[Kmymoney-devel] "kmm-brokerage-account"

Allan agander93 at gmail.com
Wed Dec 18 11:58:18 UTC 2013


Hi Thomas

On 18/12/13 06:34, Thomas Baumgart wrote:
> AFAIR, an older version of KMyMoney allowed to use any name for the brokerage
> account and the mapping to the investment account was done via this KVP entry.
>
> Nowadays, the brokerage account has to have a specific name derived from the
> investment account and this will do the mapping behind the scenes.
>
OK, that's useful to know.
However, for a user coming from Quicken, his file contains no brokerage 
accounts, and he does not deal with a broker as such, but does imports 
from say a provider of unit trusts or stocks, with no money balance in 
this account.

So, when first setting up KMyMoney, his/(my) QIF imports for investments 
contained ["L"] records, and all the history reflects that.  Now, if 
importing via CSV, the user gets asked to input the relevant account to 
receive/provide cash.  If the user does not enter a valid account name, 
then if he has set up a 'xxx (Brokerage)' account, that will be used. 
If he does not have a 'xxx (Brokerage)', the transaction will be 
imported unbalanced and can be edited later.

It seems that with OFX, the 'Brokerage' account will always be used.

> Not knowing out of which context you took that line I cannot comment if
> removing is a good idea. Think about old data files which still contain this
> KVP an rely on it. Not sure if that makes sense, but it just crossed my mind.

As far as I was able to find, that KVP never gets set, so any old file 
probably couldn't make use of the KVP.  In bool 
MyMoneyStatement::read(const QDomElement& _e), QDomDocument* _doc), I 
did find a similar string - "brokerageaccount", I think it was, in the 
code for direct connects, but not in the OFX local file import area, but 
it gets used only in MyMoneyStatement::write(QDomElement& _root, 
QDomDocument* _doc).

The code I mentioned is in 
MyMoneyStatementReader::processTransactionEntry(), starting circa line 559 -

"if (thisaccount.accountType() == MyMoneyAccount::Investment) {
     // determine the brokerage account
     brokerageactid = m_account.value("kmm-brokerage-account").toUtf8();
     if (brokerageactid.isEmpty()) {
       brokerageactid = 
file->accountByName(statementTransactionUnderImport.m_strBrokerageAccount).id();
     }
     if (brokerageactid.isEmpty()) {
       brokerageactid = 
file->nameToAccount(statementTransactionUnderImport.m_strBrokerageAccount);
     }
     if (brokerageactid.isEmpty()) {
        brokerageactid = file->nameToAccount(thisaccount.brokerageName());
      }

The last two instructions come from Chris's recent patch (25 Nov), as 
his OFX imports were incomplete -"The reader trying to create splits 
cannot find the brokerage account for a split using 
statementTransactionUnderImport so all the imported transactions are 
broken."

Allan

> On Monday 09 December 2013 22:35:38 Allan wrote:
>
>> Hi
>>
>> This key is used -
>>     brokerageactid = m_account.value("kmm-brokerage-account").toUtf8()
>> in two places, but, as far as I can see, it never gets set, so the
>> following tests will always fail, or so it seems.  Am I missing something?
>>
>> Should it be set, or should the instruction be removed?
>>
>> Allan
>> _______________________________________________
>> KMyMoney-devel mailing list
>> KMyMoney-devel at kde.org
>> https://mail.kde.org/mailman/listinfo/kmymoney-devel
>>
>>
>> _______________________________________________
>> KMyMoney-devel mailing list
>> KMyMoney-devel at kde.org
>> https://mail.kde.org/mailman/listinfo/kmymoney-devel


More information about the KMyMoney-devel mailing list