From 3d62ec9362d0b22c17a17da6197f8b2fc219a54e Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 6 Aug 2011 00:50:59 +0000 Subject: echeck options to hide routing number and add account owner name, RT#13885 --- httemplate/edit/cust_main/billing.html | 13 +++++++++---- httemplate/misc/payment.cgi | 20 ++++++++++++-------- httemplate/misc/process/payment.cgi | 9 +++++++-- httemplate/view/cust_main/billing.html | 11 +++++++---- httemplate/view/cust_main/payment_history.html | 6 +++++- 5 files changed, 40 insertions(+), 19 deletions(-) (limited to 'httemplate') diff --git a/httemplate/edit/cust_main/billing.html b/httemplate/edit/cust_main/billing.html index 3266c16af..f2d6271d0 100644 --- a/httemplate/edit/cust_main/billing.html +++ b/httemplate/edit/cust_main/billing.html @@ -234,10 +234,15 @@ % join('', map { qq!" } @FS::cust_main::paytypes). % qq!!. % -% qq!${r}!.emt('ABA/Routing number').qq! !. -% qq! !. -% qq!(!.emt('help').qq!)!. -% qq!!. +% ( $conf->exists('echeck-no_routing') +% ? '' +% : +% qq!${r}!.emt('ABA/Routing number').qq! !. +% qq! !. +% qq!(!.emt('help').qq!)!. +% qq!! +% ). % % qq!!. % qq!!. diff --git a/httemplate/misc/payment.cgi b/httemplate/misc/payment.cgi index a033c1cea..447cfa3c1 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 @@ <% mt('Type') |h %> - - <% mt('ABA/Routing number') |h %> - - - (<% mt('help') |h %>) - - +% if ( $conf->exists('echeck-no_routing') ) { + +% } else { + + <% mt('ABA/Routing number') |h %> + + + (<% mt('help') |h %>) + + +% } <% mt('Bank name') |h %> diff --git a/httemplate/misc/process/payment.cgi b/httemplate/misc/process/payment.cgi index 5fa57e448..fb6a41bd3 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 ba63833f4..cf22ff701 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 %> - - <% mt('ABA/Routing code') |h %> - <% $aba %> - + +% unless ( $conf->exists('echeck-no_routing') ) { + + <% mt('ABA/Routing code') |h %> + <% $aba %> + +% } % if ( $conf->exists('cust_main-require-bank-branch') ) { diff --git a/httemplate/view/cust_main/payment_history.html b/httemplate/view/cust_main/payment_history.html index fa9c16697..580a30751 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); -- cgit v1.2.1