All rules

A closing balance that is not the opening balance plus deposits less withdrawals

closing-balance-mismatchon by defaultJapanese / English

A closing balance that is not the opening balance plus deposits less withdrawals

Example

Flagged
- Opening balance: $2,418.36 - Total deposits: $2,941.80 - Total withdrawals: $3,203.60 - Closing balance: $2,165.56
What chaff prints
4:20 "$2,165.56" is written, but the opening balance plus deposits less withdrawals is $2,156.56
Fixed
- Opening balance: $2,418.36 - Total deposits: $2,941.80 - Total withdrawals: $3,203.60 - Closing balance: $2,156.56
What chaff prints
no finding

How to fix

Check which of the opening balance, the two totals and the closing balance is right, and correct the others.

Why it matters

On a statement summary the closing balance is the opening balance plus the total deposits less the total withdrawals. The reader takes the closing balance as given and does not add it up again. It goes wrong when a transaction is corrected and the balance is not, when the balance is copied from last month's statement, or when a digit is mistyped. When one table or one section names the balance at the start (Opening balance), the total paid in (Total deposits), the total paid out (Total withdrawals) and the balance at the end (Closing balance) once each, each with an amount, the closing balance is compared with the sum. A table whose header row has the four names is compared row by row, and one whose first column has them column by column. Outside tables, the lines of a section (from one heading to the next) that are only a name and an amount ("Opening balance: $2,418.36") are read. Which words name the four is in the language package's lexicon closing-balance-label. Amounts with a currency mark must agree to the cent. Amounts in thousands, and numbers without a mark, may be rounded, so a difference of up to two steps of their last digit is not reported. A dated note after a name (as of June 30, 2026) is not a unit, and a bare number under a column heading that is a unit word (Points) is read in that unit.

What it does not flag

A table or section without one of the four names, a table column or section that names one of them twice, names spread over separate tables or sections, amounts in different units (yen and dollars, thousands and units), and a value that is not a plain number (—, a negative or bracketed value) are not compared. A transaction table with Date, Deposit, Withdrawal and Balance columns is left to running-balance-mismatch, which checks it row by row. An amount inside a sentence ("The closing balance is $2,156.56") is not read, nor is a name not in the lexicon (Credits and Debits, which on a card statement move the other way). A sum below zero is not reported either.

Turning it off or relaxing it

Silence this one spot (in the document)
<!-- stet: closing-balance-mismatch — reason -->
Relax it for the team (the reason is kept as a comment in chaff.yaml)
npx chaffjs relax closing-balance-mismatch --why "reason"
Turn it off for the team (chaff.yaml)
rules: closing-balance-mismatch: off
Technical details
Layer
L3
Status
stable
Severity
warning
Languages
Japanese and English
Suited to
business, technical, blog, legal, docs, academic, literature, speech

Levels

Set a level for this rule under rules in chaff.yaml. With nothing set, it runs at the level its genre gives it (see By genre below).

stricterror
normalwarning
relaxedinfo

This rule has no limit to count to. A level sets how a finding is marked: relaxed keeps the finding and marks it a step lower.

By genre

Runs by default in
technical/spec, technical/readme, blog/tech, blog/essay, blog/owned-media, business/proposal, business/report, business/email, business/press-release, business/meeting-notes, legal/contract, legal/statute, legal/judgment, legal/patent, docs/manual, docs/faq, docs/glossary, academic/paper, speech/address, speech/transcript
Turned off by the genre in
literature/fiction, literature/essay, literature/poetry, literature/play

Genres

Message

"{written}" is written, but the opening balance plus deposits less withdrawals is {expected}

This page is built from the rule's definition file:packages/chaff/rules/closing-balance-mismatch.yaml