summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--FS/FS/cust_main.pm1
-rwxr-xr-xhttemplate/edit/cust_main.cgi2
-rwxr-xr-xhttemplate/edit/process/cust_main.cgi30
3 files changed, 4 insertions, 29 deletions
diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm
index fda82e45b..9e39b3006 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 9195f5dc8..9b30d31b0 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 622dd87c5..31ec4ab12 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,