import a2billing username as charged_party, RT#32909
authorIvan Kohler <ivan@freeside.biz>
Wed, 23 Sep 2015 20:16:34 +0000 (13:16 -0700)
committerIvan Kohler <ivan@freeside.biz>
Wed, 23 Sep 2015 20:16:34 +0000 (13:16 -0700)
FS/bin/freeside-cdr-a2billing-import

index 923f5fb..a8469e7 100755 (executable)
@@ -91,7 +91,7 @@ my %disposition = (
 );
 
 my @cols = (
 );
 
 my @cols = (
-  'cc_call.id as id', 'cc_card.username as username',
+  "$table.id as id", 'cc_card.username as username',
   qw( sessionid
       starttime stoptime sessiontime real_sessiontime
       terminatecauseid
   qw( sessionid
       starttime stoptime sessiontime real_sessiontime
       terminatecauseid
@@ -101,6 +101,7 @@ my @cols = (
 );
 
 my $sql = 'SELECT '.join(',', @cols). " FROM $table".
 );
 
 my $sql = 'SELECT '.join(',', @cols). " FROM $table".
+  " LEFT JOIN cc_card ON ( $table.card_id = cc_card.id ) ".
   ' WHERE freesidestatus IS NULL' .
   ($start && " AND starttime >= '$start'") .
   ($end   && " AND starttime <  '$end'") ;
   ' WHERE freesidestatus IS NULL' .
   ($start && " AND starttime >= '$start'") .
   ($end   && " AND starttime <  '$end'") ;