diff options
Diffstat (limited to 'FS')
-rw-r--r-- | FS/FS/Conf.pm | 7 | ||||
-rw-r--r-- | FS/FS/cust_main.pm | 8 |
2 files changed, 13 insertions, 2 deletions
diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm index 8d1f875db..ac0f94cf2 100644 --- a/FS/FS/Conf.pm +++ b/FS/FS/Conf.pm @@ -4455,6 +4455,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 b2bcbdcc5..4a7ad2ead 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -1910,8 +1910,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 { |