Due to the way AddReturn and UpdateFine work, if you pass in a return date to AddReturn, and that item has a calculated fine of 0, Koha will insert the 0 amount fine into accountlines. This is good behavior when we want to update an existing fine, but bad behavior if there was no fine to begin with!
Created attachment 36930 [details] [review] Bug 13841 - Unit Test
Created attachment 36931 [details] [review] Bug 13841 - Returns via backdating or SIP2 can create new fines with an amount outstanding of 0 Due to the way AddReturn and UpdateFine work, if you pass in a return date to AddReturn, and that item has a calculated fine of 0, Koha will insert the 0 amount fine into accountlines. This is good behavior when we want to update an existing fine, but bad behavior if there was no fine to begin with! Test Plan: 1) Apply the unit test patch 2) prove t/db_dependent/Circulation.t 3) Note the test fails 4) Apply this patch 5) prove t/db_dependent/Circulation.t 6) Note the test passes
Patch tested with a sandbox, by Jen DeMuth <jdemuth@roseville.ca.us>
Created attachment 36964 [details] [review] Bug 13841 - Unit Test Signed-off-by: Jen DeMuth <jdemuth@roseville.ca.us>
Created attachment 36965 [details] [review] Bug 13841 - Returns via backdating or SIP2 can create new fines with an amount outstanding of 0 Due to the way AddReturn and UpdateFine work, if you pass in a return date to AddReturn, and that item has a calculated fine of 0, Koha will insert the 0 amount fine into accountlines. This is good behavior when we want to update an existing fine, but bad behavior if there was no fine to begin with! Test Plan: 1) Apply the unit test patch 2) prove t/db_dependent/Circulation.t 3) Note the test fails 4) Apply this patch 5) prove t/db_dependent/Circulation.t 6) Note the test passes Signed-off-by: Jen DeMuth <jdemuth@roseville.ca.us>
I should note you can also test this by backdating a return to an hour before the current time. This will trigger the behavior and is more easily testable in a sandbox!
Created attachment 37085 [details] [review] [PASSED QA] Bug 13841 - Unit Test Signed-off-by: Jen DeMuth <jdemuth@roseville.ca.us> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 37086 [details] [review] [PASSED QA] Bug 13841 - Returns via backdating or SIP2 can create new fines with an amount outstanding of 0 Due to the way AddReturn and UpdateFine work, if you pass in a return date to AddReturn, and that item has a calculated fine of 0, Koha will insert the 0 amount fine into accountlines. This is good behavior when we want to update an existing fine, but bad behavior if there was no fine to begin with! Test Plan: 1) Apply the unit test patch 2) prove t/db_dependent/Circulation.t 3) Note the test fails 4) Apply this patch 5) prove t/db_dependent/Circulation.t 6) Note the test passes Signed-off-by: Jen DeMuth <jdemuth@roseville.ca.us> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Confirmed the problem in the staff interface and that the patch fixes it. Also tested that fines still get calculated.
Patches pushed to master. Nice one Kyle!
Pushed to 3.18.x will be in 3.18.6