fix: command C-PM-20 insert history
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m6s
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m6s
This commit is contained in:
parent
7a6cf119bd
commit
378c941a01
1 changed files with 15 additions and 0 deletions
|
|
@ -5450,6 +5450,21 @@ export class CommandController extends Controller {
|
|||
_profile.leaveDate = item.commandDateAffect ?? _null;
|
||||
_profile.leaveType = exceptClear.LeaveType ?? _null;
|
||||
} else {
|
||||
// บันทึกประวัติก่อนลบตำแหน่ง
|
||||
const curRevision = await this.orgRevisionRepo.findOne({
|
||||
where: { orgRevisionIsCurrent: true, orgRevisionIsDraft: false },
|
||||
});
|
||||
if (curRevision) {
|
||||
const curPosMaster = await this.employeePosMasterRepository.findOne({
|
||||
where: {
|
||||
current_holderId: _profile.id,
|
||||
orgRevisionId: curRevision.id,
|
||||
},
|
||||
});
|
||||
if (curPosMaster) {
|
||||
await CreatePosMasterHistoryEmployee(curPosMaster.id, req, "DELETE");
|
||||
}
|
||||
}
|
||||
await removeProfileInOrganize(_profile.id, "EMPLOYEE");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue