X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/041a8bb77df72193d039f511707a58eef62e31c3..aae5bae7d37a440abdfab7cf5c36d4fe77ff68f3:/SL/IS.pm diff --git a/SL/IS.pm b/SL/IS.pm index f4bfd1da6..484dcb9d0 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( @@ -167,6 +167,7 @@ sub invoice_details { $linetotal = ($linetotal != 0) ? $linetotal : " "; push(@{ $form->{discount} }, $discount); + push(@{ $form->{p_discount} }, $form->{"discount_$i"}); $form->{total} += $linetotal;