KMyMoney is a fantastic application! I have chosen it over Quicken, GNUcash, and NolaPro after extensive testing. Thank you for the fabulous development to date. When I download an OFX file for a previous period ending date 1/31/2013 prior to the current date 8/14/2013 for my checking account from CHASE bank, the following code appears toward the end of the OFX file when viewed using Microsoft Notepad: <LEDGERBAL> <BALAMT>15945.01 <DTASOF>20130814120000[0:GMT] </LEDGERBAL> When I import the file, unfortunately, KMyMoney creates and uneditable register entry: 1/31/2013 Online Statement Balance $15,945.01 that cannot be deleted. This unfortunately is NOT the balance for 1/31/2014 - it is the balance for 8/14/2013. KMyMoney does not appear to compare the ending date to the field <DTASOF> and suppress entry of an erroneously dated Online Statement Balance. The program still functions properly, as this value is ignored, but it is bothersome to look at as it conflicts with the program balance immediately above it which is correct for 1/31/2013. I am able to work around the problem by first using Microsoft Notepad to edit the OFX file and delete the four lines above, after which importing works fine and does not create any Online Statement Balance register entry at all, which is preferable as the entry is going to be the wrong balance. Reproducible: Always
One quick question - what is the opening date of the account? You can't edit any transactions prior to that date. (You shouldn't be able to create them either, but it does happen.) Also, what type of transaction does that "uneditable register entry" seem to be? Is it just a deposit, or has it been made the opening balance of the account? On the other hand, if that entry is just the warning that shows up at the bottom of the ledger, it is not really an entry - it is just a notice that will change when you do the next OFX import.
I can confirm this observation too. I see a red notice at the bottom of the ledger showing the balance as of the "future" date well past the last transaction. It would be nice to adjust the date on that red, indelible 'transaction' in the ledger. Currently, the date shown is that for the last imported transaction even though the DTASOF field shows the 'future' date. My model for using kmymoney is to import all transactions for the previous month on the first weekend of the current month. Hence there will be a few days in the current month in which there have been account transactions, and hence the latest balance in the OFX download will most likely be different from the balance at the end of the imported transactions. The reported usage, above, seems to be following a similar approach, ending with a transaction well in the past, to align to some particular interval. To have this red, indelible transaction with the wrong date catch my eye in the ledger view is quite distracting.
Created attachment 85137 [details] Screenshot showing the OFX import bug in ledger view
Created attachment 85138 [details] OFX file to reproduce the error Create an account with opening balance $5857.66 as of 01 Jan 2014 Import this OFX file See the last, red, indelible ledger entry with wrong statement balance DATE
Created attachment 85139 [details] Screenshot showing the OFX import bug in ledger view Effect of the OFX attachment, when imported.
I confirm this.
This is actually a bug in libOFX since ofxdump produces this result: ofx_proc_statement(): Currency: USD Account ID: 000000000 3243783275 Start date of this statement: Wed Jan 1 08:00:00 2014 EET End date of this statement: Fri Jan 31 07:00:00 2014 EET Ledger balance: 8697.95 Available balance: 8697.95 It's even stranger that libOFX has the following field 'ledger_balance_date' but it's never set so KMyMoney can't detect that the balance date is different from the last transaction date. Need to notify upstream about this.
Ok, I just fixed ledger_balance_date and available_balance_date in libofx 0.9.10. Assuming kmymoney actually uses it, it should fix part of the bug. Howewer, kmymoney should make some changes to never assume the balance at some specific date unless the date is available. 1) If the date isn't available for some reason, the meaning of the balance is too ambiguous to use for accounting purposes. 2) Will avoid using the balance until 0.9.10 percolates to end user machines, which may take a year or two.
(In reply to Benoit Grégoire from comment #8) > Ok, I just fixed ledger_balance_date and available_balance_date in libofx > 0.9.10. Assuming kmymoney actually uses it, it should fix part of the bug. > > Howewer, kmymoney should make some changes to never assume the balance at > some specific date unless the date is available. 1) If the date isn't > available for some reason, the meaning of the balance is too ambiguous to > use for accounting purposes. 2) Will avoid using the balance until 0.9.10 > percolates to end user machines, which may take a year or two. Thanks Benoit for fixing libofx and for the suggestions for how should KMyMoney handle this. I'll take a look at it and see what we can do.
I would like to be able to fix this until 4.7.0 is released.
Issue is still present in 4.8.0
Git commit 67d663f4ea27320d73cc72c9c6743316fb12986b by Ralf Habacker. Committed on 01/08/2017 at 22:19. Pushed by habacker into branch '4.8'. Fix 'OFX import Online Statement Balance error' Set closing balance and end date of MyMoneyStatement from ledger_balance and ledger_balance_date only if both are present to follow libofx maintainer hint mentioned in the related bug. FIXED-IN:4.8.1 M +4 -1 kmymoney/plugins/ofximport/ofximporterplugin.cpp https://commits.kde.org/kmymoney/67d663f4ea27320d73cc72c9c6743316fb12986b
Created attachment 107054 [details] kmymoney test file How to use: 1. Open this file 2. import the ofx file