From 1d8be866d273a7928230ba6641f2dae38c49a8bb Mon Sep 17 00:00:00 2001 From: Hammat Wele Date: Tue, 7 Mar 2023 20:36:39 +0000 Subject: [PATCH] Bug 33087: OPACHoldsIfAvailableAtPickup considers On order as available if OPACHoldsIfAvailableAtPickup is set to "Don't allow" (i.e. if patrons cannot place holds on items that are available at their library), patrons cannot place holds on items that are on order (or any negative not for loan value) for pickup at their library. Technically, those items are not "available", so they shouldn't be affected by this system preference. To replicate: Prerequisites : - Have at least two libraries (I used the sample libraries) - Have a patron in one of the libraries (I used Henry Acevedo), make sure you know the user id and password for that patron - Make sure the circulation rules allow holds for the patron category 1. Set OPACHoldsIfAvailableAtPickup to "Don't allow" 1.1. Go to Administration > Global system preference 1.2. Search for OPACHoldsIfAvailableAtPickup 1.3. Change the value to "Don't allow" 1.4. Click "Save all Circulation preferences" 2. Make an item "On order" at the patron's library (Henry Acevedo is at Midway) 2.1. If needed, create a bibliographic record and item 2.2. Edit the item to assign the "On order" not for loan status 2.3. Change the home and holding library to the patron's library (Midway) 2.4. Click "Save changes" 3. Try to place a hold on the item through the OPAC 3.1. In the OPAC, log in as the patron 3.2. Search for the item 3.3. Click "Place hold" --> Notice the patron's library is greyed out in the pickup location drop-down menu" 4. Apply the patch 5. Repeat step 3 --> Notice you can select the patron's library in the pickup location drop-down menu and place a hold with it --- opac/opac-reserve.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl index 85f2659a87..4465c40a22 100755 --- a/opac/opac-reserve.pl +++ b/opac/opac-reserve.pl @@ -484,7 +484,7 @@ foreach my $biblioNum (@biblionumbers) { unless ( $can_place_hold_if_available_at_pickup ) { my $items_in_this_library = Koha::Items->search({ biblionumber => $item->biblionumber, holdingbranch => $item->holdingbranch }); my $nb_of_items_issued = $items_in_this_library->search({ 'issue.itemnumber' => { not => undef }}, { join => 'issue' })->count; - if ( $items_in_this_library->count > $nb_of_items_issued ) { + if ( $items_in_this_library->count > $nb_of_items_issued && $item->notforloan >= 0) { push @not_available_at, $item->holdingbranch; } } -- 2.34.1