search voided invoices, missing files, #28684
[freeside.git] / httemplate / search / report_cust_bill_void.html
1 <& /elements/header.html, mt($title, @title_arg) &>
2
3 <FORM ACTION="cust_bill_void.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_class.html,
24       label         => mt('Customer Class'),
25       field         => 'cust_classnum',
26       multiple      => 1,
27      'pre_options'  => [ '' => emt('(none)') ],
28      'all_selected' => 1,
29   &>
30
31 %   if ( $cust_main ) {
32     <INPUT TYPE="hidden" NAME="payby" VALUE="<% $cust_main->payby %>">
33 %   } else {
34     <& /elements/tr-select-payby.html,
35                   label   => emt('Payment method:'),
36                   payby_type   => 'cust',
37                   multiple     => 1,
38                   all_selected => 1,
39     &>
40 % }
41
42   </TABLE>
43   <BR>
44
45 % }
46
47   <TABLE BGCOLOR="#cccccc" CELLSPACING=0>
48
49     <TR>
50       <TH CLASS="background" COLSPAN=2 ALIGN="left">
51         <FONT SIZE="+1">Invoice search options</FONT>
52       </TH>
53     </TR>
54
55   <& /elements/tr-input-beginning_ending.html &>
56
57   <& /elements/tr-input-lessthan_greaterthan.html,
58                 label   => emt('Charged'),
59                 field   => 'charged',
60   &>
61
62   <& /elements/tablebreak-tr-title.html,
63       value => 'Void circumstances'
64   &>
65   <& /elements/tr-select-user.html,
66       field => 'void_usernum',
67       label => 'Voided by: ',
68   &>
69   <& /elements/tr-input-beginning_ending.html, prefix => 'void_' &>
70
71   </TABLE>
72 <BR>
73 <INPUT TYPE="submit" VALUE="<% mt('Get Report') |h %>">
74
75 </FORM>
76
77 <& /elements/footer.html &>
78 <%init>
79
80 die "access denied"
81   unless $FS::CurrentUser::CurrentUser->access_right('List invoices');
82
83 my $conf = new FS::Conf;
84
85 my $title = 'Voided Invoice Report';
86 #false laziness w/report_cust_pkg.html
87 my @title_arg = ();
88
89 my $custnum = '';
90 my $cust_main = '';
91 if ( $cgi->param('custnum') =~ /^(\d+)$/ ) {
92   $custnum = $1;
93   $cust_main = qsearchs({
94     'table'     => 'cust_main', 
95     'hashref'   => { 'custnum' => $custnum },
96     'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
97   }) or die "unknown custnum $custnum";
98   $title .= ': [_1]';
99   push @title_arg, $cust_main->name;
100 }
101
102 </%init>