'use client' import { useMemo, useState } from 'react' import { Button } from '@/components/ui/button' import { Badge } from '@/components/ui/badge' import { Checkbox } from '@/components/ui/checkbox' import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow, } from '@/components/ui/table' import { CheckCircle2, AlertTriangle } from 'lucide-react' import Link from 'next/link' import type { YearEndResult, ContinuityDiscrepancy } from '@/types' import { formatCurrency } from '@/lib/utils' import { formatVoucher } from '@/lib/bookkeeping/voucher-series-resolver' interface ResultStepProps { result: YearEndResult } const ORE_TOLERANCE = 0.005 export function ResultStep({ result }: ResultStepProps) { const [acknowledged, setAcknowledged] = useState(false) const continuity = result.continuity const discrepancies = continuity?.discrepancies ?? [] // If the wizard reached ResultStep, executeYearEndClosing already enforced // that no per-account diff exceeded ORE_TOLERANCE: but surface a panel // grouped by BAS class so the user can confirm visually before leaving. return (
Perioden är stängd och en ny räkenskapsperiod har skapats.
Omföringen av föregående års resultat (2099 → 2098) kunde inte bokföras. {' '} Bokslutet och de ingående balanserna är klara, men konto 2099 “Årets resultat” bär fortfarande föregående års resultat in i den nya perioden. Det måste flyttas till 2098 innan balansräkningen stämmer. Kör om bokslutet eller kontakta support: felet är loggat.
{checkedAccounts} balanskonto(n) jämförda mellan utgående balans i stängd period och ingående balans i ny period.
{discrepancies.length === 0 ? (Inga avvikelser. Alla balanskonton i klass 1 och 2 matchar inom tolerans (±0,005 SEK).
) : (