feat: detect NW > GW weight errors in Pricing Units tab

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Christian Vidal Wolf
2026-04-22 14:31:16 +02:00
co-authored by Claude Sonnet 4.6
parent a1b046feb1
commit 4460213da3
+9
View File
@@ -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,