We need something like CircControlLostBranch with which to specify which branch should be followed for actions and fees related to lost items. Since Bug 9596 the longoverdue cron can be limited by branch, but it follows CircControl when doing so. Lost item fee and processing fee refunds also follow CircControl. However, some libraries want checkout limits and periods to be governed by issuing branch but lost item behavior to be based on the owning library of the item.
I forgot about our friend RefundLostOnReturnControl, so I was a bit wrong in my first comment. The longoverdue cron follows CircControl currently. Lost item fee refunds follow RefundLostOnReturnControl.
Created attachment 185160 [details] [review] Bug 39802: Add LostChargesControl system preference
Created attachment 185161 [details] [review] Bug 39802: Use new preference in longoverdue cron The test plan here is largely confirming that nothing has changed. Using CircControl here has an existing problem - when set to 'PickupLibrary' the check in this cron looks for items from the userenv branch - the cron doesn't have a userenv branch, it is undef, so for any library limiting by branch and with CircControl set to 'PickupLibrary' / 'the library you are logged in at' the cron will do nothing
Created attachment 185162 [details] [review] Bug 39802: Report when no branches will be selected and exit This highlights the issue mentioned in the last patch, reporting that nothign will be done and exiting the script To test: 1 - perl misc/cronjobs/longoverdue.pl -l 5=1 --library CPL 2 - Confirm script exits with warning that nothing has been done
Created attachment 185165 [details] [review] Bug 39802: Atomic update file