feat(import): detect and import the article register's Valuta column (#1183)
Fixes #1167. The register export gained a Valuta column in #1166 but the importer ignored it, so re-imported non-SEK articles silently became SEK, breaking the export -> edit -> re-import round-trip. - Column detector recognizes valuta/valutakod/currency (claimed before generic columns; no keyword collision with Momskod). - Parser normalizes to upper-case ISO shape, drops malformed codes with a file-level warning, and carries currency per row. - Execute route validates codes lazily against the currencies table (FK stays the backstop when the reference read fails), imports valid codes, defaults absent to SEK, and in merge mode only overwrites when the file explicitly carries a valid currency. - Edit step shows a muted currency marker next to non-SEK prices; manual column mapping offers Valuta. - Export docblock caveat removed. Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
aead2bc1d1
commit
36a1df4f6b
@@ -187,12 +187,18 @@ export default function ArticlesEditStep({
|
||||
</Select>
|
||||
</td>
|
||||
<td className="px-3 py-1.5">
|
||||
<Input
|
||||
value={String(row.price_excl_vat)}
|
||||
inputMode="decimal"
|
||||
onChange={(e) => handlePriceChange(row.id, e.target.value)}
|
||||
className="h-8 text-right tabular-nums"
|
||||
/>
|
||||
<div className="flex items-center gap-1.5">
|
||||
<Input
|
||||
value={String(row.price_excl_vat)}
|
||||
inputMode="decimal"
|
||||
onChange={(e) => handlePriceChange(row.id, e.target.value)}
|
||||
className="h-8 text-right tabular-nums"
|
||||
/>
|
||||
{/* Exception chip: only non-SEK rows carry a marker. */}
|
||||
{row.currency && row.currency !== 'SEK' && (
|
||||
<span className="shrink-0 text-xs text-muted-foreground">{row.currency}</span>
|
||||
)}
|
||||
</div>
|
||||
</td>
|
||||
<td className="px-3 py-1.5">
|
||||
<div className="flex items-center gap-1.5">
|
||||
|
||||
Reference in New Issue
Block a user