1 <% include( 'elements/search.html',
2 'html_init' => $html_init,
5 'count_query' => 'SELECT 1',
6 'really_disable_download' => 1,
7 'disable_download' => 1,
13 '% billed to end users',
15 '% residential > 200kbps',
28 sub { $total_percentage },
29 sub { $total_percentage },
35 my $curuser = $FS::CurrentUser::CurrentUser;
38 unless $curuser->access_right('List packages');
43 for ( qw(agentnum magic classnum) ) {
44 $search_hash{$_} = $cgi->param($_) if $cgi->param($_);
47 my @column_option = grep { /^\d+$/ } $cgi->param('part1_column_option')
48 if $cgi->param('part1_column_option');
50 my @row_option = grep { /^\d+$/ } $cgi->param('part1_row_option')
51 if $cgi->param('part1_row_option');
53 my @technology_option = &FS::Report::FCC_477::parse_technology_option($cgi);
56 my $total_residential = 0;
57 my $tech_code = $opt{tech_code};
58 my $technology = $FS::Report::FCC_477::technology[$tech_code] || 'unknown';
59 my $html_init = "<H2>Part IA $technology totals</H2>";
60 my $xml_prefix = 'PartIA_'. chr(65 + $tech_code);
62 foreach my $row ( @row_option ) {
63 foreach my $column ( @column_option ) {
65 my @report_option = ( $row || '-1', $column || '-1', $technology_option[$tech_code] );
67 my ( $count, $residential ) = FS::cust_pkg->fcc_477_count(
68 { %search_hash, 'report_option' => join(',', @report_option) }
71 $total_count += $count;
72 $total_residential += $residential;
76 my $total_percentage =
77 sprintf("%.2f", $total_count ? 100*$total_residential/$total_count : 0);