"Maybe you could give an example, so it's clearer".
When I tried POliveira's original example using the @@ option I couldn't
get an output (I don't know why).
I have since tried an example of my own and these options appear to work as
desired:
2021/01/01 * Stock up
Assets:Fruit 100 apples @@ $10.00
Assets:Fruit 80 oranges @@ $50.00
Assets:Meat 50 steaks @@ $ 200.00
Bank:Bank Account
2021/01/02 * Cash Sale
Assets:Meat -1 steaks @@ $10.00
Bank:Cash
2021/01/03 * Mrs Smith
Assets:Fruit -5 oranges @@ $10.00
Assets:Fruit -10 apples @@ $5.00
Assets:Accounts Receivable
ledger -f shop.txt bal | cat
$15
90 apples
75 oranges
49 steaks Assets
$15 Accounts Receivable
90 apples
75 oranges Fruit
49 steaks Meat
$-250 Bank
$-260 Bank Account
$10 Cash
--------------------
$-235
90 apples
75 oranges
49 steaks
On Wednesday, December 8, 2021 at 5:30:25 PM UTC+8 Martin Michlmayr wrote:
> * psionl0 <[email protected]> [2021-12-07 19:18]:
> > 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).
>
> Your "assume nothing" is to assume something.
>
> I don't want ledger to make assumptions. I want ledger to enforce
> the balancing requirement.
>
> Personally I don't like that ledger allows implicit conversations
> since ledger assumes an exchange rate. Beancount, for example,
> requires an explicit exchange rate when there are only two postings /
> two commodities.
>
> Let's do:
>
> 2021-12-08 * Test
> Assets:A 10.00 EUR
> Assets:B -8.52 GBP
>
> If you know roughly the values of EUR and GBP, this transaction
> looks obviously correct to you. But this requires a lot of knowledge
> (i.e. assumptions about the world).
>
> Now:
>
> 2021-12-08 * Test
> Assets:A 1000 EUR ; let's say I forgot the . between the 00s
> Assets:B -8.52 GBP
>
> You'd probably agree that this isn't quite right, yet ledger will
> happily assume an (incorrect) exchange rate.
>
> Using explicit exchange rates makes ledger enforce the balancing
> requirement.
>
> If I had done:
>
> 2021-12-08 * Test
> Assets:A 1000 EUR @ 0.852 GBP
> Assets:B -8.52 GBP
>
> ledger would complain.
>
> You *WANT* ledger to complain.
>
> You don't want ledger to assume.
>
> > 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).
>
> Maybe you could give an example, so it's clearer.
>
> --
> 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/0bd073dd-d85f-4990-bdfb-da4457399dc4n%40googlegroups.com.