fix issue #880 คำสั่งเลื่อนค่าจ้างลูกจ้างประจำ > ไม่แสดงรายชื่อผู้ได้รับสำเนาคำสั่ง
This commit is contained in:
parent
51c6d8f615
commit
dcbda3b94e
1 changed files with 22 additions and 9 deletions
|
|
@ -1771,18 +1771,31 @@ export class CommandController extends Controller {
|
||||||
.catch(() => {});
|
.catch(() => {});
|
||||||
|
|
||||||
if (requestBody.persons != undefined && requestBody.persons.length > 0) {
|
if (requestBody.persons != undefined && requestBody.persons.length > 0) {
|
||||||
const posMaster = await this.posMasterRepository.find({
|
let posMaster: any;
|
||||||
where: {
|
if (["C-PM-36", "C-PM-37"].includes(commandCode)) {
|
||||||
current_holderId: In(requestBody.persons.map((x) => x.profileId)),
|
posMaster = await this.employeePosMasterRepository.find({
|
||||||
orgRevision: { orgRevisionIsDraft: false, orgRevisionIsCurrent: true },
|
where: {
|
||||||
},
|
current_holderId: In(requestBody.persons.map((x) => x.profileId)),
|
||||||
select: ["orgRootId"],
|
orgRevision: { orgRevisionIsDraft: false, orgRevisionIsCurrent: true },
|
||||||
});
|
},
|
||||||
|
select: ["orgRootId"],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
posMaster = await this.posMasterRepository.find({
|
||||||
|
where: {
|
||||||
|
current_holderId: In(requestBody.persons.map((x) => x.profileId)),
|
||||||
|
orgRevision: { orgRevisionIsDraft: false, orgRevisionIsCurrent: true },
|
||||||
|
},
|
||||||
|
select: ["orgRootId"],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
let _posMaster: any;
|
let _posMaster: any;
|
||||||
if (["C-PM-38", "C-PM-40"].includes(commandCode)) {
|
if (["C-PM-38", "C-PM-40"].includes(commandCode)) {
|
||||||
_posMaster = await this.posMasterRepository.find({
|
_posMaster = await this.posMasterRepository.find({
|
||||||
where: {
|
where: {
|
||||||
orgRootId: In(posMaster.map((x) => x.orgRootId)),
|
orgRootId: In(posMaster.map((x:any) => x.orgRootId)),
|
||||||
orgChild1: IsNull(),
|
orgChild1: IsNull(),
|
||||||
orgChild2: IsNull(),
|
orgChild2: IsNull(),
|
||||||
orgChild3: IsNull(),
|
orgChild3: IsNull(),
|
||||||
|
|
@ -1796,7 +1809,7 @@ export class CommandController extends Controller {
|
||||||
} else {
|
} else {
|
||||||
_posMaster = await this.posMasterRepository.find({
|
_posMaster = await this.posMasterRepository.find({
|
||||||
where: {
|
where: {
|
||||||
orgRootId: In(posMaster.map((x) => x.orgRootId)),
|
orgRootId: In(posMaster.map((x:any) => x.orgRootId)),
|
||||||
orgRevision: { orgRevisionIsDraft: false, orgRevisionIsCurrent: true },
|
orgRevision: { orgRevisionIsDraft: false, orgRevisionIsCurrent: true },
|
||||||
isDirector: true,
|
isDirector: true,
|
||||||
current_holderId: Not(IsNull()),
|
current_holderId: Not(IsNull()),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue