diff options
| author | Ivan Kohler <ivan@freeside.biz> | 2013-05-08 04:10:51 -0700 |
|---|---|---|
| committer | Ivan Kohler <ivan@freeside.biz> | 2013-05-08 04:10:51 -0700 |
| commit | d8831096a84836e9717f79a4f580863a1a434051 (patch) | |
| tree | d3d71a6a99b345738cafddc080171743ed6991e5 | |
| parent | 6f1dc32953d75be01d0fe21762909d5c60dd79de (diff) | |
proceed with a CCH update even if some GEOCODE/tax_rate_location deletions can't be found, RT#21687
| -rw-r--r-- | FS/FS/tax_rate_location.pm | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/FS/FS/tax_rate_location.pm b/FS/FS/tax_rate_location.pm index b4be8b90e..aeb14d31a 100644 --- a/FS/FS/tax_rate_location.pm +++ b/FS/FS/tax_rate_location.pm @@ -234,13 +234,14 @@ sub batch_import { $hash->{disabled} = ''; my $tax_rate_location = qsearchs('tax_rate_location', $hash); - 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; + 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); + } delete($hash->{$_}) foreach (keys %$hash); } |
