Another Advanced Portfoio update

Mike Alexander mta at umich.edu
Mon Mar 24 19:12:16 EDT 2014


--On March 23, 2014 10:32:46 PM -0400 Gregory Gincley 
<rollenwiese at fastmail.net> wrote:

> Hey there, it's very possible I'm misunderstanding the definition or
> purpose of the cost basis calculation in this report, but I'm not
> understanding how it's arriving at the value it does for the small set
> of transactions below.
>
> Using Gnucash 2.6.2
>
> Given the report options:
>
> Effective Date: 10/6/2011
> Price Source: Nearest in Time (Transaction preference, using the price
> list has the same result)
> Basis Calculation Method: FIFO
>
> Transactions:
>
> Buy:  07/29/11 110.65 at 36.15   $4000
> Buy:  08/12/11 47.259 at 31.74   $1500
> Sell: 10/04/11 -0.165 at 29.697  $4.90
> Sell: 10/04/11 -0.661 at 29.6823 $19.62
>
>
> The Advanced Portfolio report shows a basis of $5473.06
> I guess I'm expecting it to show $5470.14 instead.
>
> ((110.65-(0.165+0.661))*36.15)+1500
>
>
> There are transaction prior to this date, but 7/29/11 is the first
> transaction after a zero balance.
>
> Again maybe I'm going about my calculation incorrectly? Any insight
> would be appreciated - Thanks,

I just pushed a change that should fix this.  Thanks for reporting it. 
The basis calculation code didn't work right if there were two or more 
lots and a sale involved a partial lot that was not the last (FIFO) or 
first (LIFO) lot.  I honestly don't know how this had been missed 
before, but I added it to me test data so it hopefully will stay fixed.

          Mike
 


More information about the gnucash-user mailing list