X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/3915f5c658e23587976dcc08ce137f4350429fcb..2ef21b8f2aaae439a9408977458bdeb9b0fd9e25:/bin/mozilla/ar.pl diff --git a/bin/mozilla/ar.pl b/bin/mozilla/ar.pl index 305b6aaad..11a12e440 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{netamount} ? ($subtotals{marge_total} * 100 / $subtotals{netamount}) : 0; + $totals{marge_percent} = $totals{netamount} ? ($totals{marge_total} * 100 / $totals{netamount} ) : 0; + 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};