From ec571dec5419f06c3ffc07d816d4e8964bfa7440 Mon Sep 17 00:00:00 2001 From: moss <> Date: Thu, 1 May 2025 16:31:25 +0700 Subject: [PATCH] sort by root --- src/controllers/ReportController.ts | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/controllers/ReportController.ts b/src/controllers/ReportController.ts index e1d5a39..e97d576 100644 --- a/src/controllers/ReportController.ts +++ b/src/controllers/ReportController.ts @@ -3651,7 +3651,7 @@ export class ReportController extends Controller { relations: ["salaryOrg", "salaryOrg.salaryPeriod"], where: { type: In(["HAFT", "FULL", "FULLHAFT"]), - isNext: false, + isNext: true, salaryOrg: { snapshot: "SNAP2", rootId: rootId, @@ -7295,7 +7295,7 @@ export class ReportController extends Controller { .addOrderBy("salaryProfile.child4Order", "ASC") .addOrderBy("salaryProfile.posMasterNo", "ASC") .getMany(); - + const _salaryRank = salaryRank.map((item) => ({ id: item.id, posMasterNo: `${item.orgShortName} ${item.posMasterNo}`, @@ -7683,6 +7683,7 @@ export class ReportController extends Controller { // }), // ) .andWhere("salaryProfileEmployee.status37 = :status", { status: "PENDING" }) + .andWhere("salaryProfileEmployee.rootId = :rootId", { rootId: body.rootId }) .select([ "salaryProfileEmployee.id", "salaryProfileEmployee.orgShortName", @@ -8828,7 +8829,10 @@ export class ReportController extends Controller { commandNo: v.commandNo, commandYear: v.commandYear, commandId: v.commandId, - salaryLevel: salary.salaryLevel && salary.salaryLevelNew ? salary.salaryLevelNew : salary.salaryLevel, + salaryLevel: + salary.salaryLevel && salary.salaryLevelNew + ? salary.salaryLevelNew + : salary.salaryLevel, group: salary.group && salary.groupNew ? salary.groupNew : salary.group, }) .then(async () => { @@ -8916,7 +8920,10 @@ export class ReportController extends Controller { commandNo: v.commandNo, commandYear: v.commandYear, commandId: v.commandId, - salaryLevel: salary.salaryLevel && salary.salaryLevelNew ? salary.salaryLevelNew : salary.salaryLevel, + salaryLevel: + salary.salaryLevel && salary.salaryLevelNew + ? salary.salaryLevelNew + : salary.salaryLevel, group: salary.group && salary.groupNew ? salary.groupNew : salary.group, }) .then(async () => {