This commit is contained in:
Bright 2024-03-25 16:28:48 +07:00
parent e05e6c625e
commit b17a55da72

View file

@ -2479,7 +2479,7 @@ export class ReportController extends Controller {
/**
* API 09- 1 3
*
* @summary 09- 1 3
* @summary 09- 1 3 bright
*
*/
@Get("emp1-09/{rootId}/{salaryPeriodId}")
@ -2576,23 +2576,29 @@ export class ReportController extends Controller {
amount: profile.amount ? Extension.ToThaiNumber(profile.amount.toLocaleString()) : "",
type1: _salaryProfileEmpAPR.length > 0
? (() => {
const type = _salaryProfileEmpAPR
const _profile = _salaryProfileEmpAPR
.filter((profileAPR) => profileAPR.citizenId === profile.citizenId)
.map((profile) => profile.type);
const Type = type[0];
return Type === "HALF" ? "0.5 ขั้น" : Type === "FULL" ? "1 ขั้น" : "ไม่ได้เลื่อนขั้นฯ";
.map((profile) => ({ type: profile.type, isNext: profile.isNext, positionSalaryAmountPer: profile.positionSalaryAmountPer }));
if(_profile[0].isNext){
return _profile[0].positionSalaryAmountPer === 0.02 ? "2%" : _profile[0].positionSalaryAmountPer === 0.04 ? "4%": "6%"
}
return _profile[0].type === "HALF" ? "0.5 ขั้น" : _profile[0].type === "FULL" ? "1 ขั้น" : "ไม่ได้เลื่อนขั้นฯ";
})()
: null, //เมษา ปีก่อนหน้า
type2: _salaryProfileEmpOCT.length > 0
? (() => {
const type = _salaryProfileEmpOCT
const _profile = _salaryProfileEmpOCT
.filter((profileOCT) => profileOCT.citizenId === profile.citizenId)
.map((profile) => profile.type);
const Type = type[0];
return Type === "HALF" ? "0.5 ขั้น" : Type === "FULL" ? "1 ขั้น" : "ไม่ได้เลื่อนขั้นฯ";
.map((profile) => ({ type: profile.type, isNext: profile.isNext, positionSalaryAmountPer: profile.positionSalaryAmountPer }));
if(_profile[0].isNext){
return _profile[0].positionSalaryAmountPer === 0.02 ? "2%" : _profile[0].positionSalaryAmountPer === 0.04 ? "4%": "6%"
}
return _profile[0].type === "HALF" ? "0.5 ขั้น" : _profile[0].type === "FULL" ? "1 ขั้น" : "ไม่ได้เลื่อนขั้นฯ";
})()
: null, //ตุลา ปีก่อนหน้า
type: profile.type === "HALF" ? "0.5 ขั้น" : profile.type === "FULL" ? "1 ขั้น" : "ไม่ได้เลื่อนขั้นฯ",
type: profile.isNext === true
? profile.positionSalaryAmountPer === 0.02 ? "2%" : profile.positionSalaryAmountPer === 0.04 ? "4%" : "6%"
: profile.type === "HALF" ? "0.5 ขั้น" : profile.type === "FULL" ? "1 ขั้น" : "ไม่ได้เลื่อนขั้นฯ",
score: null, //ผลการประเมิน
remark: null, //หมายเหตุ
};