Sorting by date doesn't sort same-day transactions correctly
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
wxBanker |
Fix Released
|
Low
|
David D Lowe |
Bug Description
Sorting transactions by date does not sort same-day transactions in the order that they were entered. This leads to an unexpected "Total" (or balance) column.
Steps to reproduce:
- Create a new account
- Create the following transactions in this order:
2008-10-02 Old $10
2009-10-02 BB $40
2009-10-02 AA $50
2010-10-02 Recent $20
The sort the transactions alphabetically by clicking on the "description" column header:
Date | Description | Amount | Total
2009-10-02 | AA | $50 | $100
2009-10-02 | BB | $40 | $50
2008-10-02 | Old | $10 | $10
2010-10-02 | Recent | $20 | $120
Now sort the transactions by date by clicking on the "date" column header:
Date | Description | Amount | Total
2008-10-02 | Old | $10 | $10
2009-10-02 | AA | $50 | $100
2009-10-02 | BB | $40 | $50
2010-10-02 | Recent | $20 | $120
As you can see, AA and BB are not sorted correctly. Because BB was entered before AA, BB should have been displayed before AA. This buggy behaviour leads to a strange "Total" (or balance) column. When sorted by date oldest to newest, one expects the "Total" column to be the sum of the transactions preceding it.
Related branches
- Michael Rooney: Approve
-
Diff: 109 lines (+35/-7)2 files modifiedwxbanker/tests/guitests.py (+22/-3)
wxbanker/transactionolv.py (+13/-4)
Changed in wxbanker: | |
assignee: | nobody → David D Lowe (flimm) |
status: | Triaged → In Progress |
Changed in wxbanker: | |
status: | In Progress → Fix Committed |
Changed in wxbanker: | |
status: | Fix Committed → Fix Released |
Thanks for this report! I think however that this is the intended behavior: column sorts are cumulative when possible. In the example you sorted by Description (ascending), then Date (ascending) so it is using the previous sort (Description ASC) as a tie-breaker. Try sorting by Description descending then Date ascending, and you'll see the opposite effect, and a similar thing with Amount and such.
Do you think this behavior is not preferred? The only issue I see is that there isn't a clear way to "reset" the previous sort columns.
It might be better sort not just be date for that column but also transaction ID, which would give you a more expected result when ordering transactions by Date descending. Right now if I do that I still get BB above AA when it should be swapped. I think I like the idea of that, and it should mean also there are no tie-breakers for dates, what do you think?