Files
bookspec/examples/statement-the-books-balance-and-the-equation-holds.toml
T
swaitsandClaude Fable 5.1 790ec8c0e6 feat(bookspec): the specification text and an example for the ledger's own laws (P13 step 4)
bookspec/spec holds the first edition: the model and the five laws
(00-model.md) and one file per area, each B-rule a section with its
status, a MUST/MAY statement, sources pinned either to a vendored source
with a verbatim quotation or to an exact external paragraph, its symbolic
form, its examples and its applicability. B-39, B-40, B-43 and B-45 are
reserved sections (allocated, not yet stated in rules.md); B-44 is stated
in rules.md and now carries its bookspec id and CONVENTION status.

Eight new examples show the laws that had none, each figure worked by
hand: an unbalanced entry is refused (Pacioli ch. 36, Pub. 583), a
negative or zero line is refused, a fraction of a cent is refused (ISO
4217), a child account takes its parent's type, the trial balance and the
accounting equation on one small book (cash 6550.25 = loan 2000 + capital
5000 + (sales 750.50 - rent 1200.25)), a reversal leaves the original
standing and a second reversal is refused, a close sweeps revenue and
expenses into Retained Earnings (3999) and the closed quarter takes no
late entry, and cents add exactly. The refusal vocabulary gains
unbalanced, negative_amount, zero_amount, too_few_lines,
finer_than_minor_unit, parent_type_mismatch, already_reversed and
period_closed; a refused entry may carry a non-positive amount.

The checker's spec.rs fails the build on a rule without its section, a
statement without MUST/SHOULD/MAY, a pin that is not verbatim in its
vendored source, examples that differ from the catalogue, or more than 60
pages.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp
2026-10-29 12:51:30 -06:00

114 lines
3.0 KiB
TOML

id = "statement-the-books-balance-and-the-equation-holds"
title = "Normal balances, the trial balance and the accounting equation on one small book"
rule = "An account MUST show its balance on its normal side (assets and expenses debit, liabilities, equity and revenue credit); the trial balance's debits MUST equal its credits; and assets MUST equal liabilities plus equity plus revenue less expenses."
status = "AUTHORITY"
sources = [
"Pacioli, Summa (1494), ch. 36: the total of the credits equals the total of the debits (docs/spec/sources/pacioli-1494.md)",
"FASB Concepts Statement 8, Ch. 4, E62: equity \"is the difference between the entity's assets and its liabilities\" (docs/spec/sources/fasb-asc.md)",
"OpenStax, Principles of Accounting, Vol. 1, 3.1: normal balances (CONVENTION; docs/spec/rules.md B-5)",
]
tags = ["accrual", "book", "us", "statement", "equation"]
[setup]
currency = "USD"
fiscal_year_start = "01-01"
basis = "accrual"
rounding = "half-even"
[[setup.accounts]]
code = "1000"
name = "Cash"
type = "asset"
[[setup.accounts]]
code = "2000"
name = "Loan"
type = "liability"
[[setup.accounts]]
code = "3000"
name = "Capital"
type = "equity"
[[setup.accounts]]
code = "4000"
name = "Sales"
type = "revenue"
tax_category = "gross_receipts"
[[setup.accounts]]
code = "6000"
name = "Rent"
type = "expense"
tax_category = "rent_property"
[[events]]
date = "2026-01-02"
description = "Members put in cash"
lines = [
{ account = "1000", side = "debit", amount = "5000.00" },
{ account = "3000", side = "credit", amount = "5000.00" },
]
[[events]]
date = "2026-01-03"
description = "A loan"
lines = [
{ account = "1000", side = "debit", amount = "2000.00" },
{ account = "2000", side = "credit", amount = "2000.00" },
]
[[events]]
date = "2026-01-10"
description = "A sale"
lines = [
{ account = "1000", side = "debit", amount = "750.50" },
{ account = "4000", side = "credit", amount = "750.50" },
]
[[events]]
date = "2026-01-15"
description = "Rent"
lines = [
{ account = "6000", side = "debit", amount = "1200.25" },
{ account = "1000", side = "credit", amount = "1200.25" },
]
# By hand. Cash: 5000.00 + 2000.00 + 750.50 - 1200.25 = 6550.25.
# Debit side: cash 6550.25 + rent 1200.25 = 7750.50.
# Credit side: loan 2000.00 + capital 5000.00 + sales 750.50 = 7750.50.
[[expect]]
query = "trial_balance"
as_of = "2026-12-31"
[expect.values]
"1000" = "6550.25"
"2000" = "-2000.00"
"3000" = "-5000.00"
"4000" = "-750.50"
"6000" = "1200.25"
# Each on its normal side, all positive here; the equation:
# assets 6550.25 = liabilities 2000.00 + equity 5000.00
# + (revenue 750.50 - expenses 1200.25) = 6550.25.
[[expect]]
query = "balances"
as_of = "2026-12-31"
[expect.values]
"1000" = "6550.25"
"2000" = "2000.00"
"3000" = "5000.00"
"4000" = "750.50"
"6000" = "1200.25"
# The trial balance as of an earlier day balances too: on January 9 there
# is no sale and no rent.
[[expect]]
query = "trial_balance"
as_of = "2026-01-09"
[expect.values]
"1000" = "7000.00"
"2000" = "-2000.00"
"3000" = "-5000.00"
"4000" = "0.00"
"6000" = "0.00"