use a separate table for freesidestatus for IVR imports, RT#39055
authorIvan Kohler <ivan@freeside.biz>
Mon, 30 Jun 2014 21:36:55 +0000 (14:36 -0700)
committerIvan Kohler <ivan@freeside.biz>
Mon, 30 Jun 2014 21:36:55 +0000 (14:36 -0700)
FS/FS/cdr/Import.pm

index 472e220..e788712 100644 (file)
@@ -83,7 +83,7 @@ sub dbi_import {
   #my @cols = values %{ $args{column_map} };
   my $sql = "SELECT * FROM $table "; # join(',', @cols). " FROM $table ".
   $sql .=  'LEFT JOIN '. $args{status_table}.
-           ' USING ( '. $args{primary_key}. ' )'
+           " ON ( $table.$pkey = ". $args{status_table}. ".$pkey )"
     if $args{status_table};
   $sql .= ' WHERE freesidestatus IS NULL ';