summaryrefslogtreecommitdiff
path: root/httemplate/view/cust_main/payment_history/attempted_payment.html
blob: 1a705b7f80d58585f68a1dd7239fd5cb453acd13 (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
<I><% mt('Payment attempt') |h %> <% $info |h %></I>
<%init>

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

my $date_format = $opt{'date_format'} || '%m/%d/%Y';

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 = mt("ABA [_1], Acct #[_2]",$aba,$account);
} else {
  $payinfo = $cust_pay_pending->payinfo;
}

$payby = translate_payby($payby,$payinfo);
my $info = $payby ? "($payby$payinfo)" : '';

if ( $opt{'pkg-balances'} && $cust_pay_pending->pkgnum ) {
  my $cust_pkg = qsearchs('cust_pkg', { 'pkgnum'=>$cust_pay_pending->pkgnum } );
  $info .= ' for '. $cust_pkg->pkg_label_long;
}

$info .= ': '. $cust_pay_pending->statustext
  if length($cust_pay_pending->statustext);

</%init>