X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fsearch%2Felements%2Freport_cust_pay_or_refund.html;h=f7a81a066c8a56c353f11359661a1bcf54718a13;hp=0e04ab0dd35dab74bf317d04eccf532743b948b4;hb=fc263806f5e475559a0c4cfdb70a5f1cefe0ffa3;hpb=7a618d4493ab7a87f6eabfd1ce3630a6b3436c2f diff --git a/httemplate/search/elements/report_cust_pay_or_refund.html b/httemplate/search/elements/report_cust_pay_or_refund.html index 0e04ab0dd..f7a81a066 100644 --- a/httemplate/search/elements/report_cust_pay_or_refund.html +++ b/httemplate/search/elements/report_cust_pay_or_refund.html @@ -19,96 +19,62 @@ Examples: - - - - - + <% emt('[_1] search options', ucfirst($name_singular)) %> +
- <% mt('Search options') |h %> -
+ + <& /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')) { - + - - - +% } - + - + - <& /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'), + &> +% } + - + @@ -116,7 +82,7 @@ Examples: % if ( $void ) { - +
<% ucfirst(PL($name_singular)) %> of type: <% mt('Card Last 4 #:') |h %> - +
<% mt('Check #:') |h %> <% mt('Check #:') |h %> - +
- - <% mt('Transaction #') |h %> - - <% mt('Transaction #:') |h %> - +
<% mt('Payment') |h %><% mt(ucfirst($name_singular). ' date') |h %> <& /elements/tr-input-beginning_ending.html, - layout => 'horiz', + layout => 'horiz', + input_time => $conf->exists('report-cust_pay-select_time'), &>
<% mt('Voided') |h %><% mt('Voided') |h %> <& /elements/tr-input-beginning_ending.html, @@ -128,21 +94,73 @@ Examples: % } +% 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', &> + +
+
+ + +<% emt('Customer search options') %> + + + <& /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 &> + +
+ % if ( $table eq 'cust_pay' ) { + +
+ + <% emt('Display options') %> + + <& /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, + &>
+% } +
@@ -156,7 +174,9 @@ my $table = 'cust_'.$opt{'thing'}; 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; my $void = $cgi->param('void') ? 1 : 0; my $unapplied = $cgi->param('unapplied') ? 1 : 0; @@ -166,4 +186,29 @@ my $title = $void ? "Voided $name_singular report" : "\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', +); +