https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40636

Paul Derscheid <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #185352|0                           |1
        is obsolete|                            |

--- Comment #11 from Paul Derscheid <[email protected]> ---
Created attachment 185413
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=185413&action=edit
Bug 40636: Fix holiday logic in CancelExpiredReserves with comprehensive edge
case handling

CancelExpiredReserves had incorrect holiday logic that checked if **today** is
a holiday instead of checking if the **hold's expiration date** was a holiday.

This caused:
* Holds that expired on non-holidays to remain active if cleanup script ran on
holidays
* Holds that expired on holidays to be cancelled if cleanup script ran on
non-holidays

The simple fix exposed additional edge cases around server downtime that could
leave holds active indefinitely.

Changes:
* Implements comprehensive holiday logic when `ExpireReservesOnHolidays = 0`
* Same-day protection: Don't cancel holds that expire TODAY if today is a
holiday
* Historical cleanup: Cancel holds that expired in the past when running on
business days
* Retrospective cancellation: Handle server downtime by checking for missed
business days
* Comprehensive test suite covering all scenarios including long-term expired
holds

To test:
1. Apply the tests patch
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/Reserves/CancelExpiredReserves.t
=> FAIL: Tests fail! The logic in the method is wrong!
3. Apply this patch
4. Repeat 2
=> SUCCESS: All tests pass, demonstrating correct behavior in all scenarios
5. Sign off :-D

Signed-off-by: Paul Derscheid <[email protected]>

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to