add search on harcoded geocode customers w/cch, RT#10376
authorivan <ivan>
Sun, 31 Oct 2010 19:04:56 +0000 (19:04 +0000)
committerivan <ivan>
Sun, 31 Oct 2010 19:04:56 +0000 (19:04 +0000)
FS/FS/cust_main/Search.pm
httemplate/search/cust_main.html
httemplate/search/report_cust_main.html

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,
index 57538d8..5bfdf17 100755 (executable)
@@ -45,7 +45,7 @@ my %search_hash = ();
 #scalars
 my @scalars = qw (
   agentnum status address paydate_year paydate_month invoice_terms
-  no_censustract custbatch usernum
+  no_censustract with_geocode custbatch usernum
   cancelled_pkgs
   cust_fields flattened_pkgs
 );
index 5b1b878..03b3452 100755 (executable)
         <TD><INPUT TYPE="checkbox" NAME="cancelled_pkgs"></TD>
     </TR>
 
-%   if ( $conf->exists('cust_main-require_censustract') ) {
-
     <TR>
       <TD ALIGN="right" VALIGN="center">Without census tract</TD>
         <TD><INPUT TYPE="checkbox" NAME="no_censustract"></TD>
     </TR>
 
+%   if ( $conf->exists('enable_taxproducts') ) {
+
+      <TR>
+        <TD ALIGN="right" VALIGN="center">With hardcoded tax location</TD>
+          <TD><INPUT TYPE="checkbox" NAME="with_geocode"></TD>
+      </TR>
+
 %   }
 
     <TR>