I am not using fava, but the behaviour you described is consistent with  
beanquery CONVERT function.

You can probably use *implicit_prices 
<https://github.com/beancount/beancount/blob/master/beancount/plugins/implicit_prices.py>*plugin,
 
it shall insert a new price entry, derived from your entry (however it will 
stay there until you specify a new one)

But I do not think you need here. You wrote that you have received a 50% 
bonus. But this means, your flight was cheaper, not that price of the 
points was higher. 

I also I am not sure I understand, why you track your points in USD, and 
not in POINTS

Assets:Other:MiscPoints -363.48 USD @@ 24232 POINT

All together, this is how I would do it

2024-01-01 price POINT 0.01 USD
2024-01-01 price MILES 0.01 USD

2024-06-21 * "Delta BOS>SEA"
  Expenses:Travel:Air       363.48 USD
  Expenses:Travel:Air:Bonus       ;This will calculate and book a negative 
cost, which will be equivalent to a bonus, received in USD
  Assets:Other:MiscPoints  - 24232 POINT @ 0.01 USD

You can experiment with it 
here: 
https://colab.research.google.com/drive/1wh5KdXxdXMC6Aa-0Ko-R6ZIa3oclDNem?usp=drive_link
On Saturday, June 22, 2024 at 6:40:53 PM UTC+2 [email protected] wrote:

> Following up here a few months later... I thought this syntax worked, and 
> it does let me (in Fava) view either the actual cost (POINT) or the 
> effective cost (in USD). However, it doesn't respect the exchange rate 
> suggested by the syntax here, it uses an historical PRICE set elswhere. 
> I've opened an issue with Fava to try to understand this (
> https://github.com/beancount/fava/issues/1827), but repeated here,
>
> I'd expect:
>
> 2024-06-21 * "Delta BOS>SEA"
> Expenses:Travel:Air
> Assets:Other:MiscPoints -363.48 USD @@ 24232 POINT
>
> To cost me 363.48 USD, but it uses the historical POINT price of 0.01 USD, 
> so it cost $242.32. However, for this one transaction I got a 50 % bonus on 
> my points, which is why I could by something worth ~360 for only ~24000. 
>
> I can get the conversion correct for this transaction with 
> "Assets:Other:MiscPoints  -363.48 USD {0.15 POINT}", but then Fava displays 
> it all in USD, not in cost (POINT). It didn't actually cost me $363 USD, so 
> I don't want that display...
>
> On Saturday, April 6, 2024 at 10:31:13 AM UTC-7 [email protected] 
> wrote:
>
>> Maybe try:
>> Assets:Points -400 USD @@ 40000 POINT
>>
>> I'm not sure what Fava will render this as, but if you care about the 
>> total cost in points more than the exchange rate then this is clearer in 
>> your ledger.
>>
>>
>> Sincerely,
>> Timothy Jesionowski
>>
>>
>> On Sat, Apr 6, 2024 at 10:34 AM Ken Mankoff <[email protected]> wrote:
>>
>>> Hello,
>>>
>>> I'd like to be able to see (in Fava) the total expenses (USD only) vs 
>>> the total cost (USD, POINT, MILE) of a vacation I took, where some of the 
>>> expenses were paid with points and miles.
>>>
>>> How should I book these transactions?
>>>
>>> For this transaction,
>>>
>>> 2024-01-01 price POINT 0.01 USD
>>> 2024-01-19 * "Hotel"
>>>     Expenses:Travel:Lodging             
>>>     Liabilities:CC               -68.30 USD
>>>     Assets:Points             -40000 POINT
>>>
>>> I've tried
>>>
>>> 1)    Assets:Points             -40000 POINT
>>> 2)    Assets:Points             -40000 POINT @ 0.01 USD
>>> 3)    Assets:Points             -40000 POINT {0.01 USD}
>>>
>>> (2) and (3) always show up as USD, even if I select "At cost" or "Units" 
>>> in Fava
>>>
>>> (1) does what I want... but relies on the 'global' POINT -> USD 
>>> conversion. I'm wondering if there is an explicit conversion method like 
>>> (2) or (3) though, because if I have several point accounts, and am 
>>> regularly spending points at different values with different merchants, I'd 
>>> prefer to track conversion per-transaction than update a global value. The 
>>> global value doesn't work if I have two transactions in the same day with 
>>> different conversions.
>>>
>>> Thanks,
>>>
>>>    -k.
>>>
>>> -- 
>>> 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/9495bfe9-a234-40ba-a4d1-77cb6479c485n%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/beancount/9495bfe9-a234-40ba-a4d1-77cb6479c485n%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/b704c366-e313-40ac-8f3b-48ca283c0a06n%40googlegroups.com.

Reply via email to