From 5a9d765f8503e6c1be32fd5a71d8f551e2f0da94 Mon Sep 17 00:00:00 2001
From: Philip Reetz
Date: Tue, 24 Jul 2007 08:17:12 +0000
Subject: [PATCH] In Berichten ar und oe auch die prozentuale Marge bei
Zwischensummen und Gesammtsummen ausgeben
---
bin/mozilla/ar.pl | 5 ++++-
bin/mozilla/oe.pl | 4 +++-
2 files changed, 7 insertions(+), 2 deletions(-)
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);
--
2.20.1