From 79d5a68878115258583d4ab2f1dfb15349175631 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Tue, 10 Mar 2020 09:02:22 -0400 Subject: [PATCH] Bug 24860: Skip non-matching volume holds in CheckReserves Signed-off-by: Andrew Fuerste-Henry Signed-off-by: Your Full Name Signed-off-by: Rebecca Coert --- C4/Reserves.pm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/C4/Reserves.pm b/C4/Reserves.pm index 9ca5f0d60d..19f211a8cd 100644 --- a/C4/Reserves.pm +++ b/C4/Reserves.pm @@ -849,6 +849,7 @@ sub CheckReserves { # See if this item is more important than what we've got so far if ( ( $res->{'priority'} && $res->{'priority'} < $priority ) || $local_hold_match ) { $item ||= Koha::Items->find($itemnumber); + next if $res->{volume_id} && ( !$item->volume || $item->volume->id != $res->{volume_id} ); next if $res->{itemtype} && $res->{itemtype} ne $item->effective_itemtype; $patron ||= Koha::Patrons->find( $res->{borrowernumber} ); my $branch = GetReservesControlBranch( $item->unblessed, $patron->unblessed ); @@ -1641,7 +1642,8 @@ sub _Findgroupreserve { biblioitems.biblioitemnumber AS biblioitemnumber, reserves.itemnumber AS itemnumber, reserves.reserve_id AS reserve_id, - reserves.itemtype AS itemtype + reserves.itemtype AS itemtype, + reserves.volume_id AS volume_id FROM reserves JOIN biblioitems USING (biblionumber) JOIN hold_fill_targets USING (biblionumber, borrowernumber, itemnumber) @@ -1676,7 +1678,8 @@ sub _Findgroupreserve { biblioitems.biblioitemnumber AS biblioitemnumber, reserves.itemnumber AS itemnumber, reserves.reserve_id AS reserve_id, - reserves.itemtype AS itemtype + reserves.itemtype AS itemtype, + reserves.volume_id AS volume_id FROM reserves JOIN biblioitems USING (biblionumber) JOIN hold_fill_targets USING (biblionumber, borrowernumber) @@ -1710,7 +1713,8 @@ sub _Findgroupreserve { reserves.timestamp AS timestamp, reserves.itemnumber AS itemnumber, reserves.reserve_id AS reserve_id, - reserves.itemtype AS itemtype + reserves.itemtype AS itemtype, + reserves.volume_id AS volume_id FROM reserves WHERE reserves.biblionumber = ? AND (reserves.itemnumber IS NULL OR reserves.itemnumber = ?) -- 2.11.0