* Martin Blais <[email protected]> [2014-06-20 23:16]:
> > ; Selling 2 ShareB at 2014/04/01
> > 2014-04-02 Selling 4 ShareA
> > Assets:Investments:Stocks:ShareA -4 ShareA {20€} @ 30€
> > Assets:Cash 120€
> > Income:Investment Gains -40€
>
> What I think has been confusing some people is that the 120E and 30E values
> above are [correctly] ignored (with your patch).
>
> They are going to be ignored, other than for adding an entry to the price
> DB, right?
> If not, how are they going to be used?
They are not ignored - they are used to calculate the gain/loss.
In other woods, this would not balance:
Assets:Investments:Stocks:ShareA -4 ShareA {20€} @ 30€
Assets:Cash 120€
Because you have 4 * 30, but also the 4*(30-20) gain, so you need:
Assets:Investments:Stocks:ShareA -4 ShareA {20€} @ 30€
Assets:Cash 120€
Income:Investment Gains -40€
I actually ran into something that's not ideal the other day. Since
ledger just caculates and doesn't understand what's going on, you
could happily do:
Assets:Investments:Stocks:ShareA -4 ShareA {20€} @ 30€
Assets:Cash 80€
This still balances, but doesn't represent the nature of the
transaction correctly -- it's exactly what you'd get without the
capital gain.
I'm not sure what to do about this... one solution is just to hope
people will get it right. Another would be new syntax to let people
give the name of an account the capital loss/gain should be booked to,
e.g.:
Assets:Investments:Stocks:ShareA -4 ShareA {20€} @ 30€ => Income:Capital
gain
Assets:Cash 120€
Then Assets:Cash is 120 and Income:Capital gain is -40
How do you handle this in beancount?
--
Martin Michlmayr
http://www.cyrius.com/
--
---
You received this message because you are subscribed to the Google Groups
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.