Bug 498703 - Kmymoney crashes when posting NEW stock purchases if the transaction-date pre-dates the stock's creation date.
Summary: Kmymoney crashes when posting NEW stock purchases if the transaction-date pre...
Status: RESOLVED WORKSFORME
Alias: None
Product: kmymoney
Classification: Applications
Component: general (show other bugs)
Version: 5.1.3
Platform: openSUSE Linux
: NOR crash
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-01-15 19:16 UTC by JAH
Modified: 2025-02-17 03:46 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 JAH 2025-01-15 19:16:36 UTC
This is a revival of bug 418479 which appeared to be resolved in  kmymoney-5.1-291-linux-64-gcc.AppImage but has reappeared for me in 5.1.3_fa1eab719

SUMMARY
It is not unusual to post a transaction to Kmymoney some days after the physical transaction occurred (i.e on a prior date).
The creation date for NEW securities (kmmAccounts.openingDate) is set automatically to the system date and cannot be changed by the user.
When the user subsequently posts the purchase transaction with a date earlier than the stock's creation date, Kmymoney crashes gracelessly.
In my case this was for  security denominated in a new foreign currency (DKK)  but the previous bug applied to base currency securities as well.

I have tried creating a price for the security on the transaction date - BEFORE posting the transaction but  without success

Only manually amending kmmAccounts.openingDate in the database resolves the crash.

Perhaps it would be possible to add an amendable "creation date" field the Add New Security dialog so users can amend the date?



STEPS TO REPRODUCE
1. Create a new security 
2. Post a purchase transaction with a date prior to today's date

OBSERVED RESULT
 User can go as far as posting all the transaction fields required including forex rates  but as soon as you commit the transaction, kmymoney crashes.

EXPECTED RESULT
Either the system should not take exception to transaction date prior to the security creation date
or
the user should be able to set the security creation date

SOFTWARE/OS VERSIONS
Linux/KDE Plasma:  opensuse 15.5
KDE Plasma Version: 5.27.9 
KDE Frameworks Version:  5.103.0
Qt Version: 5.15.8

ADDITIONAL INFORMATION
Comment 1 Thomas Baumgart 2025-01-17 17:55:21 UTC
I am not sure if this will work on 5.1.3 but it does on master.

a) Make sure "Show equity accounts" in the General/Filter settings tab is checked
b) Select the accounts view. The investment account should now show its children
c) Edit the stock child account to modify the opening date

Please report back if that does work for you.
Comment 2 JAH 2025-01-18 13:19:11 UTC
Resolved: Yes indeed it does work in 5.1.3!  My fault. I only ever think of editing investments through the Securities 'Edit investment' dialogue box  not as Accounts in their own right. Thanks very much for pointing out the solution.
Comment 3 Bug Janitor Service 2025-02-02 03:47:07 UTC
🐛🧹 ⚠️ This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information, then set the bug status to REPORTED. If there is no change for at least 30 days, it will be automatically closed as RESOLVED WORKSFORME.

For more information about our bug triaging procedures, please read https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging.

Thank you for helping us make KDE software even better for everyone!
Comment 4 Bug Janitor Service 2025-02-17 03:46:18 UTC
🐛🧹 This bug has been in NEEDSINFO status with no change for at least 30 days. Closing as RESOLVED WORKSFORME.