[freeside-commits] branch FREESIDE_3_BRANCH updated. 121bbbde83b22ae0837d8010e743dc83396a30f4
Christopher Burger
burgerc at freeside.biz
Wed Apr 11 08:59:50 PDT 2018
The branch, FREESIDE_3_BRANCH has been updated
via 121bbbde83b22ae0837d8010e743dc83396a30f4 (commit)
from 15546035e3d62df4fc09d01d526f5b1a9ee232aa (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 121bbbde83b22ae0837d8010e743dc83396a30f4
Author: Christopher Burger <burgerc at freeside.biz>
Date: Wed Apr 11 07:51:23 2018 -0400
RT# 75680 - Added date parse, and display insert error.
diff --git a/FS/FS/cdr/telapi_voip.pm b/FS/FS/cdr/telapi_voip.pm
index 65aed7666..abc7d5bd2 100644
--- a/FS/FS/cdr/telapi_voip.pm
+++ b/FS/FS/cdr/telapi_voip.pm
@@ -26,8 +26,10 @@ use FS::cdr qw( _cdr_date_parser_maker _cdr_min_parser_maker );
my($cdr, $cdrtypename, $conf, $param) = @_;
return unless length($cdrtypename);
_init_cdr_types();
- die "no matching cdrtypenum for $cdrtypename"
- unless defined $CDR_TYPES->{$cdrtypename};
+ unless (defined $CDR_TYPES->{$cdrtypename}) {
+ warn "Skipping Record: CDR type name $cdrtypename does not exist!";
+ $param->{skiprow} = 1;
+ }
$cdr->cdrtypenum($CDR_TYPES->{$cdrtypename});
}, # type
_cdr_min_parser_maker('billsec'), #PriceDurationMins
diff --git a/FS/bin/freeside-cdr-telapi-import b/FS/bin/freeside-cdr-telapi-import
index 4a637f57f..6bb3e4a36 100755
--- a/FS/bin/freeside-cdr-telapi-import
+++ b/FS/bin/freeside-cdr-telapi-import
@@ -35,6 +35,11 @@ GetOptions(
"enddate=s" => \$enddate,
);
+$startdate = str2time($startdate) or die "can't parse start date $startdate\n";
+ $startdate = time2str('%m-%d-%Y', $startdate);
+$enddate = str2time($enddate) or die "can't parse start date $enddate\n";
+ $enddate = time2str('%m-%d-%Y', $enddate);
+
my $fsuser = $ARGV[-1];
die usage() unless $fsuser;
@@ -65,11 +70,13 @@ print $cfh $page;
seek($cfh,0,0);
- print "Importing batch $cdrbatch\n";
+ warn "Importing batch $cdrbatch\n";
my $error = FS::cdr::batch_import({
'batch_namevalue' => $cdrbatch,
'file' => $cfh->filename,
'format' => 'telapi_'.$type
});
+ warn "Error importing CDR's\n".$error if $error;
+
exit;
\ No newline at end of file
-----------------------------------------------------------------------
Summary of changes:
FS/FS/cdr/telapi_voip.pm | 6 ++++--
FS/bin/freeside-cdr-telapi-import | 9 ++++++++-
2 files changed, 12 insertions(+), 3 deletions(-)
More information about the freeside-commits
mailing list