I've been using Ledger to keep track of my finances for several years, and one feature I really like is the ability to run reports from within Emacs via ledger-mode.
Creating these reports is done by customizing the ledger-reports
variable. It's also possible to set them using the ledger-reports-add
function, but I prefer to set them all in one go during setup.
My current list of reports looks like this:
(setq ledger-reports
'(("bal" "%(binary) -f %(ledger-file) bal")
("bal this month" "%(binary) -f %(ledger-file) bal -p %(month) -S amount")
("bal this year" "%(binary) -f %(ledger-file) bal -p 'this year'")
("net worth" "%(binary) -f %(ledger-file) bal Assets Liabilities")
("account" "%(binary) -f %(ledger-file) reg %(account)")))
bal- Shows the balance of all accounts; this also includes individual
expenses (such as
Expense:Car:Gas) so it's a pretty long report. bal this month- As above, but only includes transactions from the current month.
bal this year- Same as
bal, but limited to the current year. net worth- A short report that shows what I've got in each account, as well as what I owe on loans and credit cards.
account- This prompts for an account name and then shows its transactions for the current file. This is useful for quickly seeing how much money has been spent on a specific category during the year.
Emacs reports that have the %(ledger-file) token are run against the current
ledger file. I have my Ledger files stored in a projectile project so I can
quickly jump to them to run reports or make adjustments.