summaryrefslogtreecommitdiff
path: root/httemplate
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate')
-rw-r--r--httemplate/edit/cust_main/billing.html18
-rwxr-xr-xhttemplate/edit/process/cust_main.cgi2
-rw-r--r--httemplate/misc/payment.cgi17
-rw-r--r--httemplate/misc/process/payment.cgi4
-rw-r--r--httemplate/view/cust_main/billing.html11
5 files changed, 36 insertions, 16 deletions
diff --git a/httemplate/edit/cust_main/billing.html b/httemplate/edit/cust_main/billing.html
index fd078c5da..78fac6c22 100644
--- a/httemplate/edit/cust_main/billing.html
+++ b/httemplate/edit/cust_main/billing.html
@@ -127,7 +127,7 @@
% my( $account, $aba ) = split('@', $payinfo);
% my $branch = '';
% ($branch,$aba) = split('\.',$aba)
-% if $conf->exists('cust_main-require-bank-branch');
+% if $conf->config('echeck-country') eq 'CA';
%
% my $disabled = 'DISABLED style="background-color: #dddddd"';
% my $text_disabled = 'style="color: #999999"';
@@ -161,6 +161,14 @@
% my $card_billday_select_disabled = $payby eq 'CARD' ? '' : 'DISABLED';
% my $chek_billday_select_disabled = $payby eq 'CHEK' ? '' : 'DISABLED';
%
+% #false laziness w/view/cust_main/billing.html and misc/payment.cgi
+% my $routing_label = $conf->config('echeck-country') eq 'US'
+% ? 'ABA/Routing number'
+% : 'Routing number';
+% my $routing_size = $conf->config('echeck-country') eq 'CA' ? 4 : 10;
+% my $routing_maxlength = $conf->config('echeck-country') eq 'CA' ? 3 : 9;
+%
+%
% my %payby = (
%
% 'CARD' =>
@@ -235,17 +243,17 @@
% 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!<TR><TD ALIGN="right" WIDTH="200">${r}!.emt($routing_label).qq! </TD>!.
+% qq!<TD COLSPAN="3" WIDTH="408"><INPUT TYPE="text" SIZE=$routing_size MAXLENGTH=$routing_maxlength NAME="CHEK_payinfo2" VALUE="!. ( $payby =~ /^(CHEK|DCHK)$/ ? $aba : '' ). qq!"> !.
% 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">!.
%
-% ( $conf->exists('cust_main-require-bank-branch') ?
+% ( $conf->config('echeck-country') eq 'CA' ?
% qq!<TR><TD ALIGN="right">$r !.emt('Branch number').qq!</TD><TD COLSPAN="3">
-% <INPUT TYPE="text" name="CHEK_payinfo3" VALUE=$branch></TD></TR>! : '' ).
+% <INPUT TYPE="text" name="CHEK_payinfo3" VALUE="$branch" SIZE=6 MAXLENGTH=5></TD></TR>! : '' ).
%
% qq!<TR><TD ALIGN="right" WIDTH="200">${r}!.emt('Bank name').qq! </TD>!.
% qq!<TD COLSPAN="3" WIDTH="408"><INPUT TYPE="text" NAME="CHEK_payname" VALUE="!. ( $payby =~ /^(CHEK|DCHK)$/ ? $cust_main->payname : '' ). qq!"></TD></TR>!.
diff --git a/httemplate/edit/process/cust_main.cgi b/httemplate/edit/process/cust_main.cgi
index df6cec9df..f75e2a6ae 100755
--- a/httemplate/edit/process/cust_main.cgi
+++ b/httemplate/edit/process/cust_main.cgi
@@ -44,7 +44,7 @@ if ( $payby ) {
if ( $payby eq 'CHEK' || $payby eq 'DCHK' ) {
my $payinfo = $cgi->param('payinfo1'). '@';
$payinfo .= $cgi->param('payinfo3').'.'
- if $conf->exists('cust_main-require-bank-branch');
+ if $conf->config('echeck-country') eq 'CA';
$payinfo .= $cgi->param('payinfo2');
$cgi->param('payinfo',$payinfo);
}
diff --git a/httemplate/misc/payment.cgi b/httemplate/misc/payment.cgi
index 4a867d28d..093494a06 100644
--- a/httemplate/misc/payment.cgi
+++ b/httemplate/misc/payment.cgi
@@ -140,7 +140,7 @@
% or die "unparsable payinfo ". $cust_main->payinfo;
% ($account, $aba) = ($1, $2);
% ($branch,$aba) = split('\.',$aba)
-% if $conf->exists('cust_main-require-bank-branch');
+% if $conf->config('echeck-country') eq 'CA';
% $payname = $cust_main->payname;
% $ss = $cust_main->ss;
% $paytype = $cust_main->getfield('paytype');
@@ -148,6 +148,13 @@
% $stateid = $cust_main->getfield('stateid');
% $stateid_state = $cust_main->getfield('stateid_state');
% }
+%
+% #false laziness w/{edit,view}/cust_main/billing.html
+% my $routing_label = $conf->config('echeck-country') eq 'US'
+% ? 'ABA/Routing number'
+% : 'Routing number';
+% my $routing_size = $conf->config('echeck-country') eq 'CA' ? 4 : 10;
+% my $routing_maxlength = $conf->config('echeck-country') eq 'CA' ? 3 : 9;
<INPUT TYPE="hidden" NAME="month" VALUE="12">
<INPUT TYPE="hidden" NAME="year" VALUE="2037">
@@ -158,17 +165,17 @@
<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 ALIGN="right"><% mt($routing_label) |h %></TD>
<TD>
- <INPUT TYPE="text" SIZE=10 MAXLENGTH=9 NAME="payinfo2" VALUE="<%$aba%>">
+ <INPUT TYPE="text" SIZE="<% $routing_size %>" MAXLENGTH="<% $routing_maxlength %>" NAME="payinfo2" VALUE="<%$aba%>">
(<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('cust_main-require-bank-branch') ) {
+% if ( $conf->config('echeck-country') eq 'CA' ) {
<TR>
<TD ALIGN="right"><% mt('Branch number') |h %></TD>
<TD>
- <INPUT TYPE="text" NAME="payinfo3" VALUE="<%$branch%>">
+ <INPUT TYPE="text" NAME="payinfo3" VALUE="<%$branch%>" SIZE=6 MAXLENGTH=5>
</TD>
</TR>
% }
diff --git a/httemplate/misc/process/payment.cgi b/httemplate/misc/process/payment.cgi
index f4f9561dc..506e26684 100644
--- a/httemplate/misc/process/payment.cgi
+++ b/httemplate/misc/process/payment.cgi
@@ -86,8 +86,8 @@ if ( $payby eq 'CHEK' ) {
$cgi->param('payinfo2') =~ /^(\d+)$/
or errorpage("Illegal ABA/routing number ". $cgi->param('payinfo2'));
my $payinfo2 = $1;
- if ( $conf->exists('cust_main-require-bank-branch') ) {
- $cgi->param('payinfo3') =~ /^(\d+)$/
+ if ( $conf->config('echeck-country') eq 'CA' ) {
+ $cgi->param('payinfo3') =~ /^(\d{5})$/
or errorpage("Illegal branch number ". $cgi->param('payinfo2'));
$payinfo2 = "$1.$payinfo2";
}
diff --git a/httemplate/view/cust_main/billing.html b/httemplate/view/cust_main/billing.html
index 6e36e99e8..f1add6fcc 100644
--- a/httemplate/view/cust_main/billing.html
+++ b/httemplate/view/cust_main/billing.html
@@ -85,7 +85,7 @@
% } 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');
+% ($branch,$aba) = split('\.',$aba) if $conf->config('echeck-country') eq 'CA';
% my $autodemand = $cust_main->payby eq 'CHEK' ? 'automatic' : 'on-demand';
@@ -93,12 +93,17 @@
</TD>
</TR>
+% #false laziness w/edit/cust_main/billing.html and misc/payment.cgi
+% my $routing_label = $conf->config('echeck-country') eq 'US'
+% ? 'ABA/Routing number'
+% : 'Routing number';
+
<TR>
- <TD ALIGN="right"><% mt('ABA/Routing code') |h %></TD>
+ <TD ALIGN="right"><% mt($routing_label) |h %></TD>
<TD BGCOLOR="#ffffff"><% $aba %></TD>
</TR>
-% if ( $conf->exists('cust_main-require-bank-branch') ) {
+% if ( $conf->config('echeck-country') eq 'CA' ) {
<TR>
<TD ALIGN="right"><% mt('Branch number') |h %></TD>
<TD BGCOLOR="#ffffff"><% $branch %></TD>