Bug 510022

Summary: MS Money import: Dividends cause Unit Value = 0
Product: [Applications] skrooge Reporter: A D <kdebugs5828>
Component: generalAssignee: Stephane MANKOWSKI <stephane>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version First Reported In: Trunk from git   
Target Milestone: 25.1.0   
Platform: Compiled Sources   
OS: Microsoft Windows   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Unit values screenshot
json extracts from sunriise showing dividend transaction
zip containing MS Money file

Description A D 2025-09-28 12:11:57 UTC
Created attachment 185338 [details]
Unit values screenshot

SUMMARY
The fix for Bug 507235 has improved the import of investment transactions from MS Money (😀👍). Sensible Unit values come from buy and sell transactions (which is good), but dividend transactions have null quantity and price values, which results in zero values being entered for the Unit. It would be better to not add a Unit value when the price is zero/null.

STEPS TO REPRODUCE
1. Import MS Money .mny file containing dividend transactions
2. Go to the Unit page

OBSERVED RESULT
There are zero values for units resulting in a graph line with many dips to zero - see attached screenshot

EXPECTED RESULT
Just "sensible" unit values and a resulting graph line that doesn't drop to zero

SOFTWARE/OS VERSIONS:
built from source ff229aff81b122447689677920a8a688a12b1c45

ADDITIONAL INFORMATION
I will attach json extract from sunriise showing a dividend transaction.

Let me know if a .mny file is needed for testing and I will create one.
Comment 1 A D 2025-09-28 12:14:15 UTC
Created attachment 185339 [details]
json extracts from sunriise showing dividend transaction
Comment 2 Stephane MANKOWSKI 2025-09-28 13:13:05 UTC
Hi,

Yes could you provide a .mny file, this is easier for testing and I will be able to create a automatic unit test too.
Comment 3 A D 2025-09-28 13:52:32 UTC
Created attachment 185342 [details]
zip containing MS Money file

MS Money file contains investment account (investments and cash) with transactions:
Deposit £100 in to cash account
Buy 10 shares @ £5
Dividend paid (10 x £1)
Sell 10 Shares @ £6
Comment 4 Stephane MANKOWSKI 2025-09-28 17:09:50 UTC
Git commit 5baf314639a2c54eca55ded0843f35114429e7a1 by Stéphane MANKOWSKI.
Committed on 28/09/2025 at 17:09.
Pushed by smankowski into branch 'master'.

510022: MS Money import: Dividends cause Unit Value = 0

M  +1    -0    CHANGELOG
M  +7    -5    plugins/import/skrooge_import_mny/skgimportpluginmny.cpp
A  +-    --    tests/input/skgtestimportmny3/510022.mny
M  +19   -0    tests/skgbankmodelertest/skgtestimportmny3.cpp

https://invent.kde.org/office/skrooge/-/commit/5baf314639a2c54eca55ded0843f35114429e7a1