From ba8d05cbc8f4a5120b2aafaaaa45714d76059723 Mon Sep 17 00:00:00 2001 From: Hammat Wele Date: Thu, 14 Sep 2023 14:19:14 +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 Signed-off-by: Marcel de Rooy Signed-off-by: Tomas Cohen Arazi --- 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 98c3340ab3..641b8c749d 100755 --- a/opac/opac-reserve.pl +++ b/opac/opac-reserve.pl @@ -494,7 +494,7 @@ foreach my $biblioNum (@biblionumbers) { $numCopiesAvailable++; unless ( $can_place_hold_if_available_at_pickup ) { - my $items_in_this_library = Koha::Items->search({ biblionumber => $item->biblionumber, holdingbranch => $item->holdingbranch }); + my $items_in_this_library = Koha::Items->search({ biblionumber => $item->biblionumber, holdingbranch => $item->holdingbranch, notforloan => 0 }); 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 ) { push @not_available_at, $item->holdingbranch; -- 2.39.5