Bug 14687

Summary: Patron's transaction history changes items' order after paying fines
Product: Koha Reporter: Joonas Kylmälä <joonas.kylmala>
Component: PatronsAssignee: Joonas Kylmälä <joonas.kylmala>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: minor    
Priority: P4 CC: f.demians, gmcharlt, jonathan.druart, kyle.m.hall, liz, tomascohen
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 14687: Patron's transaction history changes items' order after paying fines.
Bug 14687: Patron's transaction history changes items' order after paying fines.
[PASSED QA] Bug 14687: Patron's transaction history changes items' order after paying fines.

Description Joonas Kylmälä 2015-08-17 12:29:07 UTC
1. Go to: Staff side -> Patrons -> X patron -> Fines -> *Create manual invoice*
2. Create one invoice with amount of 1.
3. Create other invoice with amount of 2.
4. Go to tab *Account* and take a look how the transactions are ordered.
5. Go to tab *Pay fines* and click Pay amount and then confirm.
6. Now you can see that in the *Account* tab the order of transactions have changed and that they go in the wrong order now.
Comment 1 Joonas Kylmälä 2015-08-17 12:56:11 UTC Comment hidden (obsolete)
Comment 2 Joonas Kylmälä 2015-08-17 12:57:24 UTC
Test plan for the patch above:

1. Go to: Staff side -> Patrons -> X patron -> Fines -> *Create manual invoice*
2. Create one invoice with amount of 1.
3. Create other invoice with amount of 2.
4. Go to tab *Account* and take a look how the transactions are ordered.
5. Go to tab *Pay fines* and click Pay amount and then confirm.
6. Now you can see that in the *Account* tab the order of transactions have changed and that they go in the wrong order now.
7. Apply patch and see that the transactions are now ordered from newest to oldest.
Comment 3 Liz Rea 2015-11-06 01:45:04 UTC Comment hidden (obsolete)
Comment 4 Kyle M Hall (khall) 2015-11-06 13:00:33 UTC
Created attachment 44552 [details] [review]
[PASSED QA] Bug 14687: Patron's transaction history changes items' order after paying fines.

Sorts Patron's accounting data consistently from newest to oldest.
It doesn't depend on anymore to timestamp (which can be same for multiple
entries) from database but instead uses accountline's id to sort.

Signed-off-by: Liz Rea <liz@catalyst.net.nz>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 5 Tomás Cohen Arazi (tcohen) 2015-11-09 15:52:55 UTC
Patch pushed to master.

Thanks Joonas!
Comment 6 Frédéric Demians 2015-11-29 20:36:46 UTC
This patch has been pushed to 3.20.x, will be in 3.20.6.
Comment 7 Liz Rea 2016-01-06 21:21:30 UTC
Pushed to 3.18.13, and released.