add city search, RT#31659
[freeside.git] / FS / FS / cust_main / Search.pm
index e0dfc3c..a8f9791 100644 (file)
@@ -726,6 +726,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
   ##