[freeside-commits] branch FREESIDE_3_BRANCH updated. 69c2f42ce788c1793b72bab9ff9d21c4e19a098e

Jeremy Davis jeremyd at 420.am
Wed Oct 7 09:50:54 PDT 2015


The branch, FREESIDE_3_BRANCH has been updated
       via  69c2f42ce788c1793b72bab9ff9d21c4e19a098e (commit)
      from  0c07b9072cd4da266d4e56f888bf33512af7d17f (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 69c2f42ce788c1793b72bab9ff9d21c4e19a098e
Author: Jeremy Davis <jeremyd at freeside.biz>
Date:   Tue Oct 6 13:40:07 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