summaryrefslogtreecommitdiff
path: root/FS/FS/tax_rate.pm
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2014-08-30 18:20:52 -0700
committerMark Wells <mark@freeside.biz>2014-08-30 18:20:52 -0700
commit60dc4fe638eb9abc5a3ea92d43031dcbfeb71454 (patch)
tree7afb7557490089633abb2b26ac0301bf2b352c49 /FS/FS/tax_rate.pm
parent5ef5203cb6da8e0a8e1f60228b9a9250605f404e (diff)
enable CCH update to remove tax classes, #30670
Diffstat (limited to 'FS/FS/tax_rate.pm')
-rw-r--r--FS/FS/tax_rate.pm24
1 files changed, 13 insertions, 11 deletions
diff --git a/FS/FS/tax_rate.pm b/FS/FS/tax_rate.pm
index 9e458e2..6bc5e18 100644
--- a/FS/FS/tax_rate.pm
+++ b/FS/FS/tax_rate.pm
@@ -880,20 +880,22 @@ sub batch_import {
}
my $tax_rate = qsearchs( 'tax_rate', $delete{$_} );
- unless ($tax_rate) {
+ if (!$tax_rate) {
$dbh->rollback if $oldAutoCommit;
$tax_rate = $delete{$_};
- return "can't find tax_rate to delete for: ".
- #join(" ", map { "$_ => ". $tax_rate->{$_} } @fields);
- join(" ", map { "$_ => ". $tax_rate->{$_} } keys(%$tax_rate) );
- }
- my $error = $tax_rate->delete;
+ warn "WARNING: can't find tax_rate to delete for: ".
+ join(" ", map { "$_ => ". $tax_rate->{$_} } keys(%$tax_rate) ).
+ " (ignoring)\n";
+ } else {
+ my $error = $tax_rate->delete; # XXX we really should not do this
+ # (it orphans CBPTRL records)
- if ( $error ) {
- $dbh->rollback if $oldAutoCommit;
- my $hashref = $delete{$_};
- $line = join(", ", map { "$_ => ". $hashref->{$_} } keys(%$hashref) );
- return "can't delete tax_rate for $line: $error";
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ my $hashref = $delete{$_};
+ $line = join(", ", map { "$_ => ". $hashref->{$_} } keys(%$hashref) );
+ return "can't delete tax_rate for $line: $error";
+ }
}
$imported++;