feat(stock-count): 新增盤點差異計算
提供帳面與實盤差異的計算邏輯
This commit is contained in:
@@ -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;
|
||||||
Reference in New Issue
Block a user