Merge branch 'develop' of github.com:Frappet/bma-ehr-organization into develop

This commit is contained in:
kittapath 2024-10-22 14:36:46 +07:00
commit 08ca03f733
2 changed files with 12 additions and 2 deletions

View file

@ -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;

View file

@ -197,6 +197,7 @@ export class CreateProfileSalary {
commandId: string | null;
// commandType?: string | null;
templateDoc: string | null;
isGovernment?: boolean | null;
}
export class CreateProfileSalaryEmployee {