From ec2059f7847d99e9218d97df988c8d68c7afcf55 Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 31 Dec 2008 22:04:46 +0000 Subject: finish up working bell_west CDR format, RT#4403 --- FS/FS/Record.pm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'FS/FS/Record.pm') diff --git a/FS/FS/Record.pm b/FS/FS/Record.pm index a44ef8b..f0b2efe 100644 --- a/FS/FS/Record.pm +++ b/FS/FS/Record.pm @@ -1569,6 +1569,11 @@ sub batch_import { eval "use Spreadsheet::ParseExcel;"; die $@ if $@; + eval "use DateTime::Format::Excel;"; + #for now, just let the error be thrown if it is used, since only CDR + # formats bill_west and troop use it, not other excel-parsing things + #die $@ if $@; + my $excel = Spreadsheet::ParseExcel::Workbook->new->Parse($filename); $parser = $excel->{Worksheet}[0]; #first sheet @@ -1642,7 +1647,7 @@ sub batch_import { #&{$field}(\%hash, $value); push @later, $field, $value; } else { - $hash{$field} = $value if length($value); + $hash{$field} = $value if defined($value) && length($value); } } @@ -1664,6 +1669,7 @@ sub batch_import { return "can't insert record". ( $line ? " for $line" : '' ). ": $error"; } + $row++; $imported++; if ( $job && time - $min_sec > $last ) { #progress bar -- cgit v1.1