rewrote CheckReserves so that it can be called with a barcode as well as on itemnumber.
This commit is contained in:
parent
d96ae9ae65
commit
4d9cb5162d
1 changed files with 15 additions and 4 deletions
|
@ -97,16 +97,27 @@ sub FindReserves {
|
||||||
}
|
}
|
||||||
|
|
||||||
sub CheckReserves {
|
sub CheckReserves {
|
||||||
my ($item) = @_;
|
my ($item, $barcode) = @_;
|
||||||
warn "In CheckReserves: itemnumber = $item";
|
# warn "In CheckReserves: itemnumber = $item";
|
||||||
my $dbh=C4Connect;
|
my $dbh=C4Connect;
|
||||||
my $qitem=$dbh->quote($item);
|
my $sth;
|
||||||
|
if ($item) {
|
||||||
|
my $qitem=$dbh->quote($item);
|
||||||
# get the biblionumber...
|
# get the biblionumber...
|
||||||
my $sth=$dbh->prepare("SELECT items.biblionumber, items.biblioitemnumber, itemtypes.notforloan
|
$sth=$dbh->prepare("SELECT items.biblionumber, items.biblioitemnumber, itemtypes.notforloan
|
||||||
FROM items, biblioitems, itemtypes
|
FROM items, biblioitems, itemtypes
|
||||||
WHERE items.biblioitemnumber = biblioitems.biblioitemnumber
|
WHERE items.biblioitemnumber = biblioitems.biblioitemnumber
|
||||||
AND biblioitems.itemtype = itemtypes.itemtype
|
AND biblioitems.itemtype = itemtypes.itemtype
|
||||||
AND itemnumber=$qitem");
|
AND itemnumber=$qitem");
|
||||||
|
} else {
|
||||||
|
my $qbc=$dbh->quote($barcode);
|
||||||
|
# get the biblionumber...
|
||||||
|
$sth=$dbh->prepare("SELECT items.biblionumber, items.biblioitemnumber, itemtypes.notforloan
|
||||||
|
FROM items, biblioitems, itemtypes
|
||||||
|
WHERE items.biblioitemnumber = biblioitems.biblioitemnumber
|
||||||
|
AND biblioitems.itemtype = itemtypes.itemtype
|
||||||
|
AND barcode=$qbc");
|
||||||
|
}
|
||||||
$sth->execute;
|
$sth->execute;
|
||||||
my ($biblio, $bibitem, $notforloan) = $sth->fetchrow_array;
|
my ($biblio, $bibitem, $notforloan) = $sth->fetchrow_array;
|
||||||
$sth->finish;
|
$sth->finish;
|
||||||
|
|
Loading…
Reference in a new issue