searching for voided payments by void date as well, RT#5786
[freeside.git] / httemplate / search / report_cust_pay.html
1 <% include('/elements/header.html', $title ) %>
2
3 <FORM ACTION="<% $void ? 'cust_pay_void.html' : 'cust_pay.cgi' %>" METHOD="GET">
4 <INPUT TYPE="hidden" NAME="magic" VALUE="_date">
5
6 <TABLE BGCOLOR="#cccccc" CELLSPACING=0>
7
8   <TR>
9     <TH BGCOLOR="#e8e8e8" COLSPAN=2 ALIGN="left">
10       <FONT SIZE="+1">Search options</FONT>
11     </TH>
12   </TR>
13
14   <TR>
15     <TD ALIGN="right">Payments of type: </TD>
16     <TD>
17       <SELECT NAME="payby" onChange="payby_changed(this)">
18         <OPTION VALUE="">all</OPTION>
19         <OPTION VALUE="CARD">credit card (all)</OPTION>
20         <OPTION VALUE="CARD-VisaMC">credit card (Visa/MasterCard)</OPTION>
21         <OPTION VALUE="CARD-Amex">credit card (American Express)</OPTION>
22         <OPTION VALUE="CARD-Discover">credit card (Discover)</OPTION>
23         <OPTION VALUE="CARD-Maestro">credit card (Maestro/Switch/Solo)</OPTION>
24         <OPTION VALUE="CHEK">electronic check / ACH</OPTION>
25         <OPTION VALUE="BILL">check</OPTION>
26         <OPTION VALUE="PREP">prepaid card</OPTION>
27         <OPTION VALUE="CASH">cash</OPTION>
28         <OPTION VALUE="WEST">Western Union</OPTION>
29         <OPTION VALUE="MCRD">manual credit card</OPTION>
30       </SELECT>
31     </TD>
32   </TR>
33
34   <SCRIPT TYPE="text/javascript">
35   
36     function payby_changed(what) {
37       if ( what.options[what.selectedIndex].value == 'BILL' ) {
38         document.getElementById('checkno_caption').style.color = '#000000';
39         what.form.payinfo.disabled = false;
40         what.form.payinfo.style.backgroundColor = '#ffffff';
41       } else {
42         document.getElementById('checkno_caption').style.color = '#bbbbbb';
43         what.form.payinfo.disabled = true;
44         what.form.payinfo.style.backgroundColor = '#dddddd';
45       }
46     }
47
48   </SCRIPT>
49
50   <TR>
51     <TD ALIGN="right"><FONT ID="checkno_caption" COLOR="#bbbbbb">Check #: </FONT></TD>
52     <TD>
53       <INPUT TYPE="text" NAME="payinfo" DISABLED STYLE="background-color: #dddddd">
54     </TD>
55   </TR>
56
57   <% include( '/elements/tr-select-agent.html',
58                  'curr_value'    => scalar($cgi->param('agentnum')),
59                  'label'         => 'for agent: ',
60                  'disable_empty' => 0,
61              )
62   %>
63
64   <TR>
65     <TD ALIGN="right" VALIGN="center">Payment</TD>
66     <TD>
67       <TABLE>
68         <% include( '/elements/tr-input-beginning_ending.html',
69                       layout   => 'horiz',
70                   )
71         %>
72       </TABLE>
73     </TD>
74   </TR>
75
76 % if ( $void ) {
77     <TR>
78       <TD ALIGN="right" VALIGN="center">Voided</TD>
79       <TD>
80         <TABLE>
81           <% include( '/elements/tr-input-beginning_ending.html',
82                         prefix => 'void',
83                         layout => 'horiz',
84                     )
85           %>
86         </TABLE>
87       </TD>
88     </TR>
89 % }
90
91   <% include( '/elements/tr-input-lessthan_greaterthan.html',
92                 'label' => 'Amount',
93                 'field' => 'paid',
94             )
95   %>
96
97 </TABLE>
98
99 <BR>
100 <INPUT TYPE="submit" VALUE="Get Report">
101
102 </FORM>
103
104 <% include('/elements/footer.html') %>
105 <%init>
106
107 die "access denied"
108   unless $FS::CurrentUser::CurrentUser->access_right('Financial reports');
109
110 my $void = $cgi->param('void') ? 1 : 0;
111
112 my $title = $void ? 'Voided payment report' : 'Payment report';
113
114 </%init>