Open iartarisi opened 1 day ago
Quoting from roi manual:
Query supplied to --inv has to match all transactions that are related to your investment. Transactions not matching --inv will be ignored.
In these transactions, ROI will conside postings that match --inv to be "investment postings" and other postings (not matching --inv) will be sorted into two categories: "cash flow" and "profit and loss", as ROI needs to know which part of the investment value is your contributions and which is due to the return on investment.
I think that the property "other postgres are either cash flows or PnL" does not hold for your initial transaction.
Try and separate your Income postings out:
P 2020/1/1 A GBP 100
2020/1/1 foo
Assets GBP -100
Assets 1 A
2020/1/1 foo
Income -1 A
Income GBP 100
2020/2/1 doesn't matter what's in this transaction
Equity GBP -100
Assets GBP 100
Thanks for the reply @adept .
That does work for roi. But those first two transactions don't balance to zero individually.
hledger -f roi-example.journal check -s
hledger: Error: /.../roi-example.journal:2-4:
2 | 2020-01-01 foo
| Assets GBP -100
| Assets 1 A
This multi-commodity transaction is unbalanced.
Automatic commodity conversion is not enabled.
The real postings' sum should be 0 but is: 1 A, GBP -100
Consider adjusting this entry's amounts, adding missing postings,
or recording conversion price(s) with @, @@ or equity postings.
I think that the property "other postgres are either cash flows or PnL" does not hold for your initial transaction.
Not sure about this. The way I read it, for that initial transaction, the Assets postings are in --inv and the Income postings are in --pnl. There are no other postings?
I am trying to use hledger-roi and keep track of average cost using something similar to the method described in this multicurrency accounting tutorial. That means that both the cash and stock amounts should always balance to zero. In order to do that, all buy and sell commodity transactions go through an Income:Trading account (simplified below to just Income).
This crashes roi, I think, because it can't handle the Income account evaluating to 0