> On 2 May 2021, at 17:35, James Cook <[email protected]> wrote:
> 
>> I’ve played with manually “converting” the currencies using “currency 
>> accounts” as described at 
>> https://beancount.github.io/docs/beancount_v3.html#currency-accounts-instead-of-a-single-conversion
>>  
>> <https://beancount.github.io/docs/beancount_v3.html#currency-accounts-instead-of-a-single-conversion>,
>>  but so far I haven’t managed to convert that currency loss to an actual 
>> loss instead of having it show up as a gain (negative expense or income 
>> value).
> 
> Can you show an example?

Hmm, well here’s what I’ve got so far… 
The `Equity:Exchange` entries are redundant except to be more specific about 
what’s going on, and could functionally be dropped if the commented exchange 
rates were uncommented.
Functionally the only change from where I started is the `Equity:FXGainLoss` 
entry.

option "inferred_tolerance_default" "GBP:0.005"
option "inferred_tolerance_default" "USD:0.005"
plugin "beancount.plugins.auto_accounts"

2020-03-31 * "Buy 11 shares of Square"
  Assets:GB:Freetrade:GIA:Cash      -482.60 GBP ;@ 1.23390 USD
  Equity:Exchange:GBP                482.60 GBP
  Equity:Exchange:USD               -595.48 USD
  Assets:GB:Freetrade:GIA:SQ             11 S_SQ {54.13456 USD}

2020-11-16 * "Sell 11 shares of Square"
  Assets:GB:Freetrade:GIA:SQ            -11 S_SQ {54.13456 USD} @ 175.81000 USD
  Equity:Exchange:USD               1933.91 USD
  Equity:Exchange:GBP              -1467.08 GBP
  Assets:GB:Freetrade:GIA:Cash      1467.08 GBP ;@ 1.31820 USD
  Income:Investments:PnL            -977.88 GBP @ 1.31820 USD
  Equity:FXGainLoss                  -37.47 GBP @ 1.31820 USD


Note that I haven’t yet managed to drop the @ exchange rates on the last two 
postings, even with the `Equity:Exchange` accounts.
And I haven’t really decided if `Equity` is the right place for that 
`FXGainLoss` account, but it certainly doesn’t make sense to me anywhere else 
or it appears to one a profit, when in fact it’s a loss (albeit a loss which is 
already accounted for in the posting to `Income:Investments:PnL`, so all I’m 
really trying to do is ‘discard’ it to make the entry balance…)

Running `bean-doctor` on this example shows 

** Balances after transaction --------------------------------

  Assets:GB:Freetrade:GIA:SQ                                                    
 

* Equity:Exchange:USD                                                 1338.43 
USD

* Equity:Exchange:GBP                                                 -984.48 
GBP

* Assets:GB:Freetrade:GIA:Cash                                         984.48 
GBP

* Income:Investments:PnL                                              -977.88 
GBP

* Equity:FXGainLoss                                                    -37.47 
GBP


I suppose one other possibility (if I do explicitly book the FX conversion to 
currency accounts, which I’m not too happy about having to do manually) would 
be to subtract that 37.47 GBP (49.39 USD) from the Equity:Exchange:USD account. 
But it seems a bit arbitrary…


>> It sounds like you have the exact same problem as me, so let me know if you 
>> find a solution more elegant than just denominating all commodities in your 
>> primary currency.
>> 
>> Incidentally I’d be very interested in your "plugin that adds a separate 
>> Canadianese version of everything” – I also need to report to two different 
>> tax authorities in different countries and haven’t worked out how to do that 
>> properly yet. Have you published your plugin anywhere?
> 
> See my earlier thread: "Tracking different cost basis methods for
> different countries?"
> 
> Current version is at
> 
> https://hub.darcs.net/falsifian/misc-pub/browse/beancount_plugins/falsifian/parallel_average_cost.py
> 
> I hope the documentation explains what's going on, but I'm happy to
> answer questions. The gist is that it just adds some postings that live
> in a "parallel universe" with new accounts and currencies.
> 
> I'm curious what will happen if anyone else tries to
> use it; I'm sure there are plenty of strange assumptions I'm making
> that are true for my own ledger.

Thanks! I’ll have a look at that.


-- 
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/7206CDE3-725F-4815-9D9C-F1166CAE0DAE%40caesarschinas.com.

Reply via email to