31149231bb63e3fab7a69794f5e610b9b26747fa
[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   'captured'   => 'capture',
16 );
17
18 my $edit_pending =
19   $FS::CurrentUser::CurrentUser->access_right('Edit customer pending payments');
20
21 my $status = emt("Status: [_1]",$cust_pay_pending->status);
22
23 my $action = $statusaction{$cust_pay_pending->status};
24
25 my $link = "";
26 if ( $action && $edit_pending ) {
27     $link = include('/elements/popup_link.html',
28                'action' => $p. 'edit/cust_pay_pending.html'.
29                              '?paypendingnum='. $cust_pay_pending->paypendingnum.
30                              ";action=$action",
31                'label'  => emt($action),
32                'color'  => '#ff0000',
33                'width'  => 655,
34                'height' => ( $action eq 'delete' ? 480 : 575 ),
35                'actionlabel' => emt(ucfirst($action). ' pending payment'),
36             );
37 }
38
39 </%init>