merge(stock-count): 報表彙整(前置 F1)併入版本分支 7.2.0.4

This commit is contained in:
HIsheR
2026-10-16 15:57:24 +08:00
+15
View File
@@ -18,3 +18,18 @@ export interface StockCountDiff {
* @returns 實盤減帳面的差異值
*/
export const diffQty = (diff: StockCountDiff): number => diff.countedQty - diff.bookQty;
/** 盤點差異報表列 */
export interface StockCountReportRow {
/** 物料識別碼 */
materialId: string;
/** 該物料的差異量 */
diff: number;
}
/**
* 依盤點資料彙整差異報表
* @param diffs - 盤點差異清單
* @returns 逐物料的差異報表列
*/
export const buildReport = (diffs: StockCountDiff[]): StockCountReportRow[] => diffs.map((diff) => ({ materialId: diff.materialId, diff: diffQty(diff) }));