feat: include empty classification in missing data view and improve pricing view column detection

This commit is contained in:
Christian Vidal Wolf
2026-04-22 14:29:38 +02:00
parent 9d169a0bdd
commit a1b046feb1
2 changed files with 10 additions and 5 deletions
+6 -2
View File
@@ -167,7 +167,7 @@ export function PricingView({ data, headers, onSaveRow, onCaptureState, onEdit,
}, [resizingColumn, resizeStartX, resizeStartWidth]);
// ── Dynamic column detection ──────────────────────────────────────────────
const { uvpIdx, srpCols, containerCols } = useMemo(() => {
const { uvpIdx, srpCols, containerCols, nwIdx, gwIdx } = useMemo(() => {
const uvpIdx = findCol(headers, 'uvp');
// All SRP columns, sorted: INT first, UK second, then alphabetically
@@ -188,7 +188,11 @@ export function PricingView({ data, headers, onSaveRow, onCaptureState, onEdit,
.map((h, i) => ({ index: i, name: h || '' }))
.filter(({ name }) => /40/i.test(name) && /h[cq]/i.test(name));
return { uvpIdx, srpCols: srp, containerCols: container };
// Net weight / Gross weight columns
const nwIdx = findCol(headers, 'nw');
const gwIdx = findCol(headers, 'gw');
return { uvpIdx, srpCols: srp, containerCols: container, nwIdx, gwIdx };
}, [headers]);
// ── Error analysis per row ────────────────────────────────────────────────