]> wagnertech.de Git - kivitendo-erp.git/blobdiff - bin/mozilla/oe.pl
In Berichten ar und oe auch die prozentuale Marge bei Zwischensummen und Gesammtsumme...
[kivitendo-erp.git] / bin / mozilla / oe.pl
index 92cfb69f9ad6db04dccab44a32ac1b3c2872d5c4..c64edef77f00d6c230557ad337ccf207a3fb7016 100644 (file)
@@ -1761,7 +1761,7 @@ sub orders {
   # escape callback for href
   $callback = $form->escape($href);
 
-  my @subtotal_columns = qw(netamount amount marge_total);
+  my @subtotal_columns = qw(netamount amount marge_total marge_percent);
 
   my %totals    = map { $_ => 0 } @subtotal_columns;
   my %subtotals = map { $_ => 0 } @subtotal_columns;
@@ -1779,6 +1779,8 @@ sub orders {
 
     map { $subtotals{$_} += $oe->{$_};
           $totals{$_}    += $oe->{$_} } @subtotal_columns;
+    $subtotals{marge_percent} = $subtotals{marge_total} / $subtotals{netamount} * 100;
+    $totals{marge_percent} = $totals{marge_total} / $totals{netamount} * 100;
 
     map { $oe->{$_} = $form->format_amount(\%myconfig, $oe->{$_}, 2) } qw(netamount tax amount marge_total marge_percent);