[freeside-commits] freeside/FS/FS Conf.pm, 1.468.2.32, 1.468.2.33 Upgrade.pm, 1.52.2.4, 1.52.2.5 cust_main.pm, 1.586.2.14, 1.586.2.15

Ivan,,, ivan at wavetail.420.am
Fri Jan 13 23:05:19 PST 2012


Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv10621/FS/FS

Modified Files:
      Tag: FREESIDE_2_3_BRANCH
	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.468.2.32
retrieving revision 1.468.2.33
diff -u -w -d -r1.468.2.32 -r1.468.2.33
--- Conf.pm	14 Jan 2012 06:15:27 -0000	1.468.2.32
+++ Conf.pm	14 Jan 2012 07:05:16 -0000	1.468.2.33
@@ -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.',
@@ -4717,13 +4728,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.52.2.4
retrieving revision 1.52.2.5
diff -u -w -d -r1.52.2.4 -r1.52.2.5
--- Upgrade.pm	13 Dec 2011 05:10:21 -0000	1.52.2.4
+++ Upgrade.pm	14 Jan 2012 07:05:17 -0000	1.52.2.5
@@ -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.586.2.14
retrieving revision 1.586.2.15
diff -u -w -d -r1.586.2.14 -r1.586.2.15
--- cust_main.pm	13 Jan 2012 10:14:16 -0000	1.586.2.14
+++ cust_main.pm	14 Jan 2012 07:05:17 -0000	1.586.2.15
@@ -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