push @fields, sub { time2str('%b %d %Y', shift->_date ) };
push @sort_fields, '_date';
-if ($opt{'show_order_number'}) {
+if ($cgi->param('show_order_number')) {
push @header, emt('Order Number');
$align .= 'r';
push @links, '';
}
+ 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');
}
}
+ #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 ) {