Thanks John. Thanks for the quick answer.

I misunderstood the tool, well I actually misunderstood commodities
for that matter. :) I'm a noob in finances/accounting.

In our case (my little company) we have many cash expenses in foreign
currencies that we reimburse in dollars. The amount of reimbursement
should use the exchange rate at the time of the expenditure, and not
be re-adjusted, as commodities are, to calculate present value. This
page describes the "official" process we try to follow:
http://www.mscs.dal.ca/~selinger/accounting/.

Through the IRC I learned that I can use @ with each foreign amount to
immediately convert it to $ (usd) amount. If I do this for all my
transactions and then I report with '-B reg', I get what I wanted. So
this works but I have many cash transactions and now they are more
verbose:

2009/07/20 * Car Gas
  jlopez:assets:reimbursables:plankor
110.00 mxn @ $0.074685387
  jlopez:assets:checking
-110.00 mxn @ $0.074685387
  company:expenses:travel:car:gas:jlopez
110.00 mxn @ $0.074685387
  company:liabilities:payable:jlopez:cash
-110.00 mxn @ $0.074685387
;receipt available

With the P directive I wanted to group a bunch of transactions from
the same day, or even multiple days (with very similar exchange
rates). Also, when I use the @ I loose the balance in actual
currencies and I get it all in $ (I don't really know how valuable
those reports would be with their original currencies, it just feels
bad that I'm loosing information that is otherwise available.)

We spent some time discussing options at the IRC and these possible
solutions came up (in random order):

* one-currency accounts (or one-commodity accounts): where the account
itself converts all amounts to its declared amount, say $. ie:
"declare payabe:jlopez:cash $" would force conversion from mxn into $
using the latest P rate. So this account is always in dollars
calculated at the time of the transaction. (sm idea)
* Fixed-and-dynamic commodities. For example, if a commodity
conversion is given as 'F date $ 14 mxn' then mxn is a fixed commodity
and is to be treated as an immediate-conversion commodity (at
transaction time, using the F table, similar to P), as opposed to
being calculated at present value for a gain/loss. A dynamic commodity
would be the same as current -V behaviour. (Demosthenex idea)
* after-datefield conversion rate. Same as @ but written only once,
after the date in the transaction (for example), instead of writing it
for every amount in the transaction (4 times in my case). This assumes
all amounts are in same currency, of course. With this option I still
need to repeat the rate for each transaction but at least I type it
once, instead of 4 times. Example:
  2009/07/20 {mxn @ $0.074685387} * Car Gas
    jlopez:assets:reimbursables:plankor
110.00
    jlopez:assets:checking
-110.00
    company:expenses:travel:car:gas:jlopez
110.00
    company:liabilities:payable:jlopez:cash
-110.00
  ;receipt available

I think the need/requirement has merit but I'm just learning these
finance/accounting things. So I really can't tell. I wonder how other
people report international expenses.

I'm an experienced C++ programmer and might be able to put some time
into this if you need my help.

Please consider these thoughts and advise.

Thanks,

Javier Leija


On Nov 24, 3:23 am, John Wiegley <[email protected]> wrote:
> On Nov 23, 2009, at 4:56 PM, jleija wrote:
>
> > I noticed a weird behaviour when doing a 'reg' on a multi-currency
> > file (Mexican peso, Guatemalan quetzal and usd). I'm using ledger v.
> > 2.6.2 in Ubuntu linux, 64 bit. Here is my command:
>
> Ledger 2.6.2 does not alert you when commodities have been revalued behind 
> the scenes.  If you did this with Ledger 3 (current 'master'), you'd see a 
> posting with the account "<Revalued>":
>
> 08-May-29 jlopez airfare t.. co:li:pa:jl:cash     $-133.82    $-133.82
> 08-May-30 jlopez dinner in.. co:li:pa:jl:cash      $-50.43    $-184.25
> 08-May-31 jlopez dinner in.. co:li:pa:jl:cash     $-138.44    $-322.69
> 08-Jun-09 Check 1004 - tra.. co:li:pa:jl:cash      $335.00      $12.31
> 08-Jul-03 jlopez airfare t.. co:li:pa:jl:cash     $-347.26    $-334.95
> 08-Jul-06 jlopez meal with.. co:li:pa:jl:cash     $-112.55    $-447.50
> 09-Jul-06 Check 1012         co:li:pa:jl:cash      $614.99     $167.49
> 09-Jul-13 Commodity rounding <Rounding>              $0.01     $167.50
> 09-Jul-13 Commodities reva.. <Revalued>             $-9.20     $158.30
> 09-Jul-13 jlopez meal at B.. co:li:pa:jl:cash      $-27.90     $130.40
> 09-Jul-15 Car Gas            co:li:pa:jl:cash      $-30.00     $100.40
> 09-Jul-20 Commodities reva.. <Revalued>            $133.38     $233.78
> 09-Jul-20 Commodity rounding <Rounding>              $0.01     $233.79
> 09-Jul-20 Car Gas            co:li:pa:jl:cash       $-8.22     $225.57
> 09-Jul-20 Commodity rounding <Rounding>             $-0.01     $225.56
> 09-Jul-20 jlopez parking i.. co:li:pa:jl:cash       $-1.49     $224.07
>
> You can see the $133.38 there, which happened because of this line:
>
> P 2009/07/20 mxn $0.074685387
>
> You see, if you run the report without -V, you see this on 7/15:
>
> 09-Jul-15 Car Gas            co:li:pa:jl:cash  -300.00 mxn     $816.17
>                                                           -5269.01 mxn
>                                                           -1322.10 qzl
>
> That's a pretty large negative balance of mxn.  So, even small price 
> fluctuations are going to cause noticeable changes in the overall value.  In 
> this case, because mxn gets a fair bit cheaper on 7/20 ($0.30 per), it means 
> your loss is much less, hence the increase in overall dollar value of the 
> account.
>
> John

Reply via email to