I now realized that using `{{}}` does throw the error I expected when `{#
}` does not.
Is this a bug? If so, I could try to fix this if you want. Do you know
where this may go wrong?
Op zondag 30 januari 2022 om 22:50:51 UTC+1 schreef Alan H:
> I realise now that my confusion stems from still living in v2 land. :-)
>
> (Note to self : check 'main' before assuming things)
>
> A
>
> On Sun, 30 Jan 2022 at 15:31, Martin Blais <[email protected]> wrote:
>
>>
>>
>> On Sun, Jan 30, 2022 at 3:55 AM Thomas den Hollander <
>> [email protected]> wrote:
>>
>>> Thank you both.
>>>
>>> > has a degree of freedom in the per-unit cost
>>>
>>> I'm afraid I don't see how it still has a degree of freedom. Isn't the
>>> unit cost determined via total_cost / units? Can interpolation overwrite
>>> existing entries? Or doesn't units * unit_cost = total_cost have to hold?
>>>
>>
>> I think {# 200.00 EUR} is interpreted as {? # 200.00 EUR} and not as
>> {0.00 # 200.00 EUR}
>>
>>
>>
>>> Op zondag 30 januari 2022 om 02:29:23 UTC+1 schreef Alan H:
>>>
>>>> Martin; Is there a pointer to the cost spec that includes / explains
>>>> the '#' notation. I will admit I didn't find it.
>>>> Alan
>>>>
>>>> On Sun, 30 Jan 2022 at 00:27, Martin Blais <[email protected]> wrote:
>>>>
>>>>> 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/35659db9-0eff-47f8-b802-bfd6b6596616n%40googlegroups.com.