summaryrefslogtreecommitdiff
path: root/httemplate/edit/process/cust_main.cgi
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2012-08-16 01:27:03 -0700
committerIvan Kohler <ivan@freeside.biz>2012-08-16 01:27:03 -0700
commit022c84a3d9c8a946d5e0b3f0fff73aa771461bc5 (patch)
treec7537861ce4bbb1c4f36f19b01f7f2f3b085f768 /httemplate/edit/process/cust_main.cgi
parent66b55857d43110136cf85d57dbda0960cad29b32 (diff)
FS/FS/cust_main/NationalID.pm
Diffstat (limited to 'httemplate/edit/process/cust_main.cgi')
-rwxr-xr-xhttemplate/edit/process/cust_main.cgi30
1 files changed, 1 insertions, 29 deletions
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,