I can workaround this or not even bother (I just leave the foreign currency as a comment). But what I'd like to know is if this is even possible with ledger or if I misunderstood what virtual posting cost and --historical were supposed to do here.
On Sun, Aug 17, 2025 at 1:53 PM Igbanam Ogbuluijah <[email protected]> wrote: > The way I've done this in the past is to see the 11 rate as 10 + 1. Now, I > can record the 1 as cost of the transaction somewhat, and the 10 continues > as the normal rate. Could this work for your case? > > > *Igbanam* > > On Sat, 16 Aug 2025, 01:23 Henry Mitchell, <[email protected]> wrote: > >> Hi, >> >> When recording expenses in a foreign currency, I want to see how much I >> had spent in my base currency (USD) as of the date of the transaction. If >> I record the price at which I want the foreign currency valued and use >> `--historical --exchange USD`, it gets what I want for the most part. >> However, credit cards have their own rate and I would like to have the >> ledger reflect that, but I can't seem to figure out how to do so correctly. >> >> Consider: >> P 2025-01-01 00:00:00 USD 150.00 JPY >> >> 2025-01-01 Should be 10.00 USD >> Assets:Cash -1500 JPY >> Expenses:Food 1500 JPY >> >> 2025-01-01 Credit Cards Use One-Off Exchange Rate >> Liabilities:Credit -11.00 USD >> Expenses:Food 1500 JPY @@ 11.00 USD >> >> 2025-01-01 Should still be 10.00 USD >> Assets:Cash -1500 JPY >> Expenses:Food 1500 JPY >> >> $ ledger --file /tmp/test.ledger --price-db /dev/null register Food >> --exchange USD --historical >> 2025-01-01 Should be 10.00 USD Expenses:Food >> 11.00 USD 11.00 USD >> 2025-01-01 Credit Cards Use One-Off Exchange Rate Expenses:Food >> 11.00 USD 22.00 USD >> 2025-01-01 Should still be 10.00 USD Expenses:Food >> 11.00 USD 33.00 USD >> >> If I set the posting cost as above, it creates a pricedb entry that >> affects the cash purchases. If I use a virtual posting cost using (@@), the >> pricedb entry doesn't get created, but `--historical --exchange USD` seems >> to ignore the explicit posting cost, so all 3 postings get valued at 10.00 >> USD. Is this intended behavior? If so, how can I have it show the Cash >> transactions as 10.00 USD and the Credit transaction as 11.00 USD? >> >> Thanks, >> Henry >> >> -- >> >> --- >> 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 [email protected]. >> To view this discussion visit >> https://groups.google.com/d/msgid/ledger-cli/CACTkciO%3DM0_O6a8M8ggQqYmHhSzwBM2QDECFCrVTBMaophoZ6g%40mail.gmail.com >> <https://groups.google.com/d/msgid/ledger-cli/CACTkciO%3DM0_O6a8M8ggQqYmHhSzwBM2QDECFCrVTBMaophoZ6g%40mail.gmail.com?utm_medium=email&utm_source=footer> >> . >> > -- > > --- > 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 [email protected]. > To view this discussion visit > https://groups.google.com/d/msgid/ledger-cli/CAOmRJrcAY8qo-LWOM_62M9jp6DPgvj9sgYrE9%3D4EGe0Q8vo9eA%40mail.gmail.com > <https://groups.google.com/d/msgid/ledger-cli/CAOmRJrcAY8qo-LWOM_62M9jp6DPgvj9sgYrE9%3D4EGe0Q8vo9eA%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > -- --- 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 [email protected]. To view this discussion visit https://groups.google.com/d/msgid/ledger-cli/CACTkciNvc20EB5%3DRyUYYcraNt5NMmT7v%2BQJ7W%2B8ASVfkDz6NAw%40mail.gmail.com.
