Skip to content

T 136


uid: T-136 title: Working Paper Pack β€” accounting number format, single tabbed workbook, re-add journals.csv status: done area: accounting created: 2026-06-29 updated: 2026-06-29 related: T-124, T-125


Why (owner, 2026-06-29)

The owner asked whether the Working Paper Pack (WPP) deliverables are in the format professional accountants actually need. Context from the owner (verbatim):

"The WPP that the web app has been integrated to be able to produce, are the deliverables in it in the format that professional accountants need? Previously, it produced content in .json and CSV files but I was unsure whether they needed the .json file, so I made it so that the WPP includes xlsx now only."

Assessment given to the owner: - The JSON was correctly dropped β€” no accountant/auditor consumes a JSON of financial statements; it's a machine-interchange format. The only JSON left (manifest.json) is a metadata index, not statement data. The owner's instinct was right. - XLSX-only is the correct primary format β€” auditors work in Excel (tick-and-tie, foot/cross-foot, pivot). The pack content is genuinely audit-ready (TB, P&L, BS, Cash Flow, SOCIE, AR aging, related-party HKFRS s.33, notes s.8, fixed assets s.17, journals, IR56M candidates, comparative period, framework citation, integrity flags, frozen "as-filed" provenance). - Two presentation gaps + one data note were flagged; the owner approved fixing all three.

What shipped

  1. Accounting number format (lib/accounting/wppXlsx.ts). Currency/decimal cells now carry #,##0.00;(#,##0.00) β€” thousands separators, 2dp, parenthesised negatives β€” so figures read as 1,500.00 / (2,300.00) instead of bare 1500 / -2300. The format is applied only to cells whose raw CSV value has a decimal point: the canonical CSV writer (wppCsv.ts formatAmount) always emits money at fixed 2dp, so "has a decimal" reliably marks currency, while GL codes / years / counts are pure integers and are left unformatted (so a code like 4001 is not rendered 4,001). Cells remain real numbers, so Excel SUM/pivot still work.

  2. Single tabbed workbook (lib/accounting/wppXlsx.ts + pages/api/accounting/working-paper-pack.ts). The pack was 11 separate xlsx/*.xlsx files; it's now ONE working-paper-pack.xlsx with a Cover tab (mirrors README.txt so the workbook is self-describing) + one tab per statement, in canonical order. This is the conventional working-paper file structure β€” flip between sheets, write cross-sheet tick-and-tie formulas β€” instead of juggling eleven loose files. New exported buildWorkingPaperWorkbook() replaces the eleven *ToXlsx() buffer builders (only the WPP endpoint imported them). Every tab keeps the shared Bank-Tx-style letterhead (T-124/T-125 unification).

  3. Re-added journals.csv (pages/api/accounting/working-paper-pack.ts). A flat journal listing ships alongside the workbook β€” XLSX is fine for human review, but audit data-analytics tools (IDEA / ACL / CaseWare) ingest a delimited extract more directly for journal-entry testing (JET). Same rows as the workbook's Journal Entries tab, via the existing journalsToCsv.

New zip layout: README.txt + manifest.json + working-paper-pack.xlsx (12 tabs) + journals.csv. The manifest.json files list + the cover sheet contents listing were updated to match.

Verification

  • npx tsc --noEmit -p tsconfig.json β€” clean (0 errors).
  • Runtime smoke (scratch tsx harness, since the endpoint needs Firestore/session): built a real workbook from minimal fixtures, re-loaded it with ExcelJS, asserted: valid .xlsx (PK magic), 12 tabs in canonical order, a currency cell (1500) carries #,##0.00;(#,##0.00), and a GL code cell (4001) carries no number format. All passed. Harness was removed after the run.
  • The CSV serialisers (wppCsv.ts) are unchanged β€” the auditor's re-render β†’ text-diff verification path is intact; the workbook is purely a presentation layer over their output.

Decision log

2026-06-29 β€” opened + shipped (Accounting (Infrastructure))

  • βœ… Attestation (Accounting (Infrastructure)): read AGENTS.md; scope-scan β€” T-125 (render every statement as XLSX) and T-124 (unified letterhead) are the predecessors and are done; this is owner-directed follow-up presentation/structure work on top of them, so a new task rather than reopening theirs. Branch signal main 🟒 Β· nightly πŸ”΄ β†’ main only; mirrored to taskboard.
  • Source: Accounting (Infrastructure) Β· https://claude.ai/code/session_015P6KzVYsQCLgEmUjR9bMwM
  • Proposed by: the owner (asked if the WPP format suits professional accountants). Approved by: the owner via AskUserQuestion β€” selected all three: accounting number format, single tabbed workbook, re-add journals CSV.
  • Renumber risk: opened as T-136 against a fast-moving next-free pointer (T-132–135 were taken by Records/Projects agents the same day); if a collision surfaces at merge, renumber per the AGENTS.md rule.
  • Blast radius: the WPP deliverable shape only (/api/accounting/working-paper-pack β†’ WorkingPaperPackLauncher). The zip now contains one workbook + journals.csv instead of eleven loose xlsx files. No statement content / generator logic changed; no Firestore writes; no other endpoint touched.

Commit index (backfilled 2026-07-01, best-effort Β· Coaching (Diagnostic))

Candidate related commits, auto-backfilled from git on main: commits whose message references this task's UID or a PR number it cites. Not verified β€” this squash-merged history can't yield a precise per-task list, so rows tagged (mentions only) name the task in passing (may be tangential) and untagged work commits may be missing. Treat as a starting point: verify, prune tangential rows, and append any real ones per the AGENTS.md "record every related SHA" policy.

  • 9b63aad 2026-06-29 β€” feat(ir56m): click a contributing transaction to open its standalone detail (T-136)
  • fe5c5ea 2026-06-29 β€” docs(tasks): open T-135 β€” self-describing project/invoice final status (mirror of derived, symmetric on unmatch) (mentions only)
  • 64b1a84 2026-06-30 β€” feat(T-136): WPP β€” accounting number format, single tabbed workbook, journals.csv
  • fbf0460 2026-06-30 β€” docs(T-136): bump next-free UID T-136 β†’ T-137
  • 508afa6 2026-06-30 β€” Merge remote-tracking branch 'origin/main' into claude/busy-dirac-QmUdM (mentions only)