Stock sale leads to Balance Sheet imbalance ?

Jim Bowen jim_bowen@alum.mit.edu
03 Mar 2002 16:30:04 -0800


Hi all!

I've come up with a problem that I cannot solve and don't know if it is
an error in how I've setup my accounts/transactions or if it is a bug in
the balance sheet report. (BTW - gnucash 1.6.5 running on debian i386 for
what it is worth)

Here's the situation - if I run a balance sheet report for the day prior
to a sale of stock, everything appears OK as Assets = Liabilities +
Equity. However, after the stock sale there is an imbalance of $1649..

Here are some details (w/ munged numbers for simplicity):

PRIOR to stock sale:

Assets
  Investments
     Cash Fund         ($373) (1)
     ABC Stock         $1010  (2) 
-----------------------------
TOTAL ASSETS            $637

Liabilities               $0
Unrealized Gain/Loss  ($2772) (3) 

Equity
  Carryover Balance    $3409  (4)
  Net Profit               0  (3)
-----------------------------
TOTAL L+E               $637


I then sell the stock (144 of 340 shares @ $3.00) w/ the following
transaction:

ABC Stock                  $432 credit
  Cash Fund      $378 debit
  Commission      $54 debit

I then run the balance sheet report for the day of the transaction (with
it being the only transaction on that day) and get:

Assets
  Investments
     Cash Fund            $6
     ABC Stock          $578 
-----------------------------
TOTAL ASSETS            $584  (5)

Liabilities               $0
Unrealized Gain/Loss  ($1122) (3)

Equity
  Carryover Balance    $3409
  Net Profit            ($54) (3)
-----------------------------
TOTAL L+E              $2233

Assets - L & E = $584 - $2233 = $ 1649 !!

Footnotes:
 (1) Brokerage cash fund is negative due to margin purchase. (Doh!)
 (2) Shares valued at price on day of sale (via nearest day option)
 (3) Calculated by Balance Sheet report.
 (4) Carryover balance represents value at time of purchase for all
shares as well as carryover balance of cash fund.
 (5) This number seems right - there is no loss of assets other than the
fees/commissions, the rest were transferred between two asset accounts.


Any idea of what I am missing or if this is indeed a bug?!?!? It seems
to me like the Net Profit should reflect the realized loss on the sale
but I don't know how to create a transaction that writes to an income
account while transferring the money between the stock and cash fund.

Arrgh!


Jim