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>
30 <& /elements/tr-select.html,
31 label => ucfirst(PL($name_singular)) . ' of type:',
33 options => [ keys(\%payby) ],
40 <TD ALIGN="right"><% mt('Check #:') |h %> </TD>
42 <INPUT TYPE="text" ID="payinfo" NAME="payinfo">
46 <TD ALIGN="right"><% mt('Transaction #:') |h %> </TD>
48 <INPUT TYPE="text" ID="ccpay" NAME="ccpay">
52 <& /elements/tr-select-user.html &>
55 <TD ALIGN="right" VALIGN="center"><% mt(ucfirst($name_singular). ' date') |h %></TD>
58 <& /elements/tr-input-beginning_ending.html,
60 input_time => $conf->exists('report-cust_pay-select_time'),
68 <TD ALIGN="right" VALIGN="center"><% mt('Voided') |h %></TD>
71 <& /elements/tr-input-beginning_ending.html,
80 % if ( $table eq 'cust_pay' ) {
83 % # <& /elements/tr-select-batchnum.html &>
85 % #payment "entry" batch (should probably just all become the same thing)
86 <& /elements/tr-select-paybatch.html &>
90 <& /elements/tr-input-lessthan_greaterthan.html,
91 'label' => emt('Amount'),
100 <TABLE BGCOLOR="#cccccc" CELLSPACING=0>
103 <TH CLASS="background" COLSPAN=2 ALIGN="left">
104 <FONT SIZE="+1"><% mt('Customer search options') |h %></FONT>
108 <& /elements/tr-select-agent.html,
109 'curr_value' => scalar($cgi->param('agentnum')),
110 'label' => emt('Agent'),
111 'disable_empty' => 0,
114 <& /elements/tr-select-cust_class.html,
115 'label' => emt('Customer class'),
116 'field' => 'cust_classnum',
118 'pre_options' => [ 0 => emt('(none)') ],
123 % if ( $table eq 'cust_pay' ) {
126 <TABLE BGCOLOR="#cccccc" CELLSPACING=0>
129 <TH CLASS="background" COLSPAN=2 ALIGN="left">
130 <FONT SIZE="+1"><% mt('Display options') |h %></FONT>
134 <& /elements/tr-checkbox.html,
135 'label' => emt('Include tax names'),
136 'field' => 'tax_names',
145 <INPUT TYPE="submit" VALUE="<% mt('Get Report') |h %>">
149 <& /elements/footer.html &>
153 my $table = 'cust_'.$opt{'thing'};
154 my $name_singular = $opt{'name_singular'};
157 unless $FS::CurrentUser::CurrentUser->access_right('Financial reports');
159 my $conf = new FS::Conf;
161 my $void = $cgi->param('void') ? 1 : 0;
162 my $unapplied = $cgi->param('unapplied') ? 1 : 0;
164 my $title = $void ? "Voided $name_singular report" :
165 $unapplied ? "Unapplied $name_singular report" :
166 "\u$name_singular report" ;
167 $table .= '_void' if $void;
169 tie (my %payby, 'Tie::IxHash',
170 'CARD-VisaMC' => 'credit card (Visa/MasterCard)',
171 'CARD-Amex' => 'credit card (American Express)',
172 'CARD-Discover' => 'credit card (Discover)',
173 'CARD-Maestro' => 'credit card (Maestro/Switch/Solo)',
174 'CARD-Tokenized' => 'credit card (Tokenized)',
176 'CHEK' => 'electronic check / ACH',
180 'APPL' => 'Apple Store',
181 'ANRD' => 'Android Market',
183 'PREP' => 'prepaid card',
184 'WIRE' => 'wire transfer',
185 'WEST' => 'Western Union',
186 'EDI' => 'Electronic Debit (EDI)',
187 'MCRD' => 'manual credit card',
188 'MCHK' => 'manual electronic check',