Bug 21263: Pickup library not set correctly when using Default holds policy
authorMaryse Simard <maryse.simard@inlibro.com>
Thu, 7 Feb 2019 13:24:03 +0000 (08:24 -0500)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Tue, 16 Apr 2019 13:00:11 +0000 (14:00 +0100)
commit5236b45a055e90f21ae634acf5b07831ba8f02b8
tree460d9065963e12b1666c46b308b374c521dbfb92
parent9304cea6f04baab588a7de24a06dc14994b46405
Bug 21263: Pickup library not set correctly when using Default holds policy

In the case of a specific item hold, it can only be fulfilled if the pickup library
matches the hold fulfillment policy. Therefore, if OPACAllowUserToChooseBranch is
set to don't allow, the pickup library should correspond to the policy.

In case of hold that does not specify an item, the homebranch or holdingbranch
can't be determined at this time, so the pickup library still defaults to the
homebranch of the borrower. Same if there is no policy or it states 'any'.

To test:
- Make sure OPACAllowUserToChooseBranch is set to don't allow
- Make sure you have two branches A and B
- Have one item whose homebranch is B
- Have one user whose homebranch is A
- Make sure the circulation rules allow the user to reserve the item's item type

1. Go to Administration > Circulation and fines rules
2. Create a Default holds policy by item type for that item type
    - Item type = item's item type
    - Hold policy = From any library
    - Hold pickup library match = item's home library
    - Return policy = item returns home
3. Go to the OPAC and log in with the user's credentials
4. Search for the item
5. Click on "Place hold"
6. Select a specific item and confirm hold
7. In the user's file on the OPAC and check the reservation's pickup library. It should be the item's homebranch

You can then repeat the steps for 'item's holding library' or 'any library' as
the Hold pickup library match. It should also work the same way if there is no
'Default holds policy by item type' for this item type but a 'Default checkout,
hold and return policy' set.

Finally, check that placing a hold without selecting a specific item still
defaults the pickup library to the borrower's homebranch.

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 275dee5f9b9a26b3490bf3646c71c78a2d8647eb)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
opac/opac-reserve.pl