Skip to content

Instantly share code, notes, and snippets.

@simonmichael
Last active November 21, 2021 17:52
Show Gist options
  • Save simonmichael/10596645 to your computer and use it in GitHub Desktop.
Save simonmichael/10596645 to your computer and use it in GitHub Desktop.
seeking minimal ledger budget examples
; whenever there's a food expense, deduct the same amount from the budget
= /^expenses:food$/
(budget:food) -1
1/1 opening balances
assets:checking 1000
equity:opening balances
1/2 budget allocation ; could also do this with an automated posting on income txns
(budget:food) 200
1/3 purchase food
expenses:food 20
assets:checking
1/2 purchase food
expenses:food 30
assets:checking
$ ledger -f budget.ledger bal
950 assets:checking
150 budget:food
-1000 equity:opening balances
50 expenses:food
--------------------
150
$ ledger -f budget.ledger reg budget
02/01/2014 budget allocation (budget:food) 200 200
03/01/2014 purchase food (budget:food) -20 180
02/01/2014 purchase food (budget:food) -30 150
$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment