From e01d7de0936bc43c0c7b60cb5ef604ba3755ecff Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Thu, 12 Jan 2006 17:55:09 +0000 Subject: [PATCH] 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. --- SL/IS.pm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 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( -- 2.20.1