}
}
+ #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 ) {