summaryrefslogtreecommitdiff
path: root/FS/FS/tax_rate_location.pm
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2013-05-08 04:35:35 -0700
committerIvan Kohler <ivan@freeside.biz>2013-05-08 04:35:35 -0700
commitfc8def113cc11ef4572b45100c37ff2b37bb7a3d (patch)
tree55151e662f43caa30762fe702308713a49dc71b4 /FS/FS/tax_rate_location.pm
parent7685d697180f48048b8a98de84718a26d8fb58b7 (diff)
revert: proceed with a CCH update even if some GEOCODE/tax_rate_location deletions can't be found, RT#21687
Diffstat (limited to 'FS/FS/tax_rate_location.pm')
-rw-r--r--FS/FS/tax_rate_location.pm15
1 files changed, 7 insertions, 8 deletions
diff --git a/FS/FS/tax_rate_location.pm b/FS/FS/tax_rate_location.pm
index aeb14d3..b4be8b9 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);
}