X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fcust_location.pm;h=4521bd39b33bf15f89304dd0515d2619b424126f;hp=e1b853383da4c9efff1a031d90d769e9287a625e;hb=9f179ee5fc7fc07a3f5e03ad1ad58cd3cadf1a56;hpb=338485d75b27ea0e5ab561856720633f890374c4 diff --git a/FS/FS/cust_location.pm b/FS/FS/cust_location.pm index e1b853383..4521bd39b 100644 --- a/FS/FS/cust_location.pm +++ b/FS/FS/cust_location.pm @@ -265,8 +265,15 @@ sub insert { return $error; } - #false laziness with cust_main, will go away eventually - if ( !$import and $conf->config('tax_district_method') ) { + # If using tax_district_method, for rows in state of Washington, + # without a tax district already specified, queue a job to find + # the tax district + if ( + !$import + && !$self->district + && lc $self->state eq 'wa' + && $conf->config('tax_district_method') + ) { my $queue = new FS::queue { 'job' => 'FS::geocode_Mixin::process_district_update' @@ -943,7 +950,11 @@ sub _upgrade_data { die "$error (fixing whitespace in $field, locationnum ".$location->locationnum.')' if $error; - if ( $use_districts ) { + if ( + $use_districts + && !$location->district + && lc $location->state eq 'wa' + ) { my $queue = new FS::queue { 'job' => 'FS::geocode_Mixin::process_district_update' };