fix report (gov)

This commit is contained in:
Bright 2024-04-05 14:08:15 +07:00
parent 80daf64940
commit d29e06384c

View file

@ -1784,8 +1784,9 @@ export class ReportController extends Controller {
posNumber: posNumber:
profile.orgShortName + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), profile.orgShortName + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()),
amount: profile.amount ? Extension.ToThaiNumber(profile.amount.toLocaleString()) : null, amount: profile.amount ? Extension.ToThaiNumber(profile.amount.toLocaleString()) : null,
reason: null, //เหตุผล
score: null, //สรุปผลการประเมินฯ ระดับและคะแนน score: null, //สรุปผลการประเมินฯ ระดับและคะแนน
reason: null, remark: null, //หมายเหตุ
}; };
}); });
@ -2000,11 +2001,24 @@ export class ReportController extends Controller {
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบรอบการขึ้นเงินเดือน"); throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบรอบการขึ้นเงินเดือน");
} }
const salaryOrg = await this.salaryOrgRepository.findOne({ const salaryOrgGroup1 = await this.salaryOrgRepository.findOne({
where: { where: {
salaryPeriodId: salaryPeriodId, salaryPeriodId: salaryPeriodId,
rootId: rootId, rootId: rootId,
snapshot: "SNAP2", snapshot: "SNAP2",
group: "GROUP1"
},
order: {
group: "ASC",
},
relations: ["salaryProfiles"],
});
const salaryOrgGroup2 = await this.salaryOrgRepository.findOne({
where: {
salaryPeriodId: salaryPeriodId,
rootId: rootId,
snapshot: "SNAP2",
group: "GROUP2"
}, },
order: { order: {
group: "ASC", group: "ASC",
@ -2014,7 +2028,7 @@ export class ReportController extends Controller {
const salaryProfileSpecial = await this.salaryProfileRepository.find({ const salaryProfileSpecial = await this.salaryProfileRepository.find({
where: { where: {
salaryOrgId: salaryOrg?.id, salaryOrgId: In([salaryOrgGroup1?.id, salaryOrgGroup2?.id,]),
amountSpecial: MoreThan(1), amountSpecial: MoreThan(1),
}, },
select: [ select: [
@ -2038,9 +2052,10 @@ export class ReportController extends Controller {
const salaryProfileNoAmount = await this.salaryProfileRepository.find({ const salaryProfileNoAmount = await this.salaryProfileRepository.find({
where: { where: {
salaryOrgId: salaryOrg?.id, salaryOrgId: In([salaryOrgGroup1?.id, salaryOrgGroup2?.id,]),
amountUse: IsNull() || 0, // amountUse: IsNull() || 0,
positionSalaryAmount: IsNull() || 0, // positionSalaryAmount: IsNull() || 0,
type: "NONE"
}, },
select: [ select: [
"id", "id",
@ -2066,7 +2081,8 @@ export class ReportController extends Controller {
position: item.position, position: item.position,
posType: item.posType, posType: item.posType,
posLevel: item.posLevel, posLevel: item.posLevel,
posMasterNo: Extension.ToThaiNumber(String(item.posMasterNo)), posMasterNo:
item.orgShortName + Extension.ToThaiNumber(String(item.posMasterNo)),
amount: amount:
item.amount == undefined || item.amount == null item.amount == undefined || item.amount == null
? "" ? ""
@ -2084,7 +2100,8 @@ export class ReportController extends Controller {
position: item.position, position: item.position,
posType: item.posType, posType: item.posType,
posLevel: item.posLevel, posLevel: item.posLevel,
posMasterNo: Extension.ToThaiNumber(String(item.posMasterNo)), posMasterNo:
item.orgShortName + Extension.ToThaiNumber(String(item.posMasterNo)),
amount: amount:
item.amount == undefined || item.amount == null item.amount == undefined || item.amount == null
? "" ? ""
@ -2092,11 +2109,6 @@ export class ReportController extends Controller {
remark: null, remark: null,
})); }));
// const mapData = {
// profileSpecial,
// profileNoAmount,
// };
// return mapData;
return new HttpSuccess({ return new HttpSuccess({
template: "gov1-08", template: "gov1-08",
reportName: "gov1-08", reportName: "gov1-08",