add search on harcoded geocode customers w/cch, RT#10376
[freeside.git] / FS / FS / cust_main / Search.pm
index a87928f..a7f876f 100644 (file)
@@ -520,6 +520,13 @@ sub search {
     if $params->{'no_censustract'};
 
   ##
+  # parse with hardcoded tax location checkbox
+  ##
+
+  push @where, "geocode is not null"
+    if $params->{'with_geocode'};
+
+  ##
   # dates
   ##
 
@@ -704,6 +711,17 @@ sub search {
 
   }
 
+  if ( $params->{'with_geocode'} ) {
+
+    unshift @extra_headers, 'Tax location override', 'Calculated tax location';
+    unshift @extra_fields, sub { my $c = shift; $c->get('geocode'); },
+                           sub { my $c = shift;
+                                 $c->set('geocode', '');
+                                 $c->geocode('cch'); #XXX only cch right now
+                               };
+
+  }
+
   my $sql_query = {
     'table'         => 'cust_main',
     'select'        => $select,