fixup 477 XML output
[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     <TR>
80       <TD ALIGN="right">Invoice terms</TD>
81       <TD>
82         <% include( '/elements/select-terms.html',
83                       'pre_options' => [ '' => 'all' ],
84                       'empty_value' => 'NULL',
85                   )
86         %>
87       </TD>
88     </TR>
89     
90     <% include( '/elements/tr-input-lessthan_greaterthan.html',
91                   label   => 'Current balance',
92                   field   => 'current_balance',
93               )
94     %>
95
96     <TR>
97       <TD ALIGN="right" VALIGN="center">Include cancelled packages</TD>
98         <TD><INPUT TYPE="checkbox" NAME="cancelled_pkgs"></TD>
99     </TR>
100
101 %   if ( $conf->exists('cust_main-require_censustract') ) {
102
103     <TR>
104       <TD ALIGN="right" VALIGN="center">Without census tract</TD>
105         <TD><INPUT TYPE="checkbox" NAME="no_censustract"></TD>
106     </TR>
107
108 %   }
109
110     <TR>
111       <TH BGCOLOR="#e8e8e8" COLSPAN=2>&nbsp;</TH>
112     </TR>
113
114     <TR>
115       <TH BGCOLOR="#e8e8e8" COLSPAN=2 ALIGN="left"><FONT SIZE="+1">Display options</FONT></TH>
116     </TR>
117     <% include( '/elements/tr-select-cust-fields.html' ) %>
118
119     <TR>
120       <TD ALIGN="right" VALIGN="center">Add package columns</TD>
121         <TD><INPUT TYPE="checkbox" NAME="flattened_pkgs"></TD>
122     </TR>
123   </TABLE>
124
125 <BR>
126 <INPUT TYPE="submit" VALUE="Get Report">
127
128 </FORM>
129
130 <% include('/elements/footer.html') %>
131 <%init>
132
133 die "access denied"
134   unless ( $FS::CurrentUser::CurrentUser->access_right('List customers') &&
135            $FS::CurrentUser::CurrentUser->access_right('List packages')
136          );;
137
138 my $conf = new FS::Conf;
139
140 </%init>
141 <%once>
142
143 my %label = (
144   'signupdate'     => 'Signup date',
145 );
146
147 </%once>