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 454305 - Trial Balance Report: Wrong after negative Stock Split
Trial Balance Report: Wrong after negative Stock Split
Status: VERIFIED FIXED
Product: GnuCash
Classification: Other
Component: Reports
2.1.x
Other All
: Normal minor
: ---
Assigned To: Charles Day
Chris Lyttle
Depends on:
Blocks: backport
 
 
Reported: 2007-07-06 15:32 UTC by Fred Bone
Modified: 2018-06-29 21:41 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Sample file showing the problem (38.31 KB, application/octet-stream)
2007-07-06 15:37 UTC, Fred Bone
Details

Description Fred Bone 2007-07-06 15:32:04 UTC
Please describe the problem:
After a stock consolidation (negative split), the value of the stock is shown incorrectly in Trial Balance; the difference between correct and displayed value carries through to the total line, resulting in an apparent failure to balance.

Steps to reproduce:
1. Create a new file including the "Investment Accounts" group
2. Create a suitable stock account
3. enter a transaction to purchase, say, 500 at 4 each, total 2000
4. Use the Stock Split Wizard to enter a negative split: say, -200, with no cash amount involved. This changes the number of shares held but should not change the total value
5. Invoke a Trial balance report


Actual results:
Trial Balance report shows value of 857.14 (should be 2000) against the stock; 2000 against whichever account the purchase came from; and these respective amounts in Debit and Credit column totals, for an imbalance of 1142.86.

Expected results:
Correct amount of 2000 showing against the stock and in the debit column total.

Does this happen every time?
Yes, provided only that the split is negative.

Other information:
Playing with the figures shows that the report is apparently trying to calculate a weighted average of the prices in order to revalue the residual stock, but is always adding the number of shares involved in the split (i.e. taking the absolute value). A positive number (i.e. a distribution rather than a consolidation) gives the expected result.

Correct calculation:
     500 at 4 = 2000
less 200 at 0 =    0
   = 300    for 2000 = 6.6667 each
Trial Balance: 300 at 6.6667 = 2000

Calculation apparently used:
     500 at 4 = 2000
plus 200 at 0 =    0
   = 700    for 2000 = 2.85714 each
Trial Balance: 300 at 2.85 = 857.14
Comment 1 Fred Bone 2007-07-06 15:37:48 UTC
Created attachment 91305 [details]
Sample file showing the problem

Uncompressed GnuCash XML file constructed as per description; contains exactly two transactions.
Comment 2 Charles Day 2008-07-16 16:03:13 UTC
Fix committed in r17339. Requesting backport for 2.2.
Comment 3 Andreas Köhler 2008-07-22 23:00:02 UTC
Applied to branches/2.2 as r17389 for inclusion in GnuCash 2.2.6.
Thanks!
Comment 4 John Ralls 2018-06-29 21:41:56 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=454305. Please update any external references or bookmarks.