Last year a client nearly went under. Not because the business was unprofitable - they had a 15% margin on paper. They ran out of cash because three big invoices came in late while payroll and rent were due the same week.
That’s when I built them a 13-week rolling cash flow forecast in Beancount. It’s now the single most valuable report I produce for any client, and I’ve adapted it for my own bookkeeping business. Here’s the system.
Why 13 Weeks?
Thirteen weeks is one quarter. It’s long enough to see problems coming but short enough to forecast with reasonable accuracy. Monthly forecasts miss the week-to-week timing mismatches that kill small businesses. Annual budgets are too abstract to prevent a cash crunch in March.
The 13-week forecast answers one question: Will I be able to pay my bills every week for the next three months?
The Beancount Structure
Accounts for Cash Flow Tracking
; Operating accounts - where cash actually lives
2025-01-01 open Assets:Business:Checking:Main USD
2025-01-01 open Assets:Business:Checking:Payroll USD
2025-01-01 open Assets:Business:Savings:Reserve USD
; Receivables - money owed TO you
2025-01-01 open Assets:Business:Receivables:ClientA USD
2025-01-01 open Assets:Business:Receivables:ClientB USD
2025-01-01 open Assets:Business:Receivables:ClientC USD
; Payables - money you OWE
2025-01-01 open Liabilities:Business:Payables:Vendors USD
2025-01-01 open Liabilities:Business:CreditCard:Chase USD
2025-01-01 open Liabilities:Business:LOC USD ; Line of credit
The Weekly Cash Position Note
Every Friday, I update a note directive that serves as the cash flow forecast. This is the core of the system:
2025-02-07 note Assets:Business:Checking:Main "
=== 13-WEEK CASH FLOW FORECAST ===
As of: Friday, February 7, 2025
Starting cash: $42,500
WEEK 1 (Feb 10-14):
IN: ClientA payment (+$8,500) - Invoice #1042, Net 30, sent Jan 12
IN: ClientC retainer (+$3,000) - Auto-ACH Monday
OUT: Payroll (-$12,000) - Friday
OUT: AWS hosting (-$450) - Auto-debit Tuesday
OUT: Office rent (-$2,800) - Due 15th
NET: -$3,750
ENDING CASH: $38,750
WEEK 2 (Feb 17-21):
IN: ClientB milestone payment (+$15,000) - Project complete, Net 15
IN: ClientA retainer (+$3,000) - Auto-ACH Monday
OUT: Payroll (-$12,000) - Friday
OUT: Contractor invoice (-$4,500) - Net 30 from Jan 20
OUT: Insurance (-$850) - Quarterly, due Feb 20
NET: +$650
ENDING CASH: $39,400
WEEK 3 (Feb 24-28):
IN: ClientC project phase 2 (+$12,000) - Upon approval, estimated
OUT: Payroll (-$12,000) - Friday
OUT: Software subscriptions (-$380) - Various, month-end
NET: -$380
ENDING CASH: $39,020
... (weeks 4-13 continue)
WEEK 13 (May 5-9):
... (projected)
ENDING CASH: $51,200
=== ALERTS ===
WEEK 6 (Mar 17-21): Cash dips to $28,400
- Quarterly tax payment ($9,200) + normal expenses
- ACTION: Ensure ClientB pays by Mar 10
- CONTINGENCY: Draw $5,000 from LOC if needed
MINIMUM CASH THRESHOLD: $25,000
WEEKS BELOW THRESHOLD: 0 (if all goes to plan)
WEEKS AT RISK: Week 6 (within $3,400 of threshold)
"
What Makes This Different From a Budget
A budget tells you what you plan to spend. A cash flow forecast tells you when money will actually move. The distinction matters because:
2025-01-15 note Assets:Business "
=== BUDGET vs CASH FLOW ===
EXAMPLE: January revenue is $45,000 on paper
BUDGET VIEW:
January revenue: $45,000
January expenses: $38,000
January profit: $7,000
Looks great!
CASH FLOW VIEW:
Week 1: $3,000 in (retainer), $14,800 out (payroll + rent)
Week 2: $0 in (waiting on invoices), $12,000 out (payroll)
Week 3: $8,500 in (one invoice paid), $12,450 out (payroll + vendor)
Week 4: $33,500 in (three invoices paid), $12,000 out (payroll)
Week 2 cash: NEGATIVE $11,800 from starting position
You need $24,800 of cash reserves to survive January
Even though you'll end January with +$7,000
THIS IS HOW PROFITABLE BUSINESSES GO BROKE.
Cash timing kills more businesses than bad margins.
"
Building the Forecast from Beancount Data
Step 1: Know Your Receivables Aging
I run this query to see what’s outstanding and when it’s expected:
SELECT
account,
sum(position) as outstanding
WHERE
account ~ 'Receivables'
AND year = 2025
GROUP BY account
ORDER BY sum(position) DESC
Then I tag each receivable with expected collection timing:
; When I send an invoice, I record the receivable with metadata
2025-01-12 * "ClientA" "Project Alpha - Phase 3 complete"
Assets:Business:Receivables:ClientA 8,500.00 USD
Income:Business:Consulting -8,500.00 USD
invoice_number: "1042"
payment_terms: "Net 30"
expected_payment: "2025-02-11"
collection_confidence: "HIGH" ; Always pays on time
2025-01-20 * "ClientD" "Website redesign - 50% milestone"
Assets:Business:Receivables:ClientD 6,000.00 USD
Income:Business:Consulting -6,000.00 USD
invoice_number: "1045"
payment_terms: "Net 45"
expected_payment: "2025-03-06"
collection_confidence: "MEDIUM" ; Sometimes 1-2 weeks late
Step 2: Know Your Fixed Outflows
2025-01-01 note Liabilities:Business "
=== FIXED WEEKLY/MONTHLY OUTFLOWS ===
WEEKLY:
Payroll (every Friday): $12,000
MONTHLY (fixed dates):
Rent (1st): $2,800
AWS/hosting (auto-debit): $450
Software subscriptions: $380
Phone/internet: $185
QUARTERLY:
Insurance (Feb, May, Aug, Nov): $850
Estimated taxes (Apr, Jun, Sep, Jan): $9,200
ANNUAL:
Business license (March): $350
Professional liability (June): $2,400
Equipment refresh (budgeted): $5,000
TOTAL FIXED MONTHLY: ~$28,815
This number is your survival line.
If revenue drops, you need this much to keep the lights on.
"
Step 3: Track Collection Patterns
This is where Beancount metadata really shines. Over time, you build a picture of how each client actually pays:
2025-02-11 * "ClientA" "Payment received - Invoice 1042"
Assets:Business:Checking:Main 8,500.00 USD
Assets:Business:Receivables:ClientA -8,500.00 USD
invoice_number: "1042"
days_to_pay: 30 ; Exactly on terms
collection_note: "Always reliable, auto-ACH"
2025-03-18 * "ClientD" "Payment received - Invoice 1045"
Assets:Business:Checking:Main 6,000.00 USD
Assets:Business:Receivables:ClientD -6,000.00 USD
invoice_number: "1045"
days_to_pay: 57 ; 12 days late
collection_note: "Needed reminder email on day 40"
After a year of tracking, you know: ClientA always pays in 30 days. ClientD averages 52 days. ClientB pays in 15 days but sometimes holds to 25. You forecast accordingly.
The Client That Almost Went Under
Back to my client’s story. Their problem was textbook:
2024-06-01 note Assets:Business "
=== WHAT HAPPENED ===
JUNE 2024 CASH CRISIS:
Starting cash: $18,000
Month revenue (accrued): $52,000
Month expenses: $44,000
Profit on paper: $8,000
ACTUAL CASH TIMELINE:
Week 1: -$14,000 out (payroll + rent), $0 in
Week 2: -$12,000 out (payroll), $3,000 in (one small payment)
Week 3: -$16,500 out (payroll + quarterly tax), $0 in
Week 4: -$12,000 out (payroll), $49,000 in (three late payments)
Cash balance by week:
Start: $18,000
Week 1: $4,000
Week 2: -$5,000 <-- OVERDRAFT
Week 3: -$21,500 <-- CRISIS
Week 4: $15,500 <-- Recovery, but damage done
CONSEQUENCES:
- $850 in overdraft fees
- Missed contractor payment, damaged relationship
- Emergency LOC draw at 12% APR
- Stress-related health issues for the owner
- All because three clients paid in week 4 instead of weeks 1-3
"
A 13-week forecast would have flagged this six weeks in advance. They could have:
- Sent early payment reminders to key clients
- Delayed a discretionary expense
- Drawn the LOC proactively at better terms
- Negotiated the quarterly tax payment
The Weekly Ritual
Every Friday, I spend 30 minutes:
- Record the week’s actual cash movements
- Compare actual vs. forecast (was I right?)
- Roll the forecast forward one week
- Flag any weeks where cash drops below threshold
- Take action on any alerts from the next 3 weeks
This 30-minute weekly habit has prevented more financial crises than any other practice in my 10 years of bookkeeping.
Questions for Discussion
- Do you forecast cash flow at all? If so, what timeframe and method?
- How do you handle uncertainty? Some of my clients’ receivables are genuinely unpredictable (government contracts, for example).
- Personal finance version: Has anyone adapted this for personal cash flow? Timing of paychecks, bills, and quarterly tax payments can create the same crunch.
- Automation: I’m doing this manually with note directives. Has anyone built a Beancount plugin or Python script that generates a cash flow projection from receivables metadata?
The spreadsheet world has dozens of 13-week templates. I think Beancount can do it better because we already have the transaction data, the metadata, and the query language. We just need to connect them into a forecasting workflow.