--On April 28, 2006 5:12:18 PM -0400 David Hampton <[EMAIL PROTECTED]> wrote:

What about lots?  I've been playing around with them a bit and they
don't really seem ready for use.  They are effectively disabled
right  now because of the bug I mentioned in
<https://lists.gnucash.org/pipermail/gnucash-devel/2006-April/017154
.html>.  I didn't put this in bugzilla but if it is something that
people think  should be worked on now I will.  If this bug is fixed
lots work better  but not well enough to be used effectively.

I committed this today.

Thanks for committing this. Sorry about not putting it in bugzilla. I'll transfer this there if you think it would be useful.

I see that you changed the code in gnc_lot_get_balance_before. It's looking for all splits before the one given and in my version it considered the gains source split if given a gains split. This is important. My first version was like the one you committed but it didn't work if you had two disposals of the same stock on the same day. The gains splits are put in a separate transaction by the capital gain scrubbing code, and the transaction sorting code may sort gains splits after other splits on the same day (and did in my case). This meant that the second disposal on the same day didn't work right since the capital gains from the first disposal weren't considered in calculating the basis for the second disposal. I should have added some comments documenting why I did this.

I've attached a patch the shows what I'm talking about. It also patches cap-gains.[ch] to define the xaccSplitGetGainsSourceSplit method used to find the source split associated with a capital gains split. There are some other changes in the cap-gains.[ch] patch which might be worth considering. They are mostly to more consistently use lot_amount and lot_value rather than opening_amount and opening_value.

--
Mike Alexander           [EMAIL PROTECTED]
Ann Arbor, MI            PGP key ID: BEA343A6


Attachment: CapGains3.patch
Description: Binary data

_______________________________________________
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel

Reply via email to