https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43838
--- Comment #2 from Tomás Cohen Arazi (tcohen) <[email protected]> --- Created attachment 208393 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=208393&action=edit Bug 43838: Don't jump a whole week outside weekly Dayweek periods With useDaysMode set to 'Dayweek', next_open_days and prev_open_days called get_push_amt on every closed day they met, which returns 7 unless the weekday is a weekly closure. Any caller asking for the next or previous open day got a date a whole week away instead: - ReturnBeforeExpiry (CalcDateDue) - TalkingTech_itiva_outbound.pl - non-weekly loan periods, which the syspref describes as pushed to "the next open day otherwise" - hourly loans ending on a closed day This patch makes next_open_days and prev_open_days skip closed days one day at a time, whatever the useDaysMode value. The move to the next open matching weekday is now only applied by addDays, for 'Dayweek' and loan periods that are a whole number of weeks, through a new _push_to_open_weekday helper. Weekly loan periods behave as before. Test plan: 1. Apply the regression tests 2. Run: $ ktd --shell k$ prove t/db_dependent/Koha/Library/Calendar.t => FAIL: Tests fail! Dates are moved a whole week 3. Apply this patch 4. Repeat step 2 => SUCCESS: Tests pass! 5. Run: k$ prove t/db_dependent/Calendar.t \ t/db_dependent/Circulation/CalcDateDue.t \ t/db_dependent/Circulation.t => SUCCESS: Tests pass! 6. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list -- [email protected] To unsubscribe send an email to [email protected] website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
