From ffd3148f9aed8cd1d8bd0f3854bded3d28fe2a21 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Wed, 4 Jul 2007 12:40:01 +0000 Subject: [PATCH] Bei Gutschriften muss der Ertrag negativ sein. --- bin/mozilla/io.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/mozilla/io.pl b/bin/mozilla/io.pl index db50d4ae2..19f8113be 100644 --- a/bin/mozilla/io.pl +++ b/bin/mozilla/io.pl @@ -324,7 +324,8 @@ sub display_row { $form->{"marge_percent_$i"} = 0; } - $form->{"marge_absolut_$i"} = ($real_sellprice - $form->{"lastcost_$i"}) * $form->{"qty_$i"}; + my $marge_adjust_credit_note = $form->{type} eq 'credit_note' ? -1 : 1; + $form->{"marge_absolut_$i"} = ($real_sellprice - $form->{"lastcost_$i"}) * $form->{"qty_$i"} * $marge_adjust_credit_note; $form->{"marge_total"} += $form->{"marge_absolut_$i"}; $form->{"lastcost_total"} += $form->{"lastcost_$i"} * $form->{"qty_$i"}; $form->{"sellprice_total"} += $real_sellprice * $form->{"qty_$i"}; -- 2.20.1