From cd78d5c8e136073e88295081c082b46d21fa2869 Mon Sep 17 00:00:00 2001 From: dev-b Date: Fri, 16 Oct 2026 15:52:58 +0800 Subject: [PATCH 1/3] =?UTF-8?q?feat(receipt):=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E7=A5=A8=E6=93=9A=E6=89=B9=E9=87=8F=E5=88=97=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 由第二開發者開發,暫推遠端以便與第一開發者共享協作 --- src/modules/receipt-batch-print.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/modules/receipt-batch-print.ts diff --git a/src/modules/receipt-batch-print.ts b/src/modules/receipt-batch-print.ts new file mode 100644 index 0000000..8751782 --- /dev/null +++ b/src/modules/receipt-batch-print.ts @@ -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.map((id) => ({ templateId, warehouseId: id })); From c0874a127f8c6da969d7396faaf7d22f9200d392 Mon Sep 17 00:00:00 2001 From: HIsheR Date: Fri, 16 Oct 2026 15:53:23 +0800 Subject: [PATCH 2/3] =?UTF-8?q?feat(receipt):=20=E6=89=B9=E9=87=8F?= =?UTF-8?q?=E5=88=97=E5=8D=B0=E5=B7=A5=E4=BD=9C=E4=BE=9D=E5=80=89=E5=BA=AB?= =?UTF-8?q?=E4=BB=A3=E7=A2=BC=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 第一開發者接續第二開發者的共享分支 --- src/modules/receipt-batch-print.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/receipt-batch-print.ts b/src/modules/receipt-batch-print.ts index 8751782..49fd20c 100644 --- a/src/modules/receipt-batch-print.ts +++ b/src/modules/receipt-batch-print.ts @@ -15,6 +15,6 @@ export interface BatchPrintJob { * 建立批量列印工作清單 * @param templateId - 票據模板識別碼 * @param warehouseIds - 目標倉庫識別碼清單 - * @returns 逐倉庫展開的列印工作 + * @returns 逐倉庫展開的列印工作(依倉庫代碼排序) */ -export const createBatchJobs = (templateId: string, warehouseIds: string[]): BatchPrintJob[] => warehouseIds.map((id) => ({ templateId, warehouseId: id })); +export const createBatchJobs = (templateId: string, warehouseIds: string[]): BatchPrintJob[] => [...warehouseIds].sort().map((id) => ({ templateId, warehouseId: id })); From e2f8f5619a314f72b7cae31486ed405ae311093a Mon Sep 17 00:00:00 2001 From: dev-b Date: Fri, 16 Oct 2026 15:53:40 +0800 Subject: [PATCH 3/3] =?UTF-8?q?feat(receipt):=20=E6=89=B9=E9=87=8F?= =?UTF-8?q?=E5=88=97=E5=8D=B0=E6=BF=BE=E9=99=A4=E7=A9=BA=E5=80=89=E5=BA=AB?= =?UTF-8?q?=E4=BB=A3=E7=A2=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 第二開發者本地提交,尚未推遠端 --- src/modules/receipt-batch-print.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/receipt-batch-print.ts b/src/modules/receipt-batch-print.ts index 8751782..cb9e9e8 100644 --- a/src/modules/receipt-batch-print.ts +++ b/src/modules/receipt-batch-print.ts @@ -15,6 +15,6 @@ export interface BatchPrintJob { * 建立批量列印工作清單 * @param templateId - 票據模板識別碼 * @param warehouseIds - 目標倉庫識別碼清單 - * @returns 逐倉庫展開的列印工作 + * @returns 逐倉庫展開的列印工作(濾除空倉庫代碼) */ -export const createBatchJobs = (templateId: string, warehouseIds: string[]): BatchPrintJob[] => warehouseIds.map((id) => ({ templateId, warehouseId: id })); +export const createBatchJobs = (templateId: string, warehouseIds: string[]): BatchPrintJob[] => warehouseIds.filter((id) => id !== "").map((id) => ({ templateId, warehouseId: id }));