RT# 77532 - fixed error where cust main fax not showing, and fixed checking of phonet...
[freeside.git] / httemplate / view / cust_main / payment_history / attempted_payment.html
index 1a705b7..63209c7 100644 (file)
@@ -3,22 +3,7 @@
 
 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;
-}
-
+my ($payby,$payinfo) = translate_payinfo($cust_pay_pending);
 $payby = translate_payby($payby,$payinfo);
 my $info = $payby ? "($payby$payinfo)" : '';
 
@@ -27,7 +12,15 @@ if ( $opt{'pkg-balances'} && $cust_pay_pending->pkgnum ) {
   $info .= ' for '. $cust_pkg->pkg_label_long;
 }
 
-$info .= ': '. $cust_pay_pending->statustext
-  if length($cust_pay_pending->statustext);
+my $detail = '';
+if ( $cust_pay_pending->failure_status ) {
+  $detail = $cust_pay_pending->display_status;
+  $detail .= ' (' . $cust_pay_pending->statustext . ')'
+    if $cust_pay_pending->statustext;
+} else {
+  $detail = $cust_pay_pending->statustext;
+}
+
+$info .= ': '.$detail if length($detail);
 
 </%init>