]> wagnertech.de Git - kivitendo-erp.git/commitdiff
Bei Gutschriften muss der Ertrag negativ sein.
authorMoritz Bunkus <m.bunkus@linet-services.de>
Wed, 4 Jul 2007 12:40:01 +0000 (12:40 +0000)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Wed, 4 Jul 2007 12:40:01 +0000 (12:40 +0000)
bin/mozilla/io.pl

index db50d4ae29e8618ae3875895cc66b27d1b1d3b9d..19f8113be90dc0bb257b00d390fa2311d0cd86d1 100644 (file)
@@ -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"};