After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 778455 - Security Valuations in Trial Balance Report causes Incorrect Unrealized Gains in Release 2.6.15
Security Valuations in Trial Balance Report causes Incorrect Unrealized Gains...
Status: RESOLVED NOTABUG
Product: GnuCash
Classification: Other
Component: Currency and Commodity
2.6.15
Other Windows
: Normal normal
: ---
Assigned To: gnucash-core-maint
gnucash-core-maint
Depends on:
Blocks:
 
 
Reported: 2017-02-10 15:55 UTC by David Carlson
Modified: 2018-06-29 23:54 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Small Test File for Unrealized Gain Problem (3.08 KB, application/x-gnucash)
2017-02-10 15:55 UTC, David Carlson
Details

Description David Carlson 2017-02-10 15:55:34 UTC
Created attachment 345464 [details]
Small Test File for Unrealized Gain Problem

I am submitting the example file kindly produced by David T in his investigations of the calculations of unrealized gains in Gnucash.  

At this time I have not fully investigated the issue, but this file superficially appears to be fully balanced.  Yet, in release 2.6.11 in Debian Linux the Trial Balance report shows it as being $104.60 out of balance on Feb 5, 2017.  Release 2.6.15 in Windows gives an out of balance of $64.05 on the same date.

I noted that the price database shows three entries.  The entry for the first transaction dated February 3 is shown as February 9 in the price database.

Setting the Trial Balance Report to show the exchange rate provides another clue.

Reviewing the bug history, I found Bug 776517 as well as several other bugs that were all closed having been verified and fixed in the past.

This is just a start for all to use in the investigation.
Comment 1 Chris Good 2017-02-11 08:12:36 UTC
I changed the Trial Balance report option, commodity Report Currency from AUD to USD for my testing as my default currency is AUD.

Unfortunately the supplied test file uses gross pricing (fees & commissions on separate splits) instead of net pricing and we know that currently gross pricing causes Trial Balance (TB) problems. When I changed the transactions to net pricing, the TB balances (Win10 2.6.15).
I tested also in 2.6.14 (rev 5fcdfba 2016-10-24, not released 2.6.14 revision), and, using supplied test file (gross pricing), it shows TB as at 5 Feb 2017, using both Price Sources Nearest in Time and Average Costing, is out by $104.30, not $104.60 as stated in the initial problem description for 2.6.11. David Carlson, could you please confirm that was a typo?

It is interesting that the imbalance is different between 2.6.14 and 2.6.15 but as 2.6.15 seems to be correct (the imbalance is the total of the fees and commissions on 5/2/2017), and we know this is already a known limitation with gross pricing, it would be better to get a problem example using net pricing.

I'll again ask the various people who have reported Trial Balance imbalances, if they can provide example GnuCash data files, using net pricing.
Comment 2 Chris Good 2017-02-11 08:43:11 UTC
From: Chris Good [mailto:chris.good@ozemail.com.au] 
Sent: Saturday, 11 February 2017 7:41 PM
To: 'Richard Lindgren' <rlindgren74@gmail.com>; 'mjchurchil@aol.com' <mjchurchil@aol.com>; 'hppweu@frontier.com' <hppweu@frontier.com>
Cc: 'gnucash-user@gnucash.org' <gnucash-user@gnucash.org>
Subject: RE: Trial Balance Report with Investment Transactions

Hi Richard, Mike (Churchil) + Pam (hppweu),

Bug 778455 https://bugzilla.gnome.org/show_bug.cgi?id=778455 has been raised for the investment Trial Balance problems in 2.6.15.
Unfortunately, we have yet to receive an example GnuCash data file that shows this problem and without it, it is unlikely this problem will be solved.
If you could provide a small test, depersonalised data file, showing the problem, it would be a great help.
If that is too much work, but you would be prepared to share your real data file with just me or one of the developers, please email it directly without copying gnucash-user or share it some other way.

Regards, Chris Good
Comment 3 Chris Good 2017-02-11 23:52:45 UTC
Note that in 2.6.15, calculation of average cost was changed for https://bugzilla.gnome.org/show_bug.cgi?id=775368#c4 and default price source for many reports, including Trial Balance) was changed from Average Cost to Nearest in Time for https://bugzilla.gnome.org/show_bug.cgi?id=340991.

There are 2 issues currently being discussed on gnucash-user:
1) Trial Balance does not cope with gross pricing (enhancement request)
2) Some investment users are reporting that data that balanced in 2.6.14 (or 2.6.11) TB no longer balances in 2.6.15. An example GnuCash data file of this problem would help.
Comment 4 John Ralls 2017-02-13 04:05:53 UTC
This is really simple. You can't both expense and net your commissions, it's counting the same money twice. If you really want to break out the commissions and fees, put the  "expense" accounts under income:capital gains (in the US you'll need to do that twice for short term and long term gains) and adjust the capital gain line so that it comes out to the right amount. It will probably take a bit of practice to get the splits set up the right way.
Comment 5 John Ralls 2018-06-29 23:54:12 UTC
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=778455. Please update any external references or bookmarks.