แก้หลังจากพ้นราชการสังกัดไม่แสดงในรายงาน

This commit is contained in:
Bright 2025-07-24 14:23:50 +07:00
parent 665ab5de4e
commit 2ec55789a7

View file

@ -1671,7 +1671,14 @@ export class CommandController extends Controller {
"current_holders.orgChild2",
"current_holders.orgChild3",
"current_holders.orgChild4",
"profileSalary"
],
order: {
profileSalary: {
order: "DESC",
createdAt: "DESC"
}
}
});
const shortName =
profile?.current_holders.length == 0
@ -1753,16 +1760,30 @@ export class CommandController extends Controller {
let _child2 = child2?.orgChild2Name;
let _child3 = child3?.orgChild3Name;
let _child4 = child4?.orgChild4Name;
let _OrgLeave:any = []
if (profile?.isLeave && profile?.profileSalary.length > 0) {
_OrgLeave = [
profile?.profileSalary[0].orgChild4 ? profile?.profileSalary[0].orgChild4 : null,
profile?.profileSalary[0].orgChild3 ? profile?.profileSalary[0].orgChild3 : null,
profile?.profileSalary[0].orgChild2 ? profile?.profileSalary[0].orgChild2 : null,
profile?.profileSalary[0].orgChild1 ? profile?.profileSalary[0].orgChild1 : null,
profile?.profileSalary[0].orgRoot ? profile?.profileSalary[0].orgRoot : null,
];
}
const orgLeave = _OrgLeave.filter((x:any) => x !== undefined && x !== null).join("\n");
return {
no: Extension.ToThaiNumber((idx + 1).toString()),
org:
commandCode != "C-PM-21"
? (_child4 == null ? "" : _child4 + "\n") +
(_child3 == null ? "" : _child3 + "\n") +
(_child2 == null ? "" : _child2 + "\n") +
(_child1 == null ? "" : _child1 + "\n") +
(_root == null ? "" : _root)
? profile?.isLeave == false
?
(_child4 == null ? "" : _child4 + "\n") +
(_child3 == null ? "" : _child3 + "\n") +
(_child2 == null ? "" : _child2 + "\n") +
(_child1 == null ? "" : _child1 + "\n") +
(_root == null ? "" : _root)
:
orgLeave
: (profile?.child4Temp == null ? "" : profile?.child4Temp + "\n") +
(profile?.child3Temp == null ? "" : profile?.child3Temp + "\n") +
(profile?.child2Temp == null ? "" : profile?.child2Temp + "\n") +