improving checkdigit sub.
This commit is contained in:
parent
a8574a5b83
commit
bf1a858645
1 changed files with 20 additions and 21 deletions
|
@ -90,6 +90,9 @@ sub checkdigit {
|
|||
#different from the one where the checkdigit on the number is
|
||||
#not correct
|
||||
|
||||
if (C4::Context->preference("checkdigit") eq "none") {
|
||||
return 1;
|
||||
}
|
||||
unless ( $nounique )
|
||||
{
|
||||
my $dbh=C4::Context->dbh;
|
||||
|
@ -103,9 +106,6 @@ sub checkdigit {
|
|||
}
|
||||
}
|
||||
|
||||
if (C4::Context->preference("checkdigit") eq "none") {
|
||||
return 1;
|
||||
} else {
|
||||
my @weightings = (8,4,6,3,5,2,1);
|
||||
my $sum;
|
||||
my $i = 1;
|
||||
|
@ -124,7 +124,6 @@ sub checkdigit {
|
|||
$valid = 1;
|
||||
}
|
||||
return $valid;
|
||||
}
|
||||
} # sub checkdigit
|
||||
|
||||
=item checkvalidisbn
|
||||
|
|
Loading…
Reference in a new issue