X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fsearch%2Felements%2Freport_cust_pay_or_refund.html;fp=httemplate%2Fsearch%2Felements%2Freport_cust_pay_or_refund.html;h=a25e696438e8936e78127115f5f9557d9847feed;hp=70727c00774a81c7e2c21c44bbe5a81df3cc05b0;hb=bc6770012b72baee61e86c54e959ac8ee234ff86;hpb=2748aaf4aa3f19e17a37edc07e89ee402108900d diff --git a/httemplate/search/elements/report_cust_pay_or_refund.html b/httemplate/search/elements/report_cust_pay_or_refund.html index 70727c007..a25e69643 100644 --- a/httemplate/search/elements/report_cust_pay_or_refund.html +++ b/httemplate/search/elements/report_cust_pay_or_refund.html @@ -23,7 +23,7 @@ Examples: - <% mt('Payment search options') |h %> + <% mt('[_1] search options', ucfirst($name_singular)) |h %> @@ -51,6 +51,20 @@ Examples: <& /elements/tr-select-user.html &> +% if ( $has_reason ) { +% # limit to reasons that are in use for the table being reported on +% # (maybe order by count(*) desc?) + <& /elements/tr-select-table.html, + label => emt('Reason'), + field => 'reasonnum', + id => 'reasonnum', + table => 'reason', + name_col => 'reason', + extra_sql => " WHERE EXISTS(SELECT 1 FROM $table WHERE $table.reasonnum = reason.reasonnum) ", + empty_label => emt('any'), + &> +% } + <% mt(ucfirst($name_singular). ' date') |h %> @@ -166,6 +180,8 @@ my $title = $void ? "Voided $name_singular report" : "\u$name_singular report" ; $table .= '_void' if $void; +my $has_reason = dbdef->table($table)->column('reasonnum'); + tie (my %payby, 'Tie::IxHash', 'CARD-VisaMC' => 'credit card (Visa/MasterCard)', 'CARD-Amex' => 'credit card (American Express)',