update 2473
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m2s

This commit is contained in:
Adisak 2026-05-11 13:25:26 +07:00
parent b000e8b531
commit 7a6cf119bd
3 changed files with 12 additions and 9 deletions

View file

@ -137,6 +137,7 @@ export async function CreatePosMasterHistoryOfficer(
export async function CreatePosMasterHistoryEmployee(
posMasterId: string,
request: RequestWithUser | null,
type?: string | null,
): Promise<boolean> {
try {
await AppDataSource.transaction(async (manager) => {
@ -167,15 +168,17 @@ export async function CreatePosMasterHistoryEmployee(
? pm.positions.find((p) => p.positionIsSelected === true) ?? null
: null;
h.ancestorDNA = pm.ancestorDNA;
h.prefix = pm.current_holder?.prefix || _null;
h.firstName = pm.current_holder?.firstName || _null;
h.lastName = pm.current_holder?.lastName || _null;
if (!type || type != "DELETE") {
h.prefix = pm.current_holder?.prefix || _null;
h.firstName = pm.current_holder?.firstName || _null;
h.lastName = pm.current_holder?.lastName || _null;
h.position = selectedPosition?.positionName ?? _null;
h.posType = selectedPosition?.posType?.posTypeName ?? _null;
h.posLevel = selectedPosition?.posLevel?.posLevelName ?? _null;
}
h.posMasterNoPrefix = pm.posMasterNoPrefix ?? _null;
h.posMasterNo = pm.posMasterNo ?? _null;
h.posMasterNoSuffix = pm.posMasterNoSuffix ?? _null;
h.position = selectedPosition?.positionName ?? _null;
h.posType = selectedPosition?.posType?.posTypeName ?? _null;
h.posLevel = selectedPosition?.posLevel?.posLevelName ?? _null;
h.shortName =
[
pm.orgChild4?.orgChild4ShortName,