merge(stock-count): 報表彙整(前置 F1)併入版本分支 7.2.0.4
This commit is contained in:
@@ -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) }));
|
||||
|
||||
Reference in New Issue
Block a user