[freeside-commits] branch master updated. 956df0bc6383ed0513d4dd00668f3b24c42ba1e4

Jeremy Davis jeremyd at 420.am
Wed Oct 7 09:48:41 PDT 2015


The branch, master has been updated
       via  956df0bc6383ed0513d4dd00668f3b24c42ba1e4 (commit)
      from  f27e48e51e2154468d960f1be656538373332ee5 (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 956df0bc6383ed0513d4dd00668f3b24c42ba1e4
Author: Jeremy Davis <jeremyd at freeside.biz>
Date:   Tue Oct 6 13:37:15 2015 -0400

    cdr types for AMCom CDR's

diff --git a/FS/FS/cdr/amcom.pm b/FS/FS/cdr/amcom.pm
index 97ab402..43e6afd 100644
--- a/FS/FS/cdr/amcom.pm
+++ b/FS/FS/cdr/amcom.pm
@@ -4,6 +4,8 @@ use strict;
 use base qw( FS::cdr );
 use vars qw( %info );
 use DateTime;
+use FS::Record qw( qsearchs );
+use FS::cdr_type;
 
 my ($tmp_mday, $tmp_mon, $tmp_year);
 
@@ -29,7 +31,14 @@ my ($tmp_mday, $tmp_mon, $tmp_year);
         if $cdr->accountcode eq '' && $field =~ /^(1800|1300)/;
     },
     'uniqueid',   # 4. Record ID
-    'dcontext',   # 5. Call Category (LOCAL, NATIONAL, FREECALL, MOBILE)
+    sub {	   # 5. Call Category (LOCAL, NATIONAL, FREECALL, MOBILE)
+      my ($cdr, $data) = @_;
+      $data ||= 'none';
+
+      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
       my ($cdr, $date) = @_;
       $date =~ /^(\d{2})(\d{2})(\d{4})$/

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/cdr/amcom.pm |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)




More information about the freeside-commits mailing list