I must admit that I am also puzzled why the transaction needs to be
"balanced" when a post involves multiple currencies/commodities.
In the first example, ledger produces the following balance report.
10.00 GBP
-20.00 USD Assets
10.00 GBP Bank1
-15.00 EUR Bank2
15.00 EUR
-20.00 USD Paypal
--------------------
10.00 GBP
-20.00 USD
If it does a "conversion" within each individual transaction then it
doesn't make use of the information when displaying the result so there is
no reason why the second transaction shouldn't also lead to the same
report. Ledger doesn't need to "know" the conversion rate when a
transaction contains multiple currencies. It just has to "assume" that
whatever the exchange rate is will balance the transaction (ie assume
nothing).
The reason why I question this is that ledger could also be used to record
items of stock in the same way that it records currencies. Unfortunately,
as it stands, I have to record the purchase or sale of each item of stock
individually which breaks up the bank transaction and makes it more
difficult to reconcile with my bank statement. Using @ or @@ prevents
ledger from displaying the individual item totals in the balance report
(they have all been converted).
On Tuesday, December 7, 2021 at 9:31:17 PM UTC+8 POliveira wrote:
> Thanks Martin.
> I was reading the manual and trying to sort out how to use exchange
> amounts in this case, but without success.
> Can you exemplify how this transaction could be recorded in a single entry
> using explicit exchange rates/amounts?
>
> On Tuesday, December 7, 2021 at 2:38:22 PM UTC+4 Martin Michlmayr wrote:
>
>> * POliveira <[email protected]> [2021-12-07 01:05]:
>> > 2021/05/31 * Currency Exchange
>> > Assets:Paypal 15.00 EUR
>> > Assets:Paypal -20.00 USD
>>
>> Typically, you should specify an exchange rate with @ or @@ to make
>> the relationship between two currencies clear.
>>
>> However, if there are only two postings, ledger will do an implicit
>> conversation for you, i.e. it does not require an explicit exchange
>> rate (@) or exchange amount (@@).
>>
>> I strongly recommend to always use @ or @@ though since implicit
>> conversations could lead to problems that are hard to track down
>> later.
>>
>> > 2021/05/31 * Currency Exchange
>> > Assets:Paypal 15.00 EUR
>> > Assets:Paypal -20.00 USD
>> > Assets:Bank1 10.00 GBP
>> > Assets:Bank2 -15.00 EUR
>>
>> This involves 3 currencies. How should ledger know the relationship
>> between these currencies?
>>
>> It may be obvious to a human what you want in this case, but you'll
>> have to tell ledger explicitly. As mentioned above, *explicit* is
>> good anyway as it helps you avoid mistakes.
>>
>> --
>> Martin Michlmayr
>> https://www.cyrius.com/
>>
>
--
---
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 on the web visit
https://groups.google.com/d/msgid/ledger-cli/203e7ddd-344e-4a39-8f8e-84b5f1f7d64dn%40googlegroups.com.