X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=bin%2Ftaqua-accountcode-rewrite;h=e6d579013419058782877107ea3f47b98098b3bd;hp=97e0a46e51355760eddd88099ab5afe26a71ef4b;hb=1f2021c9b76da7cc59e2a981fbac6b24312876d2;hpb=c33b039c24de7192a72b172b317937f749c2cea3 diff --git a/bin/taqua-accountcode-rewrite b/bin/taqua-accountcode-rewrite index 97e0a46e5..e6d579013 100755 --- a/bin/taqua-accountcode-rewrite +++ b/bin/taqua-accountcode-rewrite @@ -2,9 +2,8 @@ my $usage = " This script is for fixing CDRs that were supposed to receive Taqua -accountcode/caller ID rewrites but didn't. It will skip records that had -any rewrites performed, but will operate on CDRs that have already been -billed. Options: +accountcode/caller ID rewrites but didn't. It will reprocess records that +were already rewritten, so use with caution. Options: -s DATE: find calls on or after DATE (required) -e DATE: find calls on or before DATE (optional, defaults to right now) @@ -25,7 +24,7 @@ die $usage unless $opt{start}; my $fixed = 0; my $notfound = 0; my $failed = 0; -my $extra_sql = 'WHERE lastapp IS NOT NULL AND freesiderewritestatus IS NULL' . +my $extra_sql = 'WHERE lastapp IS NOT NULL '. ' AND cdrtypenum = 1'. ' AND calldate >= to_timestamp('.$opt{start}.')'; if ( $opt{end} ) { @@ -117,7 +116,7 @@ while (my $cdr = $cursor->fetch) { # source number, and start and end dates $detail = qsearchs('cust_bill_pkg_detail', { 'amount' => $primary->rated_price, - 'classnum' => $cdr->rated_classnum, + 'classnum' => $primary->rated_classnum, 'duration' => $primary->rated_seconds, 'startdate' => $primary->startdate, 'format' => 'C',