merge(7.2.0.4): 追加需求批次驗收通過併入主分支(沿用既有版本號)
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* 票據批量列印模組(沙盤推演示意)
|
||||
* 由第二開發者在共享功能分支 feature/receipt-batch-print 上開發
|
||||
*/
|
||||
|
||||
/** 單筆批量列印工作 */
|
||||
export interface BatchPrintJob {
|
||||
/** 使用的票據模板識別碼 */
|
||||
templateId: string;
|
||||
/** 目標倉庫識別碼 */
|
||||
warehouseId: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 建立批量列印工作清單
|
||||
* @param templateId - 票據模板識別碼
|
||||
* @param warehouseIds - 目標倉庫識別碼清單
|
||||
* @returns 逐倉庫展開的列印工作(先濾除空倉庫代碼,再依倉庫代碼排序)
|
||||
*/
|
||||
export const createBatchJobs = (templateId: string, warehouseIds: string[]): BatchPrintJob[] => warehouseIds.filter((id) => id !== "").sort().map((id) => ({ templateId, warehouseId: id }));
|
||||
@@ -11,8 +11,10 @@ export interface ReceiptTemplate {
|
||||
templateId: string;
|
||||
/** 版型:熱感紙或 A4 */
|
||||
layout: ReceiptLayout;
|
||||
/** 模板標題,顯示於票據頂部 */
|
||||
headerText: string;
|
||||
/** 模板標題,顯示於票據頂部;留空則帶入門店名稱(熱感紙版型需有值) */
|
||||
headerText?: string;
|
||||
/** 票據頁尾文字,顯示於票據底部 */
|
||||
footerText: string;
|
||||
}
|
||||
|
||||
/** 依版型查詢可用模板 */
|
||||
|
||||
@@ -18,3 +18,25 @@ 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) }));
|
||||
|
||||
/**
|
||||
* 將差異報表列轉為 CSV 字串(依賴 F1 的報表列型別)
|
||||
* @param rows - 差異報表列
|
||||
* @returns 以換行分隔的 CSV 內容
|
||||
*/
|
||||
export const toCsv = (rows: StockCountReportRow[]): string => rows.map((row) => `${row.materialId},${row.diff}`).join("\n");
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* 倉庫標籤模組(沙盤推演示意)
|
||||
* 屬於 7.2.0.4 版本驗收後追加的需求,不新開版本號
|
||||
*/
|
||||
|
||||
/** 倉庫標籤設定 */
|
||||
export interface WarehouseLabel {
|
||||
/** 倉庫識別碼 */
|
||||
warehouseId: string;
|
||||
/** 標籤顯示名稱 */
|
||||
label: string;
|
||||
/** 標籤顏色代碼,如 #4a9eea */
|
||||
color: string;
|
||||
}
|
||||
|
||||
/** 預設標籤顏色(未設定顏色時使用) */
|
||||
export const DEFAULT_LABEL_COLOR = "#4a9eea";
|
||||
|
||||
/** 依倉庫查詢標籤設定 */
|
||||
export const getLabel = (warehouseId: string): WarehouseLabel | null => null;
|
||||
Reference in New Issue
Block a user