From: Sven Schöling Date: Thu, 14 May 2009 15:54:58 +0000 (+0000) Subject: Pricefaktoren auch im assembly_row flow mitschleifen und berechnen. X-Git-Tag: release-2.6.0rc1~60 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=ccde19fe1c1eb5ea7f0d6cb2d9d2f6b522d6ca01;p=kivitendo-erp.git Pricefaktoren auch im assembly_row flow mitschleifen und berechnen. Fix für Bug 987 --- diff --git a/SL/IC.pm b/SL/IC.pm index f691a354f..784366582 100644 --- a/SL/IC.pm +++ b/SL/IC.pm @@ -690,9 +690,11 @@ sub assembly_item { my $dbh = $form->dbconnect($myconfig); my $query = - qq|SELECT p.id, p.partnumber, p.description, p.sellprice, p.weight, p.onhand, p.unit, pg.partsgroup + qq|SELECT p.id, p.partnumber, p.description, p.sellprice, p.weight, p.onhand, p.unit, pg.partsgroup, + p.price_factor_id, pfac.factor AS price_factor FROM parts p LEFT JOIN partsgroup pg ON (p.partsgroup_id = pg.id) + LEFT JOIN price_factors pfac ON pfac.id = p.price_factor_id WHERE $where|; $form->{item_list} = selectall_hashref_query($form, $dbh, $query, @values); diff --git a/bin/mozilla/ic.pl b/bin/mozilla/ic.pl index 3a34b2b14..d75436c4a 100644 --- a/bin/mozilla/ic.pl +++ b/bin/mozilla/ic.pl @@ -1586,9 +1586,9 @@ sub assembly_row { $form->{"partnumber_$i"} =~ s/\"/"/g; $linetotal = - $form->round_amount($form->{"sellprice_$i"} * $form->{"qty_$i"}, 2); + $form->round_amount($form->{"sellprice_$i"} * $form->{"qty_$i"} / ($form->{"price_factor_$i"} || 1), 2); $line_purchase_price = - $form->round_amount($form->{"lastcost_$i"} * $form->{"qty_$i"}, 2); #lastcost == purchase_price | ungenaue datenbankfeld-übersetzung + $form->round_amount($form->{"lastcost_$i"} * $form->{"qty_$i"} / ($form->{"price_factor_$i"} || 1), 2); #lastcost == purchase_price | ungenaue datenbankfeld-übersetzung $form->{assemblytotal} += $linetotal; $form->{assembly_purchase_price_total} += $line_purchase_price; @@ -1672,6 +1672,8 @@ sub assembly_row { {"id_$i"}> {"sellprice_$i"}> {"weight_$i"}> + {"price_factor_id_$i"}> + {"price_factor_$i"}> |; }