a8583ea676a693c3274f2ae73b7e4836cf3e8c73
[freeside.git] / httemplate / search / report_cust_main.html
1 <% include('/elements/header.html', 'Customer Report' ) %>
2
3 <FORM ACTION="cust_main.html" METHOD="GET">
4 <INPUT TYPE="hidden" NAME="magic" VALUE="bill">
5
6   <TABLE BGCOLOR="#cccccc" CELLSPACING=0>
7
8     <TR>
9       <TH BGCOLOR="#e8e8e8" COLSPAN=2 ALIGN="left"><FONT SIZE="+1">Search options</FONT></TH>
10     </TR>
11
12     <% include( '/elements/tr-select-agent.html',
13                   'curr_value'    => scalar($cgi->param('agentnum')),
14                   'disable_empty' => 0,
15                )
16     %>
17
18     <% include( '/elements/tr-select-cust_main-status.html',
19                   'label' => 'Status'
20               )
21     %>
22
23
24 %   foreach my $field (qw( signupdate )) {
25
26       <TR>
27         <TD ALIGN="right" VALIGN="center"><% $label{$field} %></TD>
28         <TD>
29           <TABLE>
30             <% include( '/elements/tr-input-beginning_ending.html',
31                           prefix   => $field,
32                           layout   => 'horiz',
33                       )
34             %>
35           </TABLE>
36         </TD>
37       </TR>
38
39 %   }
40
41     <% include( '/elements/tr-select-payby.html',
42                   'payby_type'   => 'cust',
43                   'multiple'     => 1,
44                   'all_selected' => 1,
45               )
46     %>
47
48     <TR>
49       <TD ALIGN="right">Payment expiration before</TD>
50       <TD>
51         <SELECT NAME="paydate_month" DISABLED>
52 %         foreach my $month ( 1 .. 12 ) {
53             <OPTION VALUE="<% $month %>"><% $month %></OPTION>
54 %         }
55         </SELECT>
56         /
57         <SELECT NAME="paydate_year" onChange="paydate_year_changed(this);">
58           <OPTION VALUE=""></OPTION>
59 %         my $lastyear = (localtime(time))[5] + 1899;
60 %         foreach my $year ( $lastyear .. $lastyear+12 ) {
61             <OPTION VALUE="<% $year %>"><% $year %></OPTION>
62 %         }
63         </SELECT>
64       </TD>
65     </TR>
66
67     <SCRIPT TYPE="text/javascript">
68       function paydate_year_changed(what) {
69         var value = what.options[what.selectedIndex].value;
70         var month_select = what.form.paydate_month;
71         if ( value == '' ) {
72           month_select.disabled = true;
73         } else {
74           month_select.disabled = false;
75         }
76       }
77     </SCRIPT>
78     
79     <% include( '/elements/tr-input-lessthan_greaterthan.html',
80                   label   => 'Current balance',
81                   field   => 'current_balance',
82               )
83     %>
84
85     <TR>
86       <TD ALIGN="right" VALIGN="center">Include cancelled packages</TD>
87         <TD><INPUT TYPE="checkbox" NAME="cancelled_pkgs"></TD>
88     </TR>
89
90 %   if ( $conf->exists('cust_main-require_censustract') ) {
91
92     <TR>
93       <TD ALIGN="right" VALIGN="center">Without census tract</TD>
94         <TD><INPUT TYPE="checkbox" NAME="no_censustract"></TD>
95     </TR>
96
97 %   }
98
99     <TR>
100       <TH BGCOLOR="#e8e8e8" COLSPAN=2>&nbsp;</TH>
101     </TR>
102
103     <TR>
104       <TH BGCOLOR="#e8e8e8" COLSPAN=2 ALIGN="left"><FONT SIZE="+1">Display options</FONT></TH>
105     </TR>
106     <% include( '/elements/tr-select-cust-fields.html' ) %>
107
108     <TR>
109       <TD ALIGN="right" VALIGN="center">Add package columns</TD>
110         <TD><INPUT TYPE="checkbox" NAME="flattened_pkgs"></TD>
111     </TR>
112   </TABLE>
113
114 <BR>
115 <INPUT TYPE="submit" VALUE="Get Report">
116
117 </FORM>
118
119 <% include('/elements/footer.html') %>
120 <%init>
121
122 die "access denied"
123   unless ( $FS::CurrentUser::CurrentUser->access_right('List customers') &&
124            $FS::CurrentUser::CurrentUser->access_right('List packages')
125          );;
126
127 my $conf = new FS::Conf;
128
129 </%init>
130 <%once>
131
132 my %label = (
133   'signupdate'     => 'Signup date',
134 );
135
136 </%once>