fix: prefer pending pallet for carton scan
This commit is contained in:
@@ -92,7 +92,11 @@ export function classifyScan(items, states, scanCode, scannedBoxCodes = {}) {
|
||||
return { type: 'pallet', item: palletItem }
|
||||
}
|
||||
|
||||
const item = items.find((entry) => (entry.boxCodes || []).includes(scanCode)) || null
|
||||
const matchingItems = items.filter((entry) => (entry.boxCodes || []).includes(scanCode))
|
||||
const item = matchingItems.find((entry) => {
|
||||
const status = states[entry.id] || ITEM_STATUS.PENDING
|
||||
return status !== ITEM_STATUS.PICKED && status !== ITEM_STATUS.SKIPPED
|
||||
}) || matchingItems[0] || null
|
||||
if (!item) return { type: 'unknown', item: null }
|
||||
if (isSealedPalletItem(item)) {
|
||||
const status = states[item.id] || ITEM_STATUS.PENDING
|
||||
|
||||
Reference in New Issue
Block a user