fix A/R report
[freeside.git] / httemplate / search / report_477.html
index 2b51112..38073ad 100755 (executable)
@@ -1,64 +1,67 @@
-<% include('/elements/header.html', 'FCC Form 477 Report' ) %>
-
+% if ( $conf->exists('old_fcc_report') ) {
+%   $m->clear_buffer;
+%   $m->print($cgi->redirect($fsurl . 'search/old477/report_477.html'));
+%   $m->abort;
+% }
+<& /elements/header.html, 'FCC Form 477 Report' &>
+% if ( $curuser->access_right('Edit FCC report configuration') ) {
+<FONT SIZE="+1"><STRONG>Preparation</STRONG></FONT>
+<UL>
+  <LI> <A HREF="<% $p %>browse/part_pkg-fcc.html">Configure packages</A> for FCC reporting categories.</LI>
+  <LI> <A HREF="<% $p %>browse/deploy_zone.html">Enter deployment zones</A> for broadband Internet or mobile phone.</LI>
+</UL>
+% }
+  
 <FORM ACTION="477.html" METHOD="GET">
-<INPUT TYPE="hidden" NAME="magic" VALUE="active">
 
   <TABLE BGCOLOR="#cccccc" CELLSPACING=0>
 
     <TR>
       <TH CLASS="background" COLSPAN=2 ALIGN="left">
-        <FONT SIZE="+1">Search options</FONT>
+        <FONT SIZE="+1">Report options</FONT>
       </TH>
     </TR>
 
-    <% include( '/elements/tr-select-agent.html',
-                   'curr_value'    => scalar( $cgi->param('agentnum') ),
-                   'disable_empty' => 0,
-               )
-    %>
-
-    <% include( '/elements/tr-select-pkg_class.html',
-                   'pre_options' => [ '0' => 'all' ],
-                   'empty_label' => '(empty class)',
-               )
-    %>
-
-%   if ( scalar( qsearch( 'part_pkg_report_option', { 'disabled' => '' } ) ) ) {
-%   # the m2 javascript magic in edit/elements/edit.html would be better here
+    <& /elements/tr-select-agent.html,
+      'curr_value'    => scalar( $cgi->param('agentnum') ),
+      'disable_empty' => 0,
+    &>
 
-    <% include( '/elements/tr-select-table.html',
-                   'label'        => 'Column report classes',
-                   'table'        => 'part_pkg_report_option',
-                   'name_col'     => 'name',
-                   'hashref'      => { 'disabled' => '' },
-                   'element_name' => 'column_option',
-                   'multiple'     => 'multiple',
-               )
-    %>
+    <& /elements/tr-input-date-field.html, {
+        'label'         => 'As of date',
+        'name'          => 'date',
+        'value'         => '',
+        'format'        => '%m/%d/%Y'
+    } &>
 
-    <% include( '/elements/tr-select-table.html',
-                   'label'        => 'Row report classes',
-                   'table'        => 'part_pkg_report_option',
-                   'name_col'     => 'name',
-                   'hashref'      => { 'disabled' => '' },
-                   'element_name' => 'row_option',
-                   'multiple'     => 'multiple',
-               )
-    %>
-
-%   }
+    <& /elements/tr-checkbox-multiple.html,
+      'label'   => 'Enable parts',
+      'field'   => 'parts',
+      'labels'  => $part_titles,
+      'options' => [ keys %$part_titles ]
+    &>
 
+    <& /elements/tr-checkbox.html,
+      'label'   => 'Ignore package quantities',
+      'field'   => 'ignore_quantity',
+      'value'   => 1,
+    &>
   </TABLE>
 
-<BR>
-<INPUT TYPE="submit" VALUE="Get Report">
+  <BR>
+  <INPUT TYPE="submit" VALUE="Get Report">
 
 </FORM>
 
-<% include('/elements/footer.html') %>
+<& /elements/footer.html &>
 <%init>
 
+my $curuser = $FS::CurrentUser::CurrentUser;
 die "access denied"
-  unless $FS::CurrentUser::CurrentUser->access_right('List packages');
+  unless $curuser->access_right('List packages');
+
+my $conf = FS::Conf->new;
+
+my $part_titles = FS::Report::FCC_477->parts;
 
 </%init>