Summary: | Suspension days calculation doesn't honour finesCalendar | ||
---|---|---|---|
Product: | Koha | Reporter: | Tomás Cohen Arazi (tcohen) <tomascohen> |
Component: | Circulation | Assignee: | Tomás Cohen Arazi (tcohen) <tomascohen> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | major | ||
Priority: | P5 - low | CC: | chris, felipe.gomez3, gmcharlt, jonathan.druart, kyle.m.hall, tomascohen |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
GIT URL: | Change sponsored?: | Sponsored | |
Patch complexity: | Trivial patch | Documentation contact: | |
Documentation submission: | Text to go in the release notes: | ||
Version(s) released in: | Circulation function: | ||
Bug Depends on: | |||
Bug Blocks: | 13958 | ||
Attachments: |
Bug 13909: Suspension days calculation should respect finesCalendar
[SIGNED-OFF] Bug 13909: Suspension days calculation should respect finesCalendar [PASSED QA] Bug 13909: Suspension days calculation should respect finesCalendar Bug 13909: (QA followup) fix references to get_chargeable_units |
Description
Tomás Cohen Arazi (tcohen)
2015-03-25 19:04:26 UTC
Created attachment 37374 [details] [review] Bug 13909: Suspension days calculation should respect finesCalendar This patch make _debar_user_on_return respect the finesCalendar syspref. It does so, by replacing the ad-hoc overdue days calculation in favor of C4::Overdues::_get_chargeable_units (which is renamed C4::Overdues::get_chargeable_units and exported). There's no behaviour change besides making the calculation simpler and correct. To test: - Set finesCalendar = "directly" - Have a circulation rule stating: interval for calculating fines = 1 suspension days = 3 - Have the calendar set for sunday and saturday as holidays. - Checkout an item with a branch/itype/borrower category that matches the defined circ rule with a hand-writen due date to (say) last friday. - Check the item in => FAIL: Notice that the user is debarred using the calendar (skipping saturday and sunday). - Apply the patch - Repeat the previous steps => SUCCESS: calculation is correct (counting saturday and sunday as overdue days, i.e. 'directly'). - Set finesCalendar = "calendar" - Repeat the test => SUCCESS: calculation is correct (skipping holidays). - Sign off. Sponsored-by: Universidad Nacional de Cordoba Created attachment 37598 [details] [review] [SIGNED-OFF] Bug 13909: Suspension days calculation should respect finesCalendar This patch make _debar_user_on_return respect the finesCalendar syspref. It does so, by replacing the ad-hoc overdue days calculation in favor of C4::Overdues::_get_chargeable_units (which is renamed C4::Overdues::get_chargeable_units and exported). There's no behaviour change besides making the calculation simpler and correct. To test: - Set finesCalendar = "directly" - Have a circulation rule stating: interval for calculating fines = 1 suspension days = 3 - Have the calendar set for sunday and saturday as holidays. - Checkout an item with a branch/itype/borrower category that matches the defined circ rule with a hand-writen due date to (say) last friday. - Check the item in => FAIL: Notice that the user is debarred using the calendar (skipping saturday and sunday). - Apply the patch - Repeat the previous steps => SUCCESS: calculation is correct (counting saturday and sunday as overdue days, i.e. 'directly'). - Set finesCalendar = "calendar" - Repeat the test => SUCCESS: calculation is correct (skipping holidays). - Sign off. Sponsored-by: Universidad Nacional de Cordoba Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Created attachment 37646 [details] [review] [PASSED QA] Bug 13909: Suspension days calculation should respect finesCalendar This patch make _debar_user_on_return respect the finesCalendar syspref. It does so, by replacing the ad-hoc overdue days calculation in favor of C4::Overdues::_get_chargeable_units (which is renamed C4::Overdues::get_chargeable_units and exported). There's no behaviour change besides making the calculation simpler and correct. To test: - Set finesCalendar = "directly" - Have a circulation rule stating: interval for calculating fines = 1 suspension days = 3 - Have the calendar set for sunday and saturday as holidays. - Checkout an item with a branch/itype/borrower category that matches the defined circ rule with a hand-writen due date to (say) last friday. - Check the item in => FAIL: Notice that the user is debarred using the calendar (skipping saturday and sunday). - Apply the patch - Repeat the previous steps => SUCCESS: calculation is correct (counting saturday and sunday as overdue days, i.e. 'directly'). - Set finesCalendar = "calendar" - Repeat the test => SUCCESS: calculation is correct (skipping holidays). - Sign off. Sponsored-by: Universidad Nacional de Cordoba Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Patch pushed to master. Created attachment 37708 [details] [review] Bug 13909: (QA followup) fix references to get_chargeable_units Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com> Pushed to 3.18.x will be in 3.18.6 Hello in Koha 3.20 Suspentions fails when loan by hours See http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14293 The solution: Remove line 2157 in the /usr/share/koha/lib/C4/Circulation.pm $finedays = $finedays * 24 if ( $unit eq 'hours' ); |