Bug 14549: Check patrons reserves for any holds on a bib when checking out an item
authorNick Clemens <nick@bywatersolutions.com>
Fri, 28 Jun 2019 12:37:25 +0000 (12:37 +0000)
committerFridolin Somers <fridolin.somers@biblibre.com>
Fri, 9 Aug 2019 14:51:35 +0000 (16:51 +0200)
commit3038990c8b45f8f901c3fe023c59037f59f69285
tree6d8790a74d1d36738bf1f4bbcc38a44f83d68867
parent4569d1487fcb64dca64bf9e52d94df7d73a2af98
Bug 14549: Check patrons reserves for any holds on a bib when checking out an item

MoveReserve uses CheckReserves to see if the current patron has any holds
on the title they are checking out, however, CheckReserves doesn't return
all holds on a biblio, it returns holds on the item from the holdsqueue
if they exist

This can create a condition where we check holds on an item, find we have it planned for
another borrower, confirm checkout to the current borrower, but don't fill their hold

To test:
  1) Find record
  2) place record level holds for 2 different patrons (record level)
  3) Run holds queue builder, check the queue to confirm an item was selected for patron 1
     Circulation->Holds queue->Library="All"
  4) Check out the item queued for patron with priority 1 to the second patron
  5) You should be asked to confirm, do so
  6) Note the item checks out, but both holds remain
  7) Apply patch
  8) Check in the item
  9) Don't confirm the hold
 10) Check the holds on the record and the holds queue
 11) Patron 1 should be priority 1 with an item selected from the holds queue
 12) Checkout to patron 2 as before
 13) Note the hold for patron 2 is filled this time
 14) Prove -v t/db_dependent/Reserves.t

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 36ee00ed952ed9081eeeca5e98fe006fbaa12db6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
C4/Reserves.pm