Revision 2172794d
Von Jan Büren vor etwa 1 Jahr hinzugefügt
SL/Controller/Part.pm | ||
---|---|---|
140 | 140 |
|
141 | 141 |
$::form->{"cvar_" . $_->{name} . "_valid"} = 1 for @default_valid_configs; |
142 | 142 |
} else { |
143 |
$::form->{lastcost_modified} = $self->check_lastcost_modified;
|
|
143 |
$self->{lastcost_modified} = $self->check_lastcost_modified;
|
|
144 | 144 |
} |
145 | 145 |
|
146 | 146 |
# $self->part has been loaded, parsed and validated without errors and is ready to be saved |
147 | 147 |
$self->part->db->with_transaction(sub { |
148 | 148 |
|
149 | 149 |
$self->part->save(cascade => 1); |
150 |
$self->part->set_lastcost_assemblies_and_assortiments if $self->{lastcost_modified}; |
|
150 | 151 |
|
151 | 152 |
SL::DB::History->new( |
152 | 153 |
trans_id => $self->part->id, |
... | ... | |
864 | 865 |
|
865 | 866 |
sub check_lastcost_modified { |
866 | 867 |
my ($self) = @_; |
867 |
|
|
868 | 868 |
return abs($self->part->lastcost - $self->part->last_price_update->lastcost) < 0.009 ? undef : 1; |
869 | 869 |
} |
870 | 870 |
|
Auch abrufbar als: Unified diff
Einkaufspreis von Erzeugnissen/Sortimententen ohne after_save hook