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 {