Hi guys,

I'm using ledger for tracking car expenses [1] and I'm getting confused
with fixing lot prices.

Let's say I have this example (L is for liters):

 2018/03/13 * Fuel
         Expenses:Car:Fuel          23.700 L @ EUR 2.10
         (Expenses:Car:Mileage)     = 116666 km
         Assets:Wallet              EUR -49.77

and when I use command:

 ledger -X EUR reg

it will correctly calculate liter price and show in euro currency. In my
country we also have tax on fuel, calculated by formula 'N L * 0.01'. If
I add this as:

 2018/03/13 * Fuel
         Expenses:Car:Fuel          23.700 L @ EUR 2.10
     Expenses:Car:Fuel:Tax      23.700 L @ EUR 0.01
         (Expenses:Car:Mileage)     = 116666 km
         Assets:Wallet              EUR -50.01

now ledger register report looks like this:

18-Mar-13 Fuel   Expenses:Car:Fuel       EUR 0.24   EUR 0.24
                 <Adjustment>            EUR -0.01  EUR 0.23
                 Expenses:Car:Fuel:Tax   EUR 0.24   EUR 0.47
                 (Expenses:Car:Mileage)  km116666   EUR 0.47
                                                    km116666
                 Assets:Wallet           EUR -50.01 EUR -49.54
                                                    km116666

which is kind of wrong - it is starting to use last value to calculate 
EUR/Liter.

After catching [2], I've tried to fix price (although I'd like to keep
fluctuating capability of this comodity so I could handle case: "how
much all my spent fuel would cost in year XXXX") with this, omitting
mileage:

 2018/03/13 * Fuel
         Expenses:Car:Fuel          23.700 L {=EUR 2.10}
     Expenses:Car:Fuel:Tax      23.700 L {=EUR 0.01}
         Assets:Wallet              EUR -50.01

and ledger started to complain with this report:

---------------------
Unbalanced remainder is:
          EUR -50.01
23.700 L {=EUR 0.01}
23.700 L {=EUR 2.10}
Amount to balance against:
23.700 L {=EUR 0.01}
23.700 L {=EUR 2.10}
Error: Transaction does not balance
---------------------

However, if I change {=EUR ...} to =EUR ... like here:

 2018/03/13 * Fuel
         Expenses:Car:Fuel          23.700 L @ =EUR 2.10
     Expenses:Car:Fuel:Tax      23.700 L @ =EUR 0.01
         Assets:Wallet              EUR -50.01

register report is doing proper calculation and balancing.

Anyone has any idea what is going on here? If I'm getting documentation
from [2] correct, my last two examples should be equal and valid, but
obviously they are not for ledger.

Best regards,
Sanel

[1] https://groups.google.com/forum/#!msg/ledger-cli/Ojl0Rk96zqg/cGp8ArG_AAAJ
[2] https://www.ledger-cli.org/3.0/doc/ledger3.html#Fixated-prices-and-costs

-- 

--- 
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].
For more options, visit https://groups.google.com/d/optout.

Reply via email to