bug_7458: Correct existing existing call numbers retrieval

Adjusted to account for duplicate call numbers in the database.  Now retrieves next available call number correctly.
This commit is contained in:
Srdjan Jankovic 2012-03-07 17:44:01 +13:00 committed by Paul Poulain
parent ecc1e94f35
commit 1b79faad5b
1 changed files with 1 additions and 1 deletions

View File

@ -104,7 +104,7 @@ sub plugin {
if ( my $first = $dbh->selectrow_array("SELECT itemcallnumber
FROM items
WHERE itemcallnumber = ?", undef, $padded) ) {
my $icn = $dbh->selectcol_arrayref("SELECT itemcallnumber
my $icn = $dbh->selectcol_arrayref("SELECT DISTINCT itemcallnumber
FROM items
WHERE itemcallnumber LIKE ?
AND itemcallnumber > ?