From: Mark Wells Date: Thu, 17 Nov 2016 08:54:04 +0000 (-0800) Subject: skip tax district update on disabled locations X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=50ccf7c4c7a6416922c95eebea84b547d1235817 skip tax district update on disabled locations --- diff --git a/FS/FS/cust_location.pm b/FS/FS/cust_location.pm index a9660d86c..e1b853383 100644 --- a/FS/FS/cust_location.pm +++ b/FS/FS/cust_location.pm @@ -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.')' diff --git a/FS/FS/geocode_Mixin.pm b/FS/FS/geocode_Mixin.pm index ef16e741d..b999be0ab 100644 --- a/FS/FS/geocode_Mixin.pm +++ b/FS/FS/geocode_Mixin.pm @@ -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);