<INPUT TYPE="hidden" NAME="magic" VALUE="_date">
<INPUT TYPE="hidden" NAME="unapplied" VALUE="<% $unapplied %>">
-<TABLE BGCOLOR="#cccccc" CELLSPACING=0>
-
- <TR>
- <TH CLASS="background" COLSPAN=2 ALIGN="left">
- <FONT SIZE="+1"><% mt('Search options') |h %></FONT>
- </TH>
- </TR>
+ <FONT CLASS="fsinnerbox-title"><% emt('[_1] search options', ucfirst($name_singular)) %></FONT>
+ <TABLE CLASS="fsinnerbox">
+
+ <& /elements/tr-select.html,
+ label => ucfirst(PL($name_singular)) . ' of type:',
+ field => 'payby',
+ options => [ keys %payby ],
+ labels => \%payby,
+ multiple => 1,
+ size => 18,
+ &>
+% if (substr($conf->config('card_masking_method'), -5) eq 'last4' || !$conf->config('card_masking_method')) {
<TR>
- <TD ALIGN="right"><% ucfirst(PL($name_singular)) %> of type: </TD>
+ <TH ALIGN="right"><% mt('Card Last 4 #:') |h %></TH>
<TD>
- <SELECT NAME="payby" SIZE=10 MULTIPLE>
-%# <OPTION VALUE=""><% mt('all') |h %></OPTION>
-%# <OPTION VALUE="CARD"><% mt('credit card (all)') |h %></OPTION>
- <OPTION VALUE="CARD-VisaMC" SELECTED><% mt('credit card (Visa/MasterCard)') |h %></OPTION>
- <OPTION VALUE="CARD-Amex" SELECTED><% mt('credit card (American Express)') |h %></OPTION>
- <OPTION VALUE="CARD-Discover" SELECTED><% mt('credit card (Discover)') |h %></OPTION>
- <OPTION VALUE="CARD-Maestro" SELECTED><% mt('credit card (Maestro/Switch/Solo)') |h %></OPTION>
- <OPTION VALUE="CARD-Tokenized" SELECTED><% mt('credit card (Tokenized)') |h %></OPTION>
- <OPTION VALUE="CHEK" SELECTED><% mt('electronic check / ACH') |h %></OPTION>
- <OPTION VALUE="BILL" SELECTED><% mt('check') |h %></OPTION>
- <OPTION VALUE="PREP" SELECTED><% mt('prepaid card') |h %></OPTION>
- <OPTION VALUE="CASH" SELECTED><% mt('cash') |h %></OPTION>
- <OPTION VALUE="WEST" SELECTED><% mt('Western Union') |h %></OPTION>
- <OPTION VALUE="MCRD" SELECTED><% mt('manual credit card') |h %></OPTION>
- </SELECT>
+ <INPUT TYPE="text" ID="paymask" NAME="paymask">
</TD>
</TR>
-
+% }
<TR>
- <TD ALIGN="right"><% mt('Check #:') |h %> </TD>
+ <TH ALIGN="right"><% mt('Check #:') |h %> </TH>
<TD>
<INPUT TYPE="text" ID="payinfo" NAME="payinfo">
</TD>
</TR>
<TR>
- <TD ALIGN="right"><% mt('Transaction #:') |h %> </TD>
+ <TH ALIGN="right"><% mt('Transaction #:') |h %> </TH>
<TD>
<INPUT TYPE="text" ID="ccpay" NAME="ccpay">
</TD>
</TR>
- <& /elements/tr-select-agent.html,
- 'curr_value' => scalar($cgi->param('agentnum')),
- 'label' => emt('for agent: '),
- 'disable_empty' => 0,
- &>
-
<& /elements/tr-select-user.html &>
+% if ( $has_reason ) {
+% # limit to reasons that are in use for the table being reported on
+% # (maybe order by count(*) desc?)
+ <& /elements/tr-select-table.html,
+ label => emt('Reason'),
+ field => 'reasonnum',
+ id => 'reasonnum',
+ table => 'reason',
+ name_col => 'reason',
+ extra_sql => " WHERE EXISTS(SELECT 1 FROM $table WHERE $table.reasonnum = reason.reasonnum) ",
+ empty_label => emt('any'),
+ &>
+% }
+
<TR>
- <TD ALIGN="right" VALIGN="center"><% mt('Payment') |h %></TD>
+ <TH ALIGN="right" VALIGN="center"><% mt(ucfirst($name_singular). ' date') |h %></TH>
<TD>
<TABLE>
<& /elements/tr-input-beginning_ending.html,
% if ( $void ) {
<TR>
- <TD ALIGN="right" VALIGN="center"><% mt('Voided') |h %></TD>
+ <TH ALIGN="right" VALIGN="center"><% mt('Voided') |h %></TH>
<TD>
<TABLE>
<& /elements/tr-input-beginning_ending.html,
</TR>
% }
+% if ( $table eq 'cust_pay' ) {
+
+% # payment batch
+% # <& /elements/tr-select-batchnum.html &>
+
+% #payment "entry" batch (should probably just all become the same thing)
+ <& /elements/tr-select-paybatch.html &>
+
+% }
+
<& /elements/tr-input-lessthan_greaterthan.html,
'label' => emt('Amount'),
'field' => 'paid',
&>
+
+</TABLE>
+<BR>
+
+
+<FONT CLASS="fsinnerbox-title"><% emt('Customer search options') %></FONT>
+<TABLE CLASS="fsinnerbox">
+
+ <& /elements/tr-select-cust_tag.html,
+ 'custnum' => $opt{'custnum'},
+ &>
+
+ <& /elements/tr-select-agent.html,
+ 'curr_value' => scalar($cgi->param('agentnum')),
+ 'label' => emt('Agent'),
+ 'disable_empty' => 0,
+ &>
+
+ <& /elements/tr-select-cust_class.html,
+ 'label' => emt('Customer class'),
+ 'field' => 'cust_classnum',
+ 'multiple' => 1,
+ 'pre_options' => [ 0 => emt('(none)') ],
+ &>
+
+ <& options_cust_location.html &>
+
+</TABLE>
+
% if ( $table eq 'cust_pay' ) {
+
+ <BR>
+
+ <FONT CLASS="fsinnerbox-title"><% emt('Display options') %></FONT>
+ <TABLE CLASS="fsinnerbox">
+
<& /elements/tr-checkbox.html,
'label' => emt('Include tax names'),
'field' => 'tax_names',
'value' => 1,
&>
-% }
+
+ <& /elements/tr-checkbox.html,
+ 'label' => emt('Include order number'),
+ 'field' => 'show_order_number',
+ 'value' => 1,
+ &>
</TABLE>
+% }
+
<BR>
<INPUT TYPE="submit" VALUE="<% mt('Get Report') |h %>">
my $name_singular = $opt{'name_singular'};
die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Financial reports');
+ unless $FS::CurrentUser::CurrentUser->access_right('Basic payment and refund reports');
my $conf = new FS::Conf;
"\u$name_singular report" ;
$table .= '_void' if $void;
+my $has_reason = dbdef->table($table)->column('reasonnum');
+
+tie (my %payby, 'Tie::IxHash',
+ 'CARD-VisaMC' => 'credit card (Visa/MasterCard)',
+ 'CARD-Amex' => 'credit card (American Express)',
+ 'CARD-Discover' => 'credit card (Discover)',
+ 'CARD-Maestro' => 'credit card (Maestro/Switch/Solo)',
+ 'CARD-Tokenized' => 'credit card (Tokenized)',
+
+ 'CHEK' => 'electronic check / ACH',
+ 'BILL' => 'check',
+ 'CASH' => 'cash',
+ 'PPAL' => 'Paypal',
+ 'APPL' => 'Apple Store',
+ 'ANRD' => 'Android Market',
+
+ 'PREP' => 'prepaid card',
+ 'WIRE' => 'wire transfer',
+ 'WEST' => 'Western Union',
+ 'IDTP' => 'IDT Payment Services',
+ 'EDI' => 'Electronic Debit (EDI)',
+ 'MCRD' => 'manual credit card',
+ 'MCHK' => 'manual electronic check',
+);
+
</%init>