From: Ivan Kohler Date: Wed, 27 May 2020 20:44:33 +0000 (-0700) Subject: fix top subtotals on refund reports X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=f30eaaf66cd0a947f388a03edd4522ba92a367bb;ds=sidebyside fix top subtotals on refund reports --- diff --git a/httemplate/search/elements/cust_pay_or_refund.html b/httemplate/search/elements/cust_pay_or_refund.html index fbcae9d4d..f925fecf2 100755 --- a/httemplate/search/elements/cust_pay_or_refund.html +++ b/httemplate/search/elements/cust_pay_or_refund.html @@ -58,6 +58,7 @@ Examples: 'group_column' => 'payby', 'group_label' => 'payby_name', + 'amount_field' => $amount_field, 'subtotal' => { $opt{amount_field} => "sum($amount_field)" }, 'subtotal_row' => [ 'Subtotal', sub { sprintf($money, $_[0]->$amount_field) }, diff --git a/httemplate/search/elements/grouped-search/html b/httemplate/search/elements/grouped-search/html index 24cf50e96..cb9c96ce6 100644 --- a/httemplate/search/elements/grouped-search/html +++ b/httemplate/search/elements/grouped-search/html @@ -5,6 +5,8 @@ my $conf = FS::Conf->new; my %opt = @_; $opt{'name'} ||= PL($opt{'name_singular'}); +my $amount_field = $opt{amount_field}; + my $group_info = $m->comp('core', %opt); my $redirect; @@ -109,7 +111,7 @@ my $money = $conf->config('money_char') || '$';
% if ( $group->num_rows > 0 ) { -

<% emt('[quant,_1,_2]', $group->num_rows, $opt{name_singular}) %> for <% emt($money.$group->paid) %> +

<% emt('[quant,_1,_2]', $group->num_rows, $opt{name_singular}) %> for <% emt($money.$group->$amount_field()) %>

%# download links

<% emt('Download results:') %>