Bug 352683 - Transactions in Ledger page not removed when Investment is deleted or closed
Summary: Transactions in Ledger page not removed when Investment is deleted or closed
Status: RESOLVED WORKSFORME
Alias: None
Product: kmymoney
Classification: Applications
Component: general (show other bugs)
Version: 4.8.0
Platform: Mint (Debian based) Linux
: NOR normal
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-14 08:19 UTC by timothy
Modified: 2022-01-03 04:34 UTC (History)
2 users (show)

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


Attachments
Demo kmymoney file (4.59 KB, application/x-kmymoney)
2015-09-21 12:36 UTC, timothy
Details

Note You need to log in before you can comment on or make changes to this bug.
Description timothy 2015-09-14 08:19:19 UTC
This is a mix of a number of problems concerning the closing or deleting of investments. I could submit a bug report for each problem, but as they might be programmatically linked they are collected in this one bug report.

On the Investment Page:
1) The Investment Options drop-down box has options for 'Close Account' and
 'Reopen Account' not 'Close Investment' & 'Reopen Investment'.  I have checked this out and it is indeed a misprint. The  'Close Account'  removes the investment from the investment page and the 'Reopen Account'  brings it back again. The 'Delete Investment' option does not allow  a reopening of the investment.

On Ledger page
2) In both cases of Delete Investment or Close Account, all the investment transactions remain on the Ledger page.

On Investment page:
3) After deletion of an investment it is not possible to create a new investment - the option is greyed out.


Reproducible: Always

Steps to Reproduce:
1. In ledger page click on 'Investments' in the side panel
2. Right click the relevant investment 
3. Select option from the drop-down box

Actual Results:  
1) No option is available for 'Close Investment' except possibly 'Delete Investment'
2) All investments transactions remain on ledger page after closure or deletion
3) After 'Delete Investment' option selected there is no option to create a new investment (greyed)

Expected Results:  
1) The drop-down box should show  'Close Investment' & 'Reopen Investment' not  'Close Account' and 'Reopen Account' .
2) The investment transactions should be removed from the Ledger page.
3) Deleting one investment should not prohibit one from creating a new investment

KMM Version 4.7.90-601bc8c80c

Closure of an Investment should still allow for the investment to feature in reports as the transactions will still be in the data file. Tax reports at the end of the tax year or when required will need to reference relevant transactions even though the investment has been closed.

Reopening the investment should bring back the investment in both the Ledger and Investment pages.

As far as deleting an investment goes, I am not sure how this is done. Presumably all references to that investment are deleted. I do not understand how that can be done without affecting the validity of the overall data.
Comment 1 timothy 2015-09-14 12:23:06 UTC
Something I should have mentioned. This case is an investment account with multiple investments.
Comment 2 Thomas Baumgart 2015-09-14 18:41:02 UTC
Could you add a demo file to this bug report so that we have the same starting point in chasing this issue? Ideally, you can give us detailed instructions on how to reproduce the problem with the values of the demo file (in case the above description does not match). Thank you very much for your support.
Comment 3 timothy 2015-09-15 12:33:01 UTC
I am working on it. I have created a new demo file with a minimum of
transactions. However I am getting different results depending on the
order of activities. 
What complicates matters is the mislabeling of 'accounts' instead of
'investments'. Since I have discovered that the 'Settings/Configure
KMM/Do not show closed accounts' also affects what appears in the
Investment Options drop-down box.
It makes for a confusing report, and in fact all might be cleared up by
correcting the labeling.
Comment 4 timothy 2015-09-21 12:36:50 UTC
Created attachment 94663 [details]
Demo kmymoney file

Introduction
The demo.kmy contains one Investment Account (Inv-ac) with three Investments. These are all Money Market investments with the same stock symbol AAAA (for three children perhaps).

All the shares are removed (transferred out) from one of these investments (Invest-1) to the child's own investment or wherever on 1 September 2015. We wish to close this investment, but keep the transactions until the tax year ends.

Click on Investments in the side panel. Select the account in the "Select Account" drop down box (there is only one). Right click on Tnvest-1 in the Investment page. The "Investment Options" popup box appears. There is however no option to close the investment in the box. There is an option to "Close Account". We do not want to do that, but take a chance and yes, Invest-1 is removed from the list of investments on the Investment page.

A popup information box  gives info on making the investment visible in the views. This information also refers only to "accounts" not investments.

It would seem that the "Close account" and "Reopen account" are mislabeled and should refer to investments.

Click on "Ledgers" in the side panel to return to the ledger page for that account. The transactions for "Invest-1" are still visible in the ledger view. These should be removed from view as per the info box .
Comment 5 timothy 2015-09-22 07:31:42 UTC
This is similar to  [Bug 353002] New: Add ability to hide zero-balance equities on Investments page
Comment 6 Jack 2020-06-14 02:15:49 UTC
I'm confused about the details here.  To the best of my understanding, you can close an investment if there are currently no shares of it held in any investment account.  Closing it prevents creating or editing any transaction referring to that specific investment.  Deleting an investment is only possible if it is not referred to in any transaction, and as it totally deletes the definition of that investment, you clearly cannot buy shares of it after it is deleted (without re-creating it as a new investment.)  Aside from the problem of the program not making it obvious why you cannot close or delete an investment (which should be wishlist enhancements) is there anything else about this which can still be considered a bug, or separate wishlist item?  (I may separately file a new wishlist for more explicit clarification of the difference between securities and equities - one providing a baseline definition of the stock or bond, and the other being an account which holds shares.  (I'm trying hard not to use the specific terms here, hopefully it avoids more confusion instead of adding it.)  Those accounts only occur within Investment accounts, and there can be multiple such accounts for a single underlying stock/bond.)

In terms of the current subject of this bug, the current process is that any transactions referring to a security can block the deletion of that stock.  It doesn't make sense for closing or deleting a security to delete any transactions, since that is altering history.  If you really want to do that, delete the transactions first, then close or delete the security.

I'm not sure if this needs to be converted to (a better specified) wishlist, or closed as either WONTFIX or NOTABUG.
Comment 7 Jack 2021-12-04 01:36:40 UTC
I realize I should have changed the status of this bug when I made my previous comment.  I agree there is an unfortunate terminology in that the individual investments held within an investment account are also referred to as accounts.  Perhaps this terminology will be clarified if/when the whole framework for handling investments gets revisited.  For now however, I ask again whether there is anything here which still seems to be  real bug, or if it can be altered into a more specific wishlist, otherwise I don't see any reason to keep it open.
Comment 8 Bug Janitor Service 2021-12-19 04:35:21 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 9 Bug Janitor Service 2022-01-03 04:34:56 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!