Beancount: check a statement close at the next day’s opening
Updated · 3 min read
A Beancount balance directive checks the start of its date, before that date’s transactions. If a statement’s value is explicitly the closing balance at the end of October 31, the corresponding simple daily assertion belongs on November 1. Keep the bank’s transaction dates unchanged; moving transactions to silence a failed assertion changes the evidence.
This guide is for a Beancount user turning a statement boundary into a check. The official language documentation defines the timing and commodity scope. First establish whether your source amount is an opening or closing value: a date printed next to a balance does not settle that question on its own.
The desktop apps export date, description, and amount as CSV. Open CSV in Excel to save an XLSX workbook. Statement support varies: verify the result against your own PDF.
Reproduce the daily-boundary example
We ran five invented USD cases with Beancount 3.2.3, using bean-check in an isolated Python environment on October 16, 2026. No bank file, import adapter or customer ledger was used. The passing case is:
option "title" "SYNTHETIC bank cutoff demonstration"
2026-01-01 open Assets:Checking USD
2026-01-01 open Equity:Opening-Balances USD
2026-01-01 open Income:Example USD
2026-01-01 open Expenses:Example USD
2026-10-30 * "SYNTHETIC opening"
Assets:Checking 100.00 USD
Equity:Opening-Balances -100.00 USD
2026-10-31 * "SYNTHETIC cutoff-day receipt"
Assets:Checking 25.00 USD
Income:Example -25.00 USD
2026-11-01 * "SYNTHETIC next-day payment"
Assets:Checking -5.00 USD
Expenses:Example 5.00 USD
2026-11-01 balance Assets:Checking 125.00 USD
Save the example as cutoff.bean and run bean-check cutoff.bean with that version. The invented account has $100 before October 31, receives $25 on October 31 and pays $5 on November 1. The November 1 assertion expects $125, because it precedes the $5 payment. The balance after that payment would be $120, which is a different boundary.
Compare the five executed controls
| Case | Assertion | Observed exit code | Meaning |
|---|---|---|---|
| Correct next-day boundary | November 1, 125 USD | 0 | Includes October 31’s receipt |
| Closing amount asserted a day early | October 31, 125 USD | 1 | Accumulated amount is 100 USD at that opening |
| Correct cutoff-day opening | October 31, 100 USD | 0 | Tests before the receipt |
| Directive moved earlier in the file | November 1, 125 USD | 0 | Physical placement does not redefine dated semantics |
| Next-day payment wrongly included | November 1, 120 USD | 1 | The assertion still sees 125 USD, not the later payment |
The two failures are useful negative controls, not errors to conceal. The implementation of balance checks also distinguishes a check from an instruction to alter the account to the claimed amount.
Interpret a failure without forcing a balance
- Confirm account identity and the source’s exact boundary. Do not use today’s available balance for a historical cutoff.
- Check transactions on the cutoff date and the assertion date. Determine which belong before the asserted opening.
- Check the asserted commodity. A USD assertion is not a check of a separate EUR balance.
- Preserve the failed output, source values and unresolved rows. Investigate missing, duplicated or misdated entries before considering a correction.
These controls do not cover time-zone conversions, intraday cutoffs, liabilities or multi-currency accounting. A passing check also cannot detect two omissions that cancel each other. Combine it with row identities and the statement reconciliation process.
Keep the next-day rule conditional on the source
Use the following day for a documented end-of-day closing value. Use the stated day for a documented opening value. If the source does not establish which it is, keep the assertion decision unresolved. The deliverable is a correctly dated check with its source boundary and reproducible output, not a journal adjustment that makes an unexplained difference disappear.
Synthetic review case. The values are teaching data, not a vendor export or an import file.
For a bank source available only as PDF, download LocalExtract. It processes one PDF locally into date,description,amount CSV; review and adapt those rows for the actual destination.
Related guide: Bank statement reconciliation: balances, matches and exceptions.
Documentation for the added task checked October 16, 2026.
LocalExtract Team
We build LocalExtract, a desktop bank statement converter. Questions or corrections? Contact · Editorial policy