[freeside-commits] branch FREESIDE_3_BRANCH updated. 88bcaa5c3269d551567a907d394166fc8cf0ee69

Jeremy Davis jeremyd at 420.am
Wed Feb 19 07:24:02 PST 2014


The branch, FREESIDE_3_BRANCH has been updated
       via  88bcaa5c3269d551567a907d394166fc8cf0ee69 (commit)
      from  54ebf25fcba5a61d041f3260007f3e729989f92e (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 88bcaa5c3269d551567a907d394166fc8cf0ee69
Author: Jeremy Davis <jeremyd at freeside.biz>
Date:   Wed Feb 19 10:23:52 2014 -0500

    #26342 RBC fixes

diff --git a/FS/FS/pay_batch/RBC.pm b/FS/FS/pay_batch/RBC.pm
index 6ee5771..7536266 100644
--- a/FS/FS/pay_batch/RBC.pm
+++ b/FS/FS/pay_batch/RBC.pm
@@ -93,6 +93,15 @@ $name = 'RBC';
   row => sub {
     my ($cust_pay_batch, $pay_batch) = @_;
     my ($account, $aba) = split('@', $cust_pay_batch->payinfo);
+    my($bankno, $branch);
+    if ( $aba =~ /^0(\d{3})(\d{5})$/ ) { # standard format for Canadian bank ID
+      ($bankno, $branch) = ( $1, $2 );
+    } elsif ( $aba =~ /^(\d{5})\.(\d{3})$/ ) { #how we store branches
+      ($branch, $bankno) = ( $1, $2 );
+    } else {
+      die "invalid branch/routing number '$aba'\n";
+    }
+
     $i++;
     sprintf("%06u", $i).
     'D'.
@@ -101,8 +110,9 @@ $name = 'RBC';
     ' '.
     sprintf("%-19s", $cust_pay_batch->paybatchnum).
     '00'.
-    sprintf("%09u", $aba).
-    sprintf("%-18s", $account).
+    sprintf("%04u", $bankno).
+    sprintf("%05u", $branch).
+    sprintf("%-18u", $account).
     ' '.
     sprintf("%010.0f",$cust_pay_batch->amount*100).
     '      '.
@@ -129,7 +139,7 @@ $name = 'RBC';
     'Z'.
     'TRL'.
     sprintf("%10s", $client_num).
-    ' ' x 20 .
+    '0' x 20 .
     sprintf("%06u", $batchcount).
     sprintf("%014.0f", $batchtotal*100).
     '00' .

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

Summary of changes:
 FS/FS/pay_batch/RBC.pm |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)




More information about the freeside-commits mailing list