Bug 443728 - Ledger selection list for Investment Account includes zero balance stocks
Summary: Ledger selection list for Investment Account includes zero balance stocks
Status: REPORTED
Alias: None
Product: kmymoney
Classification: Applications
Component: ux-ui (show other bugs)
Version: 5.1.0
Platform: Microsoft Windows Microsoft Windows
: NOR minor
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-10-14 16:05 UTC by Glenn
Modified: 2021-10-16 10:51 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Glenn 2021-10-14 16:05:29 UTC
SUMMARY
In the Ledgers tab, the Ledger selection list for Investment accounts lists the stocks in the account (why???). For one account, which is a sub-account of Assets, only the stocks with non-zero number of shares are listed. For another account, which is a sub-account of IRA under Assets, ALL stocks are listed, even those which have been sold so the number of shares is zero. 

STEPS TO REPRODUCE
Not sure. try this.
1. Create a sub-account IRA under Assets.
2. Create an Investment account under IRA.
3. Add some stocks to the account, and Sell or Remove so at least one has zero shares.

OBSERVED RESULT
Ledger selection list for the Investment account lists ALL stocks, even those with zero shares.

EXPECTED RESULT
Only stocks with non-zero shares are listed.
OR, do not list the stocks at all.
Account name is sufficient, without all its holdings.

SOFTWARE/OS VERSIONS
Windows: 10
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Thomas Baumgart 2021-10-16 10:44:09 UTC
Git commit 4cea5503a721d761734c32826465b438f3422f3b by Thomas Baumgart.
Committed on 16/10/2021 at 10:19.
Pushed by tbaumgart into branch 'master'.

Implement option to hide zero balance equity and investment accounts

M  +1    -0    kmymoney/converter/mymoneystatementreader.cpp
M  +1    -0    kmymoney/dialogs/knewaccountdlg.cpp
M  +32   -0    kmymoney/models/accountsproxymodel.cpp
M  +3    -0    kmymoney/models/accountsproxymodel.h
M  +10   -8    kmymoney/models/accountsproxymodel_p.h
M  +1    -0    kmymoney/views/kaccountsview.cpp
M  +1    -0    kmymoney/views/kcategoriesview.cpp
M  +1    -0    kmymoney/views/kinvestmentview_p.h
M  +1    -0    kmymoney/views/kpayeesview_p.h
M  +1    -0    kmymoney/views/newspliteditor.cpp
M  +1    -0    kmymoney/views/newtransactioneditor.cpp
M  +3    -1    kmymoney/views/simpleledgerview.cpp
M  +1    -0    kmymoney/wizards/newaccountwizard/khierarchypage.cpp

https://invent.kde.org/office/kmymoney/commit/4cea5503a721d761734c32826465b438f3422f3b
Comment 2 Thomas Baumgart 2021-10-16 10:51:28 UTC
Fixing this in the 5.1 branch requires more work, as the option currently is only evaluated once at application start and the logic differs very much from the master version.