projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
199450c
)
fix CCH update adding a TAXCAT, RT#21687
author
Ivan Kohler
<ivan@freeside.biz>
Wed, 8 May 2013 09:11:01 +0000
(
02:11
-0700)
committer
Ivan Kohler
<ivan@freeside.biz>
Wed, 8 May 2013 09:11:01 +0000
(
02:11
-0700)
FS/FS/tax_class.pm
patch
|
blob
|
history
diff --git
a/FS/FS/tax_class.pm
b/FS/FS/tax_class.pm
index
bfec2c0
..
eeb8993
100644
(file)
--- a/
FS/FS/tax_class.pm
+++ b/
FS/FS/tax_class.pm
@@
-259,13
+259,15
@@
sub batch_import {
'description' => $type->[1].':'.$cat->[1],
} );
my $error = $tax_class->insert;
'description' => $type->[1].':'.$cat->[1],
} );
my $error = $tax_class->insert;
- return
$error
if $error;
+ return
"can't insert tax_class for old TAXTYPE $type and new TAXCAT $cat: $error"
if $error;
$imported++;
}
}
$imported++;
}
}
+ my %cats = map { $_=>1 } ( @old_cats, @{$data->{'taxcat'}} );
+
foreach my $type (@{$data->{'taxtype'}}) {
foreach my $type (@{$data->{'taxtype'}}) {
- foreach my $cat (
@old_cats, @{$data->{'taxcat'}}
) {
+ foreach my $cat (
keys %cats
) {
if ( $job ) { # progress bar
if ( time - $min_sec > $last ) {
if ( $job ) { # progress bar
if ( time - $min_sec > $last ) {
@@
-283,7
+285,7
@@
sub batch_import {
'description' => $type->[1].':'.$cat->[1],
} );
my $error = $tax_class->insert;
'description' => $type->[1].':'.$cat->[1],
} );
my $error = $tax_class->insert;
- return
$error
if $error;
+ return
"can't insert tax_class for new TAXTYPE $type and TAXCAT $cat: $error"
if $error;
$imported++;
}
}
$imported++;
}
}
@@
-363,7
+365,7
@@
sub batch_import {
my $error = &{$endhook}();
if ( $error ) {
$dbh->rollback if $oldAutoCommit;
my $error = &{$endhook}();
if ( $error ) {
$dbh->rollback if $oldAutoCommit;
- return "can't
insert tax_class for $line
: $error";
+ return "can't
run end hook
: $error";
}
$dbh->commit or die $dbh->errstr if $oldAutoCommit;
}
$dbh->commit or die $dbh->errstr if $oldAutoCommit;