}
##
+ # city
+ ##
+ if ( $params->{'city'} =~ /\S/ ) {
+ my $city = dbh->quote($params->{'city'});
+ push @where, "EXISTS(
+ SELECT 1 FROM cust_location
+ WHERE cust_location.custnum = cust_main.custnum
+ AND cust_location.city = $city
+ )";
+ }
+
+ ##
# county
##
if ( $params->{'county'} =~ /\S/ ) {
'ON (cust_main.'.$pre.'locationnum = '.$pre.'location.locationnum) ';
}
+ # always make referral available in results
+ # (maybe we should be using FS::UI::Web::join_cust_main instead?)
+ $addl_from .= ' LEFT JOIN part_referral ON (cust_main.refnum = part_referral.refnum) ';
+
my $count_query = "SELECT COUNT(*) FROM cust_main $addl_from $extra_sql";
my @select = (