Ledger is a double entry accounting system. This means ledger is like the law of thermodymnics. No energy is ever lost or destroyed. In the same way no money is ever lost or destroyed. So in ledger to say that you made $500 from your paycheck, your boss gave you $-500 dollars.
#+BEGIN_SRC ledger 2015/11/25 Paycheck Assets:Checking $25.00 Income:Salary $-25.00 #+END_SRC
The ultimate goal is ledger is to show you how much money you can spend.
Most older folks you a checkbook journal to record their withdraws from their checking account. Ledger is a general journal. It records additions and subtractions (credits and debits).
Transactions happens when you money either leaves your bank account or enters your bank account. There are several possible initials characters that Ledger must see when reading a transaction.
] DESC
If * follows the date, then it means that the trasaction has cleared. If ! follows the date, it means that the transaction is pending.
The next line that follows must be ACCOUNT AMOUNT [; NOTE]
Some examples
2017/05/10 ! bought groceries
Expenses:Groceries $35
Assets:Bank account
Notice that the date is formatted as YEAR/MM/DD.
This is a pending transaction. You swiped your card, but your bank has not released the funds yet.
2017/05/10 * bought DVD
Expenses:Entertainment $5
Assets:Bank account
This is a complete transaction. I swiped my card, and the bank has let go of my funds. You can get an overview of your transactions via this ledger command:
It primarily shows you your transactions.
ledger -f <ledger file> balance
It's also probably a good idea to set up some default ledger accounts. This way, ledger will warn you if one of your transactions contain a misspelling. Perhaps you could have some accounts like so:
account Expenses:Cash
alias envelopes
account Expenses:Insurance
alias insurance
account Expenses:Tithe
account Expenses:Groceries
alias groceries
account Expenses:Auto:Gas
alias gas
account Expenses:Date
alias date
account Expenses:Tithe
alias tithe
account Expenses:Rent
alias rent
account Expenses:Electric
alias electric
bucket Assets:Bank Account
If you also use the "--strict option" and you accidentally spell "Expenses:bank accout", Ledger will warn you that you've made a mistake.
ledger balance -f budget.ledger
You can also get a detailed report of your monthly expenses:
ledger -M register -f budget.ledger
This output can look a bit too much. What if you only want to see what you spent on Rent last month? You could do this:
ledger --strict -f budget.ledger Expenses:Rent
You can also limit transactions to after a begin date
ledger --strict -f budget.ledger -b '2018/06/01'
info:ledger-mode#Transactions that occur on specific dates
I can use no-web or tangle
2018/07/05 * Dinner and a movie
Expenses:Entertainment $30
Assets:Bank Account
; :SILLYTAG:
Tags can also have values
2018/03/01 * lost bet on the baseball game
Expenses:Gambling $20
Assets:Bank Account $20
; Jeff is smarter than me. He bet $0.
; JEFF:0
2011/01/27 Book Store Expenses:Books $20.00 Assets:Checking $-20.00
2011/12/01 Sale Expenses:Entertainment:Date $ 30.00 Assets:Checking $-30.00
I write
2011/01/27 Book Store Expenses:Books $20.00
2011/12/01 Sale Expenses:Entertainment:Date $ 30.00
And ledger is smart enough to know what I mean.
Capture is amazing. It lets you replace any regexp with an account name. It's like alias on steroids
capture Expenses:Debt:"College Loan" Debt
Now any time I write Debt as an occount, ledger know I'm referring to Expenses:Debt:"College Loan"
Let's me define expressions for future use.
For example, let's say that my rent is currently $500 a month.
define rent=$500
2015/05/01 Rent Expenses:Rent rent
If sometime later rent changes I can just update the cost of rent
define rent=$600
You can also use define variables like
(rent*2)
apply tag hastag apply tag nestedtag: true
2011/01/25 Tom's Used Cars Expenses:Auto $ 5,500.00 ; :nobudget: Assets:Checking
2011/01/27 Book Store Expenses:Books $20.00 Liabilities:MasterCard
end apply tag
2011/12/01 Sale Assets:Checking:Business $ 30.00 Income:Sales
end apply tag
is the equivalent of:
2011/01/25 Tom's Used Cars ; :hastag: ; nestedtag: true Expenses:Auto $ 5,500.00 ; :nobudget: Assets:Checking
2011/01/27 Book Store ; :hastag: ; nestedtag: true Expenses:Books $20.00 Liabilities:MasterCard
2011/12/01 Sale ; :hastag: Assets:Checking:Business $ 30.00 Income:Sales
I just need to set a periodic transaction at the top of my ledger file.
; there are my monthly expenses
~ Monthly
rent $1000
Expenses:Auto:Gas $80
Expenses:Groceries $500
Expenses:Tithe $100
Expenses:Debt $200
Expenses:Electric $100
Assets