Bug 343878 - investment account does not have key value pair for lastImportedTransactionDate
Summary: investment account does not have key value pair for lastImportedTransactionDate
Status: RESOLVED FIXED
Alias: None
Product: kmymoney
Classification: Applications
Component: general (show other bugs)
Version: git (master)
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-06 22:49 UTC by Jack
Modified: 2018-09-03 06:18 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 5.0.2


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jack 2015-02-06 22:49:12 UTC
Looking in the .kmy file at all accoutns for which I use OFX direct connect (libofx) all have ONLINEBANKING sections.  However, in the keyvaluepairs, only credit card and bank accounts have a value for the key lastImportedTransactionDate.  
The problem this causes is that if you configure the online settings for the account to use Date of last update, KMM can't find that date, and so uses current date minus 60 days instead, which can lead to very unexpected results, such as re-downloading transactions you have intentionally deleted.  (In my case, all the investment accounts are with Merrill Lynch, but I do not believe this is relevant.)

Reproducible: Always

Steps to Reproduce:
1. Add an investment account and map it to an online account for direct connect OFX download.
2. Edit the account, and set Online settings/Import Details to use last update.
3. create an empty file ofxlog.txt in your home directory
4. Update the account.  (I don't know what it uses for the initial update, but it shouldn't matter.)
5. Update the account again.

Actual Results:  
Check the ofxlog.txt for the requested start date of transactions to download.  After the first download, it should be some long ago date, but doesn't matter.  After the second download, the requested start date is 60 days ago.

Expected Results:  
After the second download, the requested start date should be today.  (It could possible be a few days earlier, according to a note on the developers mailing list, to account for transactions added "late" by the institution.  However, it should be recent, not 60 days ago.

Normally, this wouldn't matter, as old transactions would be recognized as duplicates, so it would just be downloading extra bits.  However, because Merril Lynch does funny things, I sometimes find it easier to create new transactions and delete the downloaded ones instead of modifying the downloaded transaction.  In this case, all these deleted transaction keep coming back.
Comment 1 Jack 2018-08-01 18:52:55 UTC
I have recently noticed another side effect of this issue: for investment accounts, I can not find any way to know when the last online update was done.  On the Edit Account Dialog, Online Setting tab, Import Details subtab, if Last update is ticked, the actual date of last update is shown, but not for Investment Accounts.  I believe that this is because for Investment Accounts, the date of last update is not stored anywhere.
Comment 2 Thomas Baumgart 2018-08-24 16:10:29 UTC
Git commit 3e95b8c4ec4b640c83ce36d0623f1bdc8ca2d136 by Thomas Baumgart.
Committed on 24/08/2018 at 16:09.
Pushed by tbaumgart into branch 'master'.

Store date independant from statement balance

Store the date of the last imported independant of a changed statement
balance.
FIXED-IN: 5.0.2

M  +3    -3    kmymoney/converter/mymoneystatementreader.cpp

https://commits.kde.org/kmymoney/3e95b8c4ec4b640c83ce36d0623f1bdc8ca2d136
Comment 3 Thomas Baumgart 2018-09-03 06:18:00 UTC
Git commit 86b53d2b398725883366680c454dec20bcdbbdee by Thomas Baumgart.
Committed on 03/09/2018 at 06:18.
Pushed by tbaumgart into branch '5.0'.

Work-around for missing statement end date

This change amends commit 3e95b8c4ec4b6. Some XML elements of an OFX
file/download are not processed by LibOFX. Among them is the statement
date information for investment statements.

This adds a work-around which uses the post date of the youngest
transaction as the statement end date should the real thing be missing.
FIXED-IN: 5.0.2

M  +4    -3    kmymoney/converter/mymoneystatementreader.cpp
M  +15   -1    kmymoney/mymoney/mymoneystatement.cpp
M  +12   -2    kmymoney/mymoney/mymoneystatement.h

https://commits.kde.org/kmymoney/86b53d2b398725883366680c454dec20bcdbbdee