diff --git a/src/controllers/ReportController.ts b/src/controllers/ReportController.ts index 51bffd8..388b2af 100644 --- a/src/controllers/ReportController.ts +++ b/src/controllers/ReportController.ts @@ -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",