From b2319419c1425b6c44a8ee03360288a5a9cf860d Mon Sep 17 00:00:00 2001 From: Kittapath Date: Thu, 25 Apr 2024 14:38:42 +0700 Subject: [PATCH] no message --- src/controllers/ReportController.ts | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/src/controllers/ReportController.ts b/src/controllers/ReportController.ts index 3f51d8a..b387a6b 100644 --- a/src/controllers/ReportController.ts +++ b/src/controllers/ReportController.ts @@ -6300,6 +6300,7 @@ export class ReportController extends Controller { const salaryRank = await this.salaryProfileRepository.find({ where: { salaryOrgId: In(salaryOrgs.map((x) => x.id)), + type: In(["FULLHAFT", "FULL", "HAFT"]), }, }); @@ -6334,9 +6335,16 @@ export class ReportController extends Controller { }); const salaryRank = await this.salaryProfileRepository.find({ - where: { - salaryOrgId: In(salaryOrgs.map((x) => x.id)), - }, + where: [ + { + salaryOrgId: In(salaryOrgs.map((x) => x.id)), + amountSpecial: MoreThan(0), + }, + { + salaryOrgId: In(salaryOrgs.map((x) => x.id)), + type: "NONE", + }, + ], }); const _salaryRank = salaryRank.map((item) => ({ @@ -6372,6 +6380,8 @@ export class ReportController extends Controller { const salaryRank = await this.salaryProfileRepository.find({ where: { salaryOrgId: In(salaryOrgs.map((x) => x.id)), + type: In(["FULLHAFT", "FULL", "HAFT"]), + isRetired: true, }, }); @@ -6401,13 +6411,14 @@ export class ReportController extends Controller { if (!salary) { throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลการขึ้นเงินเดือน"); } - const salaryOrgs = await this.salaryOrgRepository.find({ + const salaryOrgs = await this.salaryOrgEmployeeRepository.find({ where: { id: salary.id }, }); - const salaryRank = await this.salaryProfileRepository.find({ + const salaryRank = await this.salaryProfileEmployeeRepository.find({ where: { salaryOrgId: In(salaryOrgs.map((x) => x.id)), + type: In(["FULLHAFT", "FULL", "HAFT"]), }, }); @@ -6437,13 +6448,14 @@ export class ReportController extends Controller { if (!salary) { throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลการขึ้นเงินเดือน"); } - const salaryOrgs = await this.salaryOrgRepository.find({ + const salaryOrgs = await this.salaryOrgEmployeeRepository.find({ where: { id: salary.id }, }); - const salaryRank = await this.salaryProfileRepository.find({ + const salaryRank = await this.salaryProfileEmployeeRepository.find({ where: { salaryOrgId: In(salaryOrgs.map((x) => x.id)), + amountSpecial: MoreThan(0), }, });