projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
start of FCC 477 report rewrite, #24047 and #28020
[freeside.git]
/
httemplate
/
search
/
477partIA.html
diff --git
a/httemplate/search/477partIA.html
b/httemplate/search/477partIA.html
index
1cd0b70
..
55e901b
100755
(executable)
--- 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...
% 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" %>>
<<% $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" %>>
<<% $el %>><% $cell->[1] %><<% "/$el" %>>
+% }
% }
% $row++;
% } # foreach $cell
% }
% $row++;
% } # foreach $cell
@@
-57,9
+59,11
@@
</TD>
% for (my $col = 0; $col < scalar(@download_option); $col++) {
<TD>
</TD>
% for (my $col = 0; $col < scalar(@download_option); $col++) {
<TD>
+% if ( $data[$col][$row][0] > 0 ) {
<% $data[$col][$row][0] %>
<% $data[$col][$row][0] %>
-% if ( $percentages ) {
+%
if ( $percentages ) {
<BR><% $data[$col][$row][1] %>
<BR><% $data[$col][$row][1] %>
+% }
% }
</TD>
% } # for $col
% }
</TD>
% } # for $col
@@
-76,14
+80,17
@@
die "access denied"
my %opt = @_;
my %search_hash;
my %opt = @_;
my %search_hash;
-
+
for ( qw(agentnum state) ) {
$search_hash{$_} = $cgi->param($_) if $cgi->param($_);
for ( qw(agentnum state) ) {
$search_hash{$_} = $cgi->param($_) if $cgi->param($_);
-}
-$search_hash{'status'} = 'active';
+} # note that separation by state is no longer required after July 2014
$search_hash{'country'} = 'US';
$search_hash{'classnum'} = [ $cgi->param('classnum') ];
$search_hash{'country'} = 'US';
$search_hash{'classnum'} = [ $cgi->param('classnum') ];
+my $info = FS::part_pkg_fcc_option->info;
+
+
+
# arrays of report_option_ numbers, running parallel to
# the download and upload speed arrays
my @download_option = $cgi->param('part1_column_option');
# arrays of report_option_ numbers, running parallel to
# the download and upload speed arrays
my @download_option = $cgi->param('part1_column_option');
@@
-110,6
+117,12
@@
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');
# 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} ];
+
my $query = FS::cust_pkg->search(\%search_hash);
my $count_query = $query->{'count_query'};
my $query = FS::cust_pkg->search(\%search_hash);
my $count_query = $query->{'count_query'};
@@
-139,7
+152,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 $count = FS::Record->scalar_sql($this_count_query);
my $residential = FS::Record->scalar_sql($this_count_query . $is_residential);
- my $percent = sprintf('%.
2
f', $count ? 100 * $residential / $count : 0);
+ my $percent = sprintf('%.
3
f', $count ? 100 * $residential / $count : 0);
$data[$col][$row] = [ $count, $percent ];
$total_count += $count;
$data[$col][$row] = [ $count, $percent ];
$total_count += $count;
@@
-149,10
+162,10
@@
for ( my $row = 0; $row < scalar @upload_option; $row++ ) {
}
my $total_percentage =
}
my $total_percentage =
- sprintf("%.
2
f", $total_count ? 100*$total_residential/$total_count : 0);
+ sprintf("%.
3
f", $total_count ? 100*$total_residential/$total_count : 0);
my $above_200_percentage =
my $above_200_percentage =
- sprintf("%.
2
f", $total_count ? 100*$above_200/$total_count : 0);
+ sprintf("%.
3
f", $total_count ? 100*$above_200/$total_count : 0);
my @summary_row = (
$total_count,
my @summary_row = (
$total_count,