From b8fd8fee6b08f3e9c3db63cda09d4ee7191ea678 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Thu, 12 Jun 2008 18:17:47 +0000 Subject: [PATCH] Den Preisfaktor nicht vor dem Runden des Einzelpreises einbeziehen, sonst kommen stark verfaelschte Ergebnisse heraus. Berechnung von Zeilensumme und Rabatt in io.pl mit OE.pm abgeglichen. --- bin/mozilla/io.pl | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bin/mozilla/io.pl b/bin/mozilla/io.pl index 236bd186b..af2b892ff 100644 --- a/bin/mozilla/io.pl +++ b/bin/mozilla/io.pl @@ -235,9 +235,8 @@ sub display_row { $decimalplaces = max 2, length $1; $price_factor = $price_factors{$form->{"price_factor_id_$i"}} || 1; - $discount = $form->round_amount($form->{"sellprice_$i"} * $form->{"discount_$i"} / 100, $decimalplaces); - $linetotal = $form->round_amount(($form->{"sellprice_$i"} - $discount) / $price_factor, $decimalplaces); - $linetotal = $form->round_amount($linetotal * $form->{"qty_$i"}, 2); + $discount = $form->round_amount($form->{"qty_$i"} * $form->{"sellprice_$i"} * $form->{"discount_$i"} / 100 / $price_factor, 2); + $linetotal = $form->round_amount($form->{"qty_$i"} * $form->{"sellprice_$i"} * (100 - $form->{"discount_$i"}) / 100 / $price_factor, 2); $column_data{runningnumber} = $cgi->textfield(-name => "runningnumber_$i", -size => 5, -value => $i); # HuT $column_data{partnumber} = $cgi->textfield(-name => "partnumber_$i", -size => 12, -value => $form->{"partnumber_$i"}); -- 2.20.1