diff options
| author | levinse <levinse> | 2011-06-05 05:41:46 +0000 | 
|---|---|---|
| committer | levinse <levinse> | 2011-06-05 05:41:46 +0000 | 
| commit | 9dbdea5f6aaff3beaf8d19b434196009482029a8 (patch) | |
| tree | a0c164da8c76167ebd9f82b4026f5fcda9db1451 | |
| parent | 76a1ecdb1b69fa83a8385adc4a50ac243096c994 (diff) | |
FCC form 477 part II and V issues, RT13057
| -rw-r--r-- | FS/FS/Conf.pm | 2 | ||||
| -rwxr-xr-x | httemplate/search/477.html | 10 | ||||
| -rwxr-xr-x | httemplate/search/477partV.html | 14 | ||||
| -rwxr-xr-x | httemplate/search/report_477.html | 22 | 
4 files changed, 41 insertions, 7 deletions
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 @@      %>      <TR id='partIIA' style="display:none"><TD>Part IIA</TD><TD><TABLE> +%   $i = 0;  %   foreach my $option ( @FS::Report::FCC_477::part2aoption ) {      <TR>        <TH><% $option %></TH> @@ -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"),                   )        %>        </TD>      </TR> +%    $i++  %   }    </TABLE></TD></TR> @@ -146,6 +150,7 @@      %>      <TR id='partIIB' style="display:none"><TD>Part IIB</TD><TD><TABLE> +%   $i = 0;  %   foreach my $option ( @FS::Report::FCC_477::part2boption ) {      <TR>        <TH><% $option %></TH> @@ -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"),                   )        %>        </TD>      </TR> +%    $i++  %   }    </TABLE></TD></TR> @@ -185,8 +193,22 @@                     'label' => 'Enable part V?',                     'field' => 'part',                     'value' => 'V', +                   'onchange' => 'partchange(this)',                 )      %> +    <TR id='partV' style="display:none"> +        <TD>Part V</TD> +        <TD> +            <% include( '/elements/select-table.html', +                     'table'        => 'part_pkg_report_option', +                     'name_col'     => 'name', +                     'hashref'      => { 'disabled' => '' }, +                     'element_name' => 'partv_report_option', +                 ) +            %> +        </TD> +    </TR> +      <% include( '/elements/tr-checkbox.html',                     'label' => 'Enable part VI?',  | 
