From d3dd633dffa40324c636ca6104e6e656abaac0c4 Mon Sep 17 00:00:00 2001 From: Bright Date: Wed, 10 Apr 2024 12:12:36 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=84=E0=B8=B3=E0=B8=AA=E0=B8=B1=E0=B9=88?= =?UTF-8?q?=E0=B8=87=E0=B8=84=E0=B9=88=E0=B8=B2=E0=B8=95=E0=B8=AD=E0=B8=9A?= =?UTF-8?q?=E0=B9=81=E0=B8=97=E0=B8=99=E0=B8=9E=E0=B8=B4=E0=B9=80=E0=B8=A8?= =?UTF-8?q?=E0=B8=A9=20=E0=B9=81=E0=B8=A5=E0=B8=B0=E0=B8=9C=E0=B8=B9?= =?UTF-8?q?=E0=B9=89=E0=B9=84=E0=B8=A1=E0=B9=88=E0=B9=84=E0=B8=94=E0=B9=89?= =?UTF-8?q?=E0=B9=80=E0=B8=A5=E0=B8=B7=E0=B9=88=E0=B8=AD=E0=B8=99=E0=B9=80?= =?UTF-8?q?=E0=B8=87=E0=B8=B4=E0=B8=99=E0=B9=80=E0=B8=94=E0=B8=B7=E0=B8=AD?= =?UTF-8?q?=E0=B8=99=20=E0=B8=A3=E0=B8=AD=E0=B8=9A=E0=B8=95=E0=B8=B8?= =?UTF-8?q?=E0=B8=A5=E0=B8=B2=E0=B8=84=E0=B8=A1=20(gov2-09)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/ReportController.ts | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/controllers/ReportController.ts b/src/controllers/ReportController.ts index a0e7996..888635e 100644 --- a/src/controllers/ReportController.ts +++ b/src/controllers/ReportController.ts @@ -2271,9 +2271,9 @@ export class ReportController extends Controller { } /** - * APIคำสั่งค่าตอบแทนพิเศษ และผู้ไม่ได้เลื่อน รอบเมษายน + * APIคำสั่งค่าตอบแทนพิเศษ และผู้ไม่ได้เลื่อน รอบเมษายน และรอบตุลาคม * - * @summary คำสั่งค่าตอบแทนพิเศษ และผู้ไม่ได้เลื่อน รอบเมษายน + * @summary คำสั่งค่าตอบแทนพิเศษ และผู้ไม่ได้เลื่อน รอบเมษายน และรอบตุลาคม * * @param {string} rootId Guid, *Id Root * @param {string} salaryPeriodId Guid, *Id Period @@ -2283,7 +2283,7 @@ export class ReportController extends Controller { const salaryPeriod = await this.salaryPeriodRepository.findOne({ where: { id: salaryPeriodId, - period: "APR", + // period: "APR", isActive: true, }, }); @@ -2405,13 +2405,18 @@ export class ReportController extends Controller { })); return new HttpSuccess({ - template: "gov1-08", - reportName: "gov1-08", + template: salaryPeriod.period === "APR" ? "gov1-08" : "gov2-09", + reportName: salaryPeriod.period === "APR" ? "gov1-08" : "gov2-09", data: { year: Extension.ToThaiNumber(String(Extension.ToThaiYear(salaryPeriod.year))), - date: Extension.ToThaiNumber( + date: salaryPeriod.period === "APR" + ? Extension.ToThaiNumber( Extension.ToThaiFullDate(new Date(`${salaryPeriod.year}-04-01`)), + ) + : Extension.ToThaiNumber( + Extension.ToThaiFullDate(new Date(`${salaryPeriod.year}-10-01`)), ), + agency: salaryOrgGroup1?.root, profileSpecial: profileSpecial, profileNoAmount: profileNoAmount, },