summaryrefslogtreecommitdiff
path: root/FS/FS/Record.pm
diff options
context:
space:
mode:
authorivan <ivan>2008-12-31 22:04:46 +0000
committerivan <ivan>2008-12-31 22:04:46 +0000
commitec2059f7847d99e9218d97df988c8d68c7afcf55 (patch)
treee76d13f9de289a1d7d89eb8df923634ae3383593 /FS/FS/Record.pm
parentb1a95fab76cca9fd65072b1c4852d8aebcb650ea (diff)
finish up working bell_west CDR format, RT#4403
Diffstat (limited to 'FS/FS/Record.pm')
-rw-r--r--FS/FS/Record.pm8
1 files changed, 7 insertions, 1 deletions
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