5 include( 'elements/report_cust_pay_or_refund.html',
7 'name_singular' => 'payment',
10 include( 'elements/report_cust_pay_or_refund.html',
12 'name_singular' => 'refund',
16 <& /elements/header.html, mt($title) &>
18 <FORM ACTION="<% $table %>.html" METHOD="GET">
19 <INPUT TYPE="hidden" NAME="magic" VALUE="_date">
20 <INPUT TYPE="hidden" NAME="unapplied" VALUE="<% $unapplied %>">
22 <TABLE BGCOLOR="#cccccc" CELLSPACING=0>
25 <TH CLASS="background" COLSPAN=2 ALIGN="left">
26 <FONT SIZE="+1"><% mt('Search options') |h %></FONT>
31 <TD ALIGN="right"><% ucfirst(PL($name_singular)) %> of type: </TD>
33 <SELECT NAME="payby" onChange="payby_changed(this)">
34 <OPTION VALUE=""><% mt('all') |h %></OPTION>
35 <OPTION VALUE="CARD"><% mt('credit card (all)') |h %></OPTION>
36 <OPTION VALUE="CARD-VisaMC"><% mt('credit card (Visa/MasterCard)') |h %></OPTION>
37 <OPTION VALUE="CARD-Amex"><% mt('credit card (American Express)') |h %></OPTION>
38 <OPTION VALUE="CARD-Discover"><% mt('credit card (Discover)') |h %></OPTION>
39 <OPTION VALUE="CARD-Maestro"><% mt('credit card (Maestro/Switch/Solo)') |h %></OPTION>
40 <OPTION VALUE="CHEK"><% mt('electronic check / ACH') |h %></OPTION>
41 <OPTION VALUE="BILL"><% mt('check') |h %></OPTION>
42 <OPTION VALUE="PREP"><% mt('prepaid card') |h %></OPTION>
43 <OPTION VALUE="CASH"><% mt('cash') |h %></OPTION>
44 <OPTION VALUE="WEST"><% mt('Western Union') |h %></OPTION>
45 <OPTION VALUE="MCRD"><% mt('manual credit card') |h %></OPTION>
50 <SCRIPT TYPE="text/javascript">
52 function payby_changed(what) {
53 if ( what.options[what.selectedIndex].value == 'BILL' ) {
54 document.getElementById('checkno_caption').style.color = '#000000';
55 what.form.payinfo.disabled = false;
56 what.form.payinfo.style.backgroundColor = '#ffffff';
58 document.getElementById('checkno_caption').style.color = '#bbbbbb';
59 what.form.payinfo.disabled = true;
60 what.form.payinfo.style.backgroundColor = '#dddddd';
67 <TD ALIGN="right"><FONT ID="checkno_caption" COLOR="#bbbbbb"><% mt('Check #:') |h %> </FONT></TD>
69 <INPUT TYPE="text" NAME="payinfo" DISABLED STYLE="background-color: #dddddd">
73 <& /elements/tr-select-agent.html,
74 'curr_value' => scalar($cgi->param('agentnum')),
75 'label' => emt('for agent: '),
79 <& /elements/tr-select-user.html &>
82 <TD ALIGN="right" VALIGN="center"><% mt('Payment') |h %></TD>
85 <& /elements/tr-input-beginning_ending.html,
94 <TD ALIGN="right" VALIGN="center"><% mt('Voided') |h %></TD>
97 <& /elements/tr-input-beginning_ending.html,
106 <& /elements/tr-input-lessthan_greaterthan.html,
107 'label' => emt('Amount'),
111 % if ( $table eq 'cust_pay' ) {
112 <& /elements/tr-checkbox.html,
113 'label' => emt('Include tax names'),
114 'field' => 'tax_names',
122 <INPUT TYPE="submit" VALUE="<% mt('Get Report') |h %>">
126 <& /elements/footer.html &>
130 my $table = 'cust_'.$opt{'thing'};
131 my $name_singular = $opt{'name_singular'};
134 unless $FS::CurrentUser::CurrentUser->access_right('Financial reports');
136 my $void = $cgi->param('void') ? 1 : 0;
137 my $unapplied = $cgi->param('unapplied') ? 1 : 0;
139 my $title = $void ? "Voided $name_singular report" :
140 $unapplied ? "Unapplied $name_singular report" :
141 "\u$name_singular report" ;
142 $table .= '_void' if $void;