From a26dbea9b796097fcb4d14b71a069d5a75eab4ca Mon Sep 17 00:00:00 2001 From: =?utf8?q?Stephan=20K=C3=B6hler?= Date: Mon, 16 Jan 2006 15:01:26 +0000 Subject: [PATCH] Merge von 772,773 aus unstable: Bugfix 220 -Fix zu Bug 220, Rabatt wurde nur fuer ein einzelnes Item berechnet. Man sollte dazu noch erwaehnen, dass das anscheinend kein Bug, sondern eine Designentscheidung im SQL-Ledger ist. -Nachtrag zu Bug 220, Rabatt wurde nur fuer ein einzelnes Item berechnet. Korrektur bei Angeboten --- SL/IS.pm | 12 ++++++------ SL/OE.pm | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/SL/IS.pm b/SL/IS.pm index f4bfd1da6..14f375a1f 100644 --- a/SL/IS.pm +++ b/SL/IS.pm @@ -141,14 +141,14 @@ sub invoice_details { $dec = length $dec; my $decimalplaces = ($dec > 2) ? $dec : 2; - my $discount = - $form->round_amount( - $sellprice * $form->parse_amount($myconfig, - $form->{"discount_$i"}) / 100, - $decimalplaces); + my $i_discount = $form->round_amount($sellprice * + $form->parse_amount($myconfig, $form->{"discount_$i"}) / 100, $decimalplaces); + + my $discount = $form->round_amount($form->{"qty_$i"} * $i_discount, $decimalplaces); # keep a netprice as well, (sellprice - discount) - $form->{"netprice_$i"} = $sellprice - $discount; + $form->{"netprice_$i"} = $sellprice - $i_discount; + push(@{ $form->{netprice} }, ($form->{"netprice_$i"} != 0) ? $form->format_amount( diff --git a/SL/OE.pm b/SL/OE.pm index 4e3be4539..6dec175bd 100644 --- a/SL/OE.pm +++ b/SL/OE.pm @@ -887,14 +887,14 @@ sub order_details { $dec = length $dec; my $decimalplaces = ($dec > 2) ? $dec : 2; - my $discount = - $form->round_amount( - $sellprice * $form->parse_amount($myconfig, - $form->{"discount_$i"}) / 100, - $decimalplaces); + my $i_discount = $form->round_amount($sellprice * + $form->parse_amount($myconfig, $form->{"discount_$i"}) / 100, $decimalplaces); + + my $discount = $form->round_amount($form->{"qty_$i"} * $i_discount, $decimalplaces); # keep a netprice as well, (sellprice - discount) - $form->{"netprice_$i"} = $sellprice - $discount; + #$form->{"netprice_$i"} = $sellprice - $discount; + $form->{"netprice_$i"} = $sellprice - $i_discount; my $linetotal = $form->round_amount($form->{"qty_$i"} * $form->{"netprice_$i"}, 2); -- 2.20.1