This commit is contained in:
seb
2026-10-21 03:22:35 +02:00
parent b09100b13e
commit fbf107843f
9 changed files with 448 additions and 172 deletions

View File

@@ -107,10 +107,14 @@ class ManifestLines extends PureComponent {
<TableBody>
{(() => {
const shippedSkus = new Set();
const shippedOrderLineIds = new Set();
const shippedNames = new Set();
if (kind === 'order' && Array.isArray(shipments)) {
for (const sh of shipments) {
for (const sl of sh.lines || []) {
if (sl.sku) shippedSkus.add(String(sl.sku).trim().toLowerCase());
if (sl.orderLineId != null) shippedOrderLineIds.add(sl.orderLineId);
if (!sl.sku && sl.name) shippedNames.add(String(sl.name).trim().toLowerCase());
}
}
}
@@ -122,7 +126,12 @@ class ManifestLines extends PureComponent {
return lines.map((line, index) => {
const lineKey = line.key ?? index;
const rawSku = line.sku != null ? String(line.sku).trim() : '';
const isOnShipment = kind === 'order' && Boolean(rawSku && shippedSkus.has(rawSku.toLowerCase()));
const lineName = line.name != null ? String(line.name).trim() : '';
const isOnShipment = kind === 'order' && Boolean(
(rawSku && shippedSkus.has(rawSku.toLowerCase())) ||
(line.id != null && shippedOrderLineIds.has(line.id)) ||
(!rawSku && lineName && shippedNames.has(lineName.toLowerCase()))
);
const isDelivery = kind === 'delivery';
const matched = isDelivery
? supplierArticlesByLineKey[lineKey] ||