update customer list and zip code report to use cust_location, #940
[freeside.git] / httemplate / search / report_cust_main.html
1 <& /elements/header.html, mt('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 CLASS="background" COLSPAN=2 ALIGN="left"><FONT SIZE="+1"><% mt('Search options') |h %></FONT></TH>
10     </TR>
11
12     <& /elements/tr-select-agent.html,
13                   'curr_value'    => scalar($cgi->param('agentnum')),
14                   'disable_empty' => 0,
15     &>
16
17     <& /elements/tr-select-cust_main-status.html,
18                   'label' => emt('Status'),
19     &>
20
21     <& /elements/tr-select-cust_class.html,
22                   'label'        => emt('Class'),
23                   'multiple'     => 1,
24                   'pre_options'  => [ '' => emt('(none)') ],
25                   'all_selected' => 1,
26     &>
27
28     <& /elements/tr-select-part_referral.html,
29                   'label'        => emt('Advertising Source'),
30                   'multiple'     => 1,
31                   'all_selected' => 1,
32     &>
33
34     <TR>
35       <TD ALIGN="right" VALIGN="center"><% mt('Address') |h %></TD>
36       <TD><INPUT TYPE="text" NAME="address" SIZE=54></TD>
37     </TR>
38     
39     <TR>
40       <TD ALIGN="right" VALIGN="center"><% mt('Zip') |h %></TD>
41       <TD><INPUT TYPE="text" NAME="zip" SIZE=12></TD>
42     </TR>
43
44     <TR>
45         <TD ALIGN="right" VALIGN="center"><% mt('Signup date') |h %></TD>
46         <TD>
47         <TABLE>
48             <& /elements/tr-input-beginning_ending.html,
49                       prefix   => 'signupdate',
50                       layout   => 'horiz',
51             &>
52         </TABLE>
53         </TD>
54     </TR>
55
56 %    if ( $conf->exists('cust_main-enable_birthdate') ) {
57       <TR>
58           <TD ALIGN="right" VALIGN="center"><% mt('Date of Birth') |h %></TD>
59           <TD>
60           <TABLE>
61               <& /elements/tr-input-beginning_ending.html,
62                         prefix   => 'birthdate',
63                         layout   => 'horiz',
64               &>
65           </TABLE>
66           </TD>
67       </TR>
68 %   }
69
70 %    if ( $conf->exists('cust_main-enable_spouse_birthdate') ) {
71       <TR>
72           <TD ALIGN="right" VALIGN="center"><% mt('Spouse Date of Birth') |h %></TD>
73           <TD>
74           <TABLE>
75               <& /elements/tr-input-beginning_ending.html,
76                         prefix   => 'spouse_birthdate',
77                         layout   => 'horiz',
78               &>
79           </TABLE>
80           </TD>
81       </TR>
82 %   }
83
84 %    if ( $conf->exists('cust_main-enable_anniversary_date') ) {
85       <TR>
86           <TD ALIGN="right" VALIGN="center"><% mt('Anniversary Date') |h %></TD>
87           <TD>
88           <TABLE>
89               <& /elements/tr-input-beginning_ending.html,
90                         prefix   => 'anniversary_date',
91                         layout   => 'horiz',
92               &>
93           </TABLE>
94           </TD>
95       </TR>
96 %   }
97
98     <& /elements/tr-select-cust_tag.html,
99                   'cgi'          => $cgi,
100                   'is_report'    => 1,
101                   'multiple'     => 1,
102     &>
103
104     <& /elements/tr-select-payby.html,
105                   'payby_type'   => 'cust',
106                   'multiple'     => 1,
107                   'all_selected' => 1,
108     &>
109
110     <TR>
111       <TD ALIGN="right"><% mt('Payment expiration before') |h %></TD>
112       <TD>
113         <SELECT NAME="paydate_month" DISABLED>
114 %         foreach my $month ( 1 .. 12 ) {
115             <OPTION VALUE="<% $month %>"><% $month %></OPTION>
116 %         }
117         </SELECT>
118         /
119         <SELECT NAME="paydate_year" onChange="paydate_year_changed(this);">
120           <OPTION VALUE=""></OPTION>
121 %         my $lastyear = (localtime(time))[5] + 1899;
122 %         foreach my $year ( $lastyear .. $lastyear+12 ) {
123             <OPTION VALUE="<% $year %>"><% $year %></OPTION>
124 %         }
125         </SELECT>
126       </TD>
127     </TR>
128
129     <SCRIPT TYPE="text/javascript">
130       function paydate_year_changed(what) {
131         var value = what.options[what.selectedIndex].value;
132         var month_select = what.form.paydate_month;
133         if ( value == '' ) {
134           month_select.disabled = true;
135         } else {
136           month_select.disabled = false;
137         }
138       }
139     </SCRIPT>
140  
141     <TR>
142       <TD ALIGN="right"><% mt('Invoice terms') |h %></TD>
143       <TD>
144         <& /elements/select-terms.html,
145                       'pre_options' => [ '' => emt('all') ],
146                       'empty_value' => 'NULL',
147         &>
148       </TD>
149     </TR>
150     
151     <& /elements/tr-input-lessthan_greaterthan.html,
152                   label   => emt('Current balance'),
153                   field   => 'current_balance',
154     &>
155
156     <TR>
157       <TD ALIGN="right" VALIGN="center"><% mt('Without census tract') |h %></TD>
158         <TD><INPUT TYPE="checkbox" NAME="no_censustract"></TD>
159     </TR>
160
161 %   if ( $conf->exists('enable_taxproducts') ) {
162
163       <TR>
164         <TD ALIGN="right" VALIGN="center"><% mt('With hardcoded tax location') |h %></TD>
165           <TD><INPUT TYPE="checkbox" NAME="with_geocode"></TD>
166       </TR>
167
168 %   }
169
170     <TR>
171       <TH CLASS="background" COLSPAN=2>&nbsp;</TH>
172     </TR>
173
174     <TR>
175       <TH CLASS="background" COLSPAN=2 ALIGN="left"><FONT SIZE="+1"><% mt('Display options') |h %></FONT></TH>
176     </TR>
177     <& /elements/tr-select-cust-fields.html &>
178
179     <TR>
180       <TD ALIGN="right" VALIGN="center"><% mt('Add package columns') |h %></TD>
181         <TD><INPUT TYPE="checkbox" NAME="flattened_pkgs"></TD>
182     </TR>
183
184     <TR>
185       <TD ALIGN="right" VALIGN="center"><% mt('Include cancelled packages') |h %></TD>
186         <TD><INPUT TYPE="checkbox" NAME="cancelled_pkgs"></TD>
187     </TR>
188
189   </TABLE>
190
191 <BR>
192 <INPUT TYPE="submit" VALUE="<% mt('Get Report') |h %>">
193
194 </FORM>
195
196 <& /elements/footer.html &>
197 <%init>
198
199 die "access denied"
200   unless $FS::CurrentUser::CurrentUser->access_right('Advanced customer search');
201
202 my $conf = new FS::Conf;
203
204 </%init>