revert: proceed with a CCH update even if some GEOCODE/tax_rate_location deletions...
authorIvan Kohler <ivan@freeside.biz>
Wed, 8 May 2013 11:35:35 +0000 (04:35 -0700)
committerIvan Kohler <ivan@freeside.biz>
Wed, 8 May 2013 11:35:35 +0000 (04:35 -0700)
FS/FS/tax_rate_location.pm

index aeb14d3..b4be8b9 100644 (file)
@@ -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);
       }