fix report gov1-04

This commit is contained in:
AdisakKanthawilang 2024-03-20 11:50:19 +07:00
parent d5f40373a8
commit 2fc8c3d459

View file

@ -486,37 +486,44 @@ export class ReportController extends Controller {
"amount", "amount",
"amountSpecial", "amountSpecial",
], ],
order: {
"posMasterNo": "ASC",
}
}); });
const mapData = { return new HttpSuccess({
effectiveDate: salaryPeriod?.effectiveDate, template: "gov1-04",
root: salaryProfile[0]?.root, reportName: "gov1-04",
profile: salaryProfile.map((item, index) => ({ data: {
no: Extension.ToThaiNumber(String(index + 1)), year: Extension.ToThaiNumber(String(Extension.ToThaiYear(salaryPeriod?.year))),
fullname: item.prefix + item.firstName + " " + item.lastName, effectiveDate: salaryPeriod?.effectiveDate,
position: root: salaryProfile[0]?.root,
item.position + profile: salaryProfile.map((item, index) => ({
"/" + no: Extension.ToThaiNumber(String(index + 1)),
(item.child4 == undefined && item.child4 == null ? "" : item.child4 + "/") + fullname: item.prefix + item.firstName + " " + item.lastName,
(item.child3 == undefined && item.child3 == null ? "" : item.child3 + "/") + position:
(item.child2 == undefined && item.child2 == null ? "" : item.child2 + "/") + item.position +
(item.child1 == undefined && item.child1 == null ? "" : item.child1 + "/") + "/" +
(item.root == undefined && item.root == null ? "" : item.root), (item.child4 == undefined && item.child4 == null ? "" : item.child4 + "/") +
posLevel: item.posLevel, (item.child3 == undefined && item.child3 == null ? "" : item.child3 + "/") +
orgShortName: item.orgShortName + Extension.ToThaiNumber(String(item.posMasterNo)), (item.child2 == undefined && item.child2 == null ? "" : item.child2 + "/") +
amount: (item.child1 == undefined && item.child1 == null ? "" : item.child1 + "/") +
item.amount == undefined || item.amount == null (item.root == undefined && item.root == null ? "" : item.root),
? "" posLevel: item.posLevel,
: Extension.ToThaiNumber(String(item.amount)), orgShortName: item.orgShortName + Extension.ToThaiNumber(String(item.posMasterNo)),
amountSpecial: amount:
item.amountSpecial == undefined || item.amountSpecial == null item.amount == undefined || item.amount == null
? "" ? ""
: Extension.ToThaiNumber(String(item.amountSpecial)), : Extension.ToThaiNumber(String(item.amount)),
score: null, //สรุปผลการประเมินฯ ระดับและคะแนน amountSpecial:
remark: null, //หมายเหตุ item.amountSpecial == undefined || item.amountSpecial == null
})), ? ""
}; : Extension.ToThaiNumber(String(item.amountSpecial)),
return mapData; score: null, //สรุปผลการประเมินฯ ระดับและคะแนน
remark: null, //หมายเหตุ
})),
},
});
} }
/** /**