From 50fc458c3f3819b2dd8d173224a84330a356c128 Mon Sep 17 00:00:00 2001 From: Kittapath Date: Wed, 3 Apr 2024 18:59:58 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=E0=B8=84=E0=B8=B3?= =?UTF-8?q?=E0=B8=99=E0=B8=A7=E0=B8=99=E0=B9=80=E0=B8=87=E0=B8=B4=E0=B8=99?= =?UTF-8?q?=E0=B8=A5=E0=B8=B9=E0=B8=81=E0=B8=88=E0=B9=89=E0=B8=B2=E0=B8=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SalaryPeriodEmployeeController.ts | 30 +++++++++++++++++-- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/src/controllers/SalaryPeriodEmployeeController.ts b/src/controllers/SalaryPeriodEmployeeController.ts index 50f164b..aadf96c 100644 --- a/src/controllers/SalaryPeriodEmployeeController.ts +++ b/src/controllers/SalaryPeriodEmployeeController.ts @@ -474,7 +474,15 @@ export class SalaryPeriodEmployeeController extends Controller { order: { step: "DESC" }, }); //เงินเดือนเกินตาราง - if (salaryRankMax != null && step > salaryRankMax.step) { + if ( + salaryRankMax != null && + step > salaryRankMax.step && + (salaryFormula == null || + (salaryFormula != null && + salaryProfile.amount != null && + salaryFormula.salaryMax != null && + salaryFormula.salaryMax > salaryProfile.amount)) + ) { group = group + 1; //เงินเดือนในกลุ่มต่อไป let salaryRankAmount = await this.salaryRankRepository.findOne({ @@ -892,7 +900,15 @@ export class SalaryPeriodEmployeeController extends Controller { order: { step: "DESC" }, }); //เงินเดือนเกินตาราง - if (salaryRankMax != null && step > salaryRankMax.step) { + if ( + salaryRankMax != null && + step > salaryRankMax.step && + (salaryFormula == null || + (salaryFormula != null && + salaryProfile.amount != null && + salaryFormula.salaryMax != null && + salaryFormula.salaryMax > salaryProfile.amount)) + ) { group = group + 1; //เงินเดือนในกลุ่มต่อไป let salaryRankAmount = await this.salaryRankRepository.findOne({ @@ -1415,7 +1431,15 @@ export class SalaryPeriodEmployeeController extends Controller { order: { step: "DESC" }, }); //เงินเดือนเกินตาราง - if (salaryRankMax != null && step > salaryRankMax.step) { + if ( + salaryRankMax != null && + step > salaryRankMax.step && + (salaryFormula == null || + (salaryFormula != null && + salaryProfile.amount != null && + salaryFormula.salaryMax != null && + salaryFormula.salaryMax > salaryProfile.amount)) + ) { group = group + 1; //เงินเดือนในกลุ่มต่อไป let salaryRankAmount = await this.salaryRankRepository.findOne({