Summary: | t/db_dependent/Koha/Account/Line.t test fails with FinesMode set to calculate | ||
---|---|---|---|
Product: | Koha | Reporter: | Andrew Fuerste-Henry <andrew> |
Component: | Fines and fees | Assignee: | Martin Renvoize (ashimema) <martin.renvoize> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | normal | ||
Priority: | P5 - low | CC: | fridolin.somers, kyle, martin.renvoize, nick, victor |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
21.05.00,20.11.05,20.05.11
|
|
Circulation function: | |||
Bug Depends on: | 8338 | ||
Bug Blocks: | |||
Attachments: |
Bug 28097: Mock finesModes to disable recalculation
Bug 28097: Mock finesModes to disable recalculation |
Description
Andrew Fuerste-Henry
2021-04-06 16:17:37 UTC
This is a side effect of bug 8338. With finesMode set to 'production' and CalculateFinesOnReturn set to 'enabled' upon return we will first re-calculate the fine amount (in this case that would result in a '0' amount fine).. we then call '_FixOverduesOnReturn' which subsequently fines the '0' amount fine and deletes it on the assumption it's a backdated return which had resulted in an errant fine. I wonder if, rather than delete the original fine, we should void it which would give a more thorough audit trail (and fix this bug).. However, I think such a VOID would still appear on the patrons account in the OPAC and that was what I believe people wanted to avoid with bug 8338. The easy fix here is to adjust the test to mock the two preferences to ensure they are disabled for the test case. Created attachment 119275 [details] [review] Bug 28097: Mock finesModes to disable recalculation Since bug 8338 the recalcuated zero amount fine is subsequently removed in _FixOverduesOnReturn which causes this test to fail if finesMode is 'production' and 'CalculateFinesOnReturn' is enabled. Perhaps we should be 'VOID'ing fines rather than completely deleting them, but that's a question for another day. Test plan 1/ Enable finesMode in the staff client 2/ Run the test and watch it fail 3/ Apply the patch 4/ Run the test and watch it pass Created attachment 119276 [details] [review] Bug 28097: Mock finesModes to disable recalculation Since bug 8338 the recalcuated zero amount fine is subsequently removed in _FixOverduesOnReturn which causes this test to fail if finesMode is 'production' and 'CalculateFinesOnReturn' is enabled. Perhaps we should be 'VOID'ing fines rather than completely deleting them, but that's a question for another day. Test plan 1/ Enable finesMode in the staff client 2/ Run the test and watch it fail 3/ Apply the patch 4/ Run the test and watch it pass Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Small fix, passing QA Pushed to master for 21.05, thanks to everybody involved! Pushed to 20.11.x for 20.11.05 Pushed to 20.05.x for 20.05.11 Not backported to oldoldstable (19.11.x). Feel free to ask if it's needed. |