TT#72753 fix writing empty .cdr for terminated resellers

Change-Id: Ic7ae29c5da4b39112ef2a689bbfa006dcc40a685
changes/56/36556/2
Rene Krenn 6 years ago
parent ddc3c4eca8
commit f3adaa3936

@ -81,9 +81,9 @@ sub get_reseller_name {
sub get_missing_resellers {
my ($dbh, $cids) = @_;
my $stmt = "select name, $reseller_id_col from billing.resellers";
my $stmt = "select name, $reseller_id_col from billing.resellers where status != \"terminated\"";
if(@{ $cids }) {
$stmt .= " where $reseller_id_col not in (" . join (',', map { '?' }(1 .. @{ $cids }) ) . ") and status != \"terminated\"";
$stmt .= " and $reseller_id_col not in (" . join (',', map { '?' }(1 .. @{ $cids }) ) . ")";
}
my $sth = $dbh->prepare($stmt);
$sth->execute(@{ $cids });

@ -758,10 +758,10 @@ sub write_wrap {
}
}
}
close($fh);
$mark{"lastseq".$reseller_contract_id} = $file_idx;
NGCP::CDR::Export::set_mark($dbh, ($stream eq 'default' ? $exporter_type : ($exporter_type . '-' . $stream)),
{ "lastseq$reseller_contract_id" => $file_idx });
close($fh);
}
sub finish {

Loading…
Cancel
Save