Speaker Name: Thanga Ayyanar @ Gold Ayan
About the talk: Ledger is a command-line based double-entry bookkeeping
application. Accounting data is stored in a plain text file, using a
simple format, which the users prepare themselves using other tools.
Ledger does not write or modify data, it only parses the input data
and produces reports
#+title: Ledger CLI
* Basics
** Double Entry system
- Debit(Decrease assets) and Credit (Increase assets)
* Accounts
** Assets
- These are things you own that have value.
- They can be things you can physically touch, like a car or a
computer, or things that have value but aren't physical, like a
stock certificate representing ownership in a company.
** Liabilities
- These are your debts, the money you owe to others.
- This could be a car loan, mortgage, credit card debt, or money owed to a friend.
** Income
- This is the money you earn regularly, like your salary from a job, rental income from a property, or interest earned on savings.
** Expense
- This is the money you spend to live.
- This includes things like rent or mortgage payments, utilities, groceries, transportation, and entertainment.
** Equity
- This is the difference between your assets and liabilities.
- In simpler terms, it's what you actually own after you consider all your debts.
* Simple Accounts
At the highest level you have five sorts of accounts:
- Expenses: where money goes,
- Assets: where money sits,
- Income: where money comes from,
- Liabilities: money you owe,
- Equity: the real value of your property.
* Ledger cli
** Syntax
#+begin_example
YYYY-MM-DD *(OPTIONAL) PAYEE
ACCOUNT-TYPE:SUB-TYPE.. PRICE
ACCOUNT-TYPE:SUB-TYPE..
...
#+end_example
** Other commodities
#+begin_src shell
ledger -f sample.ledger bal -V
#+end_src
- Net worth: Asset - Liabilities
#+begin_src shell
ledger -f sample.ledger balance Assets Liabilities -V
#+end_src
** Weekly, Monthly & Yearly
- Change M to W or Y for respective report
#+begin_src shell
ledger -M -f sample.ledger reg
#+end_src
* What's next
** Emacs Integration
#+begin_src elisp
(use-package ledger-mode
:init
(add-to-list 'auto-mode-alist '("\\.ledger\\'" . ledger-mode)))
#+end_src
*** Indian ruppee
- https://itsfoss.com/type-rupee-symbol-ubuntu/
#+begin_src elisp
(defun insert-indian-ruppee ()
(interactive)
(insert "₹"))
(global-set-key (kbd "C-c 4") 'insert-indian-rupee)
#+end_src
** Ledger web
- https://github.com/lifepillar/ledger2html/tree/master
- https://github.com/vifon/ledger-web
* Resources
- https://ledger-cli.org/docs.html
- https://devhints.io/ledger
- https://santhoshkris.medium.com/personal-finance-management-ledger-cli-c98dd37e786e
- https://github.com/rolfschr/GSWL-private
* Alternatives
- Similar to ledger
- Beancount (Python)
- Hledger (Haskell)
- Gnucash
- Simple ledger concepts, able to convert gnu cash file to ledger cli
- Also able to support small business owners with accounts
- https://gnucash.org/
- Firefly III
- Self hosting
- https://github.com/firefly-iii/firefly-iii
* Sample Data
** Official example
- https://ledger-cli.org/doc/ledger3.html#Example-Journal-File
** Indian example
#+begin_example
;Ledger - Year 2023
;source: https://santhoshkris.medium.com/personal-finance-management-ledger-cli-c98dd37e786e
commodity ₹
note Indian Ruppee
format ₹1,000.00
nomarket
alias INR
default
2023-01-01 * Opening balance
Assets:Savings:Kotak ₹10730.88
Liabilities:CC:IOB ₹-10726.76
Equity:Opening Balances
2023-01-04 * Airtel mobile payment
Expenses:Utilities:Mobile ₹470.82
Liabilities:CC:IOB
2023-01-05 * Paycheck
Income:Paycheck ₹-24000.00
Assets:Savings:Kotak
2023-01-05 BESCOM
Expenses:Utilities:BESCOM ₹1990.00
Liabilities:CC:IOB
2023-01-05 * Card payment
Liabilities:CC:IOB ₹10000.00
Assets:Savings:Kotak
2023-01-08 * BSNL
Expenses:Utilities:BSNL ₹395.00
Assets:Savings:Kotak
2023-01-14 Netflix
Expenses:Subscriptions:Netflix ₹199.00
Liabilities:CC:IOB
2023-01-21 Adobe Photography Pack
Expenses:Subscriptions:Adobe ₹807.09
Liabilities:CC:IOB
2023-02-02 BESCOM
Expenses:Utilities:BESCOM ₹2033.94
Liabilities:CC:IOB
2023-02-03 * Food - Chaat
Expenses:EatOut ₹120.00
Assets:Savings:Kotak
2023-02-03 * Indane Gas
Expenses:Utilities:Gas ₹902.50
Assets:Savings:Kotak
2023-02-04 Jetpens - Stationery
Expenses:Shopping:Stationery ₹7813.63
Liabilities:CC:IOB
2023-02-05 * Paycheck
Income:Paycheck ₹-24000.00
Assets:Savings:Kotak
2023-02-06 * Groceries
Expenses:Shopping:Groceries ₹1793.00
Assets:Savings:Kotak
2023-02-12 * BWSSB Water bill
Expenses:Utilities:BWSSB ₹996.00
Assets:Savings:Kotak
2023-02-12 * BSNL Landline
Expenses:Utilities:BSNL ₹388.00
Assets:Savings:Kotak
2023-02-12 * Card payment
Liabilities:CC:IOB ₹30000.00
Assets:Savings:Kotak
2023-02-12 Amazon - Monitor Arm
Expenses:Shopping:Gadgets ₹1989.00
Liabilities:CC:IOB
2023-02-12 Amazon BenQ Monitor
Expenses:Shopping:Gadgets ₹15000.00
Liabilities:CC:IOB
2023-02-14 Netflix
Expenses:Subscriptions:Netflix ₹199.00
Liabilities:CC:IOB
2023-02-15 * Groceries
Expenses:Shopping:Groceries ₹1180.00
Assets:Savings:Kotak
2023-02-19 ACT Cable
Expenses:Utilities:Cable ₹334.39
Liabilities:CC:IOB
2023-03-01 Shell
Expenses:Travel:Petrol 3 LITER {=₹102.23}
Assets:Savings:Kotak
#+end_example
1 Like
https://www.petekeen.net/topic/Finance
Pete Keen has provided some other use case for using ledger in his blog. Kindly check it out if you are interested
ledger mode talk at emacs conference in 2019,
https://emacsconf.org/2019/talks/12/