Bug 12596 - Backdating returns with SpecifiyReturnDate causes fines for items not overdue!
Summary: Backdating returns with SpecifiyReturnDate causes fines for items not overdue!
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: Main
Hardware: All All
: P5 - low critical (vote)
Assignee: Kyle M Hall
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 18292
  Show dependency treegraph
 
Reported: 2014-07-17 14:56 UTC by Kyle M Hall
Modified: 2019-06-27 09:24 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 12596 - Backdating returns with SpecifiyReturnDate causes fines for items not overdue! (1.16 KB, patch)
2014-07-17 14:57 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 12596 - Backdating returns with SpecifiyReturnDate causes fines for items not overdue! (2.42 KB, patch)
2014-07-17 15:10 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 12596 - Unit Test (1.16 KB, patch)
2014-07-17 16:20 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 12596 - Backdating returns with SpecifiyReturnDate causes fines for items not overdue! (2.39 KB, patch)
2014-07-17 16:20 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 12596 - Backdating returns with SpecifiyReturnDate causes fines for items not overdue! (2.58 KB, patch)
2014-07-17 16:23 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 12596 - Unit Test (1.20 KB, patch)
2014-07-21 21:44 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 12596 - Backdating returns with SpecifiyReturnDate causes fines for items not overdue! (2.67 KB, patch)
2014-07-21 21:44 UTC, Chris Cormack
Details | Diff | Splinter Review
[PASSED QA] Bug 12596 - Unit Test (1.27 KB, patch)
2014-07-24 21:16 UTC, Katrin Fischer
Details | Diff | Splinter Review
[PASSED QA] Bug 12596 - Backdating returns with SpecifiyReturnDate causes fines for items not overdue! (2.90 KB, patch)
2014-07-24 21:16 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Kyle M Hall 2014-07-17 14:56:32 UTC
When using the backdating of returns feature, an item that is not overdue is treated as being as many days overdue as it is *not* overdue. This is due to the fact that _get_chargeable_units appears to return the difference between the return date and the due date without consideration the return date being earlier than the due date.
Comment 1 Kyle M Hall 2014-07-17 14:57:26 UTC Comment hidden (obsolete)
Comment 2 Kyle M Hall 2014-07-17 15:10:52 UTC Comment hidden (obsolete)
Comment 3 Kyle M Hall 2014-07-17 16:20:05 UTC Comment hidden (obsolete)
Comment 4 Kyle M Hall 2014-07-17 16:20:18 UTC Comment hidden (obsolete)
Comment 5 Kyle M Hall 2014-07-17 16:23:59 UTC Comment hidden (obsolete)
Comment 6 Chris Cormack 2014-07-21 21:44:32 UTC Comment hidden (obsolete)
Comment 7 Chris Cormack 2014-07-21 21:44:47 UTC Comment hidden (obsolete)
Comment 8 Katrin Fischer 2014-07-24 21:16:02 UTC
Created attachment 30049 [details] [review]
[PASSED QA] Bug 12596 - Unit Test

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Comment 9 Katrin Fischer 2014-07-24 21:16:31 UTC
Created attachment 30050 [details] [review]
[PASSED QA] Bug 12596 - Backdating returns with SpecifiyReturnDate causes fines for items not overdue!

When using the backdating of returns feature, an item that is not
overdue is treated as being as many days overdue as it is *not* overdue.
This is due to the fact that _get_chargeable_units appears to return the
difference between the return date and the due date without
consideration the return date being earlier than the due date.

Test Plan:
1) Apply the unit test patch
2) prove t/db_dependent/Circulation.t
3) Note the failure
4) Apply the second patch
5) prove t/db_dependent/Circulation.t
6) Note there are no failures

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Fixes some badly named variables also

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
In order to test this, you need to activate SpecifyReturnDate.
I confirmed the problem and verified that the bug fixes it
by running the tests, but also by testing in staff.
Comment 10 Tomás Cohen Arazi 2014-07-25 15:02:36 UTC
Patches pushed to master.

Thanks Kyle!
Comment 11 Galen Charlton 2014-08-26 22:39:57 UTC
Pushed to 3.16.x for inclusion in 3.16.3.
Comment 12 Fridolin Somers 2014-12-29 18:01:37 UTC
Pushed to 3.14.x, will be in 3.14.13