extensions for handling capital gains

Jonathan Mark jhmark at xenops.com
Fri Sep 25 19:14:20 EDT 2009


hi all...
I am new to GnuCash, and am hoping to switch to GnuCash for managing 
investment portfolios for an organization.  Accurate lot allocation and 
capital gains tax reporting (for the USA) is required.
Fortunately FIFO lot allocation is sufficient for now.

I think I will need to write a couple of extensions (or separate 
programs) to meet the requirements.
Before I start working on these in Guile or Python, I would appreciate 
any comments, or opinions about whether any of this is a good idea!

(1) New way of representing stock splits

I would like to handle a stock split by retroactively modifying all 
transactions on the stock, to reflect the post/split quantity and price.
This seems a simple process which is preferable to the current method 
for two reasons:
   a. It interacts correctly with lot allocation.
   b. It is easier to analyze investment performance if all the prices
      are on the same scale.

(2) Capital Gains calculation

To calculate capital gains, I would first run the existing Scrub 
function for all accounts.
I would then run a separate program which looks at the "Realized 
Gain/Loss" transactions created by the scrub, and enters new splits to 
assign the income to the correct accounts, by looking at the lots and 
applying some specific tax policy.
Typical accounts might be:
	Stocks:RHAT:Realized Gain Long Term
	Stocks:RHAT:Realized Gain Short Term
	Stocks:RHAT:Realized Gain Untaxed
(Broker commissions become income from "Realized Gain Untaxed" because 
they are deducted from taxable gains.)

A note on corporate spinoffs:
The "tax-scrubber" could also handle untaxable stock distributions using 
an additional account:
	Stocks:RHAT:Unrealized Gain Adjustment
When RHAT spins off 20 shares of AAA (with a letter saying to transfer 
19.4% of the cost basis from RHAT to AAA), the purchase of AAA could be 
paid for by transferring AAA's cost basis from the RHAT:Unrealized Gain 
Adjustment account.
The tax scrubber would take this as a signal to adjust the cost basis of 
certain lots of RHAT, and also to consider AAA's purchase date to be the 
original RHAT purchase date for tax purposes.

The "Unrealized Gain Adjustment" would become 0 once either all the RHAT 
is sold or all the AAA.

thanks for any comments!

best,

	Jonathan


More information about the gnucash-devel mailing list