[freeside-commits] freeside/FS/FS Conf.pm, 1.501, 1.502 Upgrade.pm, 1.56, 1.57 cust_main.pm, 1.601, 1.602
Ivan,,,
ivan at wavetail.420.am
Fri Jan 13 23:05:17 PST 2012
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv10611/FS/FS
Modified Files:
Conf.pm Upgrade.pm cust_main.pm
Log Message:
improve echeck validation for canada, deprecate echeck-nonus and cust_main-require-bank-branch config in favor of echeck-country, RT#15982
Index: Conf.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Conf.pm,v
retrieving revision 1.501
retrieving revision 1.502
diff -u -w -d -r1.501 -r1.502
--- Conf.pm 14 Jan 2012 06:15:25 -0000 1.501
+++ Conf.pm 14 Jan 2012 07:05:14 -0000 1.502
@@ -3068,6 +3068,17 @@
},
{
+ 'key' => 'echeck-country',
+ 'section' => 'billing',
+ 'description' => 'Format electronic check information for the specified country.',
+ 'type' => 'select',
+ 'select_hash' => [ 'US' => 'United States',
+ 'CA' => 'Canada (enables branch)',
+ 'XX' => 'Other',
+ ],
+ },
+
+ {
'key' => 'voip-cust_accountcode_cdr',
'section' => 'telephony',
'description' => 'Enable the per-customer option for CDR breakdown by accountcode.',
@@ -4732,13 +4743,6 @@
},
{
- '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.',
Index: Upgrade.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Upgrade.pm,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -w -d -r1.56 -r1.57
--- Upgrade.pm 13 Dec 2011 05:09:30 -0000 1.56
+++ Upgrade.pm 14 Jan 2012 07:05:15 -0000 1.57
@@ -50,6 +50,16 @@
$conf->touch('geocode-require_nw_coordinates')
if $conf->exists('svc_broadband-require-nw-coordinates');
+ unless ( $conf->config('echeck-country') ) {
+ if ( $conf->exists('cust_main-require-bank-branch') ) {
+ $conf->set('echeck-country', 'CA');
+ } elsif ( $conf->exists('echeck-nonus') ) {
+ $conf->set('echeck-country', 'XX');
+ } else {
+ $conf->set('echeck-country', 'US');
+ }
+ }
+
upgrade_overlimit_groups($conf);
map { upgrade_overlimit_groups($conf,$_->agentnum) } qsearch('agent', {});
Index: cust_main.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_main.pm,v
retrieving revision 1.601
retrieving revision 1.602
diff -u -w -d -r1.601 -r1.602
--- cust_main.pm 13 Jan 2012 10:13:55 -0000 1.601
+++ cust_main.pm 14 Jan 2012 07:05:15 -0000 1.602
@@ -2032,14 +2032,15 @@
my $payinfo = $self->payinfo;
$payinfo =~ s/[^\d\@\.]//g;
- if ( $conf->exists('cust_main-require-bank-branch') ) {
- $payinfo =~ /^(\d+)\@(\d+)\.(\d+)$/ or return 'invalid echeck account at branch.bank';
+ if ( $conf->config('echeck-country') eq 'CA' ) {
+ $payinfo =~ /^(\d+)\@(\d{5})\.(\d{3})$/
+ or return 'invalid echeck account at branch.bank';
$payinfo = "$1\@$2.$3";
- } elsif ( $conf->exists('echeck-nonus') ) {
- $payinfo =~ /^(\d+)\@(\d+)$/ or return 'invalid echeck account at aba';
+ } elsif ( $conf->config('echeck-country') eq 'US' ) {
+ $payinfo =~ /^(\d+)\@(\d{9})$/ or return 'invalid echeck account at aba';
$payinfo = "$1\@$2";
} else {
- $payinfo =~ /^(\d+)\@(\d{9})$/ or return 'invalid echeck account at aba';
+ $payinfo =~ /^(\d+)\@(\d+)$/ or return 'invalid echeck account at routing';
$payinfo = "$1\@$2";
}
$self->payinfo($payinfo);
More information about the freeside-commits
mailing list