From: Philip Reetz
Date: Tue, 24 Jul 2007 08:17:12 +0000 (+0000)
Subject: In Berichten ar und oe auch die prozentuale Marge bei Zwischensummen und Gesammtsumme...
X-Git-Tag: release-2.6.0beta1~557
X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=5a9d765f8503e6c1be32fd5a71d8f551e2f0da94;p=kivitendo-erp.git
In Berichten ar und oe auch die prozentuale Marge bei Zwischensummen und Gesammtsummen ausgeben
---
diff --git a/bin/mozilla/ar.pl b/bin/mozilla/ar.pl
index 305b6aaad..161dde9a0 100644
--- a/bin/mozilla/ar.pl
+++ b/bin/mozilla/ar.pl
@@ -1518,7 +1518,7 @@ sub ar_transactions {
# escape callback for href
$callback = $form->escape($href);
- my @subtotal_columns = qw(netamount amount paid due marge_total);
+ my @subtotal_columns = qw(netamount amount paid due marge_total marge_percent);
my %totals = map { $_ => 0 } @subtotal_columns;
my %subtotals = map { $_ => 0 } @subtotal_columns;
@@ -1532,6 +1532,9 @@ sub ar_transactions {
map { $subtotals{$_} += $ar->{$_};
$totals{$_} += $ar->{$_} } @subtotal_columns;
+ $subtotals{marge_percent} = $subtotals{marge_total} / $subtotals{netamount} * 100;
+ $totals{marge_percent} = $totals{marge_total} / $totals{netamount} * 100;
+
map { $ar->{$_} = $form->format_amount(\%myconfig, $ar->{$_}, 2) } qw(netamount tax amount paid due marge_total marge_percent);
my $is_storno = $ar->{storno} && !$ar->{storno_id};
diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl
index 92cfb69f9..c64edef77 100644
--- a/bin/mozilla/oe.pl
+++ b/bin/mozilla/oe.pl
@@ -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);