[Kmymoney-devel] Questions about KMyMoney

Thomas Baumgart thb at net-bembel.de
Thu Apr 19 13:08:15 UTC 2012


On Wednesday 18 April 2012 19:02:03 Marek Laane wrote:
> >   2: There was a bunch of strings "shares set to value in split of
> >   
> >>> transaction" or "value set to shares in split of transaction" and so
> >>> on. What does that exactly mean? What is set to what? Share isn't
> >>> here like stock but rather like a part, is it?
> >>> 
> >>> 
> >>> 
> >>> It looks like these are all within the consistency check.  There are
> >>> comments in the code referring to currency, so this may refer to
> >>> cases
> >>> where there is a currency conversion, and the two values should be
> >>> the same if they are in the same currency.  I know that doesn't
> >>> really help with the definition - but I think the "value" is the
> >>> value of that split of the transaction, and "shares" is either
> >>> really a number of shares of an investment, or else just the value
> >>> on the other side of the currency conversion.  I would have to
> >>> understand the code better to be sure.>> 
> >> So you think "shares" are real shares as stock? Not shares as part of
> >> something? It was my first reaction, too, but the syntax made me
> >> doubt...> 

> > I am not completely certain, but it is part of an error message during
> > the consistency check, so it would still lead the user to look to the
> > correct transaction for the problem.
> 
> OK, let's wait to step forward somebody with deep knowledge :-)

Sounds like you're calling me ;)

Since we support multi-currency we have two numbers for each split in a 
transaction: the number of 'shares' and it's value. They are related such:

   value = price * shares

The number of shares is always kept in the currency of the account this split 
references whereas the value is always kept in the currency assigned to the 
transaction. So in case the currency for account and transaction are 
identical, 'value' and 'share' are identical since the price is 1.

The messages you translate are caused by a consistency check. The comment 
says:

      // make sure, that shares and value have the same number if they
      // represent the same currency.

In case the sum of all values of all splits in a transaction is zero (the 
transaction is balanced) the amount of shares is adjusted, if it is not, the 
value is adjusted.

A second instance of those messages pop up where they deal with scheduled 
transactions.

They should not pop up nowadays anymore since the application does not create 
'invalid' splits anymore. They could still arise when you import from other 
sources though.

I hope that gives enough information for you to continue your very welcome and 
appreciated work.

-- 

Regards

Thomas Baumgart

GPG-FP: E55E D592 F45F 116B 8429   4F99 9C59 DB40 B75D D3BA
-------------------------------------------------------------
On Windoze it helps to reboot, on UNIX it helps to be root!
-------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 225 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kmymoney-devel/attachments/20120419/94f80692/attachment.sig>


More information about the KMyMoney-devel mailing list