X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/4d8a65151cff0399654ea47c196ab38361a976e8..2ef21b8f2aaae439a9408977458bdeb9b0fd9e25:/bin/mozilla/ar.pl diff --git a/bin/mozilla/ar.pl b/bin/mozilla/ar.pl index 699cb7dee..11a12e440 100644 --- a/bin/mozilla/ar.pl +++ b/bin/mozilla/ar.pl @@ -47,7 +47,7 @@ our ($cgi, $form, $lxdebug, $locale, %myconfig); require "bin/mozilla/arap.pl"; require "bin/mozilla/common.pl"; require "bin/mozilla/drafts.pl"; -require "bin/mozilla/report_generator.pl"; +require "bin/mozilla/reportgenerator.pl"; 1; @@ -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,10 +1532,13 @@ 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} && IS->is_storno(\%myconfig, $form, 'ar'); - my $has_storno = $ar->{storno} && !$is_storno; + my $is_storno = $ar->{storno} && !$ar->{storno_id}; + my $has_storno = $ar->{storno} && $ar->{storno_id}; $ar->{type} = $has_storno ? $locale->text("Invoice with Storno (abbreviation)") :