skip tax district update on disabled locations
authorMark Wells <mark@freeside.biz>
Thu, 17 Nov 2016 08:54:04 +0000 (00:54 -0800)
committerMark Wells <mark@freeside.biz>
Thu, 17 Nov 2016 08:55:12 +0000 (00:55 -0800)
FS/FS/cust_location.pm
FS/FS/geocode_Mixin.pm

index a9660d8..e1b8533 100644 (file)
@@ -937,7 +937,7 @@ sub _upgrade_data {
     next if $field eq 'disabled';
     foreach my $location (qsearch({
       table => 'cust_location',
-      extra_sql => " WHERE $field LIKE ' %' OR $field LIKE '% '"
+      extra_sql => " WHERE disabled IS NULL AND ($field LIKE ' %' OR $field LIKE '% ')"
     })) {
       my $error = $location->replace;
       die "$error (fixing whitespace in $field, locationnum ".$location->locationnum.')'
index ef16e74..b999be0 100644 (file)
@@ -265,6 +265,7 @@ sub process_district_update {
   my $method = $conf->config('tax_district_method')
     or return; #nothing to do if null
   my $self = $class->by_key($id) or die "object $id not found";
+  return if $self->disabled;
 
   # dies on error, fine
   my $tax_info = get_district({ $self->location_hash }, $method);