GNOME Bugzilla – Bug 538800
Balance Sheet: Gives wrong results
Last modified: 2018-06-29 22:05:34 UTC
Please describe the problem: When there is a return of capital to a stock account [no shares are traded, but money has been returned that reduces the cost basis of the stock], the balance sheet increases the value of the asset instead of decreasing it. Naturally, Assets, Liabilities, and Equity no longer balance. Steps to reproduce: 1. Create a new sample file from the Wizard, putting a starting balance of $10000 in the Checking Account 2. Create a Stock placeholder and a stock account under it XYZ Corp 3. Debit Checking Acct $100, credit XYZ acct $100 [0 shares] 4. Run Balance Sheet for the appropriate period Actual results: Checking Acct assets 8090 XYZ Corp assets 2110 Unrealized Gains added to Equity for 200 Expected results: Checking Acct assets 8090 XYZ Corp assets 1910 No Unrealized Gains Does this happen every time? Yes Other information: I think similar errors are made when the # of shares change, but this is the simplest way to see the problem in the Balance Sheet
Created attachment 112995 [details] Sample data file that demonstrates the problem Sample data file to demo the bug.
I recently upgraded to 2.2.4 in Ubuntu 8.04. The behavior of the Balance Sheet report is the same.
The effect that you are seeing is due to the price source of the report. Instead of asking GnuCash to figure out a price by the "average price" method, you would need to put the current price of $1.91 in the price editor. Then run the balance sheet with the commodity price source set to "nearest in time". In order to do what you really are asking for here, I think that a new pricing option of "basis" would need to be implemented. Then you wouldn't need to use the price editor. This feature requested has been documented in bug 521403. By the way, the average price is being determined by examining the two exchanges that have been recorded: 1000 @ 2.01 = 2010 0 @ 0 = 100 avg price = (2010 + 100) / (1000 + 0) = 2.11
Your interpretation of my example is incorrect. The 100 is a return of capital and should be used with a minus (-) sign in the calculation. If the calculation were done correctly then the result would probably be OK and the bug would go away. Is there a way to get the formula fixed?
I understand your example, and I agree with you that the weighted average price formula is wrong and should be fixed. Is this all you are asking for? I just want to make clear that this fix would still not be the same as reporting your basis. If you held the same stock in two accounts, the stock in both accounts would be revalued using the same price. The weighted average price is computed once, across all accounts, rather than per account. So neither account would be valued at its basis, except by coincidence.
I am interested in maintaining contact to the basis, but I can get around the problem you raise by making phony symbols for the same stock in different accounts. I don't use price updates anyway. So I think fixing the formula will fix many of the problems I have with the Balance Sheet. Thanks.
A have added a new "Average Cost" price source using the formula we talked about. Committed as r17266. Requesting backport for 2.2.
Backported by cstim in r17266 for GnuCash 2.2.6. Thanks a lot!
I mean r17283, of course :-)
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=538800. Please update any external references or bookmarks.