From 582a7ec8b21e8db85e7acefa754c00a968ebf837 Mon Sep 17 00:00:00 2001 From: tipaul Date: Fri, 28 Nov 2003 12:51:26 +0000 Subject: [PATCH] fix for #564 --- newimember.pl | 9 ++++++++- newjmember.pl | 9 ++++++++- newmember.pl | 9 +++------ 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/newimember.pl b/newimember.pl index e24f947521..04a1a3b96d 100755 --- a/newimember.pl +++ b/newimember.pl @@ -89,7 +89,14 @@ if ($missing !=1) { $data{'cardnumber_institution'} = C4::Members::fixup_cardnumber ($data{'cardnumber_institution'}); - my $valid=checkdigit(\%env,$data{"cardnumber_institution"}); + #check cardnumber is valid + my $nounique; + if ( $data{'type'} ne "Add" ) { + $nounique = 0; + } else { + $nounique = 1; + } + my $valid=checkdigit(\%env,$data{'cardnumber'}, $nounique); $template->param( invalid => ($valid !=1)); diff --git a/newjmember.pl b/newjmember.pl index b538a14819..2fd584db2b 100755 --- a/newjmember.pl +++ b/newjmember.pl @@ -88,7 +88,14 @@ for (my $i=0;$i<3;$i++){ $string.=" Gender
"; $missing=1; } - my $valid=checkdigit(\%env,$data{"cardnumber_child_$i"}); + #check cardnumber is valid + my $nounique; + if ( $data{'type'} ne "Add" ) { + $nounique = 0; + } else { + $nounique = 1; + } + my $valid=checkdigit(\%env,$data{'cardnumber'}, $nounique); if ($valid != 1){ $string.=" Invalid Cardnumber $number
"; $missing=1; diff --git a/newmember.pl b/newmember.pl index 578f4fee05..7e47d259ca 100755 --- a/newmember.pl +++ b/newmember.pl @@ -77,13 +77,10 @@ if ($data{'cardnumber'} eq ''){ } else { #check cardnumber is valid my $nounique; - if ( $data{'type'} ne "Add" ) - { - $nounique = 1; - } - else - { + if ( $data{'type'} ne "Add" ) { $nounique = 0; + } else { + $nounique = 1; } my $valid=checkdigit(\%env,$data{'cardnumber'}, $nounique); if ($valid != 1){ -- 2.39.5