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