From b2aa004c7ff66659169031316872bf55c53e4fd1 Mon Sep 17 00:00:00 2001 From: Bright Date: Tue, 22 Oct 2024 14:23:28 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=80=E0=B8=9E=E0=B8=B4=E0=B9=88=E0=B8=A1?= =?UTF-8?q?=E0=B8=A7=E0=B8=B1=E0=B8=99=E0=B8=97=E0=B8=B5=E0=B9=88=E0=B9=80?= =?UTF-8?q?=E0=B8=82=E0=B9=89=E0=B8=B2/=E0=B8=AD=E0=B8=AD=E0=B8=81?= =?UTF-8?q?=E0=B8=88=E0=B8=B2=E0=B8=81=E0=B8=A3=E0=B8=B2=E0=B8=8A=E0=B8=81?= =?UTF-8?q?=E0=B8=B2=E0=B8=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/CommandController.ts | 13 +++++++++++-- src/entities/ProfileSalary.ts | 1 + 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/controllers/CommandController.ts b/src/controllers/CommandController.ts index 188bbcfb..26edc464 100644 --- a/src/controllers/CommandController.ts +++ b/src/controllers/CommandController.ts @@ -1707,6 +1707,7 @@ export class CommandController extends Controller { leaveReason?: string | null; dateLeave?: Date | null; commandId?: string | null; + isGovernment?: boolean | null; }[]; }, ) { @@ -1737,7 +1738,7 @@ export class CommandController extends Controller { Object.assign(data, { ...item, ...meta }); const history = new ProfileSalaryHistory(); Object.assign(history, { ...data, id: undefined }); - + data.dateGovernment = meta.createdAt; await this.salaryRepo.save(data, { data: req }); setLogDataDiff(req, { before, after: data }); history.profileSalaryId = data.id; @@ -1780,6 +1781,7 @@ export class CommandController extends Controller { isLeave: boolean; leaveReason?: string | null; dateLeave?: Date | null; + isGovernment?: boolean | null; }[]; }, ) { @@ -1815,7 +1817,7 @@ export class CommandController extends Controller { }); const history = new ProfileSalaryHistory(); Object.assign(history, { ...data, id: undefined }); - + data.dateGovernment = meta.createdAt; await this.salaryRepo.save(data, { data: req }); setLogDataDiff(req, { before, after: data }); history.profileSalaryId = data.id; @@ -1984,6 +1986,7 @@ export class CommandController extends Controller { amount?: Double | null; positionSalaryAmount?: Double | null; mouthSalaryAmount?: Double | null; + isGovernment?: boolean | null; }[]; }, ) { @@ -2036,6 +2039,8 @@ export class CommandController extends Controller { lastUpdateFullName: req.user.name, createdAt: new Date(), lastUpdatedAt: new Date(), + dateGovernment: new Date(), + isGovernment: item.isGovernment }; Object.assign(data, meta); @@ -2181,6 +2186,7 @@ export class CommandController extends Controller { amount?: Double | null; positionSalaryAmount?: Double | null; mouthSalaryAmount?: Double | null; + isGovernment?: boolean | null; }[]; }, ) { @@ -2246,6 +2252,8 @@ export class CommandController extends Controller { lastUpdateFullName: req.user.name, createdAt: new Date(), lastUpdatedAt: new Date(), + dateGovernment: new Date(), + isGovernment: item.isGovernment }); await Promise.all([ this.profileRepository.save(_profile), @@ -2390,6 +2398,7 @@ export class CommandController extends Controller { Object.assign(salaryHistory, { ...profileSal, id: undefined }); profileSal.order = dest_item == null ? 1 : dest_item.order + 1; profileSal.profileId = profile.id; + profileSal.dateGovernment = meta.createdAt; await this.salaryRepo.save(profileSal, { data: req }); setLogDataDiff(req, { before, after: profileSal }); salaryHistory.profileSalaryId = profileSal.id; diff --git a/src/entities/ProfileSalary.ts b/src/entities/ProfileSalary.ts index 0d76a620..881dbcfc 100644 --- a/src/entities/ProfileSalary.ts +++ b/src/entities/ProfileSalary.ts @@ -197,6 +197,7 @@ export class CreateProfileSalary { commandId: string | null; // commandType?: string | null; templateDoc: string | null; + isGovernment?: boolean | null; } export class CreateProfileSalaryEmployee {