Created attachment 138513 [details] testcase STEPS TO REPRODUCE 1. download kmymoney from https://binary-factory.kde.org/job/KMyMoney_Release_win64/ 2. unpack archive, start kmymoney and open the appended file 3. Open ledger of checking account OBSERVED RESULT The reconciled balance is displayed after the transaction of statement page 3.1 EXPECTED RESULT It should be displayed after statement page 2.1 SOFTWARE/OS VERSIONS Windows: 10 KDE Frameworks Version: 5.74 Qt Version: 5.14 ADDITIONAL INFORMATION The reason for this is that currently entries in the reconciliation history can only be defined for all transactions of a day, which only works in special cases. In all cases where debits, transfers and or credits take place during the day after retrieving a bank statement, these would be incorrectly included, as can be seen in the attached test case.
The current implementation does not support mid-day statements. To support it, the reconciliation history needs to be tied to a specific transaction id instead of a post or entry date.
That would also require that there is a fixed sort order, and that the transaction id's are monotonically increasing in time. However, that is likely the case if they are based on a date/timestamp. I suppose the sorting is not absolutely required, but then the UI should be modified so that it is absolutely clear to the user which transactions are before and which are after the transaction used as the last to be reconciled.
Just out of curiosity, how does GnuCash do it? Anyone has any experience with it?
(In reply to Dawid Wróbel from comment #3) > Just out of curiosity, how does GnuCash do it? gnucash uses posting and entry data with time as the date with seconds accuracy <trn:date-posted> <ts:date>2021-05-25 10:59:00 +0000</ts:date> </trn:date-posted> <trn:date-entered> <ts:date>2021-05-25 13:02:57 +0000</ts:date> </trn:date-entered> Each split of a reconciled transaction has a reconciliation status and a timestamp with date, time and time zone <trn:split> <split:id type="guid">faedaac3b6ad489590f5d202268cc66f</split:id> <split:reconciled-state>y</split:reconciled-state> <split:reconcile-date> <ts:date>2021-05-25 21:59:59 +0000</ts:date> </split:reconcile-date> </trn:split> so that mid-day reconciliations are possible (but not supported by the ui yet) Since each split of a transaction assigned to an account and reconciled contains a reconcile date, this is used to map a reconcilation history. Unlike kmymoney, gnucash does not store reconciliation balances, which are calculated from the individual transactions.