Em dashes (—) and en dashes (–) had spread across comments, docs, tests,
and a few UI strings, reading as AI-generated boilerplate rather than
house style. Replaced each with punctuation matching its context: colon
for explanatory clauses, comma for asides, plain hyphen for numeric/legal
ranges (e.g. "21-23§"), "to"/"till" for date ranges, parentheses for
paired-dash asides. messages/en.json and messages/sv.json were fixed by
hand together to keep sv/en in sync.
Left untouched where the dash is the functional subject rather than
decorative punctuation: date-range-parser.ts's separator regex,
charset-repair.ts's CP1252 byte-mapping table (and its test), the SIE
encoding mojibake docs, generic-csv.ts's minus-sign normalizer, the
agent system-prompt files that already instruct against em dashes, and
a golden iXBRL test fixture compared byte-for-byte.
Also fixes two bugs surfaced along the way: an off-by-one in
ApiKeysPanel's scope-label split (a leftover from an earlier partial
pass), and a charset-repair test that had lost the literal en-dash it
exists to verify.
Regenerated the agent atom seed migration (skills:generate) since 27
SKILL.md files changed. Added a CLAUDE.md rule against em/en dashes,
with an explicit carve-out for the functional-dash cases above.
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Bundles a set of bookkeeping-correctness fixes developed together.
Correction / storno flow
- correctEntry resolves (and seeds standard BAS) accounts for the
corrected lines BEFORE writing the storno. The old order created and
posted the storno first, then hit AccountsNotInChartError on the
corrected lines and had to cancel it again — leaving a voided 0 kr
storno in the chain and permanently burning a voucher number (an
unexplained BFNAR 2013:2 gap). It now fails fast with nothing written.
- correctEntry re-points the bank transaction and underlag from the
reversed original to the live corrected entry, so the transaction keeps
reading as booked (and stays correctable) and the underlag travels with
it. recordateEntry delegates both relinks to correctEntry.
- reverseEntry (engine) clears transactions.journal_entry_id for rows
booked by the reversed entry, so a plain storno returns the bank row to
"Att bokföra" with a re-booking affordance. The agent paths did this
manually; the dashboard reverse route did not.
- findUnresolvableAccounts replaces findMissingActiveAccounts in the
categorize routes: a standard BAS account merely absent from the chart
is seeded on demand by the engine, so pre-validation must not 400 on it
— only unknown numbers or deactivated accounts block.
- CorrectionChain dims cancelled (0 kr) entries and labels them so they
no longer render like a live storno.
Report accuracy
- calculateVatLiability() (lib/reports/kpi.ts) is shared by the KPI route,
the KPI xlsx export and the MCP period-summary tool, and uses the same
26xx accounts as the momsdeklaration (ruta 49). Reverse-charge and
import pairs (e.g. 2614 credit + 2645 debit) net to zero instead of
inflating the receivable (#715). VAT_OUTPUT_ACCOUNTS / VAT_INPUT_ACCOUNTS
are derived from ACCOUNT_RUTA so the widget can never drift from the
declaration.
- Kassaflödesanalys records erhållna aktieägartillskott (2093) as a
financing inflow and counts överkursfond (2086/2097) toward nyemission.
2093 was previously unmapped, so any contribution broke the 19xx
reconciliation by exactly the contributed amount (#716). Wired through
the report type, both PDF templates, the K3 PDF, the dashboard client
and the årsredovisning summary type.
Agent guidance
- shared-rules: describe the real Accounted correction flow (Rätta rader /
Rätta datum / Radera verifikat, on-demand BAS backfill) so the assistant
stops inventing flows that don't exist.
- verifikation-draft: clearer locked-period guidance.
Tests cover all of the above (storno fail-fast + seeding + relink,
reverseEntry unlink, findUnresolvableAccounts, VAT netting and the
cashflow reconciliation cases).
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* feat: add user locale preference to user_preferences table
- Introduced a new column 'locale' in the user_preferences table to store per-user UI language preferences.
- Added a CHECK constraint to ensure only supported locales ('sv', 'en') are allowed.
- Triggered a schema reload notification for the changes.
chore: declare CSS module support in TypeScript
- Added a declaration for CSS modules in globals.d.ts to enable TypeScript support for importing CSS files.
* feat: add Swish as an invoice payment method in company settings
* fix: allow scrolling in QuickReviewDialog when content overflows viewport
The dialog had no max-height or overflow handling, so tall content (e.g.
extern representation with warnings + journal preview) was clipped with
no way to scroll.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: add detailed error logging to Enable Banking integration
Adds structured console logging with full context (status codes,
response bodies, connection IDs, account UIDs, stack traces) to all
Enable Banking operations: connect, callback, sync, disconnect,
and the API client retry/error paths.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: add detailed error logging to login and register flows
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: implement KPI settings management with preferences and dynamic KPI display
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>