From ea8d60fda0cbcc2cc38058e8221731e02426594f Mon Sep 17 00:00:00 2001 From: Bright Date: Thu, 24 Apr 2025 18:15:19 +0700 Subject: [PATCH] =?UTF-8?q?fix=20=E0=B8=A3=E0=B8=B0=E0=B8=9A=E0=B8=9A?= =?UTF-8?q?=E0=B8=97=E0=B8=B0=E0=B9=80=E0=B8=9A=E0=B8=B5=E0=B8=A2=E0=B8=99?= =?UTF-8?q?=E0=B8=9B=E0=B8=A3=E0=B8=B0=E0=B8=A7=E0=B8=B1=E0=B8=95=E0=B8=B4?= =?UTF-8?q?=20(=E0=B8=97=E0=B8=B8=E0=B8=81=E0=B8=AA=E0=B8=96=E0=B8=B2?= =?UTF-8?q?=E0=B8=99=E0=B8=A0=E0=B8=B2=E0=B8=9E)=20>>=20=E0=B9=80=E0=B8=87?= =?UTF-8?q?=E0=B8=B4=E0=B8=99=E0=B9=80=E0=B8=94=E0=B8=B7=E0=B8=AD=E0=B8=99?= =?UTF-8?q?=20(=E0=B8=82=E0=B9=89=E0=B8=AD=E0=B8=A1=E0=B8=B9=E0=B8=A5?= =?UTF-8?q?=E0=B8=9B=E0=B8=A3=E0=B8=B0=E0=B9=80=E0=B8=A0=E0=B8=97=E0=B8=84?= =?UTF-8?q?=E0=B8=B3=E0=B8=AA=E0=B8=B1=E0=B9=88=E0=B8=87=E0=B9=84=E0=B8=A1?= =?UTF-8?q?=E0=B9=88=E0=B9=81=E0=B8=AA=E0=B8=94=E0=B8=87)=20#1433?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/ProfileSalaryController.ts | 11 ++++++++++- src/controllers/ProfileSalaryEmployeeController.ts | 12 ++++++++++-- .../ProfileSalaryEmployeeTempController.ts | 12 ++++++++++-- 3 files changed, 30 insertions(+), 5 deletions(-) diff --git a/src/controllers/ProfileSalaryController.ts b/src/controllers/ProfileSalaryController.ts index 18da63cd..6ce0efbf 100644 --- a/src/controllers/ProfileSalaryController.ts +++ b/src/controllers/ProfileSalaryController.ts @@ -632,6 +632,11 @@ export class ProfileSalaryController extends Controller { lastUpdatedAt: new Date(), }; const _null: any = null; + if (body.commandCode && !body.commandName) { + if (body.commandCode == "7") body.commandName = "เงินพิเศษอื่น ๆ" + else if (body.commandCode == "6") body.commandName = "เลื่อนเงินเดือนกรณีอื่น ๆ" + else if (body.commandCode == "5") body.commandName = "เลื่อนเงินเดือนตามปกติ" + } Object.assign(data, { ...body, ...meta }); const history = new ProfileSalaryHistory(); Object.assign(history, { ...data, id: undefined }); @@ -706,7 +711,11 @@ export class ProfileSalaryController extends Controller { await new permission().PermissionOrgUserUpdate(req, "SYS_REGISTRY_OFFICER", record.profileId); const before = structuredClone(record); const history = new ProfileSalaryHistory(); - + if (body.commandCode && !body.commandName) { + if (body.commandCode == "7") body.commandName = "เงินพิเศษอื่น ๆ" + else if (body.commandCode == "6") body.commandName = "เลื่อนเงินเดือนกรณีอื่น ๆ" + else if (body.commandCode == "5") body.commandName = "เลื่อนเงินเดือนตามปกติ" + } Object.assign(record, body); Object.assign(history, { ...record, id: undefined }); diff --git a/src/controllers/ProfileSalaryEmployeeController.ts b/src/controllers/ProfileSalaryEmployeeController.ts index 6b5681c2..ce06f015 100644 --- a/src/controllers/ProfileSalaryEmployeeController.ts +++ b/src/controllers/ProfileSalaryEmployeeController.ts @@ -311,7 +311,11 @@ export class ProfileSalaryEmployeeController extends Controller { createdAt: new Date(), lastUpdatedAt: new Date(), }; - + if (body.commandCode && !body.commandName) { + if (body.commandCode == "7") body.commandName = "เงินพิเศษอื่น ๆ" + else if (body.commandCode == "6") body.commandName = "เลื่อนเงินเดือนกรณีอื่น ๆ" + else if (body.commandCode == "5") body.commandName = "เลื่อนเงินเดือนตามปกติ" + } Object.assign(data, { ...body, ...meta }); const history = new ProfileSalaryHistory(); Object.assign(history, { ...data, id: undefined }); @@ -395,7 +399,11 @@ export class ProfileSalaryEmployeeController extends Controller { ); const before = structuredClone(record); const history = new ProfileSalaryHistory(); - + if (body.commandCode && !body.commandName) { + if (body.commandCode == "7") body.commandName = "เงินพิเศษอื่น ๆ" + else if (body.commandCode == "6") body.commandName = "เลื่อนเงินเดือนกรณีอื่น ๆ" + else if (body.commandCode == "5") body.commandName = "เลื่อนเงินเดือนตามปกติ" + } Object.assign(record, body); Object.assign(history, { ...record, id: undefined }); diff --git a/src/controllers/ProfileSalaryEmployeeTempController.ts b/src/controllers/ProfileSalaryEmployeeTempController.ts index f4be602a..8d6ff717 100644 --- a/src/controllers/ProfileSalaryEmployeeTempController.ts +++ b/src/controllers/ProfileSalaryEmployeeTempController.ts @@ -125,7 +125,11 @@ export class ProfileSalaryEmployeeTempController extends Controller { createdAt: new Date(), lastUpdatedAt: new Date(), }; - + if (body.commandCode && !body.commandName) { + if (body.commandCode == "7") body.commandName = "เงินพิเศษอื่น ๆ" + else if (body.commandCode == "6") body.commandName = "เลื่อนเงินเดือนกรณีอื่น ๆ" + else if (body.commandCode == "5") body.commandName = "เลื่อนเงินเดือนตามปกติ" + } Object.assign(data, { ...body, ...meta }); const history = new ProfileSalaryHistory(); Object.assign(history, { ...data, id: undefined }); @@ -150,7 +154,11 @@ export class ProfileSalaryEmployeeTempController extends Controller { if (!record) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล"); const before = structuredClone(record); const history = new ProfileSalaryHistory(); - + if (body.commandCode && !body.commandName) { + if (body.commandCode == "7") body.commandName = "เงินพิเศษอื่น ๆ" + else if (body.commandCode == "6") body.commandName = "เลื่อนเงินเดือนกรณีอื่น ๆ" + else if (body.commandCode == "5") body.commandName = "เลื่อนเงินเดือนตามปกติ" + } Object.assign(record, body); Object.assign(history, { ...record, id: undefined });