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

This commit is contained in:
kittapath 2024-10-21 14:28:33 +07:00
commit c56bf76b71
5 changed files with 48 additions and 14 deletions

View file

@ -1455,6 +1455,7 @@ export class CommandController extends Controller {
templateDoc: string | null;
posmasterId: string;
positionId: string;
commandId?: string | null;
}[];
},
) {
@ -1464,7 +1465,7 @@ export class CommandController extends Controller {
if (!profile) {
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลทะเบียนประวัตินี้");
}
let _null: any = null;
const dest_item = await this.salaryRepo.findOne({
where: { profileId: item.profileId },
order: { order: "DESC" },
@ -1485,10 +1486,9 @@ export class CommandController extends Controller {
Object.assign(data, { ...item, ...meta });
const history = new ProfileSalaryHistory();
Object.assign(history, { ...data, id: undefined });
await this.salaryRepo.save(data, { data: req });
setLogDataDiff(req, { before, after: data });
history.profileSalaryId = data.id;
history.commandId = item.commandId??_null;
await this.salaryHistoryRepo.save(history, { data: req });
const posMaster = await this.posMasterRepository.findOne({
@ -1573,6 +1573,7 @@ export class CommandController extends Controller {
templateDoc: string | null;
posmasterId: string;
positionId: string;
commandId?: string | null;
}[];
},
) {
@ -1706,6 +1707,7 @@ export class CommandController extends Controller {
isLeave: boolean;
leaveReason?: string | null;
dateLeave?: Date | null;
commandId?: string | null;
}[];
},
) {
@ -1857,6 +1859,7 @@ export class CommandController extends Controller {
positionLevel: string | null;
refCommandNo: string | null;
templateDoc: string | null;
commandId?: string | null;
}[];
},
) {
@ -1978,6 +1981,7 @@ export class CommandController extends Controller {
detail?: string | null;
level?: string | null;
unStigma?: string | null;
commandId?: string | null;
}[];
},
) {
@ -2092,6 +2096,7 @@ export class CommandController extends Controller {
date?: Date | null;
refCommandNo?: string | null;
salaryRef?: string | null;
commandId?: string | null;
}[];
},
) {
@ -2171,6 +2176,7 @@ export class CommandController extends Controller {
date?: Date | null;
refCommandNo?: string | null;
salaryRef?: string | null;
commandId?: string | null;
}[];
},
) {
@ -2208,6 +2214,7 @@ export class CommandController extends Controller {
date: item.date,
refCommandNo: item.refCommandNo,
templateDoc: item.salaryRef,
commandId: item.commandId,
position: profile.profileSalary.length > 0 ? profile.profileSalary[0].position : null,
positionType:
profile.profileSalary.length > 0 ? profile.profileSalary[0].positionType : null,
@ -2462,6 +2469,7 @@ export class CommandController extends Controller {
refId: string;
commandAffectDate: Date | null;
commandNo: string | null;
commandId?: string | null;
commandYear: number;
templateDoc: string | null;
amount: Double | null;
@ -2488,6 +2496,7 @@ export class CommandController extends Controller {
profileEmployeeId: profile.id,
date: new Date(),
amount: item.amount,
commandId: item.commandId,
positionSalaryAmount: item.positionSalaryAmount,
mouthSalaryAmount: item.mouthSalaryAmount,
posNo: profile.posMasterNoTemp,
@ -2628,6 +2637,7 @@ export class CommandController extends Controller {
refId: string;
commandAffectDate: Date | null;
commandNo: string | null;
commandId?: string | null;
commandYear: number;
templateDoc: string | null;
amount: Double | null;
@ -2766,6 +2776,7 @@ export class CommandController extends Controller {
refId: string;
commandAffectDate: Date | null;
commandNo: string | null;
commandId?: string | null;
commandYear: number;
templateDoc: string | null;
amount: Double | null;
@ -2795,6 +2806,7 @@ export class CommandController extends Controller {
profileId: profile.id,
date: new Date(),
amount: item.amount,
commandId: item.commandId,
positionSalaryAmount: item.positionSalaryAmount,
mouthSalaryAmount: item.mouthSalaryAmount,
posNo: "",

View file

@ -121,7 +121,6 @@ export class ProfileSalaryController extends Controller {
Object.assign(data, { ...body, ...meta });
const history = new ProfileSalaryHistory();
Object.assign(history, { ...data, id: undefined });
await this.salaryRepo.save(data, { data: req });
setLogDataDiff(req, { before, after: data });
history.profileSalaryId = data.id;