X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/1ed2662d31a62a67994fadb426766d1021ef8622..ca12e8dfc4773aabc13818a0398e06e44028e2bc:/SL/IS.pm?ds=inline diff --git a/SL/IS.pm b/SL/IS.pm index 9a338eb0b..b782fef26 100644 --- a/SL/IS.pm +++ b/SL/IS.pm @@ -213,8 +213,10 @@ sub invoice_details { my $decimalplaces = max 2, length($dec); my $parsed_discount = $form->parse_amount($myconfig, $form->{"discount_$i"}); - my $discount = $form->round_amount($form->{"qty_$i"} * $sellprice * $parsed_discount / 100 / $price_factor->{factor}, $decimalplaces); - my $linetotal = $form->round_amount($form->{"qty_$i"} * $sellprice * (100 - $parsed_discount) / 100 / $price_factor->{factor}, 2); + my $linetotal_exact = $form->{"qty_$i"} * $sellprice * (100 - $parsed_discount) / 100 / $price_factor->{factor}; + my $linetotal = $form->round_amount($linetotal_exact, 2); + my $discount = $form->round_amount($form->{"qty_$i"} * $sellprice * $parsed_discount / 100 / $price_factor->{factor} - ($linetotal - $linetotal_exact), + $decimalplaces); my $nodiscount_linetotal = $form->round_amount($form->{"qty_$i"} * $sellprice / $price_factor->{factor}, 2); $form->{"netprice_$i"} = $form->round_amount($form->{"qty_$i"} ? ($linetotal / $form->{"qty_$i"}) : 0, 2); @@ -1526,7 +1528,7 @@ sub get_customer { # get customer $query = qq|SELECT - c.name AS customer, c.discount, c.creditlimit, c.terms, + c.id AS customer_id, c.name AS customer, c.discount, c.creditlimit, c.terms, c.email, c.cc, c.bcc, c.language_id, c.payment_id, c.street, c.zipcode, c.city, c.country, c.notes AS intnotes, c.klass as customer_klass, c.taxzone_id, c.salesman_id,