$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));
$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;
} 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){