stray closing /TABLE in the no-ticket case
[freeside.git] / httemplate / search / report_cust_bill.html
1 <& /elements/header.html, mt($title, @title_arg) &>
2
3 <FORM ACTION="cust_bill.html" METHOD="GET">
4 <INPUT TYPE="hidden" NAME="magic" VALUE="_date">
5 <INPUT TYPE="hidden" NAME="custnum" VALUE="<% $custnum %>">
6
7 % unless ( $custnum ) {
8
9   <TABLE BGCOLOR="#cccccc" CELLSPACING=0>
10
11     <TR>
12       <TH CLASS="background" COLSPAN=2 ALIGN="left">
13         <FONT SIZE="+1">Customer search options</FONT>
14       </TH>
15     </TR>
16
17   <& /elements/tr-select-agent.html,
18                  'curr_value'    => scalar( $cgi->param('agentnum') ),
19                  'label'         => emt('Agent'),
20                  'disable_empty' => 0,
21   &>
22
23   <& /elements/tr-select-cust_main-status.html,
24        'label' => 'Customer status',
25        'field' => 'cust_status',
26   &>
27
28   <& /elements/tr-select-cust_class.html,
29       label         => mt('Customer Class'),
30       field         => 'cust_classnum',
31       multiple      => 1,
32      'pre_options'  => [ 0 => emt('(none)') ],
33   &>
34
35   </TABLE>
36   <BR>
37
38 % }
39
40   <TABLE BGCOLOR="#cccccc" CELLSPACING=0>
41
42     <TR>
43       <TH CLASS="background" COLSPAN=2 ALIGN="left">
44         <FONT SIZE="+1">Invoice search options</FONT>
45       </TH>
46     </TR>
47
48   <& /elements/tr-input-beginning_ending.html &>
49
50   <& /elements/tr-input-lessthan_greaterthan.html,
51                 label   => emt('Charged'),
52                 field   => 'charged',
53   &>
54
55   <& /elements/tr-input-lessthan_greaterthan.html,
56                 label   => emt('Owed'),
57                 field   => 'owed',
58   &>
59
60 % if ( $conf->exists('cust_bill-enable_promised_date') ) {
61   <TR>
62     
63     <TD ALIGN="right" STYLE="vertical-align:text-top">
64       <% emt('Promised payment date:') %></TD>
65     <TD>
66       <INPUT TYPE="checkbox" NAME="promised_date"   CHECKED VALUE="null">
67         <% emt('None') %> <BR>
68       <INPUT TYPE="checkbox" NAME="promised_date"   CHECKED VALUE="past">
69         <% emt('In the past') %><BR>
70       <INPUT TYPE="checkbox" NAME="promised_date"   CHECKED VALUE="future">
71         <% emt('In the future') %><BR>
72     </TD>
73   </TR>
74 % }
75
76 </TABLE>
77 <BR>
78
79 <TABLE BGCOLOR="#cccccc" CELLSPACING=0>
80
81   <TR>
82     <TH CLASS="background" COLSPAN=2 ALIGN="left">
83       <FONT SIZE="+1">Display options</FONT>
84     </TH>
85   </TR>
86
87
88 <TR>
89     <TD ALIGN="right"><INPUT TYPE="checkbox" NAME="open" VALUE="1" CHECKED></TD>
90     <TD><% mt('Show only open invoices') |h %></TD>
91 </TR>
92
93 <TR>
94     <TD ALIGN="right"><INPUT TYPE="checkbox" NAME="invoiced" VALUE="1"></TD>
95     <TD><% emt('Exclude discounts from gross amount billed'), %></TD>
96 </TR>
97
98 % unless ( $custnum ) {
99   <TR>
100     <TD ALIGN="right"><INPUT TYPE="checkbox" NAME="newest_percust" VALUE="1"></TD>
101     <TD><% mt('Show only the single most recent invoice per-customer') |h %></TD>
102   </TR>
103 % }
104
105 </TABLE>
106
107 <BR>
108 <INPUT TYPE="submit" VALUE="<% mt('Get Report') |h %>">
109
110 </FORM>
111
112 <& /elements/footer.html &>
113 <%init>
114
115 die "access denied"
116   unless $FS::CurrentUser::CurrentUser->access_right('List invoices');
117
118 my $conf = new FS::Conf;
119
120 my $title = 'Invoice Report';
121 #false laziness w/report_cust_pkg.html
122 my @title_arg = ();
123
124 my $custnum = '';
125 my $cust_main = '';
126 if ( $cgi->param('custnum') =~ /^(\d+)$/ ) {
127   $custnum = $1;
128   $cust_main = qsearchs({
129     'table'     => 'cust_main', 
130     'hashref'   => { 'custnum' => $custnum },
131     'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
132   }) or die "unknown custnum $custnum";
133   $title .= ': [_1]';
134   push @title_arg, $cust_main->name;
135 }
136
137 </%init>