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