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('Payment search options') |h %></FONT>
31 <TD ALIGN="right"><% ucfirst(PL($name_singular)) %> of type: </TD>
33 <SELECT NAME="payby" SIZE=16 MULTIPLE>
35 %# <OPTION VALUE=""><% mt('all') |h %></OPTION>
36 %# <OPTION VALUE="CARD"><% mt('credit card (all)') |h %></OPTION>
38 <OPTION VALUE="CARD-VisaMC" SELECTED><% mt('credit card (Visa/MasterCard)') |h %></OPTION>
39 <OPTION VALUE="CARD-Amex" SELECTED><% mt('credit card (American Express)') |h %></OPTION>
40 <OPTION VALUE="CARD-Discover" SELECTED><% mt('credit card (Discover)') |h %></OPTION>
41 <OPTION VALUE="CARD-Maestro" SELECTED><% mt('credit card (Maestro/Switch/Solo)') |h %></OPTION>
42 <OPTION VALUE="CARD-Tokenized" SELECTED><% mt('credit card (Tokenized)') |h %></OPTION>
44 <OPTION VALUE="CHEK" SELECTED><% mt('electronic check / ACH') |h %></OPTION>
45 <OPTION VALUE="BILL" SELECTED><% mt('check') |h %></OPTION>
46 <OPTION VALUE="CASH" SELECTED><% mt('cash') |h %></OPTION>
47 <OPTION VALUE="PPAL" SELECTED><% mt('Paypal') |h %></OPTION>
48 <OPTION VALUE="APPL" SELECTED><% mt('Apple Store') |h %></OPTION>
49 <OPTION VALUE="ANRD" SELECTED><% mt('Android Market') |h %></OPTION>
51 <OPTION VALUE="PREP" SELECTED><% mt('prepaid card') |h %></OPTION>
52 <OPTION VALUE="WIRE" SELECTED><% mt('wire transfer') |h %></OPTION>
53 <OPTION VALUE="WEST" SELECTED><% mt('Western Union') |h %></OPTION>
54 <OPTION VALUE="EDI" SELECTED><% mt('Electronic Debit (EDI)') |h %></OPTION>
55 <OPTION VALUE="MCRD" SELECTED><% mt('manual credit card') |h %></OPTION>
61 <TD ALIGN="right"><% mt('Check #:') |h %> </TD>
63 <INPUT TYPE="text" ID="payinfo" NAME="payinfo">
67 <TD ALIGN="right"><% mt('Transaction #:') |h %> </TD>
69 <INPUT TYPE="text" ID="ccpay" NAME="ccpay">
73 <& /elements/tr-select-user.html &>
76 <TD ALIGN="right" VALIGN="center"><% mt(ucfirst($name_singular). ' date') |h %></TD>
79 <& /elements/tr-input-beginning_ending.html,
81 input_time => $conf->exists('report-cust_pay-select_time'),
89 <TD ALIGN="right" VALIGN="center"><% mt('Voided') |h %></TD>
92 <& /elements/tr-input-beginning_ending.html,
101 % if ( $table eq 'cust_pay' ) {
104 % # <& /elements/tr-select-batchnum.html &>
106 % #payment "entry" batch (should probably just all become the same thing)
107 <& /elements/tr-select-paybatch.html &>
111 <& /elements/tr-input-lessthan_greaterthan.html,
112 'label' => emt('Amount'),
121 <TABLE BGCOLOR="#cccccc" CELLSPACING=0>
124 <TH CLASS="background" COLSPAN=2 ALIGN="left">
125 <FONT SIZE="+1"><% mt('Customer search options') |h %></FONT>
129 <& /elements/tr-select-agent.html,
130 'curr_value' => scalar($cgi->param('agentnum')),
131 'label' => emt('Agent'),
132 'disable_empty' => 0,
135 <& /elements/tr-select-cust_class.html,
136 'label' => emt('Customer class'),
137 'field' => 'cust_classnum',
139 'pre_options' => [ '' => emt('(none)') ],
145 % if ( $table eq 'cust_pay' ) {
148 <TABLE BGCOLOR="#cccccc" CELLSPACING=0>
151 <TH CLASS="background" COLSPAN=2 ALIGN="left">
152 <FONT SIZE="+1"><% mt('Display options') |h %></FONT>
156 <& /elements/tr-checkbox.html,
157 'label' => emt('Include tax names'),
158 'field' => 'tax_names',
167 <INPUT TYPE="submit" VALUE="<% mt('Get Report') |h %>">
171 <& /elements/footer.html &>
175 my $table = 'cust_'.$opt{'thing'};
176 my $name_singular = $opt{'name_singular'};
179 unless $FS::CurrentUser::CurrentUser->access_right('Financial reports');
181 my $conf = new FS::Conf;
183 my $void = $cgi->param('void') ? 1 : 0;
184 my $unapplied = $cgi->param('unapplied') ? 1 : 0;
186 my $title = $void ? "Voided $name_singular report" :
187 $unapplied ? "Unapplied $name_singular report" :
188 "\u$name_singular report" ;
189 $table .= '_void' if $void;