From 48040fe7e64a95cb98182c308d3e385dbe48f483 Mon Sep 17 00:00:00 2001 From: Christopher Burger Date: Tue, 27 Jun 2017 11:08:06 -0400 Subject: [PATCH] RT# 76312 - added customer tags to search options for payment report. --- httemplate/search/elements/cust_pay_or_refund.html | 15 +++++++++++++++ httemplate/search/elements/report_cust_pay_or_refund.html | 4 ++++ 2 files changed, 19 insertions(+) diff --git a/httemplate/search/elements/cust_pay_or_refund.html b/httemplate/search/elements/cust_pay_or_refund.html index 9e336faa9..f84ac3b41 100755 --- a/httemplate/search/elements/cust_pay_or_refund.html +++ b/httemplate/search/elements/cust_pay_or_refund.html @@ -581,6 +581,21 @@ if ( $cgi->param('magic') ) { } } + #check for customer tags + my $tagcount; + my $tags; + foreach my $p (keys $cgi->Vars) { + if ($p =~ /^tagnum(\d+)/ && $1) { + $tagcount++; + $addl_from .= " LEFT JOIN cust_tag ON (cust_tag.custnum = cust_pay.custnum)" unless $tagcount > 1; + $tags .= "$1,"; + } + } + if ($tags) { + $tags =~ s/,$//; + push @search, "cust_tag.tagnum in ($tags)"; + } + if ( $cgi->param('tax_names') ) { if ( dbh->{Driver}->{Name} =~ /^Pg/i ) { diff --git a/httemplate/search/elements/report_cust_pay_or_refund.html b/httemplate/search/elements/report_cust_pay_or_refund.html index b69f82624..e05f1af73 100644 --- a/httemplate/search/elements/report_cust_pay_or_refund.html +++ b/httemplate/search/elements/report_cust_pay_or_refund.html @@ -127,6 +127,10 @@ Examples: + <& /elements/tr-select-cust_tag.html, + 'custnum' => $opt{'custnum'}, + &> + <& /elements/tr-select-agent.html, 'curr_value' => scalar($cgi->param('agentnum')), 'label' => emt('Agent'), -- 2.11.0