diff options
author | Jeremy Davis <jeremyd@freeside.biz> | 2016-02-16 05:52:17 -0500 |
---|---|---|
committer | Jeremy Davis <jeremyd@freeside.biz> | 2016-02-16 05:52:17 -0500 |
commit | 24d17d1b4a68b065243c4a3366eb0f002e9b4d10 (patch) | |
tree | 536600c49b1c58aee106036426de1da516574b5f /FS/FS/cdr | |
parent | b58da967d07a7187f286bfe6353eaa65b664462d (diff) |
Revert changes on #36503
Diffstat (limited to 'FS/FS/cdr')
-rw-r--r-- | FS/FS/cdr/amcom.pm | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/FS/FS/cdr/amcom.pm b/FS/FS/cdr/amcom.pm index 697a682..4fb94ee 100644 --- a/FS/FS/cdr/amcom.pm +++ b/FS/FS/cdr/amcom.pm @@ -2,9 +2,9 @@ package FS::cdr::amcom; use strict; use base qw( FS::cdr ); -use vars qw( %info %cdrtypes); +use vars qw( %info ); use DateTime; -use FS::Record qw( qsearch ); +use FS::Record qw( qsearchs ); use FS::cdr_type; my ($tmp_mday, $tmp_mon, $tmp_year); @@ -16,12 +16,6 @@ my ($tmp_mday, $tmp_mon, $tmp_year); 'type' => 'csv', 'sep_char' => ',', 'disabled' => 0, - 'header_buffer' => sub { - - %cdrtypes = ( map { $_->cdrtypename => $_->cdrtypenum } - qsearch('cdr_type', {}) - ); - }, #listref of what to do with each field from the CDR, in order 'import_fields' => [ @@ -43,7 +37,9 @@ my ($tmp_mday, $tmp_mon, $tmp_year); sub { # 5. Call Category (LOCAL, NATIONAL, FREECALL, MOBILE) my ($cdr, $data) = @_; $data ||= 'none'; - $cdr->cdrtypenum($cdrtypes{$data} || ''); + + my $cdr_type = qsearchs('cdr_type', { 'cdrtypename' => $data } ); + $cdr->set('cdrtypenum', $cdr_type->cdrtypenum) if $cdr_type; $cdr->set('dcontext', $data); }, sub { # 6. Start Date (DDMMYYYY |