[kmymoney] [Bug 394124] Investment Sell activity is automatically set to Buy when Total ammount is rounded to zero

Ralf Habacker bugzilla_noreply at kde.org
Mon May 14 10:46:00 UTC 2018


https://bugs.kde.org/show_bug.cgi?id=394124

--- Comment #4 from Ralf Habacker <ralf.habacker at freenet.de> ---
An investment related split uses 'action="Buy"' in the saved file and uses the
sign to indicate a sell.

buy:

    <SPLIT payee="" reconcileflag="0" shares="1/1" reconciledate=""
action="Buy" bankid="" account="A000002" number="" value="1/1" memo=""
id="S0002"/>

sell: 
    <SPLIT payee="" reconcileflag="0" shares="-1/1" reconciledate=""
action="Buy" bankid="" account="A000002" number="" value="-1/1" memo=""
id="S0002"/>

This could be changed into 

sell: 
    <SPLIT payee="" reconcileflag="0" shares="1/1" reconciledate=""
action="Sell" bankid="" account="A000002" number="" value="1/1" memo=""
id="S0002"/>

to give the transaction type a higher priority.

> a cash/checking account transaction of $0 always ends up labeled as a deposit 

This is a different case and need to be fixed seperatly, because the action
attribute is currently only used for investment transactions. All other
transaction types detect whether the transaction is a deposit or a withdrawal
from the sign:

deposit: 
  <TRANSACTION postdate="2018-05-14" commodity="EUR" memo=""
id="T000000000000000002" entrydate="2018-05-14">
   <SPLITS>
    <SPLIT payee="" reconcileflag="0" shares="1/1" reconciledate="" action=""
bankid="" account="A000001" number="" value="1/1" memo="" id="S0001"/>
    <SPLIT payee="" reconcileflag="0" shares="-1/1" reconciledate="" action=""
bankid="" account="A000002" number="" value="-1/1" memo="" id="S0002"/>
   </SPLITS>
  </TRANSACTION>

withdrawal:
  <TRANSACTION postdate="2018-05-14" commodity="EUR" memo=""
id="T000000000000000003" entrydate="2018-05-14">
   <SPLITS>
    <SPLIT payee="" reconcileflag="0" shares="-1/1" reconciledate="" action=""
bankid="" account="A000001" number="" value="-1/1" memo="" id="S0001"/>
    <SPLIT payee="" reconcileflag="0" shares="1/1" reconciledate="" action=""
bankid="" account="A000002" number="" value="1/1" memo="" id="S0002"/>
   </SPLITS>
  </TRANSACTION>

To fix this, an action needs to saved into and loaded from the file. In
mymoneysplit.h there are already related constants defined 

  static const char ActionDeposit[];
  static const char ActionTransfer[];
  static const char ActionWithdrawal[];

and are already used for in the gnu cash reader and in
KMyMoneyView::fixTransactions_0(), called from
KMyMoneyView::initializeStorage().

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the KMyMoney-devel mailing list