[freeside-commits] branch master updated. 022c84a3d9c8a946d5e0b3f0fff73aa771461bc5

Ivan ivan at 420.am
Thu Aug 16 01:27:04 PDT 2012


The branch, master has been updated
       via  022c84a3d9c8a946d5e0b3f0fff73aa771461bc5 (commit)
      from  66b55857d43110136cf85d57dbda0960cad29b32 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 022c84a3d9c8a946d5e0b3f0fff73aa771461bc5
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Thu Aug 16 01:27:03 2012 -0700

    FS/FS/cust_main/NationalID.pm

diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm
index fda82e4..9e39b30 100644
--- a/FS/FS/cust_main.pm
+++ b/FS/FS/cust_main.pm
@@ -4,6 +4,7 @@ require 5.006;
 use strict;
              #FS::cust_main:_Marketgear when they're ready to move to 2.1
 use base qw( FS::cust_main::Packages FS::cust_main::Status
+             FS::cust_main::NationalID
              FS::cust_main::Billing FS::cust_main::Billing_Realtime
              FS::cust_main::Billing_Discount
              FS::cust_main::Location
diff --git a/httemplate/edit/cust_main.cgi b/httemplate/edit/cust_main.cgi
index 9195f5d..9b30d31 100755
--- a/httemplate/edit/cust_main.cgi
+++ b/httemplate/edit/cust_main.cgi
@@ -248,6 +248,8 @@ if ( $cgi->param('error') ) {
   $stateid = $cust_main->stateid; # don't mask an entered value on errors
   $payinfo = $cust_main->payinfo; # don't mask an entered value on errors
 
+  $cust_main->national_id( $cgi->param('national_id1') || $cgi->param('national_id2') );
+
   $prospectnum = $cgi->param('prospectnum') || '';
 
   $pkgpart_svcpart = $cgi->param('pkgpart_svcpart') || '';
diff --git a/httemplate/edit/process/cust_main.cgi b/httemplate/edit/process/cust_main.cgi
index 622dd87..31ec4ab 100755
--- a/httemplate/edit/process/cust_main.cgi
+++ b/httemplate/edit/process/cust_main.cgi
@@ -110,35 +110,7 @@ if ( $cgi->param('no_credit_limit') ) {
 
 $new->tagnum( [ $cgi->param('tagnum') ] );
 
-if ( my $id_country = $conf->config('national_id-country') ) {
-  if ( $id_country eq 'MY' ) {
-
-    if ( $cgi->param('national_id1') =~ /\S/ ) {
-      my $nric = $cgi->param('national_id1');
-      $nric =~ s/\s//g;
-      if ( $nric =~ /^(\d{6})\-?(\d{2})\-?(\d{4})$/ ) {
-        $new->national_id( "$1-$2-$3" );
-      } else {
-        $error ||= "Illegal NRIC: ". $cgi->param('national_id1');
-      }
-    } elsif ( $cgi->param('national_id2') =~ /\S/ ) {
-      my $oldic = $cgi->param('national_id2');
-      $oldic =~ s/\s//g;
-      if ( $oldic =~ /^\w\d{9}$/ ) {
-        $new->national_id($oldic);
-      } else {
-        $error ||= "Illegal Old IC/Passport: ". $cgi->param('national_id2');
-      }
-    } else {
-      $error ||= 'Either NRIC or Old IC/Passport is required';
-    }
-    
-  } else {
-    warn "unknown national_id-country $id_country";
-  }
-} elsif ( $cgi->param('national_id0') ) {
-  $new->national_id( $cgi->param('national_id0') );
-}
+$error ||= $new->set_national_id_from_cgi( $cgi );
 
 my %usedatetime = ( 'birthdate'        => 1,
                     'spouse_birthdate' => 1,

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/cust_main.pm                    |    1 +
 httemplate/edit/cust_main.cgi         |    2 ++
 httemplate/edit/process/cust_main.cgi |   30 +-----------------------------
 3 files changed, 4 insertions(+), 29 deletions(-)




More information about the freeside-commits mailing list