u
This commit is contained in:
@@ -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] ||
|
||||
|
||||
Reference in New Issue
Block a user