Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 2172794d

Von Jan Büren vor etwa 2 Jahren hinzugefügt

Einkaufspreis von Erzeugnissen/Sortimententen ohne after_save hook

Unterschiede anzeigen:

SL/Controller/Part.pm
$::form->{"cvar_" . $_->{name} . "_valid"} = 1 for @default_valid_configs;
} else {
$::form->{lastcost_modified} = $self->check_lastcost_modified;
$self->{lastcost_modified} = $self->check_lastcost_modified;
}
# $self->part has been loaded, parsed and validated without errors and is ready to be saved
$self->part->db->with_transaction(sub {
$self->part->save(cascade => 1);
$self->part->set_lastcost_assemblies_and_assortiments if $self->{lastcost_modified};
SL::DB::History->new(
trans_id => $self->part->id,
......
sub check_lastcost_modified {
my ($self) = @_;
return abs($self->part->lastcost - $self->part->last_price_update->lastcost) < 0.009 ? undef : 1;
}

Auch abrufbar als: Unified diff