# 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;
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};
# 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;
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);