fix TeleAPI import (what kind of crack was Christopher smoking that he couldn't fix...
[freeside.git] / FS / FS / cdr / amcom.pm
index 43e6afd..4fb94ee 100644 (file)
@@ -27,8 +27,11 @@ my ($tmp_mday, $tmp_mon, $tmp_year);
     'accountcode',# 2. BWGroupID (centrex group)
     sub {         # 3. BWGroupNumber
       my ($cdr, $field) = @_; #, $conf, $hashref) = @_;
-      $cdr->charged_party($field)
-        if $cdr->accountcode eq '' && $field =~ /^(1800|1300)/;
+
+        if ($cdr->accountcode eq '' && $field =~ /^(1800|1300)/){
+       $cdr->charged_party($field);
+       $cdr->accountcode($field);
+       }
     },
     'uniqueid',   # 4. Record ID
     sub {         # 5. Call Category (LOCAL, NATIONAL, FREECALL, MOBILE)
@@ -36,7 +39,7 @@ my ($tmp_mday, $tmp_mon, $tmp_year);
       $data ||= 'none';
 
       my $cdr_type = qsearchs('cdr_type', { 'cdrtypename' => $data } );
-      $cdr->set('cdrtypenum', $cdr_type->cdrtypenum) if $cdr_type;
+      $cdr->set('cdrtypenum', $cdr_type->cdrtypenum) if $cdr_type;      
       $cdr->set('dcontext', $data);  
     },
     sub {         # 6. Start Date (DDMMYYYY