summaryrefslogtreecommitdiff
path: root/FS/FS/cust_main/Search.pm
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2015-01-07 14:30:15 -0800
committerIvan Kohler <ivan@freeside.biz>2015-01-07 14:30:15 -0800
commitceeaad3d99869f159bf2fee490aafa4c95d03365 (patch)
treee5026eeb4204e34fe0b49fe57e0d9412a594b397 /FS/FS/cust_main/Search.pm
parent7a577311abdb174c4a5b52bd5f0d751931097efd (diff)
add city search, RT#31659
Diffstat (limited to 'FS/FS/cust_main/Search.pm')
-rw-r--r--FS/FS/cust_main/Search.pm12
1 files changed, 12 insertions, 0 deletions
diff --git a/FS/FS/cust_main/Search.pm b/FS/FS/cust_main/Search.pm
index 461633a..f0a7d41 100644
--- a/FS/FS/cust_main/Search.pm
+++ b/FS/FS/cust_main/Search.pm
@@ -728,6 +728,18 @@ sub search {
}
##
+ # 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/ ) {