This commit is contained in:
AdisakKanthawilang 2025-01-22 14:21:41 +07:00
parent 0a9d3002a4
commit 37b3f5cd6e

View file

@ -2586,7 +2586,7 @@ export class ReportController extends Controller {
}, },
}, },
order: { order: {
amount: "ASC", result: "DESC",
}, },
}); });
@ -2605,22 +2605,34 @@ export class ReportController extends Controller {
: _salaryPeriod[0].salaryOrg.fifteenPoint.toString()); : _salaryPeriod[0].salaryOrg.fifteenPoint.toString());
const formattedData = _salaryPeriod.map((profile, index) => { const formattedData = _salaryPeriod.map((profile, index) => {
const fullName = `${profile.prefix}${profile.firstName} ${profile.lastName}`;
const fullNameParts = [ const fullNameParts = [
profile.child4, profile.child4,
profile.child3, profile.child3,
profile.child2, profile.child2,
profile.child1, profile.child1,
profile.root, 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) .filter((part) => part !== undefined && part !== null)
.join("/"); .join("/");
const fullName = `${profile.prefix}${profile.firstName} ${profile.lastName}`;
const fullName_aff = fullNameParts
.filter((part) => part !== undefined && part !== null && part !== "")
.join("/");
return { return {
no: Extension.ToThaiNumber((index + 1).toLocaleString()), no: Extension.ToThaiNumber((index + 1).toLocaleString()),
fullName: fullName, fullName: fullName_aff,
affiliation: affiliation, affiliation: affiliation,
position: profile.position, position: profile.position,
posLevel: profile.posLevel posLevel: profile.posLevel
@ -2805,7 +2817,7 @@ export class ReportController extends Controller {
? "(" + Extension.ToThaiNumber(profile.amountSpecial.toString()) + ")" ? "(" + Extension.ToThaiNumber(profile.amountSpecial.toString()) + ")"
: "", : "",
amountSpecial: amountSpecial:
profile.amountSpecial > 0 ? Extension.ToThaiNumber(profile.amountSpecial.toString()) : "", profile.amountSpecial > 0 ? Extension.ToThaiNumber(profile.amountSpecial.toLocaleString()) : "",
score: profile.result, //สรุปผลการประเมินฯ ระดับและคะแนน score: profile.result, //สรุปผลการประเมินฯ ระดับและคะแนน
reason: profile.remark, reason: profile.remark,
}; };
@ -2866,7 +2878,6 @@ export class ReportController extends Controller {
profile.child1, profile.child1,
profile.root, profile.root,
]; ];
const affiliation = fullNameParts const affiliation = fullNameParts
.filter((part) => part !== undefined && part !== null) .filter((part) => part !== undefined && part !== null)
.join("/"); .join("/");