docs(handbook): the invoices-and-bills procedure, whole (P4b S4.5)

Step 1 now covers the issue: preview first (nothing written, the DRAFT PDF,
an abandoned preview uses no number), confirm only after the human has
seen it, the filed issued copy that a later look never replaces,
quantities and prices, the PO, and the snapshot of the customer at issue.
Step 6 is the CPA's list: agings tied to 1200 and 2000, sequential numbers
with voids visible, bills on their real accounts with the vendor's number
and no duplicate, card payments identified for 1099-NEC, deposits as
liabilities, light governance by decision.

A {documents_v2} placeholder (handbook::section_with, the server's
documents_v2 feature test) says "your books have not declared documents_v2
yet" before the owner's upgrade and what is on after it; no other section
changes. Parity, testing (with the For-P12 paragraph) and mcp-interface
notes for S4.5.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp
This commit is contained in:
swaitsandClaude Fable 5.1 committed 2026-10-29 12:55:10 -06:00
1 parent df93d8b951
commit caad35d75b
7 files changed
+224 -15

No files matched your search

+8 -1
View File
@@ -2254,7 +2254,14 @@ snapshots; see plan 8.2 S4.
back as a handed file (`pdf`: run its download): re-created from the
books as of the day, each standing payment on its own line with its
date, method and reference, stamped PAID (with the day), PARTIALLY
PAID, PAST DUE or VOID (P4b S3); refused for a bill.
PAID, PAST DUE or VOID (P4b S3); refused for a bill. The page prints
the invoice's own number, terms (an early discount reads in them), the customer's PO,
each line's quantity beside its price, the customer as at issue
(contact, billing address, phone, email, a Ship-to block), the
company's email, website, ways to pay (a QR code for a method with a
link) and footer; it says "Re-created on" the `as_of` day, never the
day it was printed, and the filed issued copy is never replaced by it
(P4b S4.5).
- `books.control_check { as_of? }` → `{ as_of, agrees, accounts: [{ role,
code, name, balance, documents_total, unattached: [{ entry_id, line,
date, amount }], difference, attention: [{ kind, id, status, total,
+19 -2
View File
@@ -34,8 +34,8 @@ No other statuses.
| Bank reconciliation (cleared flags + report) | Reconcile | done | — |
| QuickBooks CSV import (bank txns, chart of accounts) | Banking → Upload | done | R-FUTURE-4 |
| QuickBooks IIF + XLSX export | Export / reports | done | R-FUTURE-4 |
| A/R invoices + payments + aging | Business → Invoices | done | R-FUTURE-5; since P4b S1 (D-45) a document's paid, outstanding and status are read from its tagged ledger lines, hand lines on the receivables account are refused, `books.void_document` and `books.control_check` tie the subledger to the control account (rules.md B-38); S2 `books.documents`/`books.document` and the viewer pages; S3 the invoice PDF; S4.1-S4.3 terms, numbers, line accounts, the issued PDF filed at issue (behind `documents_v2`, the owner's next upgrade); numbers, terms, line accounts, the party snapshots and the issued PDF filed with the invoice, through `books.create_invoice`'s preview and confirm (P4b S4.4) |
| A/P bills + payments + aging | Business → Bills | done | R-FUTURE-5; the same S1 derivation and control guard on the payables account; S4.1-S4.3 the vendor's invoice number, terms, every line on its own account (behind `documents_v2`); the vendor's own invoice number (a duplicate refused), terms, line accounts and the vendor's invoice filed as the bill's evidence, through `books.create_bill`'s preview and confirm (P4b S4.4) |
| A/R invoices + payments + aging | Business → Invoices | done | R-FUTURE-5; since P4b S1 (D-45) a document's paid, outstanding and status are read from its tagged ledger lines, hand lines on the receivables account are refused, `books.void_document` and `books.control_check` tie the subledger to the control account (rules.md B-38); S2 `books.documents`/`books.document` and the viewer pages; S3 the invoice PDF; S4.1-S4.3 terms, numbers, line accounts, the issued PDF filed at issue (behind `documents_v2`, the owner's next upgrade); numbers, terms, line accounts, the party snapshots and the issued PDF filed with the invoice, through `books.create_invoice`'s preview and confirm (P4b S4.4); S4.5 the issued PDF carries the number, terms, PO, quantity and price, the bill-to's contact block and ship-to, the ways to pay with QR codes, the memo and the footer, and the viewer shows the number, terms, bill-to and PO and saves the issued copy |
| A/P bills + payments + aging | Business → Bills | done | R-FUTURE-5; the same S1 derivation and control guard on the payables account; S4.1-S4.3 the vendor's invoice number, terms, every line on its own account (behind `documents_v2`); the vendor's own invoice number (a duplicate refused), terms, line accounts and the vendor's invoice filed as the bill's evidence, through `books.create_bill`'s preview and confirm (P4b S4.4); S4.5 the viewer shows the vendor's number, the day received, terms and memo, and the handbook's procedure (numbers, terms, line accounts) |
| Payroll runs (accounting only, no tax tables) + tax remittance | Payroll | done | — |
| Tracking classes (divisional P&L) | Class tracking | done | invoice and bill lines take a class too (projects, rules.md B-37 item 8; QBO/Xero class or tracking per line) |
| CPA handoff package (TB + GL xlsx, P&L + BS pdf, zip) | Reports → export | done | — |
@@ -127,6 +127,23 @@ the owner's full contact block (D-55: phone, contact person, billing and
shipping addresses, billing email), which an invoice's bill-to copies at
issue.
### P4b S4.5: the issued PDF, the viewer and the handbook (2026-10-29)
The A/R and A/P rows above gain their note rather than a new row: no
parity item changed status, so the floor stands. The invoice a customer
pays from now prints its number, both dates, the terms (an early
discount reads in them), the customer's purchase order, each line's quantity beside its
price, the customer as it was at issue (contact, billing address, phone,
email and a Ship-to block), the company's email and website, the ways to
pay (each with a QR code when it has a link), the memo and the footer. The
current copy says it was re-created as of a day (never the wall clock).
The viewer's invoice page shows the number, terms, bill-to and PO and
saves the issued copy beside the re-created one; the Money in list names an
invoice by its number. The handbook's invoices-and-bills procedure is
complete (issue, collect, pay on terms, void or write off, the fee, the
CPA's list) and says what waits for the owner's upgrade. rules.md gains
B-39 (terms) and B-40 (numbers and the issued copy). No golden moved.
### P9a self-host deployment (2026-10-26)
P9a is a deployment, not a semantic feature: the same engine, store, MCP
+64
View File
@@ -3052,6 +3052,70 @@ and `BooksServer::new`'s copy (a dropped field must fail
extension and `parse_args`' passthrough of `--isolation` and its optional
`--http` value.
## P4b S4.5: the issued PDF, the viewer and the handbook (2026-10-29)
The page a customer pays from carries what the books know of the invoice
and nothing internal (no account code, project or id). `InvoiceDoc` gains
the quantity and unit price per line, the customer's reference, memo,
footer, the ways to pay (a QR code through `labels::qr_svg` when a method
has a link and asks for one), the seller's email and website, a Ship-to
block, and `InvoiceVersion` (`Issued`, or `Current { as_of }` whose
"Re-created on" note prints `as_of`, never the wall clock).
`ledger_package::page_of` builds every copy from the invoice's own
snapshots, so the issued copy, the DRAFT and the current copy cannot
disagree. No journal shape changed, so 8.0.6 does not apply and no golden
moved.
- **`ledger-import` unit tests (`src/invoice_pdf.rs`):**
`an_invoice_renders_deterministically` (two renders, equal bytes; the
plan's "golden sha updated once" has nothing to update: this test never
held a hash, it compares two renders), `labels_are_data` (an item
description `#import "x"`, a memo, footer, reference and a payment
method's label and lines print literally and break nothing),
`a_quantity_prints_beside_its_price` ("3 × $11.50"; a price of $0.125
prints exactly), `only_the_current_copy_says_it_was_re_created`,
`two_hundred_lines_paginate` (more than one page, a valid PDF).
- **`ledger-import` `tests/spec_import.rs`:** `invoice_pdf_prints_what_it_should`
reads the PDF back with the hayro text reader: number, both dates, the
total, terms, the PO, the seller's email and website, the quantity
detail, each payment method's label and lines, the Ship-to, memo and
footer, a CJK name and a right-to-left name; no stamp and no
"Re-created" on the issued copy; no project, account code or id.
- **`ledger-package` unit tests (`src/invoice.rs`):**
`an_invoice_prints_its_figures_as_of_a_day` now asserts the version
(`Current { as_of }`) instead of the wall-clock note, and
`the_sample_invoice_in_each_state` still renders every state.
- **`ledger-gui` `tests/invoices.rs`:**
`a_numbered_invoice_shows_its_number_terms_bill_to_and_po` (screenshot
`invoice-numbered`; the list names the invoice by number; the page offers
Save issued copy beside Save invoice PDF; a legacy invoice keeps
"Invoice {id}", shows no Details card and has no issued copy to save).
`the_list_shows_the_ledgers_figures` and `a_documents_page_shows_its_timeline`
pass unchanged.
- **`ledger-gui` `tests/view_model.rs`:**
`the_viewer_holds_a_numbered_invoice_as_the_store_does` (the viewer's
replay equals the live store's invoice: number, terms, bill-to, PO, memo,
quantity).
- **`ledger-mcp/src/handbook.rs`:** `documents_v2_follows_the_books_feature`
(the placeholder says what waits before the upgrade and what is on after;
the six steps are in order either way; no other section changes);
`handbook_sections_render_the_rule_in_force` also checks no placeholder
is left.
**For P12 (mutation targets):** `invoice_pdf::dollars` (the negative arm)
and `unit_price` (`scale() <= 2`, the exact arm), `quantity_detail`'s
both-or-neither match, `note_text`'s three arms (re-created, both, note
only); `ledger_package::invoice::payment_methods` (the `qr` flag read,
`link` appended as a last line, the QR only when a link exists);
`page_of`'s snapshot-else-party choice for the bill-to, the contact, address,
phone, email order of the bill-to lines, the seller email's snapshot-else-
company fallback, and the blank-footer filter; `invoice_document`'s stamp
arms and `InvoiceVersion::Current { as_of }`; the viewer's `details`
(each field's presence test, the bill-to join order), `invoice_name`'s
number-else-id and `issued_copy`'s PDF-and-description match; the
handbook's `documents_v2_rule` both arms and the server's `documents_v2`
feature test.
## P4b S5: sent tracking (2026-10-27)
The books record that an invoice went out; they never send it (A-4). A