[freeside-commits] branch master updated. 76275769ed7ea66b154aef4d2dd00120a53196df

Ivan ivan at 420.am
Tue Jan 7 16:53:43 PST 2014


The branch, master has been updated
       via  76275769ed7ea66b154aef4d2dd00120a53196df (commit)
      from  b8ac178ea43778293a8b5b6cc261d24b121e09e7 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 76275769ed7ea66b154aef4d2dd00120a53196df
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Tue Jan 7 16:53:43 2014 -0800

    mask echeck acct# on invoices, RT#26859

diff --git a/FS/FS/payinfo_Mixin.pm b/FS/FS/payinfo_Mixin.pm
index 6d58a3d..1104e3f 100644
--- a/FS/FS/payinfo_Mixin.pm
+++ b/FS/FS/payinfo_Mixin.pm
@@ -246,7 +246,18 @@ sub payby_payinfo_pretty {
   if ( $self->payby eq 'CARD' ) {
     $lh->maketext('Card #') . $self->paymask;
   } elsif ( $self->payby eq 'CHEK' ) {
-    $lh->maketext('E-check acct#') . $self->payinfo;
+
+    #false laziness w/view/cust_main/payment_history.html::translate_payinfo
+    my( $account, $aba ) = split('@', $self->paymask );
+
+    if ( $aba =~ /^(\d{5})\.(\d{3})$/ ) { #blame canada
+      my($branch, $routing) = ($1, $2);
+      $lh->maketext("Routing [_1], Branch [_2], Acct [_3]",
+                     $routing, $branch, $account);
+    } else {
+      $lh->maketext("Routing [_1], Acct [_2]", $aba, $account);
+    }
+
   } elsif ( $self->payby eq 'BILL' ) {
     $lh->maketext('Check #') . $self->payinfo;
   } elsif ( $self->payby eq 'PREP' ) {
diff --git a/httemplate/view/cust_main/payment_history.html b/httemplate/view/cust_main/payment_history.html
index 204647f..141a079 100644
--- a/httemplate/view/cust_main/payment_history.html
+++ b/httemplate/view/cust_main/payment_history.html
@@ -616,13 +616,18 @@ sub translate_payinfo {
     my $payby = $object->payby;
     my $payinfo = $object->payinfo;
 
-    my $conf = new FS::Conf;
-
     if ( $payby eq 'CARD' ) {
         $payinfo = $object->paymask;
     } elsif ( $payby eq 'CHEK' ) {
+        #false laziness w/payinfo_Mixin::payby_payinfo_pretty, should use that
         my( $account, $aba ) = split('@', $object->paymask );
-        $payinfo = emt("ABA [_1], Acct #[_2]",$aba,$account);
+        if ( $aba =~ /^(\d{5})\.(\d{3})$/ ) { #blame canada
+          my($branch, $routing) = ($1, $2);
+          $payinfo = emt("Routing [_1], Branch [_2], Acct [_3]",
+                         $routing, $branch, $account);
+        } else {
+          $payinfo = emt("Routing [_1], Acct [_2]", $aba, $account);
+        }
     }
 
     ($payby,$payinfo);

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/payinfo_Mixin.pm                         |   13 ++++++++++++-
 httemplate/view/cust_main/payment_history.html |   11 ++++++++---
 2 files changed, 20 insertions(+), 4 deletions(-)




More information about the freeside-commits mailing list