Nachtrag zu Bug 220, Rabatt wurde nur fuer ein einzelnes Item berechnet.
authorStephan Köhler <s.koehler@linet-services.de>
Fri, 13 Jan 2006 13:48:33 +0000 (13:48 +0000)
committerStephan Köhler <s.koehler@linet-services.de>
Fri, 13 Jan 2006 13:48:33 +0000 (13:48 +0000)
Korrektur bei Angeboten

SL/OE.pm

index dc29ffa..4e16ed5 100644 (file)
--- a/SL/OE.pm
+++ b/SL/OE.pm
@@ -892,14 +892,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);