Bug 25566

Summary: Change in DecreaseLoanHighHolds behaviour
Product: Koha Reporter: Nick Clemens <nick>
Component: CirculationAssignee: Nick Clemens <nick>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: major    
Priority: P5 - low CC: aleisha, cbrannon, gmcharlt, kyle.m.hall, lucas, martin.renvoize, victor
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25569
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.11.00, 20.05.03, 19.11.09, 19.05.15
Bug Depends on: 20567    
Bug Blocks:    
Attachments: Bug 25566: Add option to ignore found holds and use it when checking high holds
Bug 25566: Add option to ignore found holds and use it when checking high holds
Bug 25566: Add option to ignore found holds and use it when checking high holds

Description Nick Clemens 2020-05-21 11:55:09 UTC
bug 25067 made current waiting holds count when determining holdability of an item, this has an effect on decreaseLoanHighHolds. Now when checking out to a patron with a waiting hold we count the loan we are currently issuing and decrease the loan period

To recreate:
1 - Find or create a record with 10 items
2 - Set sysprefs:
     decreaseLoanHighHolds - enable
     decreaseLoanHighHoldsDuration - 2
     decreaseLoanHighHoldsValue - 2
     decreaseLoanHighHoldsControl  - 'over the number of holdable items'/dynamic
3 - Set circ rules to allow 1 hold per record on the relevant record
4 - Place 3 holds on the record
5 - Check one item in and confirm hold to set to waiting
6 - Issue to the patron with the waiting hold
7 - Get a notice that loan period is decreased
Comment 1 Nick Clemens 2020-05-21 13:47:38 UTC
Created attachment 105199 [details] [review]
Bug 25566: Add option to ignore found holds and use it when checking high holds

To test:
 1 - Find or create a record with 10 items
 2 - Set sysprefs:
     decreaseLoanHighHolds - enable
     decreaseLoanHighHoldsDuration - 2
     decreaseLoanHighHoldsValue - 2
     decreaseLoanHighHoldsControl  - 'over the number of holdable items'/dynamic
 3 - Set circ rules to allow 1 hold per record on the relevant record
 4 - Place 3 holds on the record
 5 - Check one item in and confirm hold to set to waiting
 6 - Issue to the patron with the waiting hold
 7 - Get a notice that loan period is decreased
 8 - Don't confirm the checkout
 9 - Apply patch
10 - Restart all the things
11 - Repeat checkout, no decrease this time!
Comment 2 ByWater Sandboxes 2020-05-21 17:39:07 UTC
Created attachment 105223 [details] [review]
Bug 25566: Add option to ignore found holds and use it when checking high holds

To test:
 1 - Find or create a record with 10 items
 2 - Set sysprefs:
     decreaseLoanHighHolds - enable
     decreaseLoanHighHoldsDuration - 2
     decreaseLoanHighHoldsValue - 2
     decreaseLoanHighHoldsControl  - 'over the number of holdable items'/dynamic
 3 - Set circ rules to allow 1 hold per record on the relevant record
 4 - Place 3 holds on the record
 5 - Check one item in and confirm hold to set to waiting
 6 - Issue to the patron with the waiting hold
 7 - Get a notice that loan period is decreased
 8 - Don't confirm the checkout
 9 - Apply patch
10 - Restart all the things
11 - Repeat checkout, no decrease this time!

Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Comment 3 Christopher Brannon 2020-05-21 17:40:59 UTC
Works as described.  Would like this back ported to 19.05 if possible.
Comment 4 Nick Clemens 2020-06-02 00:36:21 UTC
Bumping severity, for affected libraries this can cause loan reductions across a wide range of materials
Comment 5 Martin Renvoize 2020-07-15 12:20:46 UTC
Created attachment 106930 [details] [review]
Bug 25566: Add option to ignore found holds and use it when checking high holds

To test:
 1 - Find or create a record with 10 items
 2 - Set sysprefs:
     decreaseLoanHighHolds - enable
     decreaseLoanHighHoldsDuration - 2
     decreaseLoanHighHoldsValue - 2
     decreaseLoanHighHoldsControl  - 'over the number of holdable items'/dynamic
 3 - Set circ rules to allow 1 hold per record on the relevant record
 4 - Place 3 holds on the record
 5 - Check one item in and confirm hold to set to waiting
 6 - Issue to the patron with the waiting hold
 7 - Get a notice that loan period is decreased
 8 - Don't confirm the checkout
 9 - Apply patch
10 - Restart all the things
11 - Repeat checkout, no decrease this time!

Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 6 Martin Renvoize 2020-07-15 12:21:42 UTC
Updated tests make sense and pass with the patch.. logic makes sense and qa scritps pass.

Passing QA
Comment 7 Martin Renvoize 2020-07-16 14:42:22 UTC
Pushed to master for 20.11, thanks everyone.
Comment 8 Lucas Gass 2020-07-24 20:58:28 UTC
backported to 20.05.x for 20.05.03
Comment 9 Aleisha Amohia 2020-08-03 21:48:53 UTC
backported to 19.11.x for 19.11.09
Comment 10 Victor Grousset/tuxayo 2020-09-14 19:59:58 UTC
Backported to 19.05.x branch for 19.05.15