跳到主要内容

Envelope Budgeting Example — beancount.io

A Beancount ledger demonstrating envelope (zero-based) budgeting: giving every dollar a job before it is spent, and seeing immediately when a category runs dry. 账本备注

2026年3月
最后一笔记录 2026年3月31日(7个月前)
各期间数据
期间净值收入开支净利润
2026-01-3112,825.74 USD4,100.00 USD2,474.26 USD1,625.74 USD
2026-02-2815,275.74 USD4,100.00 USD1,650.00 USD2,450.00 USD
2026-03-3118,775.74 USD4,100.00 USD600.00 USD3,500.00 USD

财务状况2026年3月31日

净值

18,775.74 USD

+3,500.00 USD · +22.9%较上月

资产

18,775.74 USD

负债

—

无负债

资金流动2026年3月

资金流入

4,100.00 USD

前 2 个月平均4,100.00 USD

主要来源

资金流出

600.00 USD

前 2 个月平均2,062.13 USD低 71%

主要支出

现金流

正在加载账户角色…

近期活动

3月31日

3月14日

3月5日

2月5日

2月2日

README.md

Envelope Budgeting Example — beancount.io

A Beancount ledger demonstrating envelope (zero-based) budgeting: giving every dollar a job before it is spent, and seeing immediately when a category runs dry.

The method rests on one idea — envelopes are equity, not assets. The money is already in the bank; budgeting only decides what it is promised to. So an allocation moves value between equity subaccounts and never touches Assets, which is why the overlay can never disturb your bank reconciliation.

The ledger also declares matching native custom "budget" targets for each expense account. The equity postings provide rollover envelope balances; the custom directives power beancount.io's Budget report and its budget-versus-actual charts. They are complementary views of the same monthly plan.

Quick Start

bash
make install   # Install beancount + fava via uv
make check     # Verify the ledger has zero errors
make serve     # Open Fava at http://localhost:4739

File Guide

FileWhat it demonstrates
main.beanEntry point — options and include directives
accounts.beanCommodity definitions, real accounts, and the envelope tree
budgets.beanNative monthly targets used by the beancount.io Budget report
transactions/opening.beanStarting balances, and what "to be budgeted" means
transactions/funding.beanAssigning income to envelopes — kept separate from income arriving
transactions/spending.beanThe four-posting purchase: two for the money, two for the plan
transactions/overspending.beanAn envelope going negative, and covering it deliberately
transactions/sinking-funds.beanFunding an irregular bill monthly instead of being surprised by it
transactions/reset.beanRetiring a category, and reconciling against the bank

The one thing to copy

Spending is four postings, readable as two independent pairs:

beancount
2026-01-08 * "Whole Foods" "Weekly shop"
  Assets:Bank:Checking       -128.44 USD   ; what your bank sees
  Expenses:Groceries          128.44 USD
  Equity:Budget:Groceries    -128.44 USD   ; what your budget sees
  Equity:Budget:Unallocated   128.44 USD

Each pair balances on its own, so the budget overlay is always safe to add, remove, or ignore.