From 37b3f5cd6e70d608e75e91c952fada37e5fd10df Mon Sep 17 00:00:00 2001 From: AdisakKanthawilang Date: Wed, 22 Jan 2025 14:21:41 +0700 Subject: [PATCH] #1017 , #1018 , #1019 --- src/controllers/ReportController.ts | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/src/controllers/ReportController.ts b/src/controllers/ReportController.ts index ac7a7cd..e454eb1 100644 --- a/src/controllers/ReportController.ts +++ b/src/controllers/ReportController.ts @@ -2586,7 +2586,7 @@ export class ReportController extends Controller { }, }, order: { - amount: "ASC", + result: "DESC", }, }); @@ -2605,22 +2605,34 @@ export class ReportController extends Controller { : _salaryPeriod[0].salaryOrg.fifteenPoint.toString()); const formattedData = _salaryPeriod.map((profile, index) => { + const fullName = `${profile.prefix}${profile.firstName} ${profile.lastName}`; const fullNameParts = [ profile.child4, profile.child3, profile.child2, profile.child1, profile.root, + fullName + ]; + const affiliationParts = [ + profile.child4, + profile.child3, + profile.child2, + profile.child1, + profile.root ]; - const affiliation = fullNameParts + const affiliation = affiliationParts .filter((part) => part !== undefined && part !== null) .join("/"); - const fullName = `${profile.prefix}${profile.firstName} ${profile.lastName}`; + + const fullName_aff = fullNameParts + .filter((part) => part !== undefined && part !== null && part !== "") + .join("/"); return { no: Extension.ToThaiNumber((index + 1).toLocaleString()), - fullName: fullName, + fullName: fullName_aff, affiliation: affiliation, position: profile.position, posLevel: profile.posLevel @@ -2805,7 +2817,7 @@ export class ReportController extends Controller { ? "(" + Extension.ToThaiNumber(profile.amountSpecial.toString()) + ")" : "", amountSpecial: - profile.amountSpecial > 0 ? Extension.ToThaiNumber(profile.amountSpecial.toString()) : "", + profile.amountSpecial > 0 ? Extension.ToThaiNumber(profile.amountSpecial.toLocaleString()) : "", score: profile.result, //สรุปผลการประเมินฯ ระดับและคะแนน reason: profile.remark, }; @@ -2866,7 +2878,6 @@ export class ReportController extends Controller { profile.child1, profile.root, ]; - const affiliation = fullNameParts .filter((part) => part !== undefined && part !== null) .join("/");