[Bug 13909] New: _debar_user_on_return doesn't honour finesCalendar
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13909 Bug ID: 13909 Summary: _debar_user_on_return doesn't honour finesCalendar Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: major Priority: P5 - low Component: Circulation Assignee: koha-bugs@lists.koha-community.org Reporter: tomascohen@gmail.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle.m.hall@gmail.com The routine should be using C4::Overdues::_get_chargeable_units instead of an ad-hoc calculation of the overdue days to use as basis for the calculatio here: my $calendar = Koha::Calendar->new( branchcode => $branchcode ); # $deltadays is a DateTime::Duration object my $deltadays = $calendar->days_between( $dt_due, $dt_today ); To reproduce: - 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). -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13909 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Patch complexity|--- |Trivial patch -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13909 --- Comment #1 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 37374 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=37374&action=edit 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 -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13909 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |tomascohen@gmail.com |ity.org | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13909 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Change sponsored?|--- |Sponsored -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13909 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|_debar_user_on_return |Suspension days calculation |doesn't honour |doesn't honour |finesCalendar |finesCalendar -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13909 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |13958 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13909 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@biblibre.co | |m -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13909 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13909 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #37374|0 |1 is obsolete| | --- Comment #2 from Josef Moravec <josef.moravec@gmail.com> --- Created attachment 37598 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=37598&action=edit [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> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13909 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13909 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #37598|0 |1 is obsolete| | --- Comment #3 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 37646 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=37646&action=edit [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> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13909 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com Status|Passed QA |Pushed to Master --- Comment #4 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Patch pushed to master. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13909 --- Comment #5 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 37708 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=37708&action=edit Bug 13909: (QA followup) fix references to get_chargeable_units Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13909 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |Pushed to Stable CC| |chris@bigballofwax.co.nz --- Comment #6 from Chris Cormack <chris@bigballofwax.co.nz> --- Pushed to 3.18.x will be in 3.18.6 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13909 MetaBiblioteca Colombia <felipe.gomez3@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |felipe.gomez3@gmail.com --- Comment #7 from MetaBiblioteca Colombia <felipe.gomez3@gmail.com> --- 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' ); -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org