add a per-package disable_line_item_date_ranges option, RT13200
[freeside.git] / FS / FS / Record.pm
index 1280f08..e5bfb0a 100644 (file)
@@ -1850,10 +1850,12 @@ sub batch_import {
       next if $line =~ /^\s*$/; #skip empty lines
 
       $line = &{$row_callback}($line) if $row_callback;
+      
+      next if $line =~ /^\s*$/; #skip empty lines
 
       $parser->parse($line) or do {
         $dbh->rollback if $oldAutoCommit;
-        return "can't parse: ". $parser->error_input();
+        return "can't parse: ". $parser->error_input() . " " . $parser->error_diag;
       };
       @columns = $parser->fields();
 
@@ -1922,7 +1924,7 @@ sub batch_import {
     next if exists( $param->{skiprow} );
 
     if ( $preinsert_callback ) {
-      my $error = &{$postinsert_callback}($record, $param);
+      my $error = &{$preinsert_callback}($record, $param);
       if ( $error ) {
         $dbh->rollback if $oldAutoCommit;
         return "preinsert_callback error". ( $line ? " for $line" : '' ).