currency exchange and balance

347 views
Skip to first unread message

Anton Vodonosov

unread,
Feb 10, 2013, 10:06:47 PM2/10/13
to ledge...@googlegroups.com
Hi. I have a problem which I isolated into a small test case.
The journal below deals with two currencies, USD and BYR.

P 2012/08/10 01:18:00 $ BYR 10.00

2012/08/01 * Opening Balance
    Assets:Wallet             BYR 1200
    Equity:Opening Balances

2012/09/01
    Assets:Wallet              $50 @ BYR 11
    Assets:Wallet

2012/10/01
    Assets:Wallet              $50 @ BYR 12
    Assets:Wallet                          
                          

Now if I run "ledger -f journal.dat -X $ balance" it prints:

                $104  Assets:Wallet
               $-100  Equity:Opening Balances
--------------------
                  $4

As you see, there is a disbalance of $4. How to deal with that?

says that Ledger can auto-generate postings to Equity.CapitalLosses.

It would be nice, how to achieve this?

I do not want the price for the USD bought to be "fixed", because the exchange
rate is changed every day, and I would like to see reports according to the current prices.
If I understand correctly, "fixed" price will prevent that.

Max Erickson

unread,
Feb 12, 2013, 9:34:32 AM2/12/13
to ledge...@googlegroups.com
The $4 is the 50 BYR left in the account, at the last seen exchange rate of 12.


Max
Message has been deleted
Message has been deleted

Anton Vodonosov

unread,
Feb 12, 2013, 10:26:44 AM2/12/13
to ledge...@googlegroups.com
Max, thanks for the reply. I understan how it works.

The problem is that it doesn't balance when I convert commodities to USD.
If I don't convert commodities, it doesn't balance too:

                $100
              BYR 50  Assets:Wallet
           BYR -1200  Equity:Opening Balances
--------------------
                $100
           BYR -1150

So, once I have a currency exchange in my journal,
it doesn't balance, thus loosing the main utility of double-enty accounting.

My question: is it possible to get a balance report when converting all commodities
to one currency, with automatically calculated capital loses, so that total balance is 0?

Best regards,
- Anton 

Anton Vodonosov

unread,
Feb 12, 2013, 11:19:09 AM2/12/13
to ledge...@googlegroups.com
Let me show what balance I would like to get:

                $104.17  Assets:Wallet
                 $15.83  Equity:Capital Losses
               $-120.00  Equity:Opening Balances
-----------------------
                  $0.00

The algorithm to get such balance.

As we are converting everythign to $, $ values are left as is
and special care is only applied to BYR values.

1. At the initial date calculate $ cost of BYR values according to the exchange rate at the initial date.
2. Every time a transaction changes BYR account, first revaluate BYR value according to the excange rate
    at this date. The diffenrece between previous $ cost of the BYR value and its new $ cost
    is balanced with Equity:Capital Losses account. This rule applies to all BYR tranactions:
    be it currency exchange or spendings.
3. At the end of the period revaluate the BYR values according to the exchange rate at this time.
    Balance the difference with Equity:Capital Losses.

This approach is an official guideline for accountin in my country, when company has accounts in foreign currnicies.
And it works, I really lost these $15.83, because initially I was really worth of $120 and now only of $104.17.

Here is my example journal commented accourding to this algorithm:

P 2012/08/10 01:18:00 $ BYR 10.00

2012/08/01 * Opening Balance
    Assets:Wallet             BYR 1200 ; $ 120 accoring to the exchange rate at this date
    Equity:Opening Balances

2012/09/01
    ;; Here we are going to touch BYR value. First revaluate it by the current exchange rate of 11:
    ;; 1200/11 = 109.09.
    ;; The diff with the previous value (109.09 - 120 = -10.91) must be balanced
    ;; with Capital Losses account by a fake posting:
    ;;
    ;; Equity:Capital Losses    $10.91
    ;;    
    Assets:Wallet              $50 @ BYR 11
    Assets:Wallet
    ;;
    ;; Hint: BYR remaining value now is 650. 650/11 = $59.09 

2012/10/01
    ;; Again, going to touch BYR. Revaluate it first by the current exchagne rate:
    ;; 650/12 = $54.17. The diff with previous value is $59.09 - $54.17 = $4.92.
    ;; Fake posting:
    ;; Equity:Capital Losses    $4.92
    ;;    
    Assets:Wallet              $50 @ BYR 12
    Assets:Wallet                          
    ;;
    ;; Hint: BYR remaining value now is 50. 50/12 = $4.17

The balance repeated:
==========================================================================
                $104.17  Assets:Wallet
                 $15.83  Equity:Capital Losses
               $-120.00  Equity:Opening Balances
-----------------------
                  $0.00


Is it possible to have such a report from ledger?

Best regards,
- Anton

Max Erickson

unread,
Feb 12, 2013, 2:05:44 PM2/12/13
to ledge...@googlegroups.com
If you specify an exchange rate for the initial entry, Ledger will at least keep track of the change in value (so something like BYR 1200 @ $0.10). Then a register report will have entries for your adjustments.

I don't no if there is a way to have the adjustments associated with an account.

Anton Vodonosov

unread,
Feb 15, 2013, 12:46:51 AM2/15/13
to ledge...@googlegroups.com
On Tuesday, February 12, 2013 10:05:44 PM UTC+3, Max Erickson wrote:
If you specify an exchange rate for the initial entry, Ledger will at least keep track of the change in value (so something like BYR 1200 @ $0.10). Then a register report will have entries for your adjustments.

I don't no if there is a way to have the adjustments associated with an account.

Do you mean I can get balance shomehow after generating new journal with registry report?

 
Reply all
Reply to author
Forward
0 new messages