If one item has more than one "FU" or "O" fine for user, returns the first/old one and not the latest one. Solved by adding to the _FixOverduesOnReturn, from this: "SELECT * FROM accountlines WHERE (borrowernumber = ?) AND (itemnumber = ?) AND (accounttype='FU' OR accounttype='O')" to this: "SELECT * FROM accountlines WHERE (borrowernumber = ?) AND (itemnumber = ?) AND (accounttype='FU' OR accounttype='O') ORDER BY timestamp DESC"
Can you please add a test plan on how to reproduce this issue? What does O translate to?
According to https://wiki.koha-community.org/wiki/Hard_Coded_Values O is for Overdue. Test plan 1.- Let one issue overdue and return it normally, this should record a fine for the overdue. 2.- Issue the item again letting the loan overdue and get a different fine from the previous one. 3.- Return the issue with the exempt fine selected though returns.pl 4.- Note that the oldest fine was FFOR and not the one related to the actual loan. 5.- Apply the change proposed. 5.- Repeat steps 1-3 6.- Now the FFOR apply for the more recent (accountlines_id) loan.
Hm, I am not sure if O is set by the system currently, but that's not the problem here. I think there should be no 2 FU at the same time, it's a known bug - see bug 14390.
*** This bug has been marked as a duplicate of bug 14390 ***