Files
bookspec/examples/tax-category-required.toml
T
swaitsandClaude Opus 5.5 06347159f0 P3: rename accounts, one set of period defaults, tax categories warn or refuse (defects 15, 16, 8)
books.rename_account; account names trimmed, bounded, refused when a
sibling's or TIN-shaped; books.show refuses what its target ignores. A
report asked for without dates covers this fiscal year so far, everywhere
(one rule for tools, descriptions and the viewer; the IIF and CPA package
keep their own dates). policy.require_tax_category warns or refuses; a
Form 4797 gain is shown apart on every return.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T3gXMVt7XJPi6ens1or9Dj
2026-10-21 10:41:24 -06:00

129 lines
4.5 KiB
TOML

# Every revenue and expense account maps to a line of the return.
#
# wanderbooks: P3 defect 8 (an account made without a tax category went
# unnoticed); rules.md B-32; regression tests
# `add_account_warns_without_tax_category_defect_8` and
# `require_tax_category_refuses_defect_8` (ledger-mcp
# tests/spec_tax_policy.rs), `prop_tax_policy_refuses_exactly` (ledger-store
# tests/store.rs), `needs_attention_flags_every_uncategorized_pl_account_defect_8`
# (ledger-gui tests/view_model.rs).
#
# Expected values (bookspec/README.md): `uncategorized_accounts` lists
# every account that needs a category and has none, by code; each command
# is tried on a copy of the books under the policy in force when it is
# asked: `warn` (the default) after entry 1, `refuse` from then on.
id = "tax-category-required"
title = "Every revenue and expense account maps to a line of the return"
rule = "A revenue or expense account that is not a header MUST have a tax category, its link to a line of the income tax return, and every such account without one MUST be listed for the human, with activity or not. By default an account created without one is created (and listed); a company MAY refuse to create such an account without one, or to clear one it has. The accounts the books create for a bill, an invoice or a payroll run MUST NOT be refused: they are listed instead."
status = "CHOICE"
sources = [
"IRS Publication 583 (Rev. December 2024): \"Your books must show your gross income, as well as your deductions and credits.\" (why it matters: AUTHORITY; docs/spec/sources/irs-records.md)",
"Rev. Proc. 98-25 §5.01: the relationship \"between the total of the amounts in the taxpayer's machine-sensible records by account and the taxpayer's return\" (AUTHORITY; docs/spec/sources/irs-records.md)",
"IRS Publication 583: \"Except in a few cases, the law does not require any specific kind of records.\" (so warn or refuse is the company's choice; docs/spec/sources/irs-records.md)",
"DECISION, the owner, 2026-10-20 (wanderbooks plan/served.md P3, \"Settled in design\"): warn by default, header accounts exempt (wanderbooks docs/spec/rules.md B-32)",
]
tags = ["tax", "chart", "policy"]
[setup]
currency = "USD"
fiscal_year_start = "01-01"
basis = "accrual"
rounding = "half-even"
[[setup.accounts]]
code = "1000"
name = "Cash"
type = "asset"
[[setup.accounts]]
code = "4000"
name = "Sales"
type = "revenue"
tax_category = "gross_receipts"
[[setup.accounts]]
code = "6000"
name = "Operating"
type = "expense"
header = true
[[setup.accounts]]
code = "6150"
name = "Software"
type = "expense"
parent = "6000"
[[setup.accounts]]
code = "6160"
name = "Hosting"
type = "expense"
parent = "6000"
# Entry 1: Hosting used in the year before; Software never.
[[events]]
date = "2025-06-01"
description = "Hosting"
lines = [
{ account = "6160", side = "debit", amount = "12.00" },
{ account = "1000", side = "credit", amount = "12.00" },
]
# Entry 2, under refuse: a bill, whose expense account (General Expenses,
# 6999) the books create without a category, never refused.
[[events]]
date = "2026-02-01"
description = "Hosting, billed"
bill = { vendor = "Example Hosting Co", amount = "42.00" }
# After entry 1 (and its expectations), the company turns to refuse.
[[changes]]
after = 1
require_tax_category = "refuse"
# Under warn: every account without a category listed, active or not
# (the header needs none); one created without one is created.
[[expect]]
query = "uncategorized_accounts"
after = 1
values = ["6150 Software", "6160 Hosting"]
[[expect]]
query = "add_account"
after = 1
account = { code = "6170", name = "Domains", type = "expense" }
accepted = true
# Under refuse: refused without one, created with one; a header needs
# none; a needed category can't be cleared, but can be set; the accounts
# made earlier stay as they are, and the bill's is listed.
[[expect]]
query = "add_account"
account = { code = "6180", name = "Postage", type = "expense" }
refused = "tax_category_required"
[[expect]]
query = "add_account"
account = { code = "6180", name = "Postage", type = "expense", tax_category = "office_expense" }
accepted = true
[[expect]]
query = "add_account"
account = { code = "6900", name = "Other", type = "expense", header = true }
accepted = true
[[expect]]
query = "set_tax_category"
code = "4000"
refused = "tax_category_required"
[[expect]]
query = "set_tax_category"
code = "6150"
category = "other_deductions"
accepted = true
[[expect]]
query = "uncategorized_accounts"
values = ["6150 Software", "6160 Hosting", "6999 General Expenses"]