Patch: Advanced Portfolio report and capital gain

Derek Atkins warlord at MIT.EDU
Fri Nov 14 11:35:39 CST 2003


Hi,

Sorry for taking SO LONG to get to this, but this is now applied and
should be in the 1.8.8 release.

THANK YOU for the patch, and I appologize for sitting on it for so long.

-derek

frankpavageau at wanadoo.fr (Frank Pavageau) writes:

> Hi.
>
> Here is a patch against CVS to correct a problem with the Advanced
> Portfolio report regarding capital gain : when you sell stock and make
> a profit, the documentation [1] says to enter a split transaction like
> this
>
>                       Nb of shares   Share price   Total Buy   Total Sell
> Asset:Bank                                         NET_SALE
> Asset:Stocks:SYMBOL   -NB_SHARES     SELL_PRICE                GROSS_SALE
> Asset:Stocks:SYMBOL                                PROFIT
> Income:Capital Gains                                           PROFIT
> Expenses:Commisions                                COMMISSION
>
> which has the stock asset twice, including one with 0 shares.
>
> Without the patch, the Advanced Portfolio report adds all the values
> regarding the stock asset to the Money Out or Money In sums, depending
> on the direction of the transaction. This means that if you sell all
> your stock shares, you always end up with a gain of 0 (GROSS_SALE -
> PROFIT - GROSS_BUY).
>
> The patch just checks that the number of shares is not 0 before adding
> the value to the Money Out or Money In sum.
>
> BTW, I've checked bugzilla, I don't think there's a bug filed for that
> problem.
>
> Frank
>
> [1] http://www.gnucash.org/docs/v1.8/C/gnucash-guide/invest_sell1.html
> -- 
> Ankh-Morpork had dallied with many forms of government and had ended up
> with that form of democracy known as One Man, One Vote. The Patrician was
> the Man; he had the Vote.
> 	Terry Pratchett, _Mort_
>
> _______________________________________________
> gnucash-patches mailing list
> gnucash-patches at lists.gnucash.org
> https://lists.gnucash.org/mailman/listinfo/gnucash-patches

-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord at MIT.EDU                        PGP key available


More information about the gnucash-patches mailing list