X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Freport_477.html;h=12918a148cd184d090916b90b763e425e9c893f8;hb=28de2695cb889d0dc3d1b3425582f069643edcd9;hp=542824b89669a2139a9e7bbe3bdd4ce472ec08e8;hpb=a06bd793c13d7d616d698f517be88b1812e8cea9;p=freeside.git diff --git a/httemplate/search/report_477.html b/httemplate/search/report_477.html index 542824b89..12918a148 100755 --- a/httemplate/search/report_477.html +++ b/httemplate/search/report_477.html @@ -1,13 +1,12 @@ <% include('/elements/header.html', 'FCC Form 477 Report' ) %>
- - + - @@ -18,26 +17,239 @@ ) %> + <& /elements/tr-td-label.html, 'label' => 'State' &> + + <% include( '/elements/tr-select-pkg_class.html', - 'pre_options' => [ '0' => 'all' ], + 'multiple' => 1, 'empty_label' => '(empty class)', ) %> -% if ( scalar( qsearch( 'part_pkg_report_option', { 'disabled' => '' } ) ) ) { + + + <% include( '/elements/tr-checkbox.html', + 'label' => 'Enable part IA?', + 'field' => 'part', + 'id' => 'enableIA', + 'value' => 'IA', + 'onchange' => 'partchange(this); toggleVI();', + ) + %> + + - <% include( '/elements/tr-select-table.html', - 'label' => 'Report classes', - 'table' => 'part_pkg_report_option', - 'name_col' => 'name', - 'hashref' => { 'disabled' => '' }, - 'element_name' => 'report_option', - 'multiple' => 'multiple', + <% include( '/elements/tr-checkbox.html', + 'label' => 'Enable part IIA?', + 'field' => 'part', + 'id' => 'enableIIA', + 'value' => 'IIA', + 'onchange' => 'partchange(this); toggleV();', ) %> + + + <% include( '/elements/tr-checkbox.html', + 'label' => 'Enable part IIB?', + 'field' => 'part', + 'id' => 'enableIIB', + 'value' => 'IIB', + 'onchange' => 'partchange(this); toggleV();', + ) + %> + + + <% include( '/elements/tr-checkbox.html', + 'label' => 'Enable part IV?', + 'field' => 'part', + 'id' => 'enableIV', #unused + 'value' => 'IV', + 'onchange' => 'partchange(this)', + ) + %> + + + + <% include( '/elements/tr-checkbox.html', + 'label' => 'Enable part V?', + 'field' => 'part', + 'value' => 'V', + 'id' => 'enableV', + 'onchange' => 'partchange(this)', + 'postfix' => + ' (requires Part IIA or IIB)', + ) + %> + + + + + + + <% include( '/elements/tr-checkbox.html', + 'label' => 'Enable part VI?', + 'field' => 'part', + 'id' => 'enableVI', + 'value' => 'VI_census', + 'postfix' => + ' (requires part IA)', + ) + %> +
+ Search options
+ +

@@ -51,4 +263,27 @@ die "access denied" unless $FS::CurrentUser::CurrentUser->access_right('List packages'); +my @states = ( + qsearch({ + 'table' => 'cust_main', + 'select' => 'DISTINCT(state)', + 'hashref' => { 'country' => 'US' }, # 477 report isn't relevant elsewhere + }), + qsearch({ + 'table' => 'cust_main', + 'select' => 'DISTINCT(ship_state) AS state', + 'hashref' => { 'country' => 'US' }, + }), + qsearch({ + 'table' => 'cust_location', + 'select' => 'DISTINCT(state)', + 'hashref' => { 'country' => 'US' }, + }), +); + +{ + my %seen = map {$_->get('state') => 1} @states; + @states = grep $_, sort keys(%seen); +} +