add city search, RT#31659
[freeside.git] / FS / FS / cust_main / Search.pm
index 461633a..f0a7d41 100644 (file)
@@ -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/ ) {