X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fsearch%2Felements%2Fcust_pay_or_refund.html;h=5808e5f3edbb2e334f7f75c72ca918330c5cc86e;hp=ce513ab15ed3e150eb9e41af7b550a73c18753d9;hb=ba95860daaf6c4de2f90ef28057516bc7d44c8a0;hpb=4a03b0b62cef514f9217e7be61cf7a16218ea387
diff --git a/httemplate/search/elements/cust_pay_or_refund.html b/httemplate/search/elements/cust_pay_or_refund.html
index ce513ab15..5808e5f3e 100755
--- a/httemplate/search/elements/cust_pay_or_refund.html
+++ b/httemplate/search/elements/cust_pay_or_refund.html
@@ -57,13 +57,14 @@ Examples:
'group_column' => 'payby',
'group_label' => 'payby_name',
- 'subtotal' => { 'paid' => 'sum(paid)' },
+ 'subtotal' => { $opt{name_verb} => "sum($amount_field)" },
'subtotal_row' => [ 'Subtotal',
- sub { sprintf($money, $_[0]->paid) },
+ sub { sprintf($money, $_[0]->$amount_field) },
],
'total_row' => [ 'Total',
- sub { sprintf("$money", $_[0]->paid) },
+ sub { sprintf("$money", $_[0]->$amount_field) },
],
+ 'show_combined' => 1,
&>
<%init>
@@ -181,7 +182,7 @@ push @fields, 'payby_payinfo_pretty',
sub { sprintf($money, shift->$amount_field() ) },
;
push @link_onclicks, $sub_receipt, '';
-push @sort_fields, '', $amount_field;
+push @sort_fields, 'paysort', $amount_field;
if ( $unapplied ) {
push @header, emt('Unapplied');
@@ -243,6 +244,7 @@ if ( $cgi->param('magic') ) {
my @search = ();
my @select = (
"$table.*",
+ "( $table.payby || ' ' || coalesce($table.paymask, $table.payinfo) ) AS paysort",
FS::UI::Web::cust_sql_fields(),
'cust_main.custnum AS cust_main_custnum',
);