$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);
}
}
if ( scalar( @columns ) ) {
$dbh->rollback if $oldAutoCommit;
- return "Unexpected trailing columns in line (wrong format?): $line";
+ return "Unexpected trailing columns in line (wrong format?) importing tax-rate_location: $line";
}
my $error = &{$hook}(\%tax_rate_location);