Bug 329701 - Let user specify the name of the brokerage account for an investment account
Summary: Let user specify the name of the brokerage account for an investment account
Status: REPORTED
Alias: None
Product: kmymoney
Classification: Applications
Component: general (show other bugs)
Version: git (master)
Platform: Compiled Sources Linux
: NOR wishlist
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-07 22:21 UTC by Jack
Modified: 2022-08-29 00:14 UTC (History)
1 user (show)

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 Jack 2014-01-07 22:21:57 UTC
When creating an investment account, KMM currently offers to create the associated investment account, which is given the same name as the investment account, followed by ' (brokerage)'.  If the user accepts that name, then it will be used as the default brokerage account in the appropriate investment transactions.  However, if you change the name, or want to specify another already existing account (such as checking) as the brokerage account, KMM does not remember it, and you have to explicitly specify it every time it is needed.  

I would prefer that KMM actually remember the name of the brokerage account as part of the investment account configuration.

For example, I would prefer to use "Merrill Lynch - invest" and "Merrill Lynch - brokerage" instead of "Merrill Lynch" and "Merrill Lynch (brokerage)" as names for the pair of accounts.
Comment 1 allan 2014-01-08 12:32:47 UTC
I suspect it's possible to do something like this, except it doesn't seem to work at the moment.

This code appears in mymoneystatementreader.cpp -
"// determine the brokerage account
    brokerageactid = m_account.value("kmm-brokerage-account").toUtf8();
    if (brokerageactid.isEmpty()) {
     brokerageactid = file->accountByName(statementTransactionUnderImport.m_strBrokerageAccount).id();"
but that key never gets a value set.

There is another, similar
"p.setAttribute("brokerageaccount", (*it_t).m_strBrokerageAccount);",
which ends up in 
"void MyMoneyStatement::writeXMLFile(const MyMoneyStatement& _s, const QString&   _filename)" so that could actually get into your investment account in the .kmy file. 
It then gets loaded at "t.m_strBrokerageAccount = c.attribute("brokerageaccount");" in bool MyMoneyStatement::read(const QDomElement& _e).

It would be interesting to know if the string "brokerageaccount" does actually appear in your file, and what its value is.
Also, if you could try git sometime to see if your transactions do get their asset-account.

As far as I've found, the string m_strBrokerageAccount only gets set as above, and in the QIF and CSV importers.

This is a very quick analysis, so there could be holes.
Comment 2 Jack 2022-08-29 00:14:30 UTC
Updating relevant version.  
I also point out that this change may or may not include the ability for one Checking account to be the designated brokerage account for more than one Investment account.  (This is actually the case for my Vanguard accounts.)  I am not certain what should happen with any action in a Brokerage account which refers to the related Investment account - some means of letting the user choose would be necessary, or possibly default to the first Investment account for which that relationship was established.