diff --git a/src/controllers/ProfileSalaryTempController.ts b/src/controllers/ProfileSalaryTempController.ts index d9a98af4..a8ae1c94 100644 --- a/src/controllers/ProfileSalaryTempController.ts +++ b/src/controllers/ProfileSalaryTempController.ts @@ -333,10 +333,10 @@ export class ProfileSalaryTempController extends Controller { ? null : _data.current_holders.find((x) => x.orgRevisionId == findRevision.id)?.orgChild4; - let _child1 = child1 == null ? "" : `${child1.orgChild1Name} `; - let _child2 = child2 == null ? "" : `${child2.orgChild2Name} `; - let _child3 = child3 == null ? "" : `${child3.orgChild3Name} `; - let _child4 = child4 == null ? "" : `${child4.orgChild4Name} `; + let _child1 =child1?.orgChild1Name; + let _child2 =child2?.orgChild2Name; + let _child3 =child3?.orgChild3Name; + let _child4 =child4?.orgChild4Name; return { id: _data.id, @@ -358,7 +358,11 @@ export class ProfileSalaryTempController extends Controller { root: root == null ? null : root.orgRootName, orgRootShortName: root == null ? null : root.orgRootShortName, orgRevisionId: root == null ? null : root.orgRevisionId, - org: `${_child4}${_child3}${_child2}${_child1}${root?.orgRootName ?? ""}`, + org: (_child4 == null ? "" : _child4 + "\n") + + (_child3 == null ? "" : _child3 + "\n") + + (_child2 == null ? "" : _child2 + "\n") + + (_child1 == null ? "" : _child1 + "\n") + + (root?.orgRootName == null ? "" : root?.orgRootName), statusCheckEdit: _data.statusCheckEdit, type: "OFFICER", }; @@ -399,7 +403,7 @@ export class ProfileSalaryTempController extends Controller { statusCheckEdit != undefined && statusCheckEdit != null && statusCheckEdit.toUpperCase() != "ALL" - ? "profile.statusCheckEdit = :statusCheckEdit" + ? "profileEmployee.statusCheckEdit = :statusCheckEdit" : "1=1", { statusCheckEdit: statusCheckEdit?.trim()?.toUpperCase() ?? null, @@ -544,10 +548,10 @@ export class ProfileSalaryTempController extends Controller { ? null : _data.current_holders.find((x) => x.orgRevisionId == findRevision.id)?.orgChild4; - let _child1 = child1 == null ? "" : `${child1.orgChild1Name} `; - let _child2 = child2 == null ? "" : `${child2.orgChild2Name} `; - let _child3 = child3 == null ? "" : `${child3.orgChild3Name} `; - let _child4 = child4 == null ? "" : `${child4.orgChild4Name} `; + let _child1 =child1?.orgChild1Name; + let _child2 =child2?.orgChild2Name; + let _child3 =child3?.orgChild3Name; + let _child4 =child4?.orgChild4Name; return { id: _data.id, prefix: _data.prefix, @@ -627,7 +631,11 @@ export class ProfileSalaryTempController extends Controller { child4: _data.child4Temp ? _data.child4Temp : null, child4Id: _data.child4IdTemp ? _data.child4IdTemp : null, child4ShortName: _data.child4ShortNameTemp ? _data.child4ShortNameTemp : null, - org: `${_child4}${_child3}${_child2}${_child1}${root?.orgRootName ?? ""}`, + org: (_child4 == null ? "" : _child4 + "\n") + + (_child3 == null ? "" : _child3 + "\n") + + (_child2 == null ? "" : _child2 + "\n") + + (_child1 == null ? "" : _child1 + "\n") + + (root?.orgRootName == null ? "" : root?.orgRootName), statusCheckEdit: _data.statusCheckEdit, type: "EMPLOYEE", };