diff options
author | levinse <levinse> | 2011-06-23 04:14:19 +0000 |
---|---|---|
committer | levinse <levinse> | 2011-06-23 04:14:19 +0000 |
commit | 5cebf6d642a74554ca424397d806f9b59ac19c5c (patch) | |
tree | 76c2fa47ce845dba31d7b2e7deb15c154629844e | |
parent | 4de19e4303d8d692fb772b0a332be325bab50db3 (diff) |
echeck: add optional bank branch format, RT13360
-rw-r--r-- | FS/FS/Conf.pm | 7 | ||||
-rw-r--r-- | FS/FS/cust_main.pm | 8 | ||||
-rwxr-xr-x | httemplate/edit/cust_main.cgi | 2 | ||||
-rw-r--r-- | httemplate/edit/cust_main/billing.html | 6 | ||||
-rw-r--r-- | httemplate/edit/cust_main/bottomfixup.js | 2 | ||||
-rwxr-xr-x | httemplate/edit/process/cust_main.cgi | 7 | ||||
-rw-r--r-- | httemplate/view/cust_main/billing.html | 10 |
7 files changed, 36 insertions, 6 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 { diff --git a/httemplate/edit/cust_main.cgi b/httemplate/edit/cust_main.cgi index 8b15ecb23..21ce4243f 100755 --- a/httemplate/edit/cust_main.cgi +++ b/httemplate/edit/cust_main.cgi @@ -197,7 +197,7 @@ function samechanged(what) { %# cust_main/bottomfixup.js % foreach my $hidden ( % 'payauto', -% 'payinfo', 'payinfo1', 'payinfo2', 'paytype', +% 'payinfo', 'payinfo1', 'payinfo2', 'payinfo3', 'paytype', % 'payname', 'paystate', 'exp_month', 'exp_year', 'paycvv', % 'paystart_month', 'paystart_year', 'payissue', % 'payip', diff --git a/httemplate/edit/cust_main/billing.html b/httemplate/edit/cust_main/billing.html index 0db2ae8a4..5e97934c1 100644 --- a/httemplate/edit/cust_main/billing.html +++ b/httemplate/edit/cust_main/billing.html @@ -126,6 +126,8 @@ % my $payby = $cust_main->payby; % my $paytype = $cust_main->paytype; % my( $account, $aba ) = split('@', $payinfo); +% my $branch = ''; +% ($branch,$aba) = split('\.',$aba) if $conf->exists('cust_main-require-bank-branch'); % % my $disabled = 'DISABLED style="background-color: #dddddd"'; % my $text_disabled = 'style="color: #999999"'; @@ -242,6 +244,10 @@ % qq!<INPUT TYPE="hidden" NAME="CHEK_exp_month" VALUE="12">!. % qq!<INPUT TYPE="hidden" NAME="CHEK_exp_year" VALUE="2037">!. % +% ( $conf->exists('cust_main-require-bank-branch') ? +% qq!<TR><TD ALIGN="right">$r Branch number</TD><TD COLSPAN="3"> +% <INPUT TYPE="text" name="CHEK_payinfo3" VALUE=$branch></TD></TR>! : '' ). +% % qq!<TR><TD ALIGN="right" WIDTH="200">${r}Bank name </TD>!. % qq!<TD COLSPAN="3" WIDTH="408"><INPUT TYPE="text" NAME="CHEK_payname" VALUE="!. ( $payby =~ /^(CHEK|DCHK)$/ ? $cust_main->payname : '' ). qq!"></TD></TR>!. % ( $conf->exists('show_bankstate') ? diff --git a/httemplate/edit/cust_main/bottomfixup.js b/httemplate/edit/cust_main/bottomfixup.js index 942fc0e66..24156f792 100644 --- a/httemplate/edit/cust_main/bottomfixup.js +++ b/httemplate/edit/cust_main/bottomfixup.js @@ -3,7 +3,7 @@ function bottomfixup(what) { %# ../cust_main.cgi var layervars = new Array( 'payauto', - 'payinfo', 'payinfo1', 'payinfo2', 'paytype', + 'payinfo', 'payinfo1', 'payinfo2', 'payinfo3', 'paytype', 'payname', 'paystate', 'exp_month', 'exp_year', 'paycvv', 'paystart_month', 'paystart_year', 'payissue', 'payip', diff --git a/httemplate/edit/process/cust_main.cgi b/httemplate/edit/process/cust_main.cgi index aa5579b2d..f62ecc2da 100755 --- a/httemplate/edit/process/cust_main.cgi +++ b/httemplate/edit/process/cust_main.cgi @@ -42,8 +42,11 @@ $cgi->param('payby', $payby); if ( $payby ) { if ( $payby eq 'CHEK' || $payby eq 'DCHK' ) { - $cgi->param('payinfo', - $cgi->param('payinfo1'). '@'. $cgi->param('payinfo2') ); + my $payinfo = $cgi->param('payinfo1'). '@'; + $payinfo .= $cgi->param('payinfo3').'.' + if $conf->exists('cust_main-require-bank-branch'); + $payinfo .= $cgi->param('payinfo2'); + $cgi->param('payinfo',$payinfo); } $cgi->param('paydate', $cgi->param( 'exp_month' ). '-'. $cgi->param( 'exp_year' ) ); diff --git a/httemplate/view/cust_main/billing.html b/httemplate/view/cust_main/billing.html index f2596dbae..662bc9b6f 100644 --- a/httemplate/view/cust_main/billing.html +++ b/httemplate/view/cust_main/billing.html @@ -84,6 +84,8 @@ Billing information </TR> % } elsif ( $cust_main->payby eq 'CHEK' || $cust_main->payby eq 'DCHK') { % my( $account, $aba ) = split('@', $cust_main->paymask ); +% my $branch = ''; +% ($branch,$aba) = split('\.',$aba) if $conf->exists('cust_main-require-bank-branch'); Electronic check <% $cust_main->payby eq 'CHEK' ? '(automatic)' : '(on-demand)' %> @@ -93,6 +95,14 @@ Billing information <TD ALIGN="right">ABA/Routing code</TD> <TD BGCOLOR="#ffffff"><% $aba %></TD> </TR> + +% if ( $conf->exists('cust_main-require-bank-branch') ) { +<TR> + <TD ALIGN="right">Branch number</TD> + <TD BGCOLOR="#ffffff"><% $branch %></TD> + <TR> +% } + <TR> <TD ALIGN="right">Account number</TD> <TD BGCOLOR="#ffffff"><% $account %></TD> |