From fc820438443e859d37b7d8fe6a7b22f46c613cb7 Mon Sep 17 00:00:00 2001 From: levinse Date: Fri, 8 Apr 2011 16:38:24 +0000 Subject: [PATCH] update phone provsioning/inventory report as per recent bulk DID order inventory changes, RT10988 --- httemplate/search/phone_inventory_provisioned.html | 26 ++++++++++------------ 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/httemplate/search/phone_inventory_provisioned.html b/httemplate/search/phone_inventory_provisioned.html index c3de38f37..5d4b4217e 100644 --- a/httemplate/search/phone_inventory_provisioned.html +++ b/httemplate/search/phone_inventory_provisioned.html @@ -4,34 +4,33 @@ 'query' => { 'table' => 'phone_avail', 'hashref' => {}, - 'select' => 'distinct npa||nxx as npanxx' + 'select' => 'distinct latanum', }, - 'count_query' => 'SELECT COUNT(distinct npa||nxx) FROM phone_avail', - 'header' => [ 'NPANXX', + 'count_query' => 'SELECT COUNT(distinct latanum) FROM phone_avail', + 'header' => [ 'LATA #', 'Available', 'Provisioned', 'Have Usage', ], 'fields' => [ - 'npanxx', + 'latanum', sub { - my $npanxx = shift->npanxx; + my $latanum = shift->latanum; my @dids = qsearch('phone_avail', { 'svcnum' => '', - 'npa' => substr($npanxx,0,3), - 'nxx' => substr($npanxx,3,3), + 'latanum' => $latanum, } ); return scalar(@dids); }, sub { - my $npanxx = shift->npanxx; - my @dids = provisioned_dids($npanxx); + my $latanum = shift->latanum; + my @dids = provisioned_dids($latanum); return scalar(@dids); }, sub { - my $npanxx = shift->npanxx; - my @dids = provisioned_dids($npanxx); + my $latanum = shift->latanum; + my @dids = provisioned_dids($latanum); my $count = 0; foreach my $did ( @dids ) { next unless $did->cust_svc; @@ -74,11 +73,10 @@ die "access denied" # XXX: agent virtualize sub provisioned_dids { - my $npanxx = shift; + my $latanum = shift; qsearch({ 'table' => 'phone_avail', 'hashref' => { - 'npa' => substr($npanxx,0,3), - 'nxx' => substr($npanxx,3,3), + 'latanum' => $latanum, }, 'extra_sql' => ' and svcnum is not null ', }); -- 2.11.0