<%doc> Examples: include( 'elements/report_cust_pay_or_refund.html', 'thing' => 'pay', 'name_singular' => 'payment', ) include( 'elements/report_cust_pay_or_refund.html', 'thing' => 'refund', 'name_singular' => 'refund', ) <& /elements/header.html, mt($title) &>
<& /elements/tr-select-user.html &> % if ( $void ) { % } % 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', &>
<% mt('Payment search options') |h %>
<% ucfirst(PL($name_singular)) %> of type:
<% mt('Check #:') |h %>
<% mt('Transaction #:') |h %>
<% mt(ucfirst($name_singular). ' date') |h %> <& /elements/tr-input-beginning_ending.html, layout => 'horiz', input_time => $conf->exists('report-cust_pay-select_time'), &>
<% mt('Voided') |h %> <& /elements/tr-input-beginning_ending.html, prefix => 'void', layout => 'horiz', &>

<& /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' => [ '' => emt('(none)') ], 'all_selected' => 1, &>
<% mt('Customer search options') |h %>
% if ( $table eq 'cust_pay' ) {
<& /elements/tr-checkbox.html, 'label' => emt('Include tax names'), 'field' => 'tax_names', 'value' => 1, &>
<% mt('Display options') |h %>
% }
<& /elements/footer.html &> <%init> my %opt = @_; my $table = 'cust_'.$opt{'thing'}; my $name_singular = $opt{'name_singular'}; die "access denied" unless $FS::CurrentUser::CurrentUser->access_right('Financial reports'); my $conf = new FS::Conf; my $void = $cgi->param('void') ? 1 : 0; my $unapplied = $cgi->param('unapplied') ? 1 : 0; my $title = $void ? "Voided $name_singular report" : $unapplied ? "Unapplied $name_singular report" : "\u$name_singular report" ; $table .= '_void' if $void;