Hi all,

I'm trying to generate reports for an account which has transactions in 
different currencies, and I stuck.

Here is a simplified example:
Prices:
P 2017/03/01 00:00:00 £ 3.0 € 
P 2017/04/01 00:00:00 £ 2.0 € 
P 2017/05/01 00:00:00 £ 1.0 €

Transactions:
2017-01-01
 Assets:Checking €100 
 Equity:Opening Balances 

2017-03-01                  ; 1£ = 3.0 €
 Expenses:Food £30          ; it was €90 that day 
 Assets:Checking 

2017-04-01                  ; 1£ = 2.0 € 
 Expenses:Food £5           ; it was €10 that day 
 Assets:Checking 

# all €100 are spent at this moment

Now how do I run *balance* and *register* reports to get *Assets:Checking=0 
*at the end?
How to configure it to use effective price at the day of transaction?
The point is, the money were already withdrawn from the checking account 
using an effective exchange rate, there is no need to re-calculate anything 
using today's rate, it's just too late.
To be specific, Assets:Checking should be calculated as 100€ - 90€ - 10€ = 
0€.

What I tried:
*1) balance:*
$ ledger --file ledger.dat --price-db price.db bal -X € 
 €65 Assets:Checking
 €-100 Equity:Opening Balances
 €35 Expenses:Food
Obviously, it's recalculated using today's price.

*2) register:*
$ ledger --file ledger.dat --price-db price.db reg -X € Assets 
17-Jan-01 <Unspecified payee>   Assets:Checking   €100 €100 
17-Mar-01 <Unspecified payee>   Assets:Checking   €-90 €10 
17-Apr-01 Commodities revalued  <Revalued>        €30 €40 
17-Apr-01 <Unspecified payee>   Assets:Checking   €-10 €30 
17-May-01 Commodities revalued  <Revalued>        €35 €65
Again, today's rate is used

*3) tried '--no-revalued':*
$ ledger --file ledger.dat --price-db price.db reg -X € Assets --no-revalued 

17-Jan-01 <Unspecified payee> Assets:Checking €100 €100 
17-Mar-01 <Unspecified payee> Assets:Checking €-90 €10 
17-Apr-01 <Unspecified payee> Assets:Checking €-10 €30
Nope, "Revalued" transactions are just hidden, but Assets:Checking is still 
revalued.

*4) here is the -J report:*
$ ledger --file ledger.dat --price-db price.db reg -X € Assets --no-revalued 
-J 
2017-01-01 100 
2017-03-01 10 
2017-04-01 30
Unsurprisingly, it's not a 0 again.

*5) Now, I decided to try some solution from the tutorial 
<http://ledger-cli.org/3.0/doc/ledger3.html#Commodity-reporting>:*

> Or how about never re-valuating commodities used in Expenses, since they 
> cannot have a *different future value*:
> = /^Expenses:/
>  ; VALUE:: market(amount, *post.date*, exchange)

I hoped it could be what I needed.
I added the following:
= /^Assets:Checking/ 
 ; VALUE:: market(amount, post.date, exchange)

However, things got even worse:
5.1)
$ ledger --file ledger.dat --price-db price.db bal -X € 
 €2850 Assets:Checking 
 €-100 Equity:Opening Balances 
 €35 Expenses:Food
Where did these €2850 come from?

5.2)
$ ledger --file ledger.dat --price-db price.db reg -X € Assets 
17-Jan-01 <Unspecified payee> Assets:Checking €100 €100 
17-Mar-01 <Unspecified payee> Assets:Checking €2700 €2800 
17-Apr-01 <Unspecified payee> Assets:Checking €50 €2850
Same question...


I am probably missing something obvious here.
I'd really appreciate if anybody could help me with this.

Thanks in advance!

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to