my $line;
my ( $count, $last, $min_sec ) = (0, time, 5); #progressbar
- if ( $job || scalar(@column_callbacks) ) {
+ if ( $job || scalar(@column_lengths) ) {
my $error = csv_from_fixed(\$fh, \$count, \@column_lengths);
return $error if $error;
}
if ( $job ) { # progress bar
if ( time - $min_sec > $last ) {
my $error = $job->update_statustext(
- int( 100 * $imported / $count )
+ int( 100 * $imported / $count ). ",Importing tax classes"
);
die $error if $error;
$last = time;
if ( $job ) { # progress bar
if ( time - $min_sec > $last ) {
my $error = $job->update_statustext(
- int( 100 * $imported / $count )
+ int( 100 * $imported / $count ). ",Importing tax classes"
);
die $error if $error;
$last = time;
if ( $job ) { # progress bar
if ( time - $min_sec > $last ) {
my $error = $job->update_statustext(
- int( 100 * $imported / $count )
+ int( 100 * $imported / $count ). ",Importing tax classes"
);
die $error if $error;
$last = time;
}
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_class: $line";
}
my $error = &{$hook}(\%tax_class);
$dbh->commit or die $dbh->errstr if $oldAutoCommit;
- return "Empty File!" unless $imported;
+ return "Empty File!" unless ($imported || $format eq 'cch-update');
''; #no error