Bug 467081 - importing transactions prior to account opening date cannot be edited
Summary: importing transactions prior to account opening date cannot be edited
Status: REPORTED
Alias: None
Product: kmymoney
Classification: Applications
Component: importer (show other bugs)
Version: git (master)
Platform: Other All
: NOR minor
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-08 22:21 UTC by Jack
Modified: 2023-03-11 07:50 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jack 2023-03-08 22:21:44 UTC
(Tested with csv importer, but probably affects all importers.)  
If you import a transaction prior to the opening date of the account, when you edit that transaction, the "Enter"  button is disabled, so you cannot make (actually cannot save) any changes.  It's probably not a good idea to actually block such transactions being imported, but it would probably be worth having the importer pop up a warning message (only once per import) saying something like "You have imported one or more transactions prior to the opening date of the account.  You will not be able to save any changes to these transactions without changing either the date of the transaction or the opening date of the account."
Comment 1 Thomas Baumgart 2023-03-09 11:34:19 UTC
Or we could simply adjust the opening date in that case. But what about a possible opening balance transaction? Maybe a warning about it is better.
Comment 2 Jack 2023-03-10 23:26:42 UTC
The warning is the easiest, most general response.  Investment accounts can't have an opening balalnce, so just adjusting the opening date would be safe.  We could also test whether there is an opening balance transaction and only adjust the date if there is not one, but that's all just extra complication compared to a warning.  However, I suppose the warning should include mention of moving (and possibly adjusting) any opening balance transaction if there is one.
I'll be glad to look into the code if you can point me at where to start.  I'm hoping there is one place to do this, rather than independently for each type of import.
Comment 3 Thomas Baumgart 2023-03-11 07:50:06 UTC
The opening balance (in case it exists) is updated when you change the opening date in the account editor. The account opening date is also updated in case you change the post date of the opening balance transaction using the UI, AFAIR.

The MyMoneyStatementReader is the object that processes all imported data.