}
##
- # do the same for user
+ # parse sales person
+ ##
+
+ if ( $params->{'salesnum'} =~ /^(\d+)$/ ) {
+ push @where, ($1 > 0 ) ? "cust_main.salesnum = $1"
+ : 'cust_main.salesnum IS NULL';
+ }
+
+ ##
+ # parse usernum
##
if ( $params->{'usernum'} =~ /^(\d+)$/ and $1 ) {
# parse with hardcoded tax location checkbox
##
- push @where, "ship_location.geocode is not null"
+ my $tax_prefix = FS::Conf->new->exists('tax-ship_location') ? 'ship_'
+ : 'bill_';
+ push @where, "${tax_prefix}location.geocode is not null"
if $params->{'with_geocode'};
##