Bug 33087 - OPACHoldsIfAvailableAtPickup considers On order as available
Summary: OPACHoldsIfAvailableAtPickup considers On order as available
Status: Needs documenting
Alias: None
Product: Koha
Classification: Unclassified
Component: Hold requests (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Hammat wele
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on:
Blocks: 30845
  Show dependency treegraph
 
Reported: 2023-02-28 15:03 UTC by Caroline Cyr La Rose
Modified: 2023-11-19 08:16 UTC (History)
8 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.11.00


Attachments
Bug 33087: OPACHoldsIfAvailableAtPickup considers On order as available (2.72 KB, patch)
2023-03-07 20:37 UTC, Hammat wele
Details | Diff | Splinter Review
Bug 33087: OPACHoldsIfAvailableAtPickup considers On order as available (2.77 KB, text/plain)
2023-06-05 15:31 UTC, Sam Lau
Details
Bug 33087: OPACHoldsIfAvailableAtPickup considers On order as available (2.79 KB, patch)
2023-09-14 14:47 UTC, Hammat wele
Details | Diff | Splinter Review
Bug 33087: OPACHoldsIfAvailableAtPickup considers On order as available (2.88 KB, patch)
2023-09-15 08:05 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Caroline Cyr La Rose 2023-02-28 15:03:30 UTC
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
Comment 1 Hammat wele 2023-03-07 20:37:25 UTC
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
Comment 2 Sam Lau 2023-06-05 15:31:44 UTC
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>
Comment 3 Marcel de Rooy 2023-09-08 08:27:40 UTC
Looking here
Comment 4 Marcel de Rooy 2023-09-08 08:38:43 UTC
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.
Comment 5 Marcel de Rooy 2023-09-08 08:39:09 UTC
Adding Kyle here as hold expert :)
Comment 6 Hammat wele 2023-09-11 16:10:13 UTC
(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
Comment 7 Marcel de Rooy 2023-09-12 11:34:00 UTC
(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.
Comment 8 Hammat wele 2023-09-14 14:47:48 UTC
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
Comment 9 Marcel de Rooy 2023-09-15 08:05:43 UTC
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>
Comment 10 Tomás Cohen Arazi 2023-10-11 15:14:13 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 11 Fridolin Somers 2023-10-13 00:15:56 UTC
Enhancement not pushed to 23.05.x

I prefer not to change holds behavior on a stable version.