Bug 25184: Items with a negative notforloan status should not be captured for holds
authorKyle M Hall <kyle@bywatersolutions.com>
Fri, 17 Apr 2020 18:06:32 +0000 (14:06 -0400)
committerLucas Gass <lucas@bywatersolutions.com>
Fri, 15 May 2020 21:54:14 +0000 (21:54 +0000)
commit19953fc68703b3a8b067153ab5719d14b39ca709
tree2404b782e03db127079da7ed164969e35fb2e823
parentcc47b47d4f7fa34a17d2e04e5537eb0cda633800
Bug 25184: Items with a negative notforloan status should not be captured for holds

Negative notforloan statuses should allow holds to be placed but not captured.

Due to coronavirus, we have libraries setting all returned materials to a negative notforloan value of Quarantine for several days.
They're using UpdateNotForLoanStatusOnCheckin to set that status automatically. However, those items are still capturing for holds,
even though those items cannot be checked out until the notforloan status is removed.

In cases like an On Order item where we do want the hold to fill at checkin,
UpdateNotForLoanStatusOnCheckin should be used to clear that notforloan status so the hold can fill.

In master, if I set an item to a not for loan but holdable status ( < 0 ) I can place the hold,
capture the hold and set it to waiting, but *not* check it out to the patron!
This does not make sense. I should not be able to trap an item for checkout unless it can be checked out.

Test Plan:
1) Set an item's notforloan value to -1
2) Place a hold on that item
3) Check in the item
4) Trap the item for that hold
5) Attempt to check the item out to the patron, you will be unable to
   because it is notforloan
6) Apply this patch
7) Restart all the things!
8) Repeat steps 1-3
9) The screen should no longer ask if the item should be trapped
   to fill the hold!

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Catherine Ingram <Catherine.Ingram@cedarparktexas.gov>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit aa9a4fc3f64787e536faabd4b49be76d1e8144f1)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
C4/Reserves.pm
t/db_dependent/Holds.t