Revision f1c1cb83
Von Bernd Bleßmann vor etwa 1 Jahr hinzugefügt
SL/IR.pm | ||
---|---|---|
262 | 262 |
# change lastcost for part and all assemblies and assortments recursively |
263 | 263 |
my $a = SL::DB::Part->load_cached(conv_i($form->{"id_$i"})); |
264 | 264 |
my $part_price_factor = $a->price_factor_id ? $a->price_factor->factor : 1; |
265 |
$a->update_attributes(lastcost => abs($fxsellprice * $form->{exchangerate} / $basefactor / $price_factor * $part_price_factor)); |
|
266 |
$a->set_lastcost_assemblies_and_assortiments; |
|
265 |
my $new_lastcost = abs($fxsellprice * $form->{exchangerate} / $basefactor / $price_factor * $part_price_factor); |
|
266 |
if ( abs($a->lastcost - $new_lastcost) >= 0.009 ) { |
|
267 |
$a->update_attributes(lastcost => $new_lastcost); |
|
268 |
$a->set_lastcost_assemblies_and_assortiments; |
|
269 |
} |
|
267 | 270 |
|
268 | 271 |
# check if we sold the item already and |
269 | 272 |
# make an entry for the expense and inventory |
Auch abrufbar als: Unified diff
EK-Rechnung: EK-Preis nur aktualisieren, wenn geändert