From c1cabbc4cea2e0cfd9e1db668100b97069140cf5 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Thu, 26 Jul 2012 14:02:36 -0700 Subject: add anniversary date, RT#18631 --- httemplate/edit/process/cust_main.cgi | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'httemplate/edit/process/cust_main.cgi') diff --git a/httemplate/edit/process/cust_main.cgi b/httemplate/edit/process/cust_main.cgi index 5ee553b32..866452de1 100755 --- a/httemplate/edit/process/cust_main.cgi +++ b/httemplate/edit/process/cust_main.cgi @@ -112,9 +112,12 @@ $new->tagnum( [ $cgi->param('tagnum') ] ); my %usedatetime = ( 'birthdate' => 1, 'spouse_birthdate' => 1, + 'anniversary_date' => 1, ); -foreach my $dfield (qw( birthdate spouse_birthdate signupdate )) { +foreach my $dfield (qw( + signupdate birthdate spouse_birthdate anniversary_date +)) { if ( $cgi->param($dfield) && $cgi->param($dfield) =~ /^([ 0-9\-\/]{0,10})$/) { -- cgit v1.2.1 From 5a204201503f8e0db6087db6e53b84297cbc739a Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Fri, 10 Aug 2012 13:54:14 -0700 Subject: add national id # handling for my, RT#18543 --- httemplate/edit/process/cust_main.cgi | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'httemplate/edit/process/cust_main.cgi') diff --git a/httemplate/edit/process/cust_main.cgi b/httemplate/edit/process/cust_main.cgi index 866452de1..622dd87c5 100755 --- a/httemplate/edit/process/cust_main.cgi +++ b/httemplate/edit/process/cust_main.cgi @@ -110,6 +110,36 @@ 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') ); +} + my %usedatetime = ( 'birthdate' => 1, 'spouse_birthdate' => 1, 'anniversary_date' => 1, -- cgit v1.2.1 From 022c84a3d9c8a946d5e0b3f0fff73aa771461bc5 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Thu, 16 Aug 2012 01:27:03 -0700 Subject: FS/FS/cust_main/NationalID.pm --- httemplate/edit/process/cust_main.cgi | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) (limited to 'httemplate/edit/process/cust_main.cgi') 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, -- cgit v1.2.1