If OPACHoldsIfAvailableAtPickup is enabled (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. Turn on OPACHoldsIfAvailableAtPickup 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
Created attachment 147887 [details] [review] 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
Created attachment 152002 [details] 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: Sam Lau <samalau@gmail.com>
Looking here
I dont understand this patch. Looks wrong. Now we are only saying Unavailable if it is notforloan. But the idea of the pref is that you are not allowed to place holds on items not on loan. This could include on order, right? Another thing coming to my mind is that the original condition does not even look at items which are really notforloan. So is this query really correct: my $items_in_this_library = Koha::Items->search({ biblionumber => $item->biblionumber, holdingbranch => $item->holdingbranch }); Please clarify.
Adding Kyle here as hold expert :)
(In reply to Marcel de Rooy from comment #4) > I dont understand this patch. Looks wrong. > Now we are only saying Unavailable if it is notforloan. Not exactly, we are saying Unavailable if the notforloan field is positive that means for the items with notforloan field has these values: Not For Loan or Staff Collection or Added to bundle or any other positive value. > This could include on order, right? By default, the on order (Ordered) has a negative value -1 referred to auth_val.yml NOT_LOAN -1 Ordered NOT_LOAN 1 Not For Loan NOT_LOAN 2 Staff Collection NOT_LOAN 3 Added to bundle so the " && $item->notforloan >= 0 " condition will allow place hold on item when notforloan is negative (Ordered) by not putting their holdingbranch in the not_available_at list because those items are technically not "available" so we can put place them on hold
(In reply to Hammat wele from comment #6) > (In reply to Marcel de Rooy from comment #4) > > I dont understand this patch. Looks wrong. > > Now we are only saying Unavailable if it is notforloan. > Not exactly, we are saying Unavailable if the notforloan field is positive > that means for the items with notforloan field has these values: Not For > Loan or Staff Collection or Added to bundle or any other positive value. Sure. We mean the same. > By default, the on order (Ordered) has a negative value -1 referred to > auth_val.yml > NOT_LOAN -1 Ordered Sure :) > so the " && $item->notforloan >= 0 " condition will allow place hold on item > when notforloan is negative (Ordered) by not putting their holdingbranch in > the not_available_at list because those items are technically not > "available" so we can put place them on hold Yeah. But is it the right spot? (In reply to Marcel de Rooy from comment #4) > Another thing coming to my mind is that the original condition does not even > look at items which are really notforloan. > So is this query really correct: > my $items_in_this_library = Koha::Items->search({ biblionumber => > $item->biblionumber, holdingbranch => $item->holdingbranch }); What about looking here to the notforloan field ? If notforloan<>0 (positive or negative), the item cannot be issued. So it would be unfair to take it along in the count comparison. If we exclude them here, there is no reason to add the condition later. And we technically solve a broader bug.
Created attachment 155616 [details] [review] 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
Created attachment 155642 [details] [review] 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 <m.de.rooy@rijksmuseum.nl>
Pushed to master for 23.11. Nice work everyone, thanks!
Enhancement not pushed to 23.05.x I prefer not to change holds behavior on a stable version.