Tracking car expenses

227 views
Skip to first unread message

Sanel Z.

unread,
Oct 27, 2017, 9:13:10 AM10/27/17
to Ledger
Hi guys,

I'm trying to use ledger for tracking car expenses (maintenance, fuel and etc), but also I'm recording number of kilometers car went. Ledger transaction looks like this, with fictive numbers (L is for liters):

  2017/09/09 * Gas station
Expenses:Car:Fuel           35.550 L @ EUR 1.70
Expenses:Car:Fuel:Tax       35.550 L @ EUR 0.01
Expenses:Car:Mileage        109554 km
Expenses:Car:Washing        $ 6
Assets:Wallet

I'm recording mileage as currently visible on dashboard, without manual subtraction and ledger will happily add this number to the previous mileage recording, which isn't what I want.

Is there any way to instruct ledger to subtract these values ouf of the box, and show only difference for transaction or given period?

Thanks.

Best,
Sanel

Craig Earls

unread,
Oct 27, 2017, 9:17:22 AM10/27/17
to ledge...@googlegroups.com
No.  A posting (individual entries) are additions or subtractions to the underlying account.  

--

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



--
Craig, Corona De Tucson, AZ
missile_flyout
enderw88.wordpress.com

Ismael Bouya

unread,
Oct 27, 2017, 9:45:02 AM10/27/17
to ledge...@googlegroups.com
Actually, you can, just prepend an "=" sign:
2017/09/09 * Gas station
Expenses:Car:Fuel 35.550 L @ EUR 1.70
Expenses:Car:Fuel:Tax 35.550 L @ EUR 0.01
Expenses:Car:Mileage = 109554 km
Expenses:Car:Washing $ 6
Assets:Wallet

(Fri, Oct 27, 2017 at 01:17:20PM +0000) Craig Earls :
> > email to ledger-cli+...@googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
> >
>
>
>
> --
> Craig, Corona De Tucson, AZ
> [image: missile_flyout]
> enderw88.wordpress.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 ledger-cli+...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

> No.  A posting (individual entries) are additions or subtractions to the
> underlying account.  
> On Fri, Oct 27, 2017 at 6:13 AM, Sanel Z. <[1]san...@gmail.com> wrote:
>
> Hi guys,
> I'm trying to use ledger for tracking car expenses (maintenance, fuel
> and etc), but also I'm recording number of kilometers car went. Ledger
> transaction looks like this, with fictive numbers (L is for liters):
>
>   2017/09/09 * Gas station
> Expenses:Car:Fuel           35.550 L @ EUR 1.70
> Expenses:Car:Fuel:Tax       35.550 L @ EUR 0.01
> Expenses:Car:Mileage        109554 km
> Expenses:Car:Washing        $ 6
> Assets:Wallet
>
> I'm recording mileage as currently visible on dashboard, without manual
> subtraction and ledger will happily add this number to the previous
> mileage recording, which isn't what I want.
> Is there any way to instruct ledger to subtract these values ouf of the
> box, and show only difference for transaction or given period?
> Thanks.
> Best,
> Sanel
>
> --
>
> ---
> 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 [2]ledger-cli+...@googlegroups.com.
> For more options, visit [3]https://groups.google.com/d/optout.
>
> --
> Craig, Corona De Tucson, AZ
> [4]missile_flyout
> [5]enderw88.wordpress.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 [6]ledger-cli+...@googlegroups.com.
> For more options, visit [7]https://groups.google.com/d/optout.
>
> References
>
> Visible links
> 1. mailto:san...@gmail.com
> 2. mailto:ledger-cli+...@googlegroups.com
> 3. https://groups.google.com/d/optout
> 5. http://enderw88.wordpress.com/
> 6. mailto:ledger-cli+...@googlegroups.com
> 7. https://groups.google.com/d/optout




--
Ismael
signature.asc

Martin Blais

unread,
Oct 27, 2017, 10:28:19 AM10/27/17
to ledger-cli
Idea:
- Turn on Google Location Services on your phone
- After a while, download the JSON file for it
- Write a Python script to extract the already labeled "driving" segments
- Estimate distance from the start/end coordinates of each these
- Sum it up.
Less time, though it would report trips not in your own car.



--

---
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+unsubscribe@googlegroups.com.

Yuri Khan

unread,
Oct 27, 2017, 10:30:18 AM10/27/17
to ledge...@googlegroups.com
On Fri, Oct 27, 2017 at 8:44 PM, Ismael Bouya
<ismael....@normalesup.org> wrote:
> Actually, you can, just prepend an "=" sign:
> 2017/09/09 * Gas station
> Expenses:Car:Fuel 35.550 L @ EUR 1.70
> Expenses:Car:Fuel:Tax 35.550 L @ EUR 0.01
> Expenses:Car:Mileage = 109554 km
> Expenses:Car:Washing $ 6
> Assets:Wallet

You’d probably also want to make that a virtual posting, so that you
don’t get the balancing negative kilometers in your wallet:

2017/09/09 * Gas station
Expenses:Car:Fuel 35.550 L @ EUR 1.70
Expenses:Car:Fuel:Tax 35.550 L @ EUR 0.01
(Expenses:Car:Mileage) = 109554 km

Sanel Zukan

unread,
Nov 1, 2017, 8:35:12 AM11/1/17
to ledge...@googlegroups.com
Thanks guys for your replies and suggestions.

> (Expenses:Car:Mileage) = 109554 km

This is exactly what I was looking for. Previously, I erroneously used
[] (in combination with '=') which caused entries to always balance.

Best,
Sanel
> --
>
> ---
> You received this message because you are subscribed to a topic in the Google Groups "Ledger" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/ledger-cli/Ojl0Rk96zqg/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to ledger-cli+...@googlegroups.com.

Sanel Zukan

unread,
Nov 1, 2017, 8:39:18 AM11/1/17
to Martin Blais, ledger-cli
Neat idea!

But, as you mentioned, script would have to figure out when I was
driving (own car) and when not.

Best,
Sanel
>> email to ledger-cli+...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
>
> ---
> You received this message because you are subscribed to a topic in the Google Groups "Ledger" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/ledger-cli/Ojl0Rk96zqg/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to ledger-cli+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages