feat(receipt): 批量列印略過已停用倉庫

第一位開發者於本地功能分支完成,功能分支不推遠端
This commit is contained in:
HIsheR
2026-10-16 16:03:34 +08:00
parent ddc707d5cc
commit 67ff5f1222
+2 -1
View File
@@ -15,6 +15,7 @@ export interface BatchPrintJob {
* 建立批量列印工作清單
* @param templateId - 票據模板識別碼
* @param warehouseIds - 目標倉庫識別碼清單
* @param disabledIds - 已停用倉庫識別碼清單,命中者不列入列印
* @returns 逐倉庫展開的列印工作(先濾除空倉庫代碼,再依倉庫代碼排序)
*/
export const createBatchJobs = (templateId: string, warehouseIds: string[]): BatchPrintJob[] => warehouseIds.filter((id) => id !== "").sort().map((id) => ({ templateId, warehouseId: id }));
export const createBatchJobs = (templateId: string, warehouseIds: string[], disabledIds: string[] = []): BatchPrintJob[] => warehouseIds.filter((id) => id !== "" && !disabledIds.includes(id)).sort().map((id) => ({ templateId, warehouseId: id }));