X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fsearch%2Felements%2Fcust_pay_or_refund.html;h=6bd3db6226657db0610d4615570b6a61caadfc2b;hp=96d044fa0fb4a53a4cfcef6f78810a40cdde3a44;hb=b35525aa2582072e01d9a62f125e6803b5d3cb34;hpb=aadc07f765a7cdb6bc00cf89089c7e147b58d6f1 diff --git a/httemplate/search/elements/cust_pay_or_refund.html b/httemplate/search/elements/cust_pay_or_refund.html index 96d044fa0..6bd3db622 100755 --- a/httemplate/search/elements/cust_pay_or_refund.html +++ b/httemplate/search/elements/cust_pay_or_refund.html @@ -462,6 +462,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 ) {