Commit Graph
98 Commits
Author SHA1 Message Date
swaitsandClaude Opus 5.5 54590918d3 feat: cash flow statement PDF, pdf export format, cash flow in CPA package
The cash flow statement was computed and exportable as csv/json/xlsx but
missing from every PDF path, so the CPA package carried two of the three
financial statements. Now:

- ledger-import: cash_flow_pdf renders the indirect-method statement
  (operating with net income, depreciation add-back, working-capital
  lines; investing; financing; net change reconciled to beginning and
  ending cash) from the computed CashFlowStatement, so the period and
  cash accounts are the caller's.
- books.export gains format "pdf" for profit_and_loss, balance_sheet, and
  cash_flow (base64, like xlsx), plus financing_accounts for cash_flow.
- books.export_cpa_package adds cash-flow.pdf (fiscal year to date, like
  the P&L) and requires cash_accounts: without them the statement has
  nothing to reconcile to.
- One cash_flow_statement helper resolves codes and dates for xlsx, pdf,
  and the package.

Test: MCP stdio test exports all three statement PDFs, checks the
cash_accounts and bad-report refusals, and unzips the CPA package to find
all five files. Known report gaps are logged in plan/STATUS.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MtYEaR6M6Ybdhm6X98BWNu
2026-10-11 18:57:12 -07:00
swaitsandClaude Opus 5.5 4ff5d1a40b feat: receipt unlink and attachment withdrawal
Posted entries stay immutable (R-3), but their evidence can now change the
same way the ledger does: by appending events, never by editing or
deleting. New R-13a.

- books.unlink_receipt {attachment_id, reason} journals receipt.unlinked
  and leaves the receipt filed, unlinked. The receipt policy holds: an
  entry that requires a receipt can't lose its last one (structured
  receipt_required error), so a replacement is attach-new, then
  unlink-old. Drafts and reversals are exempt, as at posting.
- books.withdraw_attachment {attachment_id, reason} journals
  attachment.withdrawn for an unlinked receipt or a filed document: hidden
  from list_receipts (unless include_withdrawn), never linkable again. The
  blob stays in the store, hash-verified and readable.
- link_receipt now refuses an already-linked or withdrawn attachment.
  Before, re-linking silently moved a receipt off a posted entry,
  bypassing the policy; evidence now leaves an entry only through a
  recorded unlink. dispose_asset checks its receipt ids before posting
  instead of after.
- Schema v5 adds attachments.withdrawn_at/withdrawn_reason; existing
  stores migrate on open and replay rebuilds the projection.

Tests: store test (errors, reopen, rebuild, verify, journal history) and
an MCP stdio test (policy refusal, replace flow, withdraw, listings,
under-threshold unlink). Dry-run and live use on the the first company books:
8 migrated .eml attachments swapped for their PDF renders, trial balance
unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MtYEaR6M6Ybdhm6X98BWNu
2026-10-11 18:40:51 -07:00
swaits 91150ad882 test: init scaffold integration tests (5 green) 2026-10-12 01:07:02 +00:00
swaits 83ccafb448 feat: wanderbooks init scaffolds mise.toml + AGENT.md + books layout 2026-10-12 01:07:01 +00:00
swaits 8d3db46ae1 feat: ledger-cli crate (wanderbooks init binary) 2026-10-12 01:06:59 +00:00
swaits ec74507ed9 Payroll accounting, class tracking, CPA handoff package (48 MCP tools) 2026-10-11 15:32:23 +00:00
swaits 4a6c884714 Payroll accounting, class tracking, CPA handoff package (48 MCP tools) 2026-10-11 15:32:21 +00:00
swaits 17efb5250f Payroll accounting, class tracking, CPA handoff package (48 MCP tools) 2026-10-11 15:32:19 +00:00
swaits 13caf3be79 Payroll accounting, class tracking, CPA handoff package (48 MCP tools) 2026-10-11 15:32:18 +00:00
swaits c23677507f Payroll accounting, class tracking, CPA handoff package (48 MCP tools) 2026-10-11 15:32:16 +00:00
swaits d64fc88d05 Payroll accounting, class tracking, CPA handoff package (48 MCP tools) 2026-10-11 15:32:14 +00:00
swaits 09cec2ce21 Payroll accounting, class tracking, CPA handoff package (48 MCP tools) 2026-10-11 15:32:13 +00:00
swaits 46894c4c7f Payroll accounting, class tracking, CPA handoff package (48 MCP tools) 2026-10-11 15:32:11 +00:00
swaits 5b49df3011 Payroll accounting, class tracking, CPA handoff package (48 MCP tools) 2026-10-11 15:32:09 +00:00
swaits 5e6867c015 Payroll accounting, class tracking, CPA handoff package (48 MCP tools) 2026-10-11 15:32:07 +00:00
swaits 1da39ea6e5 Payroll accounting, class tracking, CPA handoff package (48 MCP tools) 2026-10-11 15:32:05 +00:00
swaits 6352921c28 Payroll accounting, class tracking, CPA handoff package (48 MCP tools) 2026-10-11 15:32:03 +00:00
swaits 266545bfb9 Payroll accounting, class tracking, CPA handoff package (48 MCP tools) 2026-10-11 15:32:02 +00:00
swaits cfebb9e8b3 Payroll accounting, class tracking, CPA handoff package (48 MCP tools) 2026-10-11 15:32:00 +00:00
swaits 6fe8814597 Payroll accounting, class tracking, CPA handoff package (48 MCP tools) 2026-10-11 15:31:58 +00:00
swaits f97be98a44 Payroll accounting, class tracking, CPA handoff package (48 MCP tools) 2026-10-11 15:31:56 +00:00
swaits c38d843633 Payroll accounting, class tracking, CPA handoff package (48 MCP tools) 2026-10-11 15:31:55 +00:00
swaits 1a3af122c5 Payroll accounting, class tracking, CPA handoff package (48 MCP tools) 2026-10-11 15:31:53 +00:00
swaits b2ae0e94f1 Payroll accounting, class tracking, CPA handoff package (48 MCP tools) 2026-10-11 15:31:51 +00:00
swaits ad760b9b80 Period close, bank rec, AR/AP, multi-currency (41 MCP tools) 2026-10-11 08:15:34 +00:00
swaits ec716be076 Period close, bank rec, AR/AP, multi-currency (41 MCP tools) 2026-10-11 08:15:32 +00:00
swaits bb33601fc2 Period close, bank rec, AR/AP, multi-currency (41 MCP tools) 2026-10-11 08:15:30 +00:00
swaits 26199c872e Period close, bank rec, AR/AP, multi-currency (41 MCP tools) 2026-10-11 08:15:28 +00:00
swaits e0be84ba95 Period close, bank rec, AR/AP, multi-currency (41 MCP tools) 2026-10-11 08:15:25 +00:00
swaits fb4dd2055d Period close, bank rec, AR/AP, multi-currency (41 MCP tools) 2026-10-11 08:15:24 +00:00
swaits 01a07aed46 Period close, bank rec, AR/AP, multi-currency (41 MCP tools) 2026-10-11 08:15:22 +00:00
swaits 6f077b4cd8 Period close, bank rec, AR/AP, multi-currency (41 MCP tools) 2026-10-11 08:15:20 +00:00
swaits 01c2689adf Period close, bank rec, AR/AP, multi-currency (41 MCP tools) 2026-10-11 08:15:18 +00:00
swaits a2b23b5fba Period close, bank rec, AR/AP, multi-currency (41 MCP tools) 2026-10-11 08:15:16 +00:00
swaits 6db7a99747 Next steps 5-10: resources, cash flow, QB interop, backfill, HTTP, parallel-run plan 2026-10-11 03:02:29 +00:00
swaits 6c4759dcfe Next steps 5-10: resources, cash flow, QB interop, backfill, HTTP, parallel-run plan 2026-10-11 03:02:24 +00:00
swaits b50f6d2fd3 Next steps 5-10: resources, cash flow, QB interop, backfill, HTTP, parallel-run plan 2026-10-11 03:02:21 +00:00
swaits cbe46ad232 Next steps 5-10: resources, cash flow, QB interop, backfill, HTTP, parallel-run plan 2026-10-11 03:02:18 +00:00
swaits 5f63e521c0 Next steps 5-10: resources, cash flow, QB interop, backfill, HTTP, parallel-run plan 2026-10-11 03:02:11 +00:00
swaits 89f79270b0 Next steps 5-10: resources, cash flow, QB interop, backfill, HTTP, parallel-run plan 2026-10-11 03:02:02 +00:00
swaits 82db83e4d3 Next steps 5-10: resources, cash flow, QB interop, backfill, HTTP, parallel-run plan 2026-10-11 03:01:51 +00:00
swaits 5fa2118279 Next steps 5-10: resources, cash flow, QB interop, backfill, HTTP, parallel-run plan 2026-10-11 03:01:44 +00:00
swaits d154c2e80d Next steps 5-10: resources, cash flow, QB interop, backfill, HTTP, parallel-run plan 2026-10-11 03:01:39 +00:00
swaits abf3c37ba5 Next steps 5-10: resources, cash flow, QB interop, backfill, HTTP, parallel-run plan 2026-10-11 03:01:37 +00:00
swaits 5b4252ca1e Next steps 5-10: resources, cash flow, QB interop, backfill, HTTP, parallel-run plan 2026-10-11 03:01:32 +00:00
swaits 0348ce653e Next steps 5-10: resources, cash flow, QB interop, backfill, HTTP, parallel-run plan 2026-10-11 03:01:30 +00:00
swaits 7fbd351dee Next steps 5-10: resources, cash flow, QB interop, backfill, HTTP, parallel-run plan 2026-10-11 03:01:28 +00:00
swaits 1e9fe7fee5 Next steps 5-10: resources, cash flow, QB interop, backfill, HTTP, parallel-run plan 2026-10-11 03:01:26 +00:00
swaits 1ce4932b9f Next steps 5-10: resources, cash flow, QB interop, backfill, HTTP, parallel-run plan 2026-10-11 03:01:24 +00:00
swaits f37457b557 Next steps 5-10: resources, cash flow, QB interop, backfill, HTTP, parallel-run plan 2026-10-11 03:01:22 +00:00