ปรับ report gov1-03

This commit is contained in:
Bright 2024-03-20 10:56:15 +07:00
parent 16c9395f89
commit 8d43780135

View file

@ -369,31 +369,34 @@ export class ReportController extends Controller {
],
});
const mapData = {
effectiveDate: salaryPeriod?.effectiveDate,
// root: salaryProfile[0]?.root,
profile: salaryProfile.map((item, index) => ({
no: Extension.ToThaiNumber(String(index + 1)),
fullname: item.prefix + item.firstName + " " + item.lastName,
position:
item.position +
"/" +
(item.child4 == undefined && item.child4 == null ? "" : item.child4 + "/") +
(item.child3 == undefined && item.child3 == null ? "" : item.child3 + "/") +
(item.child2 == undefined && item.child2 == null ? "" : item.child2 + "/") +
(item.child1 == undefined && item.child1 == null ? "" : item.child1 + "/") +
(item.root == undefined && item.root == null ? "" : item.root),
posLevel: item.posLevel,
posMasterNo: Extension.ToThaiNumber(String(item.posMasterNo)),
amount:
item.amount == undefined || item.amount == null
? ""
: Extension.ToThaiNumber(String(item.amount)),
score: null, //สรุปผลการประเมินฯ ระดับและคะแนน
remark: null, //หมายเหตุ
})),
};
return mapData;
return new HttpSuccess({
template: "gov1-03",
reportName: "gov1-03",
data: {
year: Extension.ToThaiNumber(String(salaryPeriod.year)),
root: salaryProfile[0]?.root,
profile: salaryProfile.map((item, index) => ({
no: Extension.ToThaiNumber(String(index + 1)),
fullname:
(item.child4 == undefined && item.child4 == null ? "" : item.child4 + "/") +
(item.child3 == undefined && item.child3 == null ? "" : item.child3 + "/") +
(item.child2 == undefined && item.child2 == null ? "" : item.child2 + "/") +
(item.child1 == undefined && item.child1 == null ? "" : item.child1 + "/") +
(item.root == undefined && item.root == null ? "" : item.root)+
"/" + item.prefix + item.firstName + " " + item.lastName, // สังกัด/ชื่อ-นามสกุล
posLevel: item.posLevel,
posMasterNo: Extension.ToThaiNumber(String(item.posMasterNo)),
amount:
item.amount == undefined || item.amount == null
? ""
: Extension.ToThaiNumber(String(item.amount.toLocaleString())),
salaryIncrease1: null, //การเลื่อนเงินเดือนปีก่อนๆหน้า
salaryIncrease2: null, //การเลื่อนเงินเดือนปีก่อนหน้า
score: null, //ผลการประเมินฯ
remark: null, //หมายเหตุ
}))
}
});
}
/**