From bacac6c931f68860f8e6197076b696b4e56834cd Mon Sep 17 00:00:00 2001 From: Kittapath Date: Fri, 22 Mar 2024 12:32:17 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89report=20=E0=B8=A5?= =?UTF-8?q?=E0=B8=B9=E0=B8=81=E0=B8=88=E0=B9=89=E0=B8=B2=E0=B8=87=E0=B9=80?= =?UTF-8?q?=E0=B8=A5=E0=B8=B7=E0=B9=88=E0=B8=AD=E0=B8=99=E0=B8=82=E0=B8=B1?= =?UTF-8?q?=E0=B9=89=E0=B8=99=E0=B9=80=E0=B8=87=E0=B8=B4=E0=B8=99=E0=B9=80?= =?UTF-8?q?=E0=B8=94=E0=B8=B7=E0=B8=AD=E0=B8=99=E0=B8=9E=E0=B8=B4=E0=B9=80?= =?UTF-8?q?=E0=B8=A8=E0=B8=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/ReportController.ts | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/controllers/ReportController.ts b/src/controllers/ReportController.ts index f3ae545..22be2bf 100644 --- a/src/controllers/ReportController.ts +++ b/src/controllers/ReportController.ts @@ -2276,7 +2276,7 @@ export class ReportController extends Controller { const _salaryPeriod = await this.salaryProfileEmployeeRepository.find({ relations: ["salaryOrg", "salaryOrg.salaryPeriod"], where: { - type: In(["NONE"]), + isNext: false, salaryOrg: { snapshot: "SNAP2", rootId: rootId, @@ -2532,6 +2532,7 @@ export class ReportController extends Controller { relations: ["salaryOrg", "salaryOrg.salaryPeriod"], where: { type: In(["HAFT", "FULL", "FULLHAFT"]), + isNext: false, salaryOrg: { snapshot: "SNAP2", rootId: rootId, @@ -2767,7 +2768,7 @@ export class ReportController extends Controller { const _salaryPeriod = await this.salaryProfileEmployeeRepository.find({ relations: ["salaryOrg", "salaryOrg.salaryPeriod"], where: { - type: In(["HAFT", "FULL", "FULLHAFT"]), + isNext: true, salaryOrg: { snapshot: "SNAP2", rootId: rootId, @@ -2806,9 +2807,17 @@ export class ReportController extends Controller { posLevel: `${profile.posTypeShort} ${profile.posLevel}`, posNumber: profile.orgShortName + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), - amount: profile.amount ? Extension.ToThaiNumber(profile.amount.toLocaleString()) : null, - precentTwo: null, //ร้อยละ 2 - precentFour: null, //ร้อยละ 4 + amount: profile.positionSalaryAmount + ? Extension.ToThaiNumber(profile.positionSalaryAmount.toLocaleString()) + : null, + precentTwo: + profile.positionSalaryAmountPer == 0.2 + ? profile.positionSalaryAmount * profile.positionSalaryAmountPer + : null, //ร้อยละ 2 + precentFour: + profile.positionSalaryAmountPer == 0.4 + ? profile.positionSalaryAmount * profile.positionSalaryAmountPer + : null, //ร้อยละ 4 reason: null, // หมายเหตุ }; }); @@ -2842,7 +2851,7 @@ export class ReportController extends Controller { const _salaryPeriod = await this.salaryProfileEmployeeRepository.find({ relations: ["salaryOrg", "salaryOrg.salaryPeriod"], where: { - type: In(["NONE"]), + isNext: false, salaryOrg: { snapshot: "SNAP2", rootId: rootId,