diff --git a/src/controllers/CommandController.ts b/src/controllers/CommandController.ts index fa26d3d1..60e1075e 100644 --- a/src/controllers/CommandController.ts +++ b/src/controllers/CommandController.ts @@ -3122,7 +3122,6 @@ export class CommandController extends Controller { body.refIds.map(async (item, i) => { const posMasterAct = await this.posMasterActRepository.findOne({ relations: [ - "posMaster", "posMaster", "posMaster.orgRoot", "posMaster.orgChild1", @@ -3172,18 +3171,17 @@ export class CommandController extends Controller { .join("/"); var _data = { no: Extension.ToThaiNumber((i + 1).toString()), - fullName: - posMasterAct.posMasterChild?.current_holder?.prefix ?? - "" + posMasterAct.posMasterChild?.current_holder?.firstName ?? - "" + " " + posMasterAct.posMasterChild?.current_holder?.lastName ?? - null, + fullName: `${item.Prefix ?? ""}${item.FirstName ?? ""} ${item.LastName ?? ""}`, oc: (posMasterAct.posMasterChild?.current_holder?.position ?? "-") + "/" + (_organization ?? "-"), postype: posMasterAct.posMasterChild?.current_holder?.posType?.posTypeName ?? "-", poslevel: posMasterAct.posMasterChild?.current_holder?.posLevel?.posLevelName ?? "-", - organizationNew: _organizationNew ?? "-", + organizationNew: + (posMasterAct.posMaster?.current_holder?.position ?? "-") + + "/" + + (_organizationNew ?? "-"), // date: Extension.ToThaiShortDate_noPrefix(new Date()), dateStart: "-", dateEnd: "-",