diff --git a/src/controllers/WorkflowController.ts b/src/controllers/WorkflowController.ts index 4fca82b1..b877087e 100644 --- a/src/controllers/WorkflowController.ts +++ b/src/controllers/WorkflowController.ts @@ -756,7 +756,12 @@ export class WorkflowController extends Controller { actFullName: null, })); const posMasterActs = await this.posMasterActRepo.find({ - where: { posMasterId: In(posMasters.map((x) => x.id)) }, + where: { + posMasterId: In(posMasters.map((x) => x.id)), + posMasterChild: { + current_holderId: Not(In(posMasters.map((x) => x.current_holderId))), + }, + }, relations: [ "posMaster", "posMaster.current_holder", @@ -770,7 +775,7 @@ export class WorkflowController extends Controller { }); posMasterActs.map((x) => { let item: any = { - id: x.posMaster?.current_holderId || null, + id: x.posMasterChild?.current_holderId || null, prefix: x.posMasterChild?.current_holder?.prefix || "", firstName: x.posMasterChild?.current_holder?.firstName || "", lastName: x.posMasterChild?.current_holder?.lastName || "",