per-agent disable_previous_balance, #15863
[freeside.git] / FS / FS / tax_class.pm
index 8ce70f5..4f03969 100644 (file)
@@ -158,7 +158,7 @@ sub batch_import {
 
   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;
   }
@@ -246,7 +246,7 @@ sub batch_import {
           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;
@@ -270,7 +270,7 @@ sub batch_import {
           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;
@@ -319,7 +319,7 @@ sub batch_import {
     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;
@@ -368,7 +368,7 @@ sub batch_import {
 
   $dbh->commit or die $dbh->errstr if $oldAutoCommit;
 
-  return "Empty File!" unless $imported;
+  return "Empty File!" unless ($imported || $format eq 'cch-update');
 
   ''; #no error