[Bug 14293] New: Error in the calculation of the suspension of users per day
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14293 Bug ID: 14293 Summary: Error in the calculation of the suspension of users per day Change sponsored?: --- Product: Koha Version: 3.18 Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Circulation Assignee: koha-bugs@lists.koha-community.org Reporter: felipe.gomez3@gmail.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle.m.hall@gmail.com Currently the system is miscalculating the day suspension when a loan is made hours. Add 24 days for each day in fines. The problem occurs when changed in version 3.16.X my $deltadays = $calendar->days_between( $dt_due, $dt_today ); by my $chargeable_units = C4::Overdues::get_chargeable_units($unit, $dt_due, $dt_today, $branchcode); In version 3.18.X, 3.20.X And the line is not necessary: $finedays = $finedays * 24 if ( $unit eq 'hours' ); Which is generating an error in the calculation of the suspension days ______________________________________ Spanish Error en el calculo de la suspensión de usuarios por Días Actualmente el sistema se encuentra calculando mal los días de suspención cuando se hace un préstamo por Horas. Agrega 24 Días por cada día de multa. El problema aparece Cuando cambiaron en la versión 3.16.X my $deltadays = $calendar->days_between( $dt_due, $dt_today ); Por my $chargeable_units = C4::Overdues::get_chargeable_units($unit, $dt_due, $dt_today, $branchcode); En la versión 3.18.X, 3.20.X Ya no se hace necesario la línea: $finedays = $finedays * 24 if ( $unit eq 'hours' ); La cual está generando un error en el cálculo de la suspensión por días. -- 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=14293 MetaBiblioteca Colombia <felipe.gomez3@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |felipe.gomez3@gmail.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14293 MetaBiblioteca Colombia <felipe.gomez3@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|3.18 |3.20 -- 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=14293 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|3.20 |master CC| |jonathan.druart@bugs.koha-c | |ommunity.org -- 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=14293 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- 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=14293 --- Comment #1 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 42387 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=42387&action=edit Bug 14293: The suspension should be calculated in days There was a mismatch between bug 13909 and bug 5549. The get_chargeable_units call from _debar_user_on_return should specify that we want a suspension in days. However I don't understand the comment let by the author of bug 5549 f61a9617184ec4b24100c1d99150bfd4ebf13336 1/
finedays is in days, so hourly loans must multiply by 24 Yes but the suspension is in days, so no need to * 24
2/ And we should have a look on this one too:
grace period is measured in the same units as the loan But the grace period is always in days. On the circ rules the column is "Fine grace period (day)". I think we should replace DateTime::Duration->new( $unit => $issuingrule->{firstremind} ); with DateTime::Duration->new( days => $issuingrule->{firstremind} );
Anyway, we definitelly need more tests in this area! Test plan: 1/ Define an issuing rule with a unit=hour 2/ Set a suspension in days 3/ Check an item out and specify a past due date. 4/ Check the item in 5/ The patron should be debarred correctly -- 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=14293 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Medium patch Assignee|koha-bugs@lists.koha-commun |jonathan.druart@bugs.koha-c |ity.org |ommunity.org Severity|normal |major -- 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=14293 Nick Clemens <nick@quecheelibrary.org> 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=14293 Nick Clemens <nick@quecheelibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #42387|0 |1 is obsolete| | --- Comment #2 from Nick Clemens <nick@quecheelibrary.org> --- Created attachment 42492 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=42492&action=edit Bug 14293: The suspension should be calculated in days There was a mismatch between bug 13909 and bug 5549. The get_chargeable_units call from _debar_user_on_return should specify that we want a suspension in days. However I don't understand the comment let by the author of bug 5549 f61a9617184ec4b24100c1d99150bfd4ebf13336 1/
finedays is in days, so hourly loans must multiply by 24 Yes but the suspension is in days, so no need to * 24
2/ And we should have a look on this one too:
grace period is measured in the same units as the loan But the grace period is always in days. On the circ rules the column is "Fine grace period (day)". I think we should replace DateTime::Duration->new( $unit => $issuingrule->{firstremind} ); with DateTime::Duration->new( days => $issuingrule->{firstremind} );
Anyway, we definitelly need more tests in this area! Test plan: 1/ Define an issuing rule with a unit=hour 2/ Set a suspension in days 3/ Check an item out and specify a past due date. 4/ Check the item in 5/ The patron should be debarred correctly Signed-off-by: Nick Clemens <nick@quecheelibrary.org> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14293 Nick Clemens <nick@quecheelibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nick@quecheelibrary.org --- Comment #3 from Nick Clemens <nick@quecheelibrary.org> --- Test plan worked as expected with one question: if they are hours overdue on an hourly loan, and not a day overdue, it seems to not suspend them. Should it? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14293 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |http://bugs.koha-community. | |org/bugzilla3/show_bug.cgi? | |id=14975 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14293 Kyle M Hall <kyle.m.hall@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |In Discussion --- Comment #4 from Kyle M Hall <kyle.m.hall@gmail.com> --- (In reply to Nick Clemens from comment #3)
Test plan worked as expected with one question: if they are hours overdue on an hourly loan, and not a day overdue, it seems to not suspend them. Should it?
I suppose the question is, should hourly loans suspend in days the number of hours overdue? If an hourly loan is 3 hours late, should the patron be suspended for 3 days? If so, changes are needed. This patch makes it so that hourly loans are suspended based on the number of *days* the item is overdue. Anything less than 24 hours rounds down to 0 days. Should hourly loans suspend for a minimum of 1 day if they are overdue by less than 24 hours? I think the logic of how hourly loan suspension should work needs to be decided before it can be decided if this patch is correct, or if it needs additional changes. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org