From: levinse Date: Sun, 5 Jun 2011 05:41:46 +0000 (+0000) Subject: FCC form 477 part II and V issues, RT13057 X-Git-Tag: freeside_2_3_0~176 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=9dbdea5f6aaff3beaf8d19b434196009482029a8 FCC form 477 part II and V issues, RT13057 --- diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm index eaa6a3de3..2499f4e54 100644 --- a/FS/FS/Conf.pm +++ b/FS/FS/Conf.pm @@ -2883,7 +2883,7 @@ and customer address. Include units.', { 'key' => 'cust_pkg-show_fcc_voice_grade_equivalent', 'section' => 'UI', - 'description' => "Show a field on package definitions for assigning a DSO equivalency number suitable for use on FCC form 477.", + 'description' => "Show a field on package definitions for assigning a DS0 equivalency number suitable for use on FCC form 477.", 'type' => 'checkbox', }, diff --git a/httemplate/search/477.html b/httemplate/search/477.html index a3880a52e..250e71811 100755 --- a/httemplate/search/477.html +++ b/httemplate/search/477.html @@ -93,6 +93,16 @@ for(my $i=0; $i < scalar(@upload); $i++) { &FS::Report::FCC_477::save_fcc477map("part1_row_option_$i",$upload[$i]); } +my @part2a_row_option = $cgi->param('part2a_row_option'); +for(my $i=0; $i < scalar(@part2a_row_option); $i++) { + &FS::Report::FCC_477::save_fcc477map("part2a_row_option_$i",$part2a_row_option[$i]); +} + +my @part2b_row_option = $cgi->param('part2b_row_option'); +for(my $i=0; $i < scalar(@part2b_row_option); $i++) { + &FS::Report::FCC_477::save_fcc477map("part2b_row_option_$i",$part2b_row_option[$i]); +} + my $url_mangler = sub { my $part = shift; my $url = $cgi->url('-path_info' => 1, '-full' => 1); diff --git a/httemplate/search/477partV.html b/httemplate/search/477partV.html index e0f5e043a..1d21649f5 100755 --- a/httemplate/search/477partV.html +++ b/httemplate/search/477partV.html @@ -30,24 +30,26 @@ for ( qw(agentnum magic) ) { $search_hash{$_} = $cgi->param($_) if $cgi->param($_); } $search_hash{'classnum'} = [ $cgi->param('classnum') ]; +$search_hash{report_option} = $cgi->param('partv_report_option') + if $cgi->param('partv_report_option'); my $sql_query = FS::cust_pkg->search( { %search_hash, 'fcc_line' > 1 }); -$sql_query->{select} = 'DISTINCT zip'; +$sql_query->{select} = 'DISTINCT substr(zip,1,5) as zip'; $sql_query->{extra_sql} =~ s/ORDER BY [.\w]+//; push @sql_query, $sql_query; push @count_query, delete($sql_query->{'count_query'}); -$count_query[0] =~ s/count\(\*\)/count(DISTINCT zip)/; +$count_query[0] =~ s/COUNT\(\*\)/count(DISTINCT substr(zip,1,5))/; $count_query[0] =~ s/ORDER BY [.\w]+//; -$search_hash{classnum} = $cgi->param('part2a_classnum') - if $cgi->param('part2a_classnum'); +$search_hash{report_option} = $cgi->param('partv_report_option') + if $cgi->param('partv_report_option'); $sql_query = FS::cust_pkg->search( { %search_hash } ); -$sql_query->{select} = 'DISTINCT zip'; +$sql_query->{select} = 'DISTINCT substr(zip,1,5) as zip'; $sql_query->{extra_sql} =~ s/ORDER BY [.\w]+//; push @sql_query, $sql_query; push @count_query, delete($sql_query->{'count_query'}); -$count_query[1] =~ s/count\(\*\)/count(DISTINCT zip)/; +$count_query[1] =~ s/COUNT\(\*\)/count(DISTINCT substr(zip,1,5))/; $count_query[1] =~ s/ORDER BY [.\w]+//; my $count_query = join(' UNION ', @count_query); diff --git a/httemplate/search/report_477.html b/httemplate/search/report_477.html index d34fb8f96..a36ac39b8 100755 --- a/httemplate/search/report_477.html +++ b/httemplate/search/report_477.html @@ -121,6 +121,7 @@ %> Part IIA +% $i = 0; % foreach my $option ( @FS::Report::FCC_477::part2aoption ) { @@ -130,10 +131,13 @@ 'name_col' => 'name', 'hashref' => { 'disabled' => '' }, 'element_name' => 'part2a_row_option', + 'curr_value' => + FS::Report::FCC_477::restore_fcc477map("part2a_row_option_$i"), ) %> +% $i++ % }
<% $option %>
@@ -146,6 +150,7 @@ %> Part IIB +% $i = 0; % foreach my $option ( @FS::Report::FCC_477::part2boption ) { @@ -155,10 +160,13 @@ 'name_col' => 'name', 'hashref' => { 'disabled' => '' }, 'element_name' => 'part2b_row_option', + 'curr_value' => + FS::Report::FCC_477::restore_fcc477map("part2b_row_option_$i"), ) %> +% $i++ % }
<% $option %>
@@ -185,8 +193,22 @@ 'label' => 'Enable part V?', 'field' => 'part', 'value' => 'V', + 'onchange' => 'partchange(this)', ) %> + + Part V + + <% include( '/elements/select-table.html', + 'table' => 'part_pkg_report_option', + 'name_col' => 'name', + 'hashref' => { 'disabled' => '' }, + 'element_name' => 'partv_report_option', + ) + %> + + + <% include( '/elements/tr-checkbox.html', 'label' => 'Enable part VI?',