From 36155a1a1c9399f955d3e118c6fe3f5bf27df8eb Mon Sep 17 00:00:00 2001 From: Kittapath Date: Tue, 21 May 2024 13:06:48 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=E0=B8=9A=E0=B8=B1?= =?UTF-8?q?=E0=B8=84=E0=B9=80=E0=B8=87=E0=B8=B4=E0=B8=99=E0=B9=80=E0=B8=94?= =?UTF-8?q?=E0=B8=B7=E0=B8=AD=E0=B8=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/SalaryPeriodController.ts | 7 ++++++- src/controllers/SalaryPeriodEmployeeController.ts | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/controllers/SalaryPeriodController.ts b/src/controllers/SalaryPeriodController.ts index 3adbb36..1c1eaf5 100644 --- a/src/controllers/SalaryPeriodController.ts +++ b/src/controllers/SalaryPeriodController.ts @@ -309,6 +309,7 @@ export class SalaryPeriodController extends Controller { where: { id: _salaryProfile.salaryOrg.id, }, + relations: { salaryProfiles: true }, }); if (salaryOrg != null) { const amountFullType = await this.salaryProfileRepository.count({ @@ -586,6 +587,7 @@ export class SalaryPeriodController extends Controller { where: { id: _salaryProfile.salaryOrg.id, }, + relations: { salaryProfiles: true }, }); if (salaryOrg != null) { const amountFullType = await this.salaryProfileRepository.count({ @@ -704,6 +706,7 @@ export class SalaryPeriodController extends Controller { where: { id: _salaryProfile.salaryOrg.id, }, + relations: { salaryProfiles: true }, }); if (salaryOrg != null) { const amountFullType = await this.salaryProfileRepository.count({ @@ -1012,6 +1015,7 @@ export class SalaryPeriodController extends Controller { where: { id: _salaryProfile.salaryOrg.id, }, + relations: { salaryProfiles: true }, }); if (salaryOrg != null) { const amountFullType = await this.salaryProfileRepository.count({ @@ -1441,6 +1445,7 @@ export class SalaryPeriodController extends Controller { where: { id: _salaryProfile.salaryOrg.id, }, + relations: { salaryProfiles: true }, }); if (salaryOrg != null) { const amountFullType = await this.salaryProfileRepository.count({ @@ -1770,7 +1775,7 @@ export class SalaryPeriodController extends Controller { if (SalaryPeriod?.period == "SPECIAL") { const SalaryOrg = await this.salaryOrgRepository.find({ where: { salaryPeriodId: SalaryPeriod.id }, - relations: ["salaryProfiles"], + relations: { salaryProfiles: true }, }); const salaryProfile = SalaryOrg.find((x) => x.salaryProfiles.length > 0); if (salaryProfile) throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่สามารถลบได้"); diff --git a/src/controllers/SalaryPeriodEmployeeController.ts b/src/controllers/SalaryPeriodEmployeeController.ts index d9e929c..089918f 100644 --- a/src/controllers/SalaryPeriodEmployeeController.ts +++ b/src/controllers/SalaryPeriodEmployeeController.ts @@ -271,6 +271,7 @@ export class SalaryPeriodEmployeeController extends Controller { where: { id: _salaryProfile.salaryOrg.id, }, + relations: { salaryProfiles: true }, }); if (salaryOrg != null) { const amountFullType = await this.salaryProfileRepository.count({ @@ -720,6 +721,7 @@ export class SalaryPeriodEmployeeController extends Controller { where: { id: _salaryProfile.salaryOrg.id, }, + relations: { salaryProfiles: true }, }); if (salaryOrg != null) { const amountFullType = await this.salaryProfileRepository.count({ @@ -839,6 +841,7 @@ export class SalaryPeriodEmployeeController extends Controller { where: { id: _salaryProfile.salaryOrg.id, }, + relations: { salaryProfiles: true }, }); if (salaryOrg != null) { const amountFullType = await this.salaryProfileRepository.count({ @@ -1322,6 +1325,7 @@ export class SalaryPeriodEmployeeController extends Controller { where: { id: _salaryProfile.salaryOrg.id, }, + relations: { salaryProfiles: true }, }); if (salaryOrg != null) { const amountFullType = await this.salaryProfileRepository.count({ @@ -1976,6 +1980,7 @@ export class SalaryPeriodEmployeeController extends Controller { where: { id: _salaryProfile.salaryOrg.id, }, + relations: { salaryProfiles: true }, }); if (salaryOrg != null) { const amountFullType = await this.salaryProfileRepository.count({