feat(stock-count): 新增盤點差異計算

提供帳面與實盤差異的計算邏輯
This commit is contained in:
HIsheR
2026-10-16 15:43:23 +08:00
parent ea63ea6446
commit 9bd174cc56
+20
View File
@@ -0,0 +1,20 @@
/**
* 盤點差異模組(沙盤推演示意)
*/
/** 單一物料的盤點差異 */
export interface StockCountDiff {
/** 物料識別碼 */
materialId: string;
/** 帳面數量 */
bookQty: number;
/** 實盤數量 */
countedQty: number;
}
/**
* 計算盤點差異數量
* @param diff - 單一物料的盤點資料
* @returns 實盤減帳面的差異值
*/
export const diffQty = (diff: StockCountDiff): number => diff.countedQty - diff.bookQty;