[Bug 24075] New: Backdating a return to the exact due date and time results in the fine not being refunded
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24075 Bug ID: 24075 Summary: Backdating a return to the exact due date and time results in the fine not being refunded Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: blocker Priority: P5 - low Component: Circulation Assignee: koha-bugs@lists.koha-community.org Reporter: bwsdonna@gmail.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle.m.hall@gmail.com When you use the date picker or book drop mode and check in an item that is due on that date, a fine is assessed and not refunded. For example: item 12345 is due on 11/19/2109 23:59. On 11/20/2019 I check the item in using date picker/book drop setting the check in date to 11/19/2019 23:59, the patron is charged a fine, and the fine is not cleared as would be expected, since the item is being checked in before it is overdue. Confirmed as a problem in master by kidclamp and khall. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24075 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |kyle@bywatersolutions.com |ity.org | CC| |kyle@bywatersolutions.com -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24075 --- Comment #1 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 95625 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=95625&action=edit Bug 24075: Backdating a return to the exact due date and time results in the fine not being refunded When you use the date picker or book drop mode and check in an item that is due on that date, a fine is assessed and not refunded. For example: item 12345 is due on 11/19/2109 23:59. On 11/20/2019 I check the item in using date picker/book drop setting the check in date to 11/19/2019 23:59, the patron is charged a fine, and the fine is not cleared as would be expected, since the item is being checked in before it is overdue. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24075 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #95625|0 |1 is obsolete| | --- Comment #2 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 95626 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=95626&action=edit Bug 24075: Backdating a return to the exact due date and time results in the fine not being refunded When you use the date picker or book drop mode and check in an item that is due on that date, a fine is assessed and not refunded. For example: item 12345 is due on 11/19/2109 23:59. On 11/20/2019 I check the item in using date picker/book drop setting the check in date to 11/19/2019 23:59, the patron is charged a fine, and the fine is not cleared as would be expected, since the item is being checked in before it is overdue. Test Plan: 1) Back date a checkout so it is overdue 2) Run fines.pl to generate the fine 3) Return the item, backdating to the same date/time is was due 4) Note the fine was not removed 5) Apply this patch 6) Repeat steps 1-3 7) Fine should be zeroed out now! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24075 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24075 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #95626|0 |1 is obsolete| | --- Comment #3 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 95654 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=95654&action=edit Bug 24075: Backdating a return to the exact due date and time results in the fine not being refunded When you use the date picker or book drop mode and check in an item that is due on that date, a fine is assessed and not refunded. For example: item 12345 is due on 11/19/2109 23:59. On 11/20/2019 I check the item in using date picker/book drop setting the check in date to 11/19/2019 23:59, the patron is charged a fine, and the fine is not cleared as would be expected, since the item is being checked in before it is overdue. Test Plan: 1) Back date a checkout so it is overdue 2) Run fines.pl to generate the fine 3) Return the item, backdating to the same date/time is was due 4) Note the fine was not removed 5) Apply this patch 6) Repeat steps 1-3 7) Fine should be zeroed out now! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24075 --- Comment #4 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 95655 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=95655&action=edit Bug 24075: Unit tests -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24075 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #95655|0 |1 is obsolete| | --- Comment #5 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 95656 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=95656&action=edit Bug 24075: Unit tests -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24075 --- Comment #6 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Comment on attachment 95654 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=95654 Bug 24075: Backdating a return to the exact due date and time results in the fine not being refunded Review of attachment 95654: --> (https://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=24075&attachment=95654) ----------------------------------------------------------------- ::: C4/Circulation.pm @@ +1966,4 @@
MarkIssueReturned( $borrowernumber, $item->itemnumber, $return_date, $patron->privacy ); }; unless ( $@ ) { + if ( $return_date_is_forced || ( C4::Context->preference('CalculateFinesOnReturn') && $is_overdue && !$item->itemlost ) ) {
This feels somewhat wrong.. I'm sure Katrin would say "But we don't ever want to recalculate fines if we have 'CalculateFinesOnReturn' turned off" So.. could this perhaps be: `if ( C4::Context->preference('CalculateFinesOnReturn') && ($return_date_is_forced || $is_overdue) && !$item->itemlost ) {` Instead? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24075 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA CC| |martin.renvoize@ptfs-europe | |.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24075 --- Comment #7 from Kyle M Hall <kyle@bywatersolutions.com> --- I like it! Updated patch incoming! (In reply to Martin Renvoize from comment #6)
Comment on attachment 95654 [details] [review] Bug 24075: Backdating a return to the exact due date and time results in the fine not being refunded
Review of attachment 95654 [details] [review]: -----------------------------------------------------------------
::: C4/Circulation.pm @@ +1966,4 @@
MarkIssueReturned( $borrowernumber, $item->itemnumber, $return_date, $patron->privacy ); }; unless ( $@ ) { + if ( $return_date_is_forced || ( C4::Context->preference('CalculateFinesOnReturn') && $is_overdue && !$item->itemlost ) ) {
This feels somewhat wrong.. I'm sure Katrin would say "But we don't ever want to recalculate fines if we have 'CalculateFinesOnReturn' turned off"
So.. could this perhaps be:
`if ( C4::Context->preference('CalculateFinesOnReturn') && ($return_date_is_forced || $is_overdue) && !$item->itemlost ) {`
Instead?
-- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24075 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24075 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #95654|0 |1 is obsolete| | Attachment #95656|0 |1 is obsolete| | --- Comment #8 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 95706 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=95706&action=edit Bug 24075: Backdating a return to the exact due date and time results in the fine not being refunded When you use the date picker or book drop mode and check in an item that is due on that date, a fine is assessed and not refunded. For example: item 12345 is due on 11/19/2109 23:59. On 11/20/2019 I check the item in using date picker/book drop setting the check in date to 11/19/2019 23:59, the patron is charged a fine, and the fine is not cleared as would be expected, since the item is being checked in before it is overdue. Test Plan: 1) Back date a checkout so it is overdue 2) Run fines.pl to generate the fine 3) Return the item, backdating to the same date/time is was due 4) Note the fine was not removed 5) Apply this patch 6) Repeat steps 1-3 7) Fine should be zeroed out now! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24075 --- Comment #9 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 95707 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=95707&action=edit Bug 24075: Unit tests -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24075 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org Depends on| |14591 --- Comment #10 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- I would say it has been caused by commit 467c24cb9da02deb00bf49333351a0843cdeda10 Bug 14591: book drop / drop box mode incorrectly decrements accrued overdue fines Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14591 [Bug 14591] book drop / drop box mode incorrectly decrements accrued overdue fines -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24075 --- Comment #11 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 95719 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=95719&action=edit Bug 24075: Alternative 1 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24075 --- Comment #12 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 95720 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=95720&action=edit Bug 24075: Alternative 2 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24075 --- Comment #13 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Lets golf a little.. I've uploaded a couple of alternatives.. let me know which of the three options seems clearest -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24075 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24075 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24075 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #95706|0 |1 is obsolete| | Attachment #95707|0 |1 is obsolete| | Attachment #95719|0 |1 is obsolete| | Attachment #95720|0 |1 is obsolete| | --- Comment #14 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 95723 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=95723&action=edit Bug 24075: Backdating a return to the exact due date and time results in the fine not being refunded When you use the date picker or book drop mode and check in an item that is due on that date, a fine is assessed and not refunded. For example: item 12345 is due on 11/19/2109 23:59. On 11/20/2019 I check the item in using date picker/book drop setting the check in date to 11/19/2019 23:59, the patron is charged a fine, and the fine is not cleared as would be expected, since the item is being checked in before it is overdue. Test Plan: 1) Back date a checkout so it is overdue 2) Run fines.pl to generate the fine 3) Return the item, backdating to the same date/time is was due 4) Note the fine was not removed 5) Apply this patch 6) Repeat steps 1-3 7) Fine should be zeroed out now! Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24075 --- Comment #15 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 95724 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=95724&action=edit Bug 24075: Unit tests -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24075 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |tomascohen@gmail.com |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24075 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch Status|Signed Off |Passed QA --- Comment #16 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Tests pass: prove t/db_dependent/Circulation/CalcFine.t t/db_dependent/Fines.t t/db_dependent/Circulation.t Behavior is the described one. Passing! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24075 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #95723|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24075 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #95724|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24075 --- Comment #17 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 95727 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=95727&action=edit Bug 24075: Backdating a return to the exact due date and time results in the fine not being refunded When you use the date picker or book drop mode and check in an item that is due on that date, a fine is assessed and not refunded. For example: item 12345 is due on 11/19/2109 23:59. On 11/20/2019 I check the item in using date picker/book drop setting the check in date to 11/19/2019 23:59, the patron is charged a fine, and the fine is not cleared as would be expected, since the item is being checked in before it is overdue. Test Plan: 1) Back date a checkout so it is overdue 2) Run fines.pl to generate the fine 3) Return the item, backdating to the same date/time is was due 4) Note the fine was not removed 5) Apply this patch 6) Repeat steps 1-3 7) Fine should be zeroed out now! Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24075 --- Comment #18 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 95728 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=95728&action=edit Bug 24075: Unit tests Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24075 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |19.11.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24075 --- Comment #19 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Nice work! Pushed to master for 19.11.00 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24075 Martha Fuerst <mfuerst@hmcpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mfuerst@hmcpl.org --- Comment #20 from Martha Fuerst <mfuerst@hmcpl.org> --- Will this be backdated to 19.05? Thanks! -Marti Fuerst -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24075 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24075 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|19.11.00 |19.11.00,19.05.05 released in| | Status|Pushed to master |Pushed to stable --- Comment #21 from Fridolin SOMERS <fridolin.somers@biblibre.com> --- Pushed to 19.05.x for 19.05.05 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org