[kmymoney] [Bug 322926] Having problem resorting data in KMM.

Christian bugzilla_noreply at kde.org
Sat Apr 21 14:31:04 UTC 2018


https://bugs.kde.org/show_bug.cgi?id=322926

--- Comment #8 from Christian <gentoo at moin.fi> ---
In my view, the balance column should always be available. The balance has to
be calculated in chronological order. That is, for a row with a newer date, the
balance column must refer to the row with the most recent earlier date, and the
amount has to be calculated from that balance and the amount entered on the
current row. It makes no sense to calculate the balance from top to bottom
irrespective of sort order because then one row can show a date and a balance
that does not match.

There is an issue on how to calculate the balance when there are multiple rows
with the same date. I suggest that, here, it makes sense to calculate it from
top to bottom. I.e., here's my suggestion:

1. Sort order can be customized and the rows on the sheet are sorted in that
way.
2. For calculation of the balance only, rows are sorted by
   (a) removing the "Date" sort key from the sort list if present,
   (b) if "Date" is sorted as descending, then reverting the order on each of
the other sort keys,
   (c) making "Date" the first sort key, ascending or descending as specified
in the sort (1),
   (d) then calculating the balance from the first row to the last row (if the
Date key is ascending) or from the last row to the first row (if the Date key
is descending).
   (e) The balance that is obtained in this way is shown in the rows that are
sorted as in (1).

I think we get the correct balances this way. The inversion of the other sort
keys in (2.b) is so that the balance column is as sensible as possible when
reading it in the final order.

Alternatively, we could get rid of the balance column and show the balance on
the separator headers. Then it would make sense (I think) to show the balances
only if the sort order is with Date as the first key. Note that the balance has
to be calculated from oldest to newest even if the sort order is from newest to
oldest.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the KMyMoney-devel mailing list