[freeside-commits] branch FREESIDE_3_BRANCH updated. 9f04e6bd89dc3a6dcf689c3b84413bd9130a1ca4

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


The branch, FREESIDE_3_BRANCH has been updated
       via  9f04e6bd89dc3a6dcf689c3b84413bd9130a1ca4 (commit)
      from  71f139bf51a5415553f7a6846d24a762d0b4bb51 (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 9f04e6bd89dc3a6dcf689c3b84413bd9130a1ca4
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Tue Jan 7 16:53:44 2014 -0800

    mask echeck acct# on invoices, RT#26859

diff --git a/FS/FS/payinfo_Mixin.pm b/FS/FS/payinfo_Mixin.pm
index ac14347..8e139f7 100644
--- a/FS/FS/payinfo_Mixin.pm
+++ b/FS/FS/payinfo_Mixin.pm
@@ -250,7 +250,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