X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Ftax_rate_location.pm;h=b4be8b90e37d4657334f2b80d05ec7b98dfec1b8;hb=78b44177a16bc4da793da1c461455a0e77d52999;hp=aeb14d31aa48c2e6ff29276067c337ddeb7f3947;hpb=7685d697180f48048b8a98de84718a26d8fb58b7;p=freeside.git diff --git a/FS/FS/tax_rate_location.pm b/FS/FS/tax_rate_location.pm index aeb14d31a..b4be8b90e 100644 --- a/FS/FS/tax_rate_location.pm +++ b/FS/FS/tax_rate_location.pm @@ -234,14 +234,13 @@ sub batch_import { $hash->{disabled} = ''; my $tax_rate_location = qsearchs('tax_rate_location', $hash); - if ( $tax_rate_location ) { - $tax_rate_location->disabled('Y'); - my $error = $tax_rate_location->replace; - return $error if $error; - } else { - warn "WARNING: Can't find tax_rate_location to delete, continuing update anyway: ". - join(" ", map { "$_ => ". $hash->{$_} } @fields); - } + return "Can't find tax_rate_location to delete: ". + join(" ", map { "$_ => ". $hash->{$_} } @fields) + unless $tax_rate_location; + + $tax_rate_location->disabled('Y'); + my $error = $tax_rate_location->replace; + return $error if $error; delete($hash->{$_}) foreach (keys %$hash); }