diff --git a/C4/Circulation/Issues.pm b/C4/Circulation/Issues.pm index c78919f91c..b3de3ed5ab 100755 --- a/C4/Circulation/Issues.pm +++ b/C4/Circulation/Issues.pm @@ -323,7 +323,7 @@ sub issueitem{ info_msg($env,"Can't issue $item->{'cardnumber'}"); } } else { - my $valid = checkdigit($env,$itemnum); + my $valid = checkdigit($env,$itemnum, 1); if ($valid ==1) { if (substr($itemnum,0,1) = "V") { #this is a borrower diff --git a/C4/Input.pm b/C4/Input.pm index 1dc63273a8..4815091c0a 100644 --- a/C4/Input.pm +++ b/C4/Input.pm @@ -79,11 +79,33 @@ C<$env> is ignored. =cut #' sub checkdigit { + + my ($env,$infl, $nounique) = @_; + $infl = uc $infl; + + + #Check to make sure the cardnumber is unique + + #FIXME: We should make the error for a nonunique cardnumber + #different from the one where the checkdigit on the number is + #not correct + + unless ( $nounique ) + { + my $dbh=C4::Context->dbh; + my $query=qq{SELECT * FROM borrowers WHERE cardnumber="$infl"}; + my $sth=$dbh->prepare($query); + $sth->execute; + my %results = $sth->fetchrow_hashref(); + if ( $sth->rows != 0 ) + { + return 0; + } + } + if (C4::Context->preference("checkdigit") eq "none") { return 1; } else { - my ($env,$infl) = @_; - $infl = uc $infl; my @weightings = (8,4,6,3,5,2,1); my $sum; my $i = 1; diff --git a/koha-tmpl/intranet-tmpl/default/en/members/moremember.tmpl b/koha-tmpl/intranet-tmpl/default/en/members/moremember.tmpl index 38d3fef52b..af80193ee6 100644 --- a/koha-tmpl/intranet-tmpl/default/en/members/moremember.tmpl +++ b/koha-tmpl/intranet-tmpl/default/en/members/moremember.tmpl @@ -66,23 +66,16 @@

- -

- "> - -
- - -
- "> - -
-
">
+ +
+ "> + +
">