Purpose

Tabular financial history. File: frontend/kundkort/components/sections/FinancialsSection.tsx. Renders in the Översikt tab.

Data shape

Reads data.finansiell_historik: FinansiellHistorik[] (types/kundkort.ts:12-18):

{ year: number; turnover_sek: number | null; result_sek: number | null;
  employees: number | null; data_gap: boolean }

Rendering

  • Sorted ascending by year (FinancialsSection.tsx:33)
  • Years become column headers; rows are: Antal anställda, Omsättning, Resultat
  • Years with data_gap === true render plus a GapBadge in muted text (FinancialsSection.tsx:67-72)
  • Missing years (gap in the year sequence) do NOT auto-fill — only years present in the array become columns
  • Negative results render in var(--status-error) (red) (FinancialsSection.tsx:26-30)

Number format

  • Turnover and result: divided by 1,000,000 → “X,Y Mkr” with sv-SE locale (formatMsek, FinancialsSection.tsx:10-19). Always one decimal place.
  • Employees: sv-SE locale integer (formatEmployees, FinancialsSection.tsx:21-24).

Empty state

If finansiell_historik.length === 0, renders the italic message “Inga finansiella uppgifter tillgängliga” with no table.

Difference vs FinancialChart

This is the table in the Översikt tab. The Analys & Grafer tab renders a different visualisation in FinancialChart driven by useEcoApi.financialTrend.financial_trend (a parallel structure with years[], turnover[], employees[]), not finansiell_historik.

See also

Tremor Charts, EcoAPI Integration, Kundkort Page.

See also