summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--FS/FS/Conf.pm7
-rw-r--r--FS/FS/cust_main.pm6
-rw-r--r--FS/FS/payinfo_Mixin.pm3
-rw-r--r--httemplate/edit/cust_main/billing.html13
-rw-r--r--httemplate/misc/payment.cgi20
-rw-r--r--httemplate/misc/process/payment.cgi9
-rw-r--r--httemplate/view/cust_main/billing.html11
-rw-r--r--httemplate/view/cust_main/payment_history.html6
8 files changed, 53 insertions, 22 deletions
diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm
index 633d5c5..b3fdfdc 100644
--- a/FS/FS/Conf.pm
+++ b/FS/FS/Conf.pm
@@ -2959,6 +2959,13 @@ and customer address. Include units.',
},
{
+ 'key' => 'echeck-no_routing',
+ 'section' => 'billing',
+ 'description' => 'Disable the routing number entirely for Electronic Check payment info.',
+ 'type' => 'checkbox',
+ },
+
+ {
'key' => 'voip-cust_accountcode_cdr',
'section' => 'telephony',
'description' => 'Enable the per-customer option for CDR breakdown by accountcode.',
diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm
index 97b1172..7832eca 100644
--- a/FS/FS/cust_main.pm
+++ b/FS/FS/cust_main.pm
@@ -1933,8 +1933,10 @@ sub check {
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') ) {
+ } elsif ( $conf->exists('echeck-no_routing') ) {
+ $payinfo =~ /^(\d+)\@(\d*)$/ or return 'invalid echeck account';
+ $payinfo = "$1\@$2";
+ } elsif ( $conf->exists('echeck-nonus') ) {
$payinfo =~ /^(\d+)\@(\d+)$/ or return 'invalid echeck account@aba';
$payinfo = "$1\@$2";
} else {
diff --git a/FS/FS/payinfo_Mixin.pm b/FS/FS/payinfo_Mixin.pm
index 84264c9..d03391f 100644
--- a/FS/FS/payinfo_Mixin.pm
+++ b/FS/FS/payinfo_Mixin.pm
@@ -165,7 +165,8 @@ sub mask_payinfo {
# Checks (Show last 2 @ bank)
my( $account, $aba ) = split('@', $payinfo );
return 'x'x(length($account)-2).
- substr($account,(length($account)-2))."@".$aba;
+ substr($account,(length($account)-2)).
+ ( length($aba) ? "@".$aba : '');
} else { # Tie up loose ends
return $payinfo;
diff --git a/httemplate/edit/cust_main/billing.html b/httemplate/edit/cust_main/billing.html
index 3266c16..f2d6271 100644
--- a/httemplate/edit/cust_main/billing.html
+++ b/httemplate/edit/cust_main/billing.html
@@ -234,10 +234,15 @@
% join('', map { qq!<OPTION VALUE="$_" !.($paytype eq $_ ? 'SELECTED' : '').">$_</OPTION>" } @FS::cust_main::paytypes).
% qq!</SELECT></TD></TR>!.
%
-% qq!<TR><TD ALIGN="right" WIDTH="200">${r}!.emt('ABA/Routing number').qq! </TD>!.
-% qq!<TD COLSPAN="3" WIDTH="408"><INPUT TYPE="text" SIZE=10 MAXLENGTH=9 NAME="CHEK_payinfo2" VALUE="!. ( $payby =~ /^(CHEK|DCHK)$/ ? $aba : '' ). qq!" SIZE=10 MAXLENGTH=9> !.
-% qq!(<A HREF="javascript:void(0);" onClick="overlib( OLiframeContent('../docs/ach.html', 380, 240, 'ach_popup' ), CAPTION, 'ACH Help', STICKY, AUTOSTATUSCAP, CLOSECLICK, DRAGGABLE ); return false;">!.emt('help').qq!</A>)!.
-% qq!</TD></TR>!.
+% ( $conf->exists('echeck-no_routing')
+% ? '<INPUT TYPE="hidden" NAME="CHEK_payinfo2" VALUE="'.
+% ( $payby =~ /^(CHEK|DCHK)$/ ? $aba : '' ). '">'
+% :
+% qq!<TR><TD ALIGN="right" WIDTH="200">${r}!.emt('ABA/Routing number').qq! </TD>!.
+% qq!<TD COLSPAN="3" WIDTH="408"><INPUT TYPE="text" SIZE=10 MAXLENGTH=9 NAME="CHEK_payinfo2" VALUE="!. ( $payby =~ /^(CHEK|DCHK)$/ ? $aba : '' ). qq!" SIZE=10 MAXLENGTH=9> !.
+% qq!(<A HREF="javascript:void(0);" onClick="overlib( OLiframeContent('../docs/ach.html', 380, 240, 'ach_popup' ), CAPTION, 'ACH Help', STICKY, AUTOSTATUSCAP, CLOSECLICK, DRAGGABLE ); return false;">!.emt('help').qq!</A>)!.
+% qq!</TD></TR>!
+% ).
%
% qq!<INPUT TYPE="hidden" NAME="CHEK_exp_month" VALUE="12">!.
% qq!<INPUT TYPE="hidden" NAME="CHEK_exp_year" VALUE="2037">!.
diff --git a/httemplate/misc/payment.cgi b/httemplate/misc/payment.cgi
index a033c1c..447cfa3 100644
--- a/httemplate/misc/payment.cgi
+++ b/httemplate/misc/payment.cgi
@@ -135,7 +135,7 @@
% $stateid, $stateid_state )
% = ( '', '', '', '', '', '', '', '' );
% if ( $cust_main->payby =~ /^(CHEK|DCHK)$/ ) {
-% $cust_main->paymask =~ /^([\dx]+)\@([\dx]+)$/i
+% $cust_main->paymask =~ /^([\dx]+)\@([\dx]*)$/i
% or die "unparsable payinfo ". $cust_main->payinfo;
% ($payinfo1, $payinfo2) = ($1, $2);
% $payname = $cust_main->payname;
@@ -154,13 +154,17 @@
<TD ALIGN="right"><% mt('Type') |h %></TD>
<TD><SELECT NAME="paytype"><% join('', map { qq!<OPTION VALUE="$_" !.($paytype eq $_ ? 'SELECTED' : '').">$_</OPTION>" } @FS::cust_main::paytypes) %></SELECT></TD>
</TR>
- <TR>
- <TD ALIGN="right"><% mt('ABA/Routing number') |h %></TD>
- <TD>
- <INPUT TYPE="text" SIZE=10 MAXLENGTH=9 NAME="payinfo2" VALUE="<%$payinfo2%>">
- (<A HREF="javascript:void(0);" onClick="overlib( OLiframeContent('../docs/ach.html', 380, 240, 'ach_popup' ), CAPTION, 'ACH Help', STICKY, AUTOSTATUSCAP, CLOSECLICK, DRAGGABLE ); return false;"><% mt('help') |h %></A>)
- </TD>
- </TR>
+% if ( $conf->exists('echeck-no_routing') ) {
+ <INPUT TYPE="text" NAME="payinfo2" VALUE="<%$payinfo2%>">
+% } else {
+ <TR>
+ <TD ALIGN="right"><% mt('ABA/Routing number') |h %></TD>
+ <TD>
+ <INPUT TYPE="text" SIZE=10 MAXLENGTH=9 NAME="payinfo2" VALUE="<%$payinfo2%>">
+ (<A HREF="javascript:void(0);" onClick="overlib( OLiframeContent('../docs/ach.html', 380, 240, 'ach_popup' ), CAPTION, 'ACH Help', STICKY, AUTOSTATUSCAP, CLOSECLICK, DRAGGABLE ); return false;"><% mt('help') |h %></A>)
+ </TD>
+ </TR>
+% }
<TR>
<TD ALIGN="right"><% mt('Bank name') |h %></TD>
<TD><INPUT TYPE="text" NAME="payname" VALUE="<%$payname%>"></TD>
diff --git a/httemplate/misc/process/payment.cgi b/httemplate/misc/process/payment.cgi
index 5fa57e4..fb6a41b 100644
--- a/httemplate/misc/process/payment.cgi
+++ b/httemplate/misc/process/payment.cgi
@@ -81,8 +81,13 @@ if ( $payby eq 'CHEK' ) {
$cgi->param('payinfo1') =~ /^(\d+)$/
or errorpage("illegal account number ". $cgi->param('payinfo1'));
my $payinfo1 = $1;
- $cgi->param('payinfo2') =~ /^(\d+)$/
- or errorpage("illegal ABA/routing number ". $cgi->param('payinfo2'));
+ if ( $conf->exists('echeck-no_routing') ) {
+ $cgi->param('payinfo2') =~ /^(\d*)$/
+ or errorpage("illegal ABA/routing number ". $cgi->param('payinfo2'));
+ } else {
+ $cgi->param('payinfo2') =~ /^(\d+)$/
+ or errorpage("illegal ABA/routing number ". $cgi->param('payinfo2'));
+ }
my $payinfo2 = $1;
$payinfo = $payinfo1. '@'. $payinfo2;
}
diff --git a/httemplate/view/cust_main/billing.html b/httemplate/view/cust_main/billing.html
index ba63833..cf22ff7 100644
--- a/httemplate/view/cust_main/billing.html
+++ b/httemplate/view/cust_main/billing.html
@@ -92,10 +92,13 @@
<% mt("Electronic check ([_1])",$autodemand) |h %>
</TD>
</TR>
-<TR>
- <TD ALIGN="right"><% mt('ABA/Routing code') |h %></TD>
- <TD BGCOLOR="#ffffff"><% $aba %></TD>
-</TR>
+
+% unless ( $conf->exists('echeck-no_routing') ) {
+ <TR>
+ <TD ALIGN="right"><% mt('ABA/Routing code') |h %></TD>
+ <TD BGCOLOR="#ffffff"><% $aba %></TD>
+ </TR>
+% }
% if ( $conf->exists('cust_main-require-bank-branch') ) {
<TR>
diff --git a/httemplate/view/cust_main/payment_history.html b/httemplate/view/cust_main/payment_history.html
index fa9c166..580a307 100644
--- a/httemplate/view/cust_main/payment_history.html
+++ b/httemplate/view/cust_main/payment_history.html
@@ -511,7 +511,11 @@ sub translate_payinfo {
$payinfo = $object->paymask;
} elsif ( $payby eq 'CHEK' ) {
my( $account, $aba ) = split('@', $object->paymask );
- $payinfo = emt("ABA [_1], Acct #[_2]",$aba,$account);
+ if ( $conf->exists('echeck-no_routing') ) {
+ $payinfo = emt("Acct #[_1]", $account);
+ } else {
+ $payinfo = emt("ABA [_1], Acct #[_2]",$aba,$account);
+ }
}
($payby,$payinfo);