X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Felements%2Fcust_pay_or_refund.html;h=187fc8357a71116af90ae39d19e6fe2366dcb02c;hb=a616d0c27799413dfbe07ee86e75df3e0d5a740f;hp=1b1be5f36bf3bdf2fe79c96cc26e4fb45eea6500;hpb=4b05b20576ddb14577d59c87c8257c6804449410;p=freeside.git diff --git a/httemplate/search/elements/cust_pay_or_refund.html b/httemplate/search/elements/cust_pay_or_refund.html index 1b1be5f36..187fc8357 100755 --- a/httemplate/search/elements/cust_pay_or_refund.html +++ b/httemplate/search/elements/cust_pay_or_refund.html @@ -348,6 +348,13 @@ if ( $cgi->param('magic') ) { } + if ( $cgi->param('paymask') ) { + $cgi->param('paymask') =~ /^\s*(\d+)\s*$/ + or die "illegal paymask ". $cgi->param('paymask'); + my $regexp = regexp_sql(); + push @search, "$table.paymask $regexp '$1\$'"; + } + if ( $cgi->param('payinfo') ) { $cgi->param('payinfo') =~ /^\s*(\d+)\s*$/ or die "illegal payinfo ". $cgi->param('payinfo'); @@ -455,6 +462,19 @@ if ( $cgi->param('magic') ) { } } + #check for customer tags + my @tags; + foreach my $p (keys $cgi->Vars) { + if ($p =~ /^tagnum(\d+)/ && $1) { + $addl_from .= " LEFT JOIN cust_tag ON (cust_tag.custnum = cust_pay.custnum)" unless @tags; + push @tags, $1; + } + } + if (@tags) { + my $tags = join(',',@tags); + push @search, "cust_tag.tagnum in ($tags)"; + } + if ( $cgi->param('tax_names') ) { if ( dbh->{Driver}->{Name} =~ /^Pg/i ) {