summaryrefslogtreecommitdiff
path: root/httemplate/view/cust_main/payment_history/pending_payment.html
blob: 40805b1aaf7ce157dea0b451698ab8e65ff4978c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<b><font size="+1" color="#FF0000">Pending payment </font></b> <% "$info $status ($link)" %>
<%init>

my( $cust_pay_pending, %opt ) = @_;

my $conf = new FS::Conf;

my $curuser = $FS::CurrentUser::CurrentUser;

my $payby = $cust_pay_pending->payby;

my $payinfo;
if ( $payby eq 'CARD' ) {
  $payinfo = $cust_pay_pending->paymask;
} elsif ( $payby eq 'CHEK' ) {
  my( $account, $aba ) = split('@', $cust_pay_pending->paymask );
  $payinfo = "ABA $aba, Acct #$account";
} else {
  $payinfo = $cust_pay_pending->payinfo;
}

my $target = "$payby$payinfo";
$payby =~ s/^BILL$/Check #/ if $payinfo;
$payby =~ s/^CHEK$/Electronic check /;
$payby =~ s/^PREP$/Prepaid card /;
$payby =~ s/^CARD$/Credit card #/; 
$payby =~ s/^COMP$/Complimentary by /; 
$payby =~ s/^CASH$/Cash/;
$payby =~ s/^WEST$/Western Union/;
$payby =~ s/^MCRD$/Manual credit card/;
$payby =~ s/^BILL$//;
my $info = $payby ? "($payby$payinfo)" : '';

my %statusaction = (
  'new'        => 'delete',
  'pending'    => 'complete',
  'captured'   => 'capture',
);

my $edit_pending =
  $FS::CurrentUser::CurrentUser->access_right('Edit customer pending payments');

my $status = "Status: ".$cust_pay_pending->status;

my $action = $statusaction{$cust_pay_pending->status};

my $link = "";
if ( $action && $edit_pending ) {
    $link = include('/elements/popup_link.html',
	       'action' => $p. 'edit/cust_pay_pending.html'.
			     '?paypendingnum='. $cust_pay_pending->paypendingnum.
			     ";action=$action",
	       'label'  => $action,
	       'color'  => '#ff0000',
	       'width'  => 655,
	       'height' => ( $action eq 'delete' ? 480 : 575 ),
	       'actionlabel' => ucfirst($action). ' pending payment',
	    );
}

</%init>