From 50700410289e9615685ff433b50d25a35454ae8d Mon Sep 17 00:00:00 2001
From: Jakob Wennberg
Date: Thu, 3 Sep 2026 18:55:09 +0200
Subject: [PATCH] fix(import): name the IB-imbalance cause and offer the manual
opening-balance path (#2082) (#2252)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The SIE preview's "Ingående balanser balanserar inte" warning was a dead
end: it said the diff would be booked to 2099 and offered an acknowledge
checkbox, nothing else. A new user parsed her SpeedLedger file five times,
never reached execute, and emailed support to ask whether IB can be
entered by hand (it can, the flow just never said so).
The warning now names the usual cause in plain Swedish (föregående års
resultat never transferred to eget kapital; SpeedLedger parks it on 9030
/9031), spells out the two ways forward, and offers a button straight into
the manual "Ingående balanser" wizard (the CSV/Excel wizard's default
entity). The acknowledgement path is unchanged. Copy stays hardcoded
Swedish like the rest of the import wizard.
Not done: letting the SIE import skip IB when a period already has them
(the import refuses such a period today), and running
findUntransferredResults at parse time so the preview can name the amount.
Closes #2082
Claude-Session: https://claude.ai/code/session_01VnConrmMCxJRQ5kfiPPWyy
Co-authored-by: Jakob Wennberg <311770904+jakobwennberg-oss@users.noreply.github.com>
Co-authored-by: Claude Fable 5.1
---
app/(dashboard)/import/page.tsx | 14 ++++++++---
components/import/SIEPreviewStep.tsx | 36 ++++++++++++++++++++++++----
2 files changed, 42 insertions(+), 8 deletions(-)
diff --git a/app/(dashboard)/import/page.tsx b/app/(dashboard)/import/page.tsx
index 1dd60a7f..5fbad292 100644
--- a/app/(dashboard)/import/page.tsx
+++ b/app/(dashboard)/import/page.tsx
@@ -700,7 +700,12 @@ const SIE_STEP_LABELS: Record = {
result: 'Resultat',
}
-function SIEImportWizard() {
+function SIEImportWizard({
+ onOpenManualOpeningBalances,
+}: {
+ /** Switch to the manual "Ingående balanser" wizard (SIE preview, issue #2082). */
+ onOpenManualOpeningBalances?: () => void
+}) {
const { toast } = useToast()
const [step, setStep] = useState('upload')
@@ -1143,7 +1148,8 @@ function SIEImportWizard() {
{step === 'preview' && preview && (
goToStep(showMappingStep ? 'mapping' : 'review')} onBack={goBack} />
+ onContinue={() => goToStep(showMappingStep ? 'mapping' : 'review')} onBack={goBack}
+ onOpenManualOpeningBalances={onOpenManualOpeningBalances} />
)}
{step === 'mapping' && (
}
{mode === 'skattekonto' && }
- {mode === 'sie' && }
+ {/* The CSV/Excel wizard opens on "Ingående balanser" by default, which is
+ exactly the manual path the SIE preview offers on an IB imbalance. */}
+ {mode === 'sie' && setMode('csv_data')} />}
{mode === 'underlag' && }
{mode === 'csv_data' && }
{mode === 'migration' && (
diff --git a/components/import/SIEPreviewStep.tsx b/components/import/SIEPreviewStep.tsx
index b87996fe..5497e092 100644
--- a/components/import/SIEPreviewStep.tsx
+++ b/components/import/SIEPreviewStep.tsx
@@ -27,6 +27,12 @@ interface SIEPreviewStepProps {
isCreatingAccounts: boolean
onContinue: () => void
onBack: () => void
+ /**
+ * Opens the manual "Ingående balanser" wizard (issue #2082). Offered next to
+ * the IB-imbalance acknowledgement so a user who rightly hesitates to book an
+ * unexplained amount to 2099 has somewhere to go other than support.
+ */
+ onOpenManualOpeningBalances?: () => void
}
export default function SIEPreviewStep({
@@ -37,6 +43,7 @@ export default function SIEPreviewStep({
isCreatingAccounts,
onContinue,
onBack,
+ onOpenManualOpeningBalances,
}: SIEPreviewStepProps) {
const errors = issues.filter((i) => i.severity === 'error')
const warnings = issues.filter((i) => i.severity === 'warning')
@@ -193,12 +200,31 @@ export default function SIEPreviewStep({
Ingående balanser balanserar inte ({formatCurrency(Math.abs(ibDiff))})
- Det betyder oftast att exporten från ditt bokföringssystem är ofullständig:
- t.ex. att skulder saknas eller att föregående års resultat inte är disponerat.
- Om du fortsätter bokförs differensen på konto 2099 (Årets resultat), vilket
- nästan alltid blir fel. Vi rekommenderar att du rättar exporten i källsystemet
- och laddar upp filen på nytt.
+ Vanligaste orsaken är att föregående års resultat aldrig fördes över till
+ eget kapital i det gamla programmet. SpeedLedger parkerar det till exempel på
+ egna 9xxx-konton (9030/9031 Obokat resultat), och då summerar inte filens
+ ingående balanser till noll: differensen är det oförda resultatet. En annan
+ orsak är en ofullständig export, till exempel att skulder saknas.
+
+ Rätta i källsystemet och ladda upp filen på nytt, eller lägg in de ingående
+ balanserna för hand i guiden Ingående balanser, där du kan rätta raderna
+ själv innan de bokförs (den här filen importeras då inte). Fortsätter du ändå
+ bokförs differensen på konto 2099 (Årets resultat), vilket nästan alltid blir
+ fel.
+