Next [was Re: Stock trades and realized gains/losses]

Glen Ditchfield gjditchfield@acm.org
Sat, 11 Jan 2003 10:03:57 -0600


On January 10, 2003 11:19 pm, Linas Vepstas wrote:
> -- When a lot is closed, we must have the 'double-balance'
>    condition:  The sum total of all 'S' is zero, and the
>         sum total of all 'C' is zero.  Thus, if I buy 100 shares
>         of RHAT for $5 and sell 100 shares of RHAT for $10, then
>         I *must* also add an 'adjusting transaction' for zero
>         shares of RHAT, at $500.  If there is no adjusting transaction,
>         then the lot cannot be closed.  If sum 'S' is zero,
>         while sum 'C' is not zero, then the lot is declared to
>         be 'out-of-balance', and an 'adjusting transaction' must
>         be forced.

Everything I know about this, I learned from reading the GnuCash 1.6 Manual's 
section on capital gains, so this is likely wrong or irrelevant to 1.7, but 
...

Shouldn't the adjusting transaction move money from a realized gain account to 
the ultimate destination account?  I thought stock sales would work like 
this:
- Buy 1 share of RHAT for $5, and record it in the stock account.
- Sell 1 share of RHAT for $9 cash.  The transaction would have splits showing
  * one share of RHAT sold from the stock account for $5 (the purchase price)
  * $4 credited (debited? whichever) from a realized gain account
  * $9 deposited in the "cash" account.

All transactions involving a lot would use the same price.  The GUI should 
support sales by having the user pick a realized gain account, and by 
automatically subtracting the purchase price from the sale price.