From b069d9a9fe7673be3a244604e8ae7a42a066f0ce Mon Sep 17 00:00:00 2001 From: Mattsson <111893710+mattssonn@users.noreply.github.com> Date: Tue, 18 Aug 2026 23:20:23 +0200 Subject: [PATCH] fix(import): keep mapping confirmation visible (#1684) * fix(import): keep mapping confirmation visible Signed-off-by: Emil * fix(import): keep source names masked --------- Signed-off-by: Emil --- DECISIONS.md | 1 + components/import/AccountMappingStep.tsx | 87 ++++++++++++++++++------ 2 files changed, 68 insertions(+), 20 deletions(-) diff --git a/DECISIONS.md b/DECISIONS.md index 42c6bb4e..c38bcbca 100644 --- a/DECISIONS.md +++ b/DECISIONS.md @@ -1055,6 +1055,7 @@ One line per decision: `[YYYY-MM-DD] : `. Appended by agents and [2026-08-18] Shopify webshop_orders port: vat_breakdown is reconstructed from the ORDER-LEVEL taxLines (net = tax / rate, remainder as a 0%-bucket, refuse on missing rates or overshoot) instead of summing line items like the WooCommerce sync: Shopify's discountedTotalSet excludes cart-level discount allocations and lineItems is a paginated connection, so part-summing can silently produce a wrong per-rate net, while tax-per-rate and the charged total are authoritative order-level facts. Refund VAT is always prorated from the parent's mix (Shopify's Refund object exposes no per-rate tax without paging refundLineItems per refund). [2026-08-18] Shopify order feed keeps its paid-only qualification (PAID/PARTIALLY_REFUNDED/REFUNDED) after the webshop_orders port, unlike WooCommerce which also imports unpaid orders for the invoice flow: widening qualification is a product decision, out of scope for the port; unpaid orders re-surface via updatedAt when payment captures. The line-item snapshot is stored only when the parts reconstruct the charged total to the ore (else [] and the invoice conversion falls back to one aggregate line), and the bookkeeping-lock row filter was dropped: an Orders-page row behind the lock is an overview row, not permanent inbox noise, and booking is still blocked by the lock triggers (parity with WooCommerce). [2026-08-18] Skattekontoutdrag sum mismatch (opening + events != closing) demoted from a hard 400 to a preview confirm gate showing ingående/händelser/utgående/differens, mirroring the orgnr-mismatch gate: Sebastian's real export was refused on it (2026-08-18) with no way forward and no figures to diagnose; nothing is booked at import and dedup makes a later complete re-import safe, so refusing the file only blocked the rows that WERE readable. Parser also takes the earliest opening / latest closing across several marker pairs, reads a marker saldo from a trailing running-saldo column, and accepts U+2212 / plus-sign amounts; the route logs the figures (amounts and counts, never row text) so the next report is diagnosable from Vercel logs. Kept the hard reject only for zero readable rows. +[2026-08-18] Issue #1668 keeps VAT confirmation in a dedicated sticky end column and makes truncated source names reveal on hover, focus, and activation: column truncation alone would still strand the hard-blocking action at responsive widths, while activation gives touch users the same full-text affordance. [2026-08-18] Issue #1659 exposes one canonical per-period VAT deadline resolver from deadline-config and makes both the MCP close check and VAT period default consume it: monthly, quarterly, annual, over-40M, and January/August rules must not drift across parallel formulas again; the MCP adapter alone applies the same banking-day adjustment as generated tax deadlines. [2026-08-18] PR #1679 reports deadline_unavailable instead of guessing when VAT settings are missing, and annual AB deadlines require the configured fiscal year to match the resolved report period: a missing or stale filing profile must not produce a plausible but legally wrong date. [2026-08-18] PR #1679 uses company_settings.entity_type as the sole annual VAT deadline source in MCP close checks: falling back to companies could mask missing or inconsistent filing settings, so annual deadlines now fail closed instead. diff --git a/components/import/AccountMappingStep.tsx b/components/import/AccountMappingStep.tsx index b41cd4fd..d5af17a4 100644 --- a/components/import/AccountMappingStep.tsx +++ b/components/import/AccountMappingStep.tsx @@ -37,6 +37,12 @@ import { vatTreatmentsForAccountClass, type AccountVatTreatment, } from '@/lib/vat/account-vat-treatment' +import { + Tooltip, + TooltipContent, + TooltipTrigger, +} from '@/components/ui/info-tooltip' +import { cn } from '@/lib/utils' interface AccountMappingStepProps { mappings: AccountMapping[] @@ -231,26 +237,31 @@ export default function AccountMappingStep({ {/* Mapping table */} -
- +
+
Källkonto - Källnamn + Källnamn Målkonto {t('vat_treatment_column')} Konfidens + + {t('vat_treatment_confirm')} + {paginatedMappings.map((mapping) => ( {mapping.sourceAccount} - {mapping.sourceName} + + + @@ -344,20 +355,6 @@ export default function AccountMappingStep({ 6 % - {mapping.requiresVatTreatmentReview && !mapping.vatTreatmentReviewed && ( - - )} ) : ( - @@ -372,11 +369,35 @@ export default function AccountMappingStep({ /> )} + + {mapping.requiresVatTreatmentReview && !mapping.vatTreatmentReviewed && ( + + )} + ))} {paginatedMappings.length === 0 && ( - + Inga konton matchar filtret @@ -435,6 +456,32 @@ export default function AccountMappingStep({ ) } +function TruncatedSourceName({ sourceName }: { sourceName: string }) { + const [open, setOpen] = useState(false) + + return ( + + + + + + {sourceName} + + + ) +} + function ConfidenceBadge({ confidence, isOverride,