fix for #564
authortipaul <tipaul>
Fri, 28 Nov 2003 12:51:26 +0000 (12:51 +0000)
committertipaul <tipaul>
Fri, 28 Nov 2003 12:51:26 +0000 (12:51 +0000)
newimember.pl
newjmember.pl
newmember.pl

index e24f947..04a1a3b 100755 (executable)
@@ -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));
 
index b538a14..2fd584d 100755 (executable)
@@ -88,7 +88,14 @@ for (my $i=0;$i<3;$i++){
       $string.=" Gender <br>";
       $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<br>";
       $missing=1;
index 578f4fe..7e47d25 100755 (executable)
@@ -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){