RT#42393: Verification cust_pay_pending handling in history & report
[freeside.git] / httemplate / view / cust_main / payment_history / pending_payment.html
1 <b><font size="+1" color="#FF0000"><% mt('Pending payment') |h %> </font></b> <% "$info $status ($link)" %>
2 <%init>
3
4 my( $cust_pay_pending, %opt ) = @_;
5
6 my ($payby, $payinfo) = translate_payinfo($cust_pay_pending);
7 my $target = "$payby$payinfo";
8 $payby = translate_payby($payby,$payinfo);
9 my $info = $payby ? "($payby$payinfo)" : '';
10
11 my %statusaction = (
12   'new'        => 'delete',
13   'thirdparty' => 'delete',
14   'pending'    => 'complete',
15   'authorized' => 'complete',
16   'captured'   => 'capture',
17 );
18
19 my $edit_pending =
20   $FS::CurrentUser::CurrentUser->access_right('Edit customer pending payments');
21
22 my $status = emt("Status: [_1]",$cust_pay_pending->status);
23
24 my $action = $statusaction{$cust_pay_pending->status};
25
26 my $link = "";
27 if ( $action && $edit_pending ) {
28     $link = include('/elements/popup_link.html',
29                'action' => $p. 'edit/cust_pay_pending.html'.
30                              '?paypendingnum='. $cust_pay_pending->paypendingnum.
31                              ";action=$action",
32                'label'  => emt($action),
33                'color'  => '#ff0000',
34                'width'  => 655,
35                'height' => ( $action eq 'delete' ? 480 : 575 ),
36                'actionlabel' => emt(ucfirst($action). ' pending payment'),
37             );
38 }
39
40 </%init>