This commit was manufactured by cvs2svn to create branch
[freeside.git] / httemplate / view / cust_main / payment_history / pending_payment.html
1 <b><font size="+1" color="#FF0000">Pending payment </font></b> <% "$info $status ($link)" %>
2 <%init>
3
4 my( $cust_pay_pending, %opt ) = @_;
5
6 my $conf = new FS::Conf;
7
8 my $curuser = $FS::CurrentUser::CurrentUser;
9
10 my $payby = $cust_pay_pending->payby;
11
12 my $payinfo;
13 if ( $payby eq 'CARD' ) {
14   $payinfo = $cust_pay_pending->paymask;
15 } elsif ( $payby eq 'CHEK' ) {
16   my( $account, $aba ) = split('@', $cust_pay_pending->paymask );
17   $payinfo = "ABA $aba, Acct #$account";
18 } else {
19   $payinfo = $cust_pay_pending->payinfo;
20 }
21
22 my $target = "$payby$payinfo";
23 $payby =~ s/^BILL$/Check #/ if $payinfo;
24 $payby =~ s/^CHEK$/Electronic check /;
25 $payby =~ s/^PREP$/Prepaid card /;
26 $payby =~ s/^CARD$/Credit card #/; 
27 $payby =~ s/^COMP$/Complimentary by /; 
28 $payby =~ s/^CASH$/Cash/;
29 $payby =~ s/^WEST$/Western Union/;
30 $payby =~ s/^MCRD$/Manual credit card/;
31 $payby =~ s/^BILL$//;
32 my $info = $payby ? "($payby$payinfo)" : '';
33
34 my %statusaction = (
35   'new'        => 'delete',
36   'pending'    => 'complete',
37   'captured'   => 'capture',
38 );
39
40 my $edit_pending =
41   $FS::CurrentUser::CurrentUser->access_right('Edit customer pending payments');
42
43 my $status = "Status: ".$cust_pay_pending->status;
44
45 my $action = $statusaction{$cust_pay_pending->status};
46
47 my $link = "";
48 if ( $action && $edit_pending ) {
49     $link = include('/elements/popup_link.html',
50                'action' => $p. 'edit/cust_pay_pending.html'.
51                              '?paypendingnum='. $cust_pay_pending->paypendingnum.
52                              ";action=$action",
53                'label'  => $action,
54                'color'  => '#ff0000',
55                'width'  => 655,
56                'height' => ( $action eq 'delete' ? 480 : 575 ),
57                'actionlabel' => ucfirst($action). ' pending payment',
58             );
59 }
60
61 </%init>