feat(parties): company details on the supplier and customer pages, the registry name becomes the displayed name (#2306)

Founder test on a real company (2026-09-05): a supplier created from
"Webhallen Oktober · Dataskärmar till kontoret" kept that text as its
name, and the SCB facts fetched for the party were nowhere on the
supplier page.

- Företagsuppgifter on /suppliers/[id] and /customers/[id]: legal name,
  org number, VAT number, country, then the SCB facts under one source
  line, with "Hämta uppgifter" or "Hitta i företagsregistret" as the one
  action. The registry helpers move out of the dossier into
  RegistryFacts so the three surfaces share them.
- The enrich route makes the registry's legal name the displayed name
  of the party and of supplier and customer rows that still carry the
  party's old name; all-capitals names are set in title case
  (lib/parties/registry-name.ts). Names a person set stay.
- legacyLedgerKey: a party confirmed under the pre-2026-09-04 key keeps
  its vouchers, so a rebuild attaches the new key instead of offering
  the same company again.
- GET /api/parties/[id] reports whether SCB is configured.

Co-authored-by: Jakob Wennberg <311770904+jakobwennberg-oss@users.noreply.github.com>
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Jakob Wennberg
2026-09-05 13:43:34 +02:00
committed by GitHub
co-authored by Jakob Wennberg Claude Fable 5.1
parent 397a3b9bca
commit 04898c3178
16 changed files with 424 additions and 61 deletions
+6
View File
@@ -8691,6 +8691,12 @@
"review_done_failed": "{failed} could not be saved.",
"review_empty": "No rows are missing an org number.",
"picker_ai_read": "Read from the voucher: {name}.",
"facts_section_title": "Company details",
"facts_refresh": "Refresh from SCB",
"facts_none": "Nothing from the company register yet. Find the company and the details are fetched.",
"facts_none_org": "Nothing from the company register yet. Fetch them by org number.",
"facts_foreign": "Foreign company ({country}), not in the SCB register. Name and VAT number come from the documents.",
"facts_renamed_title": "Details fetched, now called {name}",
"fact_trade_name": "Trade name",
"open_dossier": "Open {name}",
"attn_create": "Create suggestions",
+6
View File
@@ -8691,6 +8691,12 @@
"review_done_failed": "{failed} gick inte att spara.",
"review_empty": "Inga rader saknar org.nr.",
"picker_ai_read": "Läst ur verifikatet: {name}.",
"facts_section_title": "Företagsuppgifter",
"facts_refresh": "Uppdatera från SCB",
"facts_none": "Inga uppgifter från företagsregistret än. Leta upp företaget så hämtas de.",
"facts_none_org": "Inga uppgifter från företagsregistret än. Hämta dem med org.nr.",
"facts_foreign": "Utländskt bolag ({country}), finns inte i SCB:s register. Namn och momsnummer kommer från underlagen.",
"facts_renamed_title": "Uppgifter hämtade, heter nu {name}",
"fact_trade_name": "Firma",
"open_dossier": "Öppna {name}",
"attn_create": "Skapa förslag",