Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 0f407935

Von Bernd Bleßmann vor mehr als 1 Jahr hinzugefügt

  • ID 0f4079350d862eb2b086c13eee550f546cfee7f0
  • Vorgänger cf6b6226
  • Nachfolger 3199463f

EK-Rechnung: EK-Preis nur aktualisieren, wenn geändert

Unterschiede anzeigen:

SL/IR.pm
# change lastcost for part and all assemblies and assortments recursively
my $a = SL::DB::Part->load_cached(conv_i($form->{"id_$i"}));
my $part_price_factor = $a->price_factor_id ? $a->price_factor->factor : 1;
$a->update_attributes(lastcost => abs($fxsellprice * $form->{exchangerate} / $basefactor / $price_factor * $part_price_factor));
$a->set_lastcost_assemblies_and_assortiments;
my $new_lastcost = abs($fxsellprice * $form->{exchangerate} / $basefactor / $price_factor * $part_price_factor);
if ( abs($a->lastcost - $new_lastcost) >= 0.009 ) {
$a->update_attributes(lastcost => $new_lastcost);
$a->set_lastcost_assemblies_and_assortiments;
}
# check if we sold the item already and
# make an entry for the expense and inventory

Auch abrufbar als: Unified diff