diff options
author | Ivan Kohler <ivan@freeside.biz> | 2013-01-09 16:22:28 -0800 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2013-01-09 16:22:28 -0800 |
commit | 27ed323fad9fca12f507a524e1788fb37e36501e (patch) | |
tree | 19f3d13dee226e2527c860746083e6ee5ed19e97 /FS/FS/cdr.pm | |
parent | eb70a0b5a299e8e77e64cd10ee515270fbe14044 (diff) |
GSM TAP3.12 import format, RT#20767
Diffstat (limited to 'FS/FS/cdr.pm')
-rw-r--r-- | FS/FS/cdr.pm | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/FS/FS/cdr.pm b/FS/FS/cdr.pm index fdec921ee..fedf28aa6 100644 --- a/FS/FS/cdr.pm +++ b/FS/FS/cdr.pm @@ -11,6 +11,7 @@ use Date::Parse; use Date::Format; use Time::Local; use List::Util qw( first min ); +use Text::CSV_XS; use FS::UID qw( dbh ); use FS::Conf; use FS::Record qw( qsearch qsearchs ); @@ -325,6 +326,10 @@ sub check { $self->billsec( $self->enddate - $self->answerdate ); } + if ( ! $self->enddate && $self->startdate && $self->duration ) { + $self->enddate( $self->startdate + $self->duration ); + } + $self->set_charged_party; #check the foreign keys even? @@ -1286,8 +1291,6 @@ sub downstream_csv { #$opt{'money_char'} ||= $conf->config('money_char') || '$'; $opt{'money_char'} ||= FS::Conf->new->config('money_char') || '$'; - eval "use Text::CSV_XS;"; - die $@ if $@; my $csv = new Text::CSV_XS; my @columns = @@ -1578,6 +1581,11 @@ my %import_options = ( keys %cdr_info }, + 'format_asn_formats' => + { map { $_ => $cdr_info{$_}->{'asn_format'}; } + keys %cdr_info + }, + 'format_row_callbacks' => { map { $_ => $cdr_info{$_}->{'row_callback'}; } keys %cdr_info }, |