diff --git a/src/app/api/stockLedgerFix/client.ts b/src/app/api/stockLedgerFix/client.ts index 675ec990..80577459 100644 --- a/src/app/api/stockLedgerFix/client.ts +++ b/src/app/api/stockLedgerFix/client.ts @@ -61,6 +61,7 @@ export type StockLedgerFixInventoryResponse = { missingUomPairsAfter: number; patchedStockUomId: number; nullStockUomIdAfter: number; + orphansDeleted?: number; }; export type StockLedgerFixSearchInventoryHit = { diff --git a/src/components/StockLedgerFix/StockLedgerFixPageClient.tsx b/src/components/StockLedgerFix/StockLedgerFixPageClient.tsx index fb9cfec2..c9be243a 100644 --- a/src/components/StockLedgerFix/StockLedgerFixPageClient.tsx +++ b/src/components/StockLedgerFix/StockLedgerFixPageClient.tsx @@ -436,7 +436,7 @@ const StockLedgerFixPageClient: React.FC = () => { try { const res = await runStockLedgerFixInventory(); setInventoryMessage( - `inventory 1.0 完成:回填 stockUomId ${res.patchedStockUomId} 列、新增 ${res.inserted} 列、重算 ${res.updated} 列、之後仍缺 UOM ${res.missingUomPairsAfter}、仍 NULL stockUomId ${res.nullStockUomIdAfter}`, + `inventory 1.0 完成:回填 stockUomId ${res.patchedStockUomId} 列、新增 ${res.inserted} 列、殘列 deleted ${res.orphansDeleted ?? 0}、重算 ${res.updated} 列、之後仍缺 UOM ${res.missingUomPairsAfter}、仍 NULL stockUomId ${res.nullStockUomIdAfter}`, ); await loadInventory(); } catch (e) { @@ -713,7 +713,8 @@ const StockLedgerFixPageClient: React.FC = () => { 1.0 inventory(方案 A) 保留現有 id;lot 有、inventory 沒有的 UOM 會新增;onHand = Σ(in−out) 按 - item+UOM。沒有 lot 的列會變成 0。請在進出倉暫停時執行,再逐日 Fix。 + item+UOM。沒有 lot 的列會變成 0。同一料多顆舊列時只留一顆 stock UOM + 桶,其餘 deleted=1。請在進出倉暫停時執行,再逐日 Fix。 {inventoryError && {inventoryError}} {inventoryMessage && (