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)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Mon, 5 Aug 2019 10:39:15 +0000 (11:39 +0100)
commit36ee00ed952ed9081eeeca5e98fe006fbaa12db6
treec767e000039503f80bd073d82303f0ff0491ac74
parent33bd28fb856d496370f7132171aa479c77b28af8
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>
C4/Reserves.pm