From 4460213da3b866902ab6d5ba508f97c3b8ffed45 Mon Sep 17 00:00:00 2001 From: Christian Vidal Wolf Date: Wed, 22 Apr 2026 14:31:16 +0200 Subject: [PATCH] feat: detect NW > GW weight errors in Pricing Units tab Co-Authored-By: Claude Sonnet 4.6 --- src/components/PricingView.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/components/PricingView.tsx b/src/components/PricingView.tsx index c941636..a909fed 100644 --- a/src/components/PricingView.tsx +++ b/src/components/PricingView.tsx @@ -230,6 +230,15 @@ export function PricingView({ data, headers, onSaveRow, onCaptureState, onEdit, else if (v === 1) unitErrors.push(`${name}: value is 1`); }); + // NW > GW check + if (nwIdx >= 0 && gwIdx >= 0) { + const nw = parseFloat(String(row[nwIdx] ?? '').replace(',', '.')); + const gw = parseFloat(String(row[gwIdx] ?? '').replace(',', '.')); + if (!isNaN(nw) && !isNaN(gw) && nw > gw) { + unitErrors.push(`NW (${nw}) > GW (${gw})`); + } + } + return { row, dataIndex,