Bug 16187: Add a script to cancel unfilled holds after a specified number of days
authorNick Clemens <nick@bywatersolutions.com>
Thu, 14 Jul 2016 10:46:15 +0000 (06:46 -0400)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 20 Oct 2017 19:51:20 +0000 (16:51 -0300)
commit0afe6eca76b3160fcdcddb9e376cf277d673acca
tree35dfd106e7e4b61bec8463a8a4d91fdb726284fe
parentf0f3cb32889d6f0d64fb4965e8c00a3a1f31c6c9
Bug 16187: Add a script to cancel unfilled holds after a specified number of days

This script takes parameters:
days - how many days waiting to concal an unfilled hold on or after
library - (repeatable) branches to consider
holidays - whether or not to count holidays (default is no)

This patchset adds two methods and covers them with tests:
Koha::Holds->unfilled(); To return holds where found = undef
Koha::Hold->age( $use_calendar ); To return the number of days since a
hold was placed (including or excluding holidays)

To test:
1 - Place some holds with varying reservedates
2 - Run script with different parameters to verify options are respected
(-v for verbosity will assist here)
3 - verify that script does nothing without days parameter

Sponsored by:
    Siskiyou County Library (http://www.siskiyoulibrary.info/)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Bug 16187 - Followup

1 - Correct use of original (bad) script name
2 - Explain options better
3 - Remove change from 'W' to 'w'

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
RM note: Squashed for readability

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Koha/Hold.pm
Koha/Holds.pm
misc/cronjobs/holds/cancel_unfilled_holds.pl [new file with mode: 0755]
t/db_dependent/Hold.t
t/db_dependent/Holds.t