Summary: | Lost items not marked returned when floating-point math causes amountoutstanding to be not-quite-zero | ||
---|---|---|---|
Product: | Koha | Reporter: | Andrew Fuerste-Henry <andrew> |
Component: | Fines and fees | Assignee: | Bugs List <koha-bugs> |
Status: | RESOLVED DUPLICATE | QA Contact: | Testopia <testopia> |
Severity: | major | ||
Priority: | P5 - low | CC: | cslone, jonathan.druart, kyle, lisettepalouse+koha, martin.renvoize, nick |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
See Also: |
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26076 https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28482 |
||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: |
Description
Andrew Fuerste-Henry
2020-03-11 20:10:36 UTC
*** Bug 18895 has been marked as a duplicate of this bug. *** I did some testing here, the fines log issue is easily recreated by adding a few fines of $0.10 and then a 6.99 fine, but the checkout is still returned. Interesting! I tried it with a few fines of $1.00 and a 6.99 lost item and it didn't recreate. Makes sense that even dollars v. some cents would make the difference. I do recreate using the steps from comment 0. However I am not sure how to fix this, the "pay amount" button does not take care of the line we selected (as far as I understood). The "Pay selected" button does, and the problem exists as well here. I think we should fix that in Koha/Account/Line.pm and Koha/Account.pm where we compare $debit->amountoutstanding and $new_amountoutstanding with 0 (==0 vs sprintf %.2f for instance), but it appeared it's not enough so there may be something else... An additional note here: while Koha records amounts out to 6 decimal places, it appears this issue can occur with fractional cents even smaller than that, resulting in items not being returned even though the accountlines entry says the amountoutstanding is 0.000000. Again, recreating the issue requires some very specific values and actions: - have an item type that charges a $10 processing fee - have two items of that item type, one with replacement price 125.68 and the other with replacement price 33.95 - mark both items as lost, confirm patron owes you 179.63 - take payment of 179.63 for all fees using the Pay Selected button - the 33.95 item is not marked as returned, but the fee shows 0.000000 outstanding *** This bug has been marked as a duplicate of bug 28482 *** Totally is, thanks Katrin! |