diff --git a/backend/src/services/binReplenishService.js b/backend/src/services/binReplenishService.js index e13c3b8..870701e 100644 --- a/backend/src/services/binReplenishService.js +++ b/backend/src/services/binReplenishService.js @@ -309,8 +309,10 @@ function buildSummary(rows, orderSkuCount) { pickTotal: 0, storageTotal: 0, }; + const STATUS_SUM_KEY = { need: 'need', short: 'short', enough: 'enough', no_order: 'noOrder' }; rows.forEach((row) => { - if (summary[row.status] !== undefined) summary[row.status] += 1; + const key = STATUS_SUM_KEY[row.status]; + if (key && summary[key] !== undefined) summary[key] += 1; summary.suggestQtyTotal += row.suggestQty || 0; summary.orderQtyTotal += row.orderQty || 0; summary.exceedTotal += row.excess || 0;