'use client' import { useId, useState } from 'react' import { ChevronDown, ChevronRight } from 'lucide-react' import { AccountNumber } from '@/components/ui/account-number' export interface DeclarationAccountLine { accountNumber: string accountName: string amount: number } /** * Default formatter: whole kronor, matching the filed SRU values. Truncation, * not rounding: SFL "öretal faller bort" and the NE/INK2 SRU generators drop * öre with Math.trunc, so the UI must agree with the filed figures. Callers * that need öre pass their own formatter. */ export function formatWholeKronor(n: number): string { // + 0 normalizes -0 (Math.trunc(-0.3) is -0, which sv-SE renders "−0"). return `${(Math.trunc(n) + 0).toLocaleString('sv-SE')} kr` } /** * One expandable declaration row (NE-bilaga, INK2): ruta code chip, label, * signed amount, and a per-account breakdown behind a keyboard-accessible * toggle. Replaces the copy-pasted
|
|
{acc.accountName} | {formatAmount(acc.amount)} |