diff options
author | Ivan Kohler <ivan@freeside.biz> | 2017-06-28 17:23:32 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2017-06-28 17:23:32 -0700 |
commit | a616d0c27799413dfbe07ee86e75df3e0d5a740f (patch) | |
tree | b7cb2caf23d39346b800537ffa23deb7009bccf1 | |
parent | c4e1d36c46b1e0e4554af2dc36f19b65bf840758 (diff) | |
parent | 6244b8c0e65cfdfe4c7d3c856e6fb377e2118d5e (diff) |
Merge branch 'master' of git.freeside.biz:/home/git/freeside
-rwxr-xr-x | httemplate/search/elements/cust_pay_or_refund.html | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/httemplate/search/elements/cust_pay_or_refund.html b/httemplate/search/elements/cust_pay_or_refund.html index 6bd3db622..187fc8357 100755 --- a/httemplate/search/elements/cust_pay_or_refund.html +++ b/httemplate/search/elements/cust_pay_or_refund.html @@ -463,17 +463,15 @@ if ( $cgi->param('magic') ) { } #check for customer tags - my $tagcount; - my $tags; + 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,"; + $addl_from .= " LEFT JOIN cust_tag ON (cust_tag.custnum = cust_pay.custnum)" unless @tags; + push @tags, $1; } } - if ($tags) { - $tags =~ s/,$//; + if (@tags) { + my $tags = join(',',@tags); push @search, "cust_tag.tagnum in ($tags)"; } |