Bug 27529: Choose patron's branch or item's homebranch if following group rules and...
authorNick Clemens <nick@bywatersolutions.com>
Mon, 25 Jan 2021 15:34:31 +0000 (15:34 +0000)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 16 Apr 2021 11:56:46 +0000 (13:56 +0200)
commit99c3b9ae1f55066f4fd2bd0e37ba336f18592780
tree4350382c20401add3409fe494038f526f71457b6
parenta17134a0d1c144ee7cbe2cebb875c98691c63328
Bug 27529: Choose patron's branch or item's homebranch if following group rules and patron cannot choose branch

This patch defaults the holds pickup location to the items homebranch or the patron's branch when a group option is selected
for the hold fulfillment policy and the patron is not allowed to choose the branch on the OPAC

To test:
1 - Set 'Default checkout, hold and return policy' -> 'Hold pickup library match' to item's hold group or patron's hold group
2 - Set  OPACAllowUserToChooseBranch to 'Don't allow'
3 - Try to place an item level hold on the opac
4 - Ka-boom, etiher:
    The method Koha::Item->patrongroup is not covered by tests!
    The method Koha::Item->itemgroup is not covered by tests!
5 - Apply patch
6 - Repeat
7 - Note the pickup location is set to either the patron's branch or the items homebranch
8 - Repeat plan with the other group setting

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
opac/opac-reserve.pl