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