Merge branch 'master' of git.freeside.biz:/home/git/freeside
[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('Signup date') |h %></TD>
41         <TD>
42         <TABLE>
43             <& /elements/tr-input-beginning_ending.html,
44                       prefix   => 'signupdate',
45                       layout   => 'horiz',
46             &>
47         </TABLE>
48         </TD>
49     </TR>
50
51 %    if ( $conf->exists('cust_main-enable_birthdate') ) {
52       <TR>
53           <TD ALIGN="right" VALIGN="center"><% mt('Date of Birth') |h %></TD>
54           <TD>
55           <TABLE>
56               <& /elements/tr-input-beginning_ending.html,
57                         prefix   => 'birthdate',
58                         layout   => 'horiz',
59               &>
60           </TABLE>
61           </TD>
62       </TR>
63 %   }
64
65 %    if ( $conf->exists('cust_main-enable_spouse_birthdate') ) {
66       <TR>
67           <TD ALIGN="right" VALIGN="center"><% mt('Spouse Date of Birth') |h %></TD>
68           <TD>
69           <TABLE>
70               <& /elements/tr-input-beginning_ending.html,
71                         prefix   => 'spouse_birthdate',
72                         layout   => 'horiz',
73               &>
74           </TABLE>
75           </TD>
76       </TR>
77 %   }
78
79     <& /elements/tr-select-cust_tag.html,
80                   'cgi'          => $cgi,
81                   'is_report'    => 1,
82                   'multiple'     => 1,
83     &>
84
85     <& /elements/tr-select-payby.html,
86                   'payby_type'   => 'cust',
87                   'multiple'     => 1,
88                   'all_selected' => 1,
89     &>
90
91     <TR>
92       <TD ALIGN="right"><% mt('Payment expiration before') |h %></TD>
93       <TD>
94         <SELECT NAME="paydate_month" DISABLED>
95 %         foreach my $month ( 1 .. 12 ) {
96             <OPTION VALUE="<% $month %>"><% $month %></OPTION>
97 %         }
98         </SELECT>
99         /
100         <SELECT NAME="paydate_year" onChange="paydate_year_changed(this);">
101           <OPTION VALUE=""></OPTION>
102 %         my $lastyear = (localtime(time))[5] + 1899;
103 %         foreach my $year ( $lastyear .. $lastyear+12 ) {
104             <OPTION VALUE="<% $year %>"><% $year %></OPTION>
105 %         }
106         </SELECT>
107       </TD>
108     </TR>
109
110     <SCRIPT TYPE="text/javascript">
111       function paydate_year_changed(what) {
112         var value = what.options[what.selectedIndex].value;
113         var month_select = what.form.paydate_month;
114         if ( value == '' ) {
115           month_select.disabled = true;
116         } else {
117           month_select.disabled = false;
118         }
119       }
120     </SCRIPT>
121  
122     <TR>
123       <TD ALIGN="right"><% mt('Invoice terms') |h %></TD>
124       <TD>
125         <& /elements/select-terms.html,
126                       'pre_options' => [ '' => emt('all') ],
127                       'empty_value' => 'NULL',
128         &>
129       </TD>
130     </TR>
131     
132     <& /elements/tr-input-lessthan_greaterthan.html,
133                   label   => emt('Current balance'),
134                   field   => 'current_balance',
135     &>
136
137     <TR>
138       <TD ALIGN="right" VALIGN="center"><% mt('Without census tract') |h %></TD>
139         <TD><INPUT TYPE="checkbox" NAME="no_censustract"></TD>
140     </TR>
141
142 %   if ( $conf->exists('enable_taxproducts') ) {
143
144       <TR>
145         <TD ALIGN="right" VALIGN="center"><% mt('With hardcoded tax location') |h %></TD>
146           <TD><INPUT TYPE="checkbox" NAME="with_geocode"></TD>
147       </TR>
148
149 %   }
150
151     <TR>
152       <TH CLASS="background" COLSPAN=2>&nbsp;</TH>
153     </TR>
154
155     <TR>
156       <TH CLASS="background" COLSPAN=2 ALIGN="left"><FONT SIZE="+1"><% mt('Display options') |h %></FONT></TH>
157     </TR>
158     <& /elements/tr-select-cust-fields.html &>
159
160     <TR>
161       <TD ALIGN="right" VALIGN="center"><% mt('Add package columns') |h %></TD>
162         <TD><INPUT TYPE="checkbox" NAME="flattened_pkgs"></TD>
163     </TR>
164
165     <TR>
166       <TD ALIGN="right" VALIGN="center"><% mt('Include cancelled packages') |h %></TD>
167         <TD><INPUT TYPE="checkbox" NAME="cancelled_pkgs"></TD>
168     </TR>
169
170   </TABLE>
171
172 <BR>
173 <INPUT TYPE="submit" VALUE="<% mt('Get Report') |h %>">
174
175 </FORM>
176
177 <& /elements/footer.html &>
178 <%init>
179
180 die "access denied"
181   unless $FS::CurrentUser::CurrentUser->access_right('Advanced customer search');
182
183 my $conf = new FS::Conf;
184
185 </%init>