[freeside-commits] freeside/FS/FS/pay_batch eft_canada.pm, 1.1.2.2, 1.1.2.3
Ivan,,,
ivan at wavetail.420.am
Fri Oct 21 09:29:41 PDT 2011
Update of /home/cvs/cvsroot/freeside/FS/FS/pay_batch
In directory wavetail.420.am:/tmp/cvs-serv23748/pay_batch
Modified Files:
Tag: FREESIDE_2_3_BRANCH
eft_canada.pm
Log Message:
fix for branch numbers, RT#14859
Index: eft_canada.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/pay_batch/eft_canada.pm,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -w -d -r1.1.2.2 -r1.1.2.3
--- eft_canada.pm 22 Jul 2011 19:19:56 -0000 1.1.2.2
+++ eft_canada.pm 21 Oct 2011 16:29:38 -0000 1.1.2.3
@@ -43,11 +43,16 @@
$cust_pay_batch->first, $cust_pay_batch->last;
}
my ($account, $aba) = split('@', $cust_pay_batch->payinfo);
- # standard format for Canadian bank ID
- $aba =~ /^0(\d{3})(\d{5})$/
- or die "invalid routing number '$aba'\n";
- push @fields, sprintf('%05s', $2),
- sprintf('%03s', $1),
+ 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";
+ }
+ push @fields, sprintf('%05s', $branch),
+ sprintf('%03s', $bankno),
sprintf('%012s', $account),
sprintf('%.02f', $cust_pay_batch->amount);
# DB = debit
More information about the freeside-commits
mailing list