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 {