prevent automatic geocoding when batch processing censustract updates, RT#15381
[freeside.git] / FS / FS / cust_main.pm
index da40824..dbb0144 100644 (file)
@@ -5036,6 +5036,8 @@ sub process_censustract_update {
     # then it's a tract code
         $cust_main->set('censustract', $new_tract);
     $cust_main->set('censusyear',  $new_year);
+
+    local($import) = 1; #prevent automatic geocoding (need its own variable?)
     my $error = $cust_main->replace;
     die $error if $error;
   }
@@ -5063,6 +5065,10 @@ sub _upgrade_data { #class method
     "UPDATE cust_main SET paydate = SUBSTRING(paydate FROM 1 FOR 5) || '0' || SUBSTRING(paydate FROM 6) WHERE SUBSTRING(paydate FROM 7 FOR 1) = '-'";
   }
 
+  push @statements, #fix the weird BILL with a cc# in payinfo problem
+    #DCRD to be safe, or CARD?
+    "UPDATE cust_main SET payby = 'DCRD' WHERE payby = 'BILL' and length(payinfo) = 16";
+
   foreach my $sql ( @statements ) {
     my $sth = dbh->prepare($sql) or die dbh->errstr;
     $sth->execute or die $sth->errstr;