Oh wow... it's subtle:
2022-01-29 * "Income"
Income:Other -100.00 EUR
Assets:CoinA 1.00 COINA {100 EUR, 2022-01-29}
2022-01-29 * "Convert"
Assets:CoinA -1.00 COINA *{100 EUR, 2022-01-29}*
*^^^ here this gets matched against 1.00 COINA in the Assets:CoinA account,
and so resolved against that posting.*
Assets:CoinB 2.00 COINB *{50 EUR, 2022-01-29}*
*^^^ here this has a degree of freedom in the per-unit cost, and that gets
filled in to -100, in order to balance with the other posting in the
transaction.*
Behavior is as expected, but admittedly confusing.
Remember:
- reducing (closing) transactions will be matched against existing inventory
- augmenting (opening) transactions will be interpolated when necessary.
On Sat, Jan 29, 2022 at 7:21 PM Martin Blais <[email protected]> wrote:
> Looks a bug to me.
> I think your interpretation is correct.
>
>
> On Sat, Jan 29, 2022 at 1:36 PM Thomas den Hollander <
> [email protected]> wrote:
>
>> I have a question. It is either something I don't understand about the
>> cost system or a bug. Why does the following code snippet balance?
>>
>> 2022-01-29 commodity COINA
>> 2022-01-29 commodity COINB
>>
>> 2022-01-29 open Income:Other
>> 2022-01-29 open Assets:CoinA COINA
>> 2022-01-29 open Assets:CoinB COINB
>>
>> 2022-01-29 * "Income"
>> Income:Other -100.00 EUR
>> Assets:CoinA 1.00 COINA {# 100.00 EUR}
>>
>> 2022-01-29 * "Convert"
>> ; Why does this transaction balance?
>> Assets:CoinA -1.00 COINA {# 100.00 EUR}
>> Assets:CoinB 2.00 COINB {# 200.00 EUR}
>>
>> Shouldn't the transaction give -100.00 + 200.00 = 100.00 != 0?
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Beancount" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/beancount/7d06d7e7-c000-42cf-ae5d-1b67beba69d0n%40googlegroups.com
>> <https://groups.google.com/d/msgid/beancount/7d06d7e7-c000-42cf-ae5d-1b67beba69d0n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>
--
You received this message because you are subscribed to the Google Groups
"Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/beancount/CAK21%2BhMaBo-Ye4riOLjxfcsgekPxsWyYDe-3srKK2YU8Y8pYCQ%40mail.gmail.com.