From: Moritz Bunkus Date: Wed, 4 Jul 2007 12:40:01 +0000 (+0000) Subject: Bei Gutschriften muss der Ertrag negativ sein. X-Git-Tag: release-2.4.3^2~48 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=ffd3148f9aed8cd1d8bd0f3854bded3d28fe2a21;p=kivitendo-erp.git Bei Gutschriften muss der Ertrag negativ sein. --- 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"};