This commit was manufactured by cvs2svn to create tag 'freeside_2_1_1'.
[freeside.git] / httemplate / search / report_cust_main.html
index f32c3aa..eb1a662 100755 (executable)
@@ -1,18 +1,33 @@
 <% include('/elements/header.html', 'Customer Report' ) %>
 
-<FORM ACTION="cust_main_ADV.cgi" METHOD="GET">
+<FORM ACTION="cust_main.html" METHOD="GET">
 <INPUT TYPE="hidden" NAME="magic" VALUE="bill">
 
   <TABLE BGCOLOR="#cccccc" CELLSPACING=0>
 
     <TR>
-      <TH BGCOLOR="#e8e8e8" COLSPAN=2 ALIGN="left"><FONT SIZE="+1">Search options</FONT></TH>
+      <TH CLASS="background" COLSPAN=2 ALIGN="left"><FONT SIZE="+1">Search options</FONT></TH>
     </TR>
+
     <% include( '/elements/tr-select-agent.html',
-                   ($cgi->param('agentnum') || ''),
+                  'curr_value'    => scalar($cgi->param('agentnum')),
+                  'disable_empty' => 0,
                )
     %>
 
+    <% include( '/elements/tr-select-cust_main-status.html',
+                  'label' => 'Status'
+              )
+    %>
+
+    <% include( '/elements/tr-select-cust_class.html',
+                  'label'        => 'Class',
+                  'multiple'     => 1,
+                  'pre_options'  => [ '' => '(none)' ],
+                  'all_selected' => 1,
+              )
+    %>
+
 %   foreach my $field (qw( signupdate )) {
 
       <TR>
       </TR>
 
 %   }
+
+    <% include( '/elements/tr-select-payby.html',
+                  'payby_type'   => 'cust',
+                  'multiple'     => 1,
+                  'all_selected' => 1,
+              )
+    %>
+
+    <TR>
+      <TD ALIGN="right">Payment expiration before</TD>
+      <TD>
+        <SELECT NAME="paydate_month" DISABLED>
+%         foreach my $month ( 1 .. 12 ) {
+            <OPTION VALUE="<% $month %>"><% $month %></OPTION>
+%         }
+        </SELECT>
+        /
+        <SELECT NAME="paydate_year" onChange="paydate_year_changed(this);">
+          <OPTION VALUE=""></OPTION>
+%         my $lastyear = (localtime(time))[5] + 1899;
+%         foreach my $year ( $lastyear .. $lastyear+12 ) {
+            <OPTION VALUE="<% $year %>"><% $year %></OPTION>
+%         }
+        </SELECT>
+      </TD>
+    </TR>
+
+    <SCRIPT TYPE="text/javascript">
+      function paydate_year_changed(what) {
+        var value = what.options[what.selectedIndex].value;
+        var month_select = what.form.paydate_month;
+        if ( value == '' ) {
+          month_select.disabled = true;
+        } else {
+          month_select.disabled = false;
+        }
+      }
+    </SCRIPT>
+    <TR>
+      <TD ALIGN="right">Invoice terms</TD>
+      <TD>
+        <% include( '/elements/select-terms.html',
+                      'pre_options' => [ '' => 'all' ],
+                      'empty_value' => 'NULL',
+                  )
+        %>
+      </TD>
+    </TR>
     
+    <% include( '/elements/tr-input-lessthan_greaterthan.html',
+                  label   => 'Current balance',
+                  field   => 'current_balance',
+              )
+    %>
+
     <TR>
       <TD ALIGN="right" VALIGN="center">Include cancelled packages</TD>
         <TD><INPUT TYPE="checkbox" NAME="cancelled_pkgs"></TD>
     </TR>
 
+%   if ( $conf->exists('cust_main-require_censustract') ) {
+
+    <TR>
+      <TD ALIGN="right" VALIGN="center">Without census tract</TD>
+        <TD><INPUT TYPE="checkbox" NAME="no_censustract"></TD>
+    </TR>
+
+%   }
+
+    <TR>
+      <TH CLASS="background" COLSPAN=2>&nbsp;</TH>
+    </TR>
+
+    <TR>
+      <TH CLASS="background" COLSPAN=2 ALIGN="left"><FONT SIZE="+1">Display options</FONT></TH>
+    </TR>
+    <% include( '/elements/tr-select-cust-fields.html' ) %>
+
+    <TR>
+      <TD ALIGN="right" VALIGN="center">Add package columns</TD>
+        <TD><INPUT TYPE="checkbox" NAME="flattened_pkgs"></TD>
+    </TR>
   </TABLE>
 
 <BR>
 die "access denied"
   unless ( $FS::CurrentUser::CurrentUser->access_right('List customers') &&
            $FS::CurrentUser::CurrentUser->access_right('List packages')
-         );;
+         );
+
+my $conf = new FS::Conf;
 
 </%init>
 <%once>
 
 my %label = (
-  'signupdate'     => 'Signup Date',
+  'signupdate'     => 'Signup date',
 );
 
 </%once>