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