On Tue, Nov 27, 2007 at 12:03:58AM -0500, Morrison J. Chang wrote: > Andrew,
Hi, saw your question on irc, but you were gone. > > I noticed that you were working on the advanced portfolio report. > I've also been working on it (on and off) and I think I've fixed the > basis and splits issue. I'm curious to see what you did. I've also finished that part of the report... heh heh. In a nutshell: I've kept track of which splits have already been taken care of in a list and then only used a split in the basis calculation if we haven't seen it before. For the splits/mergers, I just run through the basis-list and total up the number of shares, work out the ratio and apply that ratio back through the list. That way the basis get recalculated for every "lot" in the basis list. > > Are you doing a total rewrite or patching the current report? not really a total rewrite, but some signigicant chunks are redone. > > If you are interested, I can send you my patch and/or post it to devel > list. sure. I'm putting this email on the list. I'm just about done with mine and I'll post it up there as well. We can have dueling reports! > > My version should handle splits and correctly calculate gain for > avg-basis, fifo, and filo. The issue with what I have now is some > rounding problems (probably due to using gnc-numeric) and I ignore > transaction values from income accounts since I don't know if there are > dividend or capital gain accounts. There's really no way to tell about the income accounts, unfortunately. At least if its reinvested. I suppose if its not reinvested you could tell because its money in and money out, but no shares touched. That's pretty tricky though. THe rounding is easy. Look at bugzilla #343245, comment #2 attachment includes code to fix the rounding errors. Pretty straightforward. What are you doing with commissions/brokerage fees? We should compare notes I think before either of us goes any farther so that we don't continue to duplicate efforts. A
signature.asc
Description: Digital signature
_______________________________________________ gnucash-devel mailing list gnucash-devel@gnucash.org https://lists.gnucash.org/mailman/listinfo/gnucash-devel