-<% include( 'elements/cust_pay_or_refund.html',
+<& elements/cust_pay_or_refund.html,
'thing' => 'pay_pending',
'amount_field' => 'paid',
'name_singular' => 'pending payment',
'name_verb' => 'pending',
'disable_link' => 1,
'disable_by' => 1, #add otaker to cust_pay_pending?
- 'html_init' => include('/elements/init_overlib.html'),
'addl_header' => [ 'Time', 'Payment Status', ],
'addl_fields' => [ sub { time2str('%r', shift->_date ) },
$status_sub,
],
- )
-%>
+ 'addl_sort_fields' => [ 'status' ],
+ 'redirect_empty' => $redirect_empty,
+&>
<%init>
my %statusaction = (
'new' => 'delete',
'pending' => 'complete',
#'authorized' => '',
- #'captured' => '',
+ 'captured' => 'capture',
#'declined' => '',
#wouldn't need to take action on a done state#'done'
);
my $status_sub = sub {
my $pending = shift;
my $return = $pending->status;
+ if ( $pending->failure_status ) {
+ $return = $pending->display_status;
+ }
my $action = $statusaction{$pending->status};
return $return unless $action && $edit_pending;
my $link = include('/elements/popup_link.html',
$return. qq! <FONT SIZE="-1">($link)</FONT>!;
};
+my $redirect_empty = sub {
+ my $cgi = shift;
+ if ( $cgi->param('custnum') =~ /^(\d+)$/ ) {
+ $p. "view/cust_main.cgi?$1";
+ } else {
+ '';
+ }
+};
+
</%init>