Just some stuff about me.
Here's my dotfiles repository.
What links here:
Commodity pricing: when you buy some commodity, you want to tell Ledger how to convert it to your preferred commodity. For example, you buy 200 USD – you want to tell Ledger how much that is in terms of EUR:
2022/05/01 Buy USD
Assets:Broker 200 usd @ 0.9482037635 eur
Assets:Broker
2022/06/01 Buy USD
Assets:Broker 400 usd @ 0.8844831769 eur
Assets:Broker
Lot price: when you want to track several different investments in the same commodity, which were bought at different prices. Sort of the “original price”. For example, when selling part of the above USD:
2022/06/05 Sell USD
Assets:Broker 200 usd {0.9482037635 eur} @ 0.93285323 eur
Assets:Broker
Fixed lot pricing: when you buy something that you consume, like gasoline, you don’t want that cost reported in terms of today’s price, but the historical price when you bought it:
2022/06/01 Shell
Expenses:Gas 11 liters {=2.24 eur}
Assets:Checking
Good article on ledger: https://dzx.cz/2020/02/19/ledger/
Why is income negative and expense positive? Money isn’t just “created”, it comes from somewhere, let’s say “society”. Income is the money you take from society, expense is the money you give back. That has to balance in the end. Think in terms of the movement of money: when you get paid, money flows from the person paying you (e.g. salary income) into your bank account.
What is equity? When you start a ledger, you have a net worth – the single numeric value that’s the sum of all of your assets. By setting up accounts, you are transferring/splitting your total equity into the respective accounts. So you debit that large amount from yourself, and credit it to the individual accounts. If your assets are greater than your opening balance equity, you’re making money:
ledger -f /path/to/file bal Assets 'Opening Balances' --collapse --exchange eur --basis
What if you want to see how much you spend with mastercard?
ledger -f /path/to/file reg ^Expenses -d 'account =~ /mastercard/' -r
This says, show expenses, but limit (-d
, display predicate) to acounts matching mastercard. Also need -r
to show related accounts (in double-entry, the other account), otherwise nothing shows up. Other useful switches are -b
for beginning date, -P
to group by payee (the description).
Filtering:
--limit
: before calculations--display
: after calculations