summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authorlevinse <levinse>2011-06-23 04:14:19 +0000
committerlevinse <levinse>2011-06-23 04:14:19 +0000
commit5cebf6d642a74554ca424397d806f9b59ac19c5c (patch)
tree76c2fa47ce845dba31d7b2e7deb15c154629844e /FS
parent4de19e4303d8d692fb772b0a332be325bab50db3 (diff)
echeck: add optional bank branch format, RT13360
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/Conf.pm7
-rw-r--r--FS/FS/cust_main.pm8
2 files changed, 13 insertions, 2 deletions
diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm
index b9ed6c83e..7fd466634 100644
--- a/FS/FS/Conf.pm
+++ b/FS/FS/Conf.pm
@@ -4403,6 +4403,13 @@ and customer address. Include units.',
},
{
+ 'key' => 'cust_main-require-bank-branch',
+ 'section' => 'UI',
+ 'description' => 'An alternate DCHK/CHEK format; require entry of bank branch number.',
+ 'type' => 'checkbox',
+ },
+
+ {
'key' => 'cust-edit-alt-field-order',
'section' => 'UI',
'description' => 'An alternate ordering of fields for the New Customer and Edit Customer screens.',
diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm
index 61625d84e..7968f35d0 100644
--- a/FS/FS/cust_main.pm
+++ b/FS/FS/cust_main.pm
@@ -1881,8 +1881,12 @@ sub check {
} elsif ( $check_payinfo && $self->payby =~ /^(CHEK|DCHK)$/ ) {
my $payinfo = $self->payinfo;
- $payinfo =~ s/[^\d\@]//g;
- if ( $conf->exists('echeck-nonus') ) {
+ $payinfo =~ s/[^\d\@\.]//g;
+ if ( $conf->exists('cust_main-require-bank-branch') ) {
+ $payinfo =~ /^(\d+)\@(\d+)\.(\d+)$/ or return 'invalid echeck account@branch.bank';
+ $payinfo = "$1\@$2.$3";
+ }
+ elsif ( $conf->exists('echeck-nonus') ) {
$payinfo =~ /^(\d+)\@(\d+)$/ or return 'invalid echeck account@aba';
$payinfo = "$1\@$2";
} else {