Lots in Account screen : Value sign
Geert Janssens
geert.gnucash at kobaltwit.be
Tue Aug 23 11:51:30 EDT 2016
On Thursday 18 August 2016 10:31:54 Chris Good wrote:
> Hi,
>
>
>
> I'm documenting using lots to calculate investments capital gains.
>
>
>
> Please see the attached screenshot.
>
>
>
> The sign of the Value in the 'Splits free' panel seems inconsistent.
>
> Why is the sign of the initial acquisition +ve, but -ve for the
> following 2 reinvested dividends?
>
> The program contains the following:
>
> gnucash/src/gnome/dialog-lot-viewer.c line 523:
>
>
>
> /* Value. Invert the sign on the first, opening entry. */
>
> currency = xaccTransGetCurrency (trans);
>
> valu = xaccSplitGetValue (split);
>
> if (node != split_list)
>
> {
>
> valu = gnc_numeric_neg (valu);
>
> }
>
>
>
> I'd like to explain why this is done?
>
> Perhaps something to do with the Business scrubbing?
>
>
>
> Regards,
>
> Chris Good
Hi Chris,
I can only speak about the business features. I have 0 experience with
investments capital gains.
>From that business perspective, I believe you have found a bug in the
code. It seemed to have slipped by when I merged a patch in 2011 which
introduces the pane with unassigned splits.
The code that inverts the first split was originally introduced by Linas
in 2003 (in commit https://github.com/Gnucash/gnucash/commit/1a997993 )
for the other pane, the one displaying the splits *in* a selected lot. I
don't know why he introduced this behavior. There is no additional
explanation with the commit.
It was later reused for displaying splits in the free splits pane.
However I don't think it makes sense there to revert the first free
split. That's just some arbitrary split. So I believe that's wrong.
And to be honest, I don't understand the motivation either to revert the
sign on the first split in the lots either. For the current (business)
code the result is rather arbitrary. Sometimes the first split is a
payment, sometimes it's an invoice. Whichever is first gets its value
reversed. So sometimes all values are negative, sometimes they're all
positive. And the amounts alter negative/positive to properly balance
the lot.
So from a business perspective, this implementation doesn't make sense
at all. I don't know whether it does for capital gains in lots. Perhaps
someone else knows ?
Geert
More information about the gnucash-devel
mailing list