You should confirm whether using "date" uses the date prior to that day, or
on that date if set.
I think it's the latter, but I can't quite remember exactly.

On Fri, Mar 30, 2018 at 9:35 PM, Hoong-Shen Wong <[email protected]
> wrote:

>
>
> On Fri, Mar 30, 2018 at 6:37 AM, Martin Blais <[email protected]> wrote:
>
>> On Wed, Mar 28, 2018 at 11:33 PM, <[email protected]> wrote:
>>
>>> In addition I was reading up the industry practice for treatment of
>>> items on the income statement and came across the following extracted at (
>>> https://www.accountingtools.com/articles/foreign-currency-t
>>> ranslation.html):
>>>
>>>
>>>    - *Assets and liabilities*. Translate using the current exchange rate
>>>    <https://www.accountingtools.com/articles/2017/5/6/exchange-rate> at
>>>    the balance sheet
>>>    <https://www.accountingtools.com/articles/2017/5/17/the-balance-sheet> 
>>> date
>>>    for assets and liabilities.
>>>    - *Income statement
>>>    
>>> <https://www.accountingtools.com/articles/2017/5/17/the-income-statement> 
>>> items*.
>>>    Translate revenues, expenses, gains, and losses using the exchange rate 
>>> as
>>>    of the dates when those items were originally recognized.
>>>
>>> That makes sense, though for tax purposes, depending on the
>> jurisdiction, one might have to translate differently, but this sounds like
>> a good default, recognizing income at the rate at the time of payment and
>> valuing assets at the latest rate.
>>
>>
>>
>>> So far I find that:
>>> - bean-report doesn't support currency conversions
>>>
>>
>> FYI long-term the idea is to replace all those report implementations by
>> SQL queries embellished as webpages.
>>
>>
>>
>>> - bean-query support currency conversions only on a per item basis, I
>>> can't construct a query that gives me the equivalent of the income
>>> statement entries but based on the exchange rate of the individual
>>> transaction dates
>>>
>>
>> Doesn't something like this provide useful output:
>>
>> beancount> select position, convert(position, "USD", date),
>> getprice(currency, "USD", date) where currency = "CAD"
>>
>>
>>
>>
>
> Actually the following works very well (your previous statement still
> gives me individual postings but I need to sum them up to get the total
> income line):
> beancount> select sum(convert(position, "USD", date) where accounts ~
> "Income:*"
>
> Thanks a lot!
>
> Regards,
> hoongshen
>
> --
> 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 post to this group, send email to [email protected].
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/beancount/CAB1%3DY91Y5Sv_tB%3D%3DUx696RtjSqMYFgTYhu8Mxwq11xfz
> 4ZvnUA%40mail.gmail.com
> <https://groups.google.com/d/msgid/beancount/CAB1%3DY91Y5Sv_tB%3D%3DUx696RtjSqMYFgTYhu8Mxwq11xfz4ZvnUA%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/CAK21%2BhP-1Br8ZWqsEZWWBDRXJoKL3G_AXGjtqacdPrE6uTJ%2BgQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to