fix report emp2-02

This commit is contained in:
AdisakKanthawilang 2024-03-28 10:26:34 +07:00
parent 4ff04f0dc5
commit 09433a80bd

View file

@ -3658,7 +3658,6 @@ export class ReportController extends Controller {
const octPreviousYear = await this.salaryPeriodRepository.findOne({
where: {
id: salaryPeriodId,
period: "OCT",
year: salaryPeriod?.year - 1,
},
@ -3666,7 +3665,6 @@ export class ReportController extends Controller {
const octPreviousYear2 = await this.salaryPeriodRepository.findOne({
where: {
id: salaryPeriodId,
period: "OCT",
year: salaryPeriod?.year - 2,
},
@ -3751,11 +3749,11 @@ export class ReportController extends Controller {
const _profile = octPreviousYearProfile2
.filter((profileOCT2) => profileOCT2.citizenId === profile.citizenId);
if (_profile.length > 0) {
return _profile[0]?.type === "HALF"
return _profile[0]?.type === "HAFT"
? ".๕ ขั้น"
: _profile[0]?.type === "FULL"
? "๑ ขั้น"
: profile?.type === "FULLHALF"
: profile?.type === "FULLHAFT"
? "๑.๕ ขั้น"
: "ไม่ได้เลื่อนขั้นฯ";
}
@ -3768,11 +3766,11 @@ export class ReportController extends Controller {
const _profile = octPreviousYearProfile
.filter((profileOCT) => profileOCT.citizenId === profile.citizenId);
if (_profile.length > 0) {
return _profile[0]?.type === "HALF"
return _profile[0]?.type === "HAFT"
? ".๕ ขั้น"
: _profile[0]?.type === "FULL"
? "๑ ขั้น"
: profile?.type === "FULLHALF"
: profile?.type === "FULLHAFT"
? "๑.๕ ขั้น"
: "ไม่ได้เลื่อนขั้นฯ";
}
@ -3787,21 +3785,21 @@ export class ReportController extends Controller {
.map((profile) => ({
type: profile.type,
}));
return _profile[0]?.type === "HALF"
return _profile[0]?.type === "HAFT"
? ".๕ ขั้น"
: _profile[0]?.type === "FULL"
? "๑ ขั้น"
: profile?.type === "FULLHALF"
: profile?.type === "FULLHAFT"
? "๑.๕ ขั้น"
: "ไม่ได้เลื่อนขั้นฯ";
})()
: null, //เมษา ปีเดียวกัน
type:
profile.type === "HALF"
profile.type === "HAFT"
? ".๕ ขั้น"
: profile.type === "FULL"
? "๑ ขั้น"
: profile.type === "FULLHALF"
: profile.type === "FULLHAFT"
? "๑.๕ ขั้น"
: "ไม่ได้เลื่อนขั้นฯ", //หน่วยงานพิจารณาเลื่อนขั้นค่าจ้าง 1 ต.ค. (จำนวนขั้น)
};