X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fsearch%2F477partIA.html;h=aa7381139392bcb0a71fde67392b45209bb262a1;hp=1cd0b70e021720582dedc2db8f6a588c7a0b39b4;hb=e9e0cf0989259b94d9758eceff448666a2e5a5cc;hpb=63973c641c4be00765fa27e55c57cc5b9aa4da19 diff --git a/httemplate/search/477partIA.html b/httemplate/search/477partIA.html index 1cd0b70e0..aa7381139 100755 --- a/httemplate/search/477partIA.html +++ b/httemplate/search/477partIA.html @@ -10,10 +10,12 @@ % my $row = 1; % foreach my $cell ( @$col_data ) { % my $el = $xml_prefix . $col . $row; # PartIA_Af1, PartIA_Af2... +% if ( $cell->[0] > 0 ) { <<% $el %>><% $cell->[0] %><<% "/$el" %>> -% if ( $percentages ) { -% $el = $xml_percent . $col . $row; # Part_p_IA_Af1, ... +% if ( $percentages ) { +% $el = $xml_percent . $col . $row; # Part_p_IA_Af1, ... <<% $el %>><% $cell->[1] %><<% "/$el" %>> +% } % } % $row++; % } # foreach $cell @@ -57,9 +59,11 @@ % for (my $col = 0; $col < scalar(@download_option); $col++) { +% if ( $data[$col][$row][0] > 0 ) { <% $data[$col][$row][0] %> -% if ( $percentages ) { +% if ( $percentages ) {
<% $data[$col][$row][1] %> +% } % } % } # for $col @@ -80,7 +84,6 @@ my %search_hash; for ( qw(agentnum state) ) { $search_hash{$_} = $cgi->param($_) if $cgi->param($_); } -$search_hash{'status'} = 'active'; $search_hash{'country'} = 'US'; $search_hash{'classnum'} = [ $cgi->param('classnum') ]; @@ -110,6 +113,13 @@ if ( $technology eq 'Symmetric xDSL' or $technology eq 'Other Wireline' ) { # whether to show residential percentages in each cell of the matrix my $percentages = ($technology eq 'Terrestrial Mobile Wireless'); +# as of date +# FCC 477 instructions: "Only count connections that are in service." +# So we count packages that were in active status as of the specified date, +# not over any sort of range. +$search_hash{'active'} = [ $opt{date}, $opt{date} ]; +warn Dumper \%search_hash; + my $query = FS::cust_pkg->search(\%search_hash); my $count_query = $query->{'count_query'}; @@ -139,7 +149,7 @@ for ( my $row = 0; $row < scalar @upload_option; $row++ ) { my $count = FS::Record->scalar_sql($this_count_query); my $residential = FS::Record->scalar_sql($this_count_query . $is_residential); - my $percent = sprintf('%.2f', $count ? 100 * $residential / $count : 0); + my $percent = sprintf('%.3f', $count ? 100 * $residential / $count : 0); $data[$col][$row] = [ $count, $percent ]; $total_count += $count; @@ -149,10 +159,10 @@ for ( my $row = 0; $row < scalar @upload_option; $row++ ) { } my $total_percentage = - sprintf("%.2f", $total_count ? 100*$total_residential/$total_count : 0); + sprintf("%.3f", $total_count ? 100*$total_residential/$total_count : 0); my $above_200_percentage = - sprintf("%.2f", $total_count ? 100*$above_200/$total_count : 0); + sprintf("%.3f", $total_count ? 100*$above_200/$total_count : 0); my @summary_row = ( $total_count,