On Fri, Apr 30, 2010 at 3:26 PM, John Wiegley wrote:
> On Apr 28, 2010, at 7:52 AM, Peter Ross wrote:
>
>> With the above the balance sheet and income and expense report don't
>> match.  The balance sheet should change by the amount of profit earnt.
>
> Ah, you need a bit more then:
>
> D 1,000.00 AUD
> D 1,000.00 EUR
>
> 2009/01/01 First sale
>      Assets:Bank                              10000.00 AUD
>      Income:Sales
>
> 2009/02/01 Marketing (1 EUR = 2.00 AUD)
>      Expenses:Marketing                        2000.00 AUD
>      Liabilities:Accounts Payable:EUR         -1000.00 EUR
>
> 2009/03/01 Pay Marketing Invoice (1 EUR = 1.95 AUD)
>      Liabilities:Accounts Payable:EUR          1000.00 EUR {2 AUD}
>      Assets:Bank                              -1950.00 AUD
>      Income:Currency Exchange                   -50.00 AUD
>
> The use of {2 AUD} matches up those particular EUR with the ones you received 
> on 2/1, yielding a 50 capital gain which must be balanced (into Income in 
> this case).  Now I get:
>
> ~ $ ledger -f /tmp/bug.dat bal assets
>        8,050.00 AUD  Assets:Bank
> ~ $ ledger -f /tmp/bug.dat bal income expense
>        2,000.00 AUD  Expenses:Marketing
>      -10,050.00 AUD  Income
>          -50.00 AUD    Currency Exchange
>      -10,000.00 AUD    Sales
> --------------------
>       -8,050.00 AUD
>
I like the idea.  Especially that it makes clear when the currency
gain is realized.

However it doesn't handle the case of unrealized currency gains.

I added the line

P 2009/02/15 EUR 1.90 AUD

to your example above and here is my balance sheet on that date

$ ledger -f invoice3.dat -X AUD -e 2009/02/15 bal assets liabilities
       10,000.00 AUD  Assets:Bank
       -1,900.00 AUD  Liabilities:Accounts Payable:EUR
--------------------
        8,100.00 AUD

This balance sheet is correct but my income and expenses shows that
I've only earnt 8,000 dollars while in fact I've actually earnt 8,100
dollars with the extra 100 dollars being an unrealized currency gain.

$ ledger -f invoice3.dat -X AUD -e 2009/02/15 bal income expenses
        2,000.00 AUD  Expenses:Marketing
      -10,000.00 AUD  Income:Sales
--------------------
       -8,000.00 AUD

However thanks for you ideas, they have certainly improved my
understanding of different ways I could use ledger.

Pete

Reply via email to