PR 2 of the behandlingshistorik plan (stacked on #1787).
- lib/reports/behandlingshistorik-pdf-template.tsx: landscape A4 react-pdf
document. Fixed header (räkenskapsår, urval, legal reference, company) and
footer (page x of y, generated in Europe/Stockholm), repeated table header,
wrap={false} rows, no `break` props. Two sections in the order the reader
needs them: "Ändringar i bokföringssystemet" (p. 9.16 second paragraph)
then "Bokföringsposter i registreringsordning" (first paragraph). Meta row:
generated, programversion, antal händelser, källor. Details as one wrapped
paragraph per row (real-data render 371 events: 1.5 s, 23 pages). Glyphs the
bundled Helvetica lacks (arrow, true minus) are mapped to ASCII.
- GET /api/reports/behandlingshistorik?format=pdf with a 4 000-event guard
(413 REPORT_PDF_TOO_LARGE, CSV/XLSX remain complete); PDF first in the
export menu; catalog exports pdf+xlsx.
- lib/reports/app-version.ts shared by the route and the archive:
revision/systemdokumentation.json now carries system.version and a
behandlingshistorik block (where and how it is produced, p. 9.15); the
shipped systemdokumentation template §9.3 points at Rapporter >
Behandlingshistorik (PDF/CSV/Excel) as well as the backup ZIP.
- Settings values that are objects render as "key: value" pairs in every
format; report carries category_filter so the document states its urval.
- Tests: 4 PDF template tests (valid PDF, empty report, filtered range,
220-row pagination), route pdf 200 + 413, route "unknown format" moved off
pdf. Prod read-only render verified visually (header, sections, paging).
Claude-Session: https://claude.ai/code/session_01Kw2CFCEt8MxzbJiXMAgMVi
Co-authored-by: Jakob Wennberg <311770904+jakobwennberg-oss@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
The downloadable BFL 5 kap. 11 § template (Hjälp > Dokumentmallar) had not
been touched since March and had drifted into describing a system we no
longer run. Users archive this document as räkenskapsinformation for 7
years, so the wrong facts were being filed as compliance evidence.
Corrected against the code:
- Auth was "Magic link via e-post (lösenordsfri)". It is e-post + lösenord
with TOTP two-factor, plus optional BankID (lib/auth/require-auth.ts,
lib/auth/bankid.ts).
- Access control claimed "en användare kan enbart se och redigera sin egen
data" with a single "Kontoägare" role. Data is company-scoped via RLS and
there are four roles, owner/admin/member/viewer
(20260330130000_multi_tenant_company_refactor.sql).
- Rättelse described storno only. Inline rättelse in the same verifikat has
existed since 20260723210000_verifikat_inline_rattelse.sql; the template
now documents both tracks and the rule that a locked or closed period
leaves storno as the only route.
- Voucher numbering claimed uniqueness "per räkenskapsår och användare" and
a single series. It is per company, fiscal year and series, and the series
is configurable per source type (lib/bookkeeping/engine.ts).
- Product is Accounted, not erp-base (lib/branding/service.ts).
- OpenAI is listed as an embeddings integration; only a stray env var
remains in lib/init.ts. Removed. Added Skatteverket, BankID and PostHog,
which were missing.
- Navigation paths were pre-redesign: Kontoplan is under Data, moms under
Skatt, and behandlingshistorik exports from Importera/Exportera >
Säkerhetsbackup, not the "Rapporter > Audit trail" that does not exist.
- BAS 2025/2026 -> BAS 2026.
Added the sections a systemdokumentation needs and this one lacked: API
keys and machine access (external agents can write to the ledger under
scoped keys and are logged as the actor), löner/AGI, anläggningsregister,
periodiseringar and dimensioner as delsystem, and säkerhetskopiering.
The granular "BFNAR 2013:2 punkt 9.x" citations are dropped rather than
renumbered; see DECISIONS.md.
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Broad update across dashboard pages, components, extensions, and lib code. Includes ESLint config additions, onboarding flow redesign, settings page refactor, help page content expansion, dead code removal, and test mock fixes. Adds dev docs and public assets.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>