From 6768a265dea93de25edadd2c9efc146c05ac18b6 Mon Sep 17 00:00:00 2001 From: Bright Date: Thu, 12 Dec 2024 17:44:57 +0700 Subject: [PATCH] =?UTF-8?q?fix=20issue=20#860=20:=20=E0=B8=A3=E0=B8=B0?= =?UTF-8?q?=E0=B8=9A=E0=B8=9A=E0=B8=97=E0=B8=B0=E0=B9=80=E0=B8=9A=E0=B8=B5?= =?UTF-8?q?=E0=B8=A2=E0=B8=99=E0=B8=9B=E0=B8=A3=E0=B8=B0=E0=B8=A7=E0=B8=B1?= =?UTF-8?q?=E0=B8=95=E0=B8=B4(=E0=B8=A5=E0=B8=B9=E0=B8=81=E0=B8=88?= =?UTF-8?q?=E0=B9=89=E0=B8=B2=E0=B8=87)=20=E0=B9=80=E0=B8=82=E0=B9=89?= =?UTF-8?q?=E0=B8=B2=E0=B9=81=E0=B8=97=E0=B9=87=E0=B8=9A=E0=B9=80=E0=B8=A1?= =?UTF-8?q?=E0=B8=99=E0=B8=B9=E0=B8=82=E0=B9=89=E0=B8=AD=E0=B8=A1=E0=B8=B9?= =?UTF-8?q?=E0=B8=A5=E0=B8=82=E0=B9=89=E0=B8=B2=E0=B8=A3=E0=B8=B2=E0=B8=8A?= =?UTF-8?q?=E0=B8=81=E0=B8=B2=E0=B8=A3=20Error?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/CommandController.ts | 1 + src/interfaces/utils.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/controllers/CommandController.ts b/src/controllers/CommandController.ts index 810d8999..3471339e 100644 --- a/src/controllers/CommandController.ts +++ b/src/controllers/CommandController.ts @@ -3474,6 +3474,7 @@ export class CommandController extends Controller { const _null: any = null; profile.employeeWage = item.amount == null ? _null : item.amount.toString(); profile.dateStart = new Date(); + profile.dateAppoint = new Date(); profile.amount = item.amount == null ? _null : item.amount; profile.amountSpecial = item.amountSpecial == null ? _null : item.amountSpecial; diff --git a/src/interfaces/utils.ts b/src/interfaces/utils.ts index bd664473..0a329890 100644 --- a/src/interfaces/utils.ts +++ b/src/interfaces/utils.ts @@ -92,7 +92,7 @@ export async function calculateGovAge(profileId: string, type: string) { } }) // const firstStartDate = new Date(records[0].date); - const firstStartDate = profile?.dateAppoint; + const firstStartDate = profile?.dateAppoint ? profile?.dateAppoint : new Date(); const firstEndDate = endDateFristRec ? new Date(endDateFristRec.dateGovernment) : new Date(); const {