diff --git a/src/controllers/ReportController.ts b/src/controllers/ReportController.ts index e41862a..35c378a 100644 --- a/src/controllers/ReportController.ts +++ b/src/controllers/ReportController.ts @@ -252,8 +252,8 @@ export class ReportController extends Controller { where: { rootId: rootId, salaryPeriodId: salaryPeriodId, - } - }) + }, + }); const root = _root?.root == null ? "" : _root.root; // const agency = _salaryPeriod[0] == null ? "" : _salaryPeriod[0].root; @@ -276,7 +276,8 @@ export class ReportController extends Controller { fullName: fullName, posLevel: profile.posLevel, posNumber: - Extension.ToThaiNumber(profile.orgShortName) + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), + Extension.ToThaiNumber(profile.orgShortName) + + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), amount: profile.amount ? Extension.ToThaiNumber(profile.amount.toLocaleString()) : null, reason: null, }; @@ -475,6 +476,7 @@ export class ReportController extends Controller { year: salaryPeriod.year, }, }, + relations: { salaryProfiles: true }, }); const _salaryPeriodAPR2 = await this.salaryOrgRepository.findOne({ where: { @@ -486,6 +488,7 @@ export class ReportController extends Controller { year: salaryPeriod.year, }, }, + relations: { salaryProfiles: true }, }); let formattedData1; if (data1 != null) { @@ -522,14 +525,15 @@ export class ReportController extends Controller { totalUser: Extension.ToThaiNumber(data1.total.toLocaleString()), sixPercentAmount: Extension.ToThaiNumber(data1.sixPercentAmount.toLocaleString()), spentAmount: Extension.ToThaiNumber(data1.spentAmount.toLocaleString()), - remainingAmount: Extension.ToThaiNumber( - (data1.sixPercentAmount - data1.spentAmount).toLocaleString(), - ), + remainingAmount: Extension.ToThaiNumber(data1.remainingAmount.toLocaleString()), fifteenPercentOld: Extension.ToThaiNumber( (_salaryPeriodAPR2 == null ? 0 : _salaryPeriodAPR2.fifteenPercent).toLocaleString(), ), totalOld: Extension.ToThaiNumber( - (_salaryPeriodAPR2 == null ? 0 : _salaryPeriodAPR2.total).toLocaleString(), + (_salaryPeriodAPR2 == null || _salaryPeriodAPR2.salaryProfiles.length == 0 + ? 0 + : _salaryPeriodAPR2.salaryProfiles.filter((x) => x.type == "FULL").length + ).toLocaleString(), ), haft: Extension.ToThaiNumber( data1.salaryProfiles.filter((x) => x.type == "HAFT").length.toLocaleString(), @@ -546,7 +550,9 @@ export class ReportController extends Controller { haftSalary: Extension.ToThaiNumber(haftSalary.toLocaleString()), fullSalary: Extension.ToThaiNumber(fullSalary.toLocaleString()), fullHaftSalary: Extension.ToThaiNumber(fullHaftSalary.toLocaleString()), - total: Extension.ToThaiNumber((haftSalary + fullSalary + fullHaftSalary).toLocaleString()), + total: Extension.ToThaiNumber( + (haftSalary + fullSalary + fullHaftSalary).toLocaleString(), + ), summary: Extension.ToThaiNumber( ( data1.sixPercentAmount - @@ -614,14 +620,22 @@ export class ReportController extends Controller { totalUser: Extension.ToThaiNumber(data2.total.toLocaleString()), sixPercentAmount: Extension.ToThaiNumber(data2.sixPercentAmount.toLocaleString()), spentAmount: Extension.ToThaiNumber(data2.spentAmount.toLocaleString()), - remainingAmount: Extension.ToThaiNumber( - (data2.sixPercentAmount - data2.spentAmount).toLocaleString(), - ), + remainingAmount: Extension.ToThaiNumber(data2.remainingAmount.toLocaleString()), fifteenPercentOld: Extension.ToThaiNumber( (_salaryPeriodAPR1 == null ? 0 : _salaryPeriodAPR1.fifteenPercent).toLocaleString(), ), totalOld: Extension.ToThaiNumber( - (_salaryPeriodAPR1 == null ? 0 : _salaryPeriodAPR1.total).toLocaleString(), + (_salaryPeriodAPR1 == null || _salaryPeriodAPR1.salaryProfiles.length == 0 + ? 0 + : _salaryPeriodAPR1.salaryProfiles + .filter( + (x) => + x.posLevel == "อาวุโส" || + x.posLevel == "ชำนาญการพิเศษ" || + (x.posLevel == "ต้น" && x.posType == "อำนวยการ"), + ) + .filter((x) => x.type == "FULL").length + ).toLocaleString(), ), haft: Extension.ToThaiNumber( data2.salaryProfiles @@ -670,7 +684,9 @@ export class ReportController extends Controller { haftSalary: Extension.ToThaiNumber(haftSalary.toLocaleString()), fullSalary: Extension.ToThaiNumber(fullSalary.toLocaleString()), fullHaftSalary: Extension.ToThaiNumber(fullHaftSalary.toLocaleString()), - total: Extension.ToThaiNumber((haftSalary + fullSalary + fullHaftSalary).toLocaleString()), + total: Extension.ToThaiNumber( + (haftSalary + fullSalary + fullHaftSalary).toLocaleString(), + ), summary: Extension.ToThaiNumber( ( data2.sixPercentAmount - @@ -740,14 +756,23 @@ export class ReportController extends Controller { totalUser: Extension.ToThaiNumber(data3.total.toLocaleString()), sixPercentAmount: Extension.ToThaiNumber(data3.sixPercentAmount.toLocaleString()), spentAmount: Extension.ToThaiNumber(data3.spentAmount.toLocaleString()), - remainingAmount: Extension.ToThaiNumber( - (data3.sixPercentAmount - data3.spentAmount).toLocaleString(), - ), + remainingAmount: Extension.ToThaiNumber(data3.remainingAmount.toLocaleString()), fifteenPercentOld: Extension.ToThaiNumber( (_salaryPeriodAPR1 == null ? 0 : _salaryPeriodAPR1.fifteenPercent).toLocaleString(), ), totalOld: Extension.ToThaiNumber( - (_salaryPeriodAPR1 == null ? 0 : _salaryPeriodAPR1.total).toLocaleString(), + (_salaryPeriodAPR1 == null || _salaryPeriodAPR1.salaryProfiles.length == 0 + ? 0 + : _salaryPeriodAPR1.salaryProfiles + .filter((x) => x.type == "FULL") + .filter( + (x) => + x.posLevel == "ปฏิบัติงาน" || + x.posLevel == "ชำนาญงาน" || + x.posLevel == "ปฏิบัติการ" || + x.posLevel == "ชำนาญการ", + ).length + ).toLocaleString(), ), haft: Extension.ToThaiNumber( data3.salaryProfiles @@ -800,7 +825,9 @@ export class ReportController extends Controller { haftSalary: Extension.ToThaiNumber(haftSalary.toLocaleString()), fullSalary: Extension.ToThaiNumber(fullSalary.toLocaleString()), fullHaftSalary: Extension.ToThaiNumber(fullHaftSalary.toLocaleString()), - total: Extension.ToThaiNumber((haftSalary + fullSalary + fullHaftSalary).toLocaleString()), + total: Extension.ToThaiNumber( + (haftSalary + fullSalary + fullHaftSalary).toLocaleString(), + ), summary: Extension.ToThaiNumber( ( data3.sixPercentAmount - @@ -849,14 +876,15 @@ export class ReportController extends Controller { totalUser: Extension.ToThaiNumber(data4.total.toLocaleString()), sixPercentAmount: Extension.ToThaiNumber(data4.sixPercentAmount.toLocaleString()), spentAmount: Extension.ToThaiNumber(data4.spentAmount.toLocaleString()), - remainingAmount: Extension.ToThaiNumber( - (data4.sixPercentAmount - data4.spentAmount).toLocaleString(), - ), + remainingAmount: Extension.ToThaiNumber(data4.remainingAmount.toLocaleString()), fifteenPercentOld: Extension.ToThaiNumber( (_salaryPeriodAPR1 == null ? 0 : _salaryPeriodAPR1.fifteenPercent).toLocaleString(), ), totalOld: Extension.ToThaiNumber( - (_salaryPeriodAPR1 == null ? 0 : _salaryPeriodAPR1.total).toLocaleString(), + (_salaryPeriodAPR1 == null || _salaryPeriodAPR1.salaryProfiles.length == 0 + ? 0 + : _salaryPeriodAPR1.salaryProfiles.filter((x) => x.type == "FULL").length + ).toLocaleString(), ), haft: Extension.ToThaiNumber( data4.salaryProfiles.filter((x) => x.type == "HAFT").length.toLocaleString(), @@ -873,7 +901,9 @@ export class ReportController extends Controller { haftSalary: Extension.ToThaiNumber(haftSalary.toLocaleString()), fullSalary: Extension.ToThaiNumber(fullSalary.toLocaleString()), fullHaftSalary: Extension.ToThaiNumber(fullHaftSalary.toLocaleString()), - total: Extension.ToThaiNumber((haftSalary + fullSalary + fullHaftSalary).toLocaleString()), + total: Extension.ToThaiNumber( + (haftSalary + fullSalary + fullHaftSalary).toLocaleString(), + ), summary: Extension.ToThaiNumber( ( data4.sixPercentAmount - @@ -1126,7 +1156,9 @@ export class ReportController extends Controller { " " + item.lastName, // สังกัด/ชื่อ-นามสกุล posLevel: item.posLevel, - posMasterNo: Extension.ToThaiNumber(item.orgShortName) + Extension.ToThaiNumber(String(item.posMasterNo.toLocaleString())), + posMasterNo: + Extension.ToThaiNumber(item.orgShortName) + + Extension.ToThaiNumber(String(item.posMasterNo.toLocaleString())), amount: item.amount == undefined || item.amount == null ? "๐" @@ -1172,7 +1204,9 @@ export class ReportController extends Controller { " " + item.lastName, // สังกัด/ชื่อ-นามสกุล posLevel: item.posLevel, - posMasterNo: Extension.ToThaiNumber(item.orgShortName) + Extension.ToThaiNumber(String(item.posMasterNo.toLocaleString())), + posMasterNo: + Extension.ToThaiNumber(item.orgShortName) + + Extension.ToThaiNumber(String(item.posMasterNo.toLocaleString())), amount: item.amount == undefined || item.amount == null ? "๐" @@ -1426,7 +1460,9 @@ export class ReportController extends Controller { " " + item.lastName, // สังกัด/ชื่อ-นามสกุล posLevel: item.posLevel, - posMasterNo: Extension.ToThaiNumber(item.orgShortName) + Extension.ToThaiNumber(String(item.posMasterNo.toLocaleString())), + posMasterNo: + Extension.ToThaiNumber(item.orgShortName) + + Extension.ToThaiNumber(String(item.posMasterNo.toLocaleString())), amount: item.amount == undefined || item.amount == null ? "๐" @@ -1485,7 +1521,9 @@ export class ReportController extends Controller { " " + item.lastName, // สังกัด/ชื่อ-นามสกุล posLevel: item.posLevel, - posMasterNo: Extension.ToThaiNumber(item.orgShortName) + Extension.ToThaiNumber(String(item.posMasterNo.toLocaleString())), + posMasterNo: + Extension.ToThaiNumber(item.orgShortName) + + Extension.ToThaiNumber(String(item.posMasterNo.toLocaleString())), amount: item.amount == undefined || item.amount == null ? "๐" @@ -1563,7 +1601,7 @@ export class ReportController extends Controller { rootId: rootId, salaryPeriodId: salaryPeriodId, }, - type: "NONE", //ไม่ได้เลื่อน + type: In(["HAFT", "FULL", "FULLHAFT"]), isRetired: false, //กรองเฉพาะคนที่ไม่เกษียณ }, order: { @@ -1579,8 +1617,8 @@ export class ReportController extends Controller { where: { rootId: rootId, salaryPeriodId: salaryPeriodId, - } - }) + }, + }); const root = _root?.root == null ? "" : _root.root; // const agency = _salaryPeriod[0] == null ? "" : _salaryPeriod[0].root; @@ -1600,7 +1638,9 @@ export class ReportController extends Controller { (profile.child1 == undefined && profile.child1 == null ? "" : profile.child1 + "/") + (profile.root == undefined && profile.root == null ? "" : profile.root), posLevel: profile.posLevel, - orgShortName: Extension.ToThaiNumber(profile.orgShortName) + Extension.ToThaiNumber(String(profile.posMasterNo.toLocaleString())), + orgShortName: + Extension.ToThaiNumber(profile.orgShortName) + + Extension.ToThaiNumber(String(profile.posMasterNo.toLocaleString())), amount: profile.amount == undefined || profile.amount == null || profile.amount == 0 ? "" @@ -1665,7 +1705,7 @@ export class ReportController extends Controller { rootId: rootId, salaryPeriodId: salaryPeriodId, }, - type: "NONE", //ไม่ได้เลื่อน + type: In(["HAFT", "FULL", "FULLHAFT"]), isRetired: true, //กรองเฉพาะคนที่เกษียณ }, order: { @@ -1681,8 +1721,8 @@ export class ReportController extends Controller { where: { rootId: rootId, salaryPeriodId: salaryPeriodId, - } - }) + }, + }); const root = _root?.root == null ? "" : _root.root; // const agency = _salaryPeriod[0] == null ? "" : _salaryPeriod[0].root; @@ -1702,7 +1742,9 @@ export class ReportController extends Controller { (profile.child1 == undefined && profile.child1 == null ? "" : profile.child1 + "/") + (profile.root == undefined && profile.root == null ? "" : profile.root), posLevel: profile.posLevel, - orgShortName: Extension.ToThaiNumber(profile.orgShortName) + Extension.ToThaiNumber(String(profile.posMasterNo.toLocaleString())), + orgShortName: + Extension.ToThaiNumber(profile.orgShortName) + + Extension.ToThaiNumber(String(profile.posMasterNo.toLocaleString())), amount: profile.amount == undefined || profile.amount == null || profile.amount == 0 ? "" @@ -1782,8 +1824,8 @@ export class ReportController extends Controller { where: { rootId: rootId, salaryPeriodId: salaryPeriodId, - } - }) + }, + }); const root = _root?.root == null ? "" : _root.root; // const agency = _salaryPeriod[0] == null ? "" : _salaryPeriod[0].root; @@ -1807,7 +1849,8 @@ export class ReportController extends Controller { position: position, posLevel: profile.posLevel, posNumber: - Extension.ToThaiNumber(profile.orgShortName) + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), + Extension.ToThaiNumber(profile.orgShortName) + + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), amount: profile.amount ? Extension.ToThaiNumber(profile.amount.toLocaleString()) : null, reason: null, //เหตุผล score: null, //สรุปผลการประเมินฯ ระดับและคะแนน @@ -1869,8 +1912,8 @@ export class ReportController extends Controller { where: { rootId: rootId, salaryPeriodId: salaryPeriodId, - } - }) + }, + }); const root = _root?.root == null ? "" : _root.root; // const agency = _salaryPeriod[0] == null ? "" : _salaryPeriod[0].root; @@ -1894,7 +1937,8 @@ export class ReportController extends Controller { position: position, posLevel: profile.posLevel, posNumber: - Extension.ToThaiNumber(profile.orgShortName) + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), + Extension.ToThaiNumber(profile.orgShortName) + + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), amount: profile.amount ? Extension.ToThaiNumber(profile.amount.toLocaleString()) : null, reason: null, //เหตุผล score: null, //สรุปผลการประเมินฯ ระดับและคะแนน @@ -1966,8 +2010,8 @@ export class ReportController extends Controller { where: { rootId: rootId, salaryPeriodId: salaryPeriodId, - } - }) + }, + }); const root = _root?.root == null ? "" : _root.root; // const agency = salaryProfile[0] == null ? "" : salaryProfile[0].root; @@ -1984,7 +2028,9 @@ export class ReportController extends Controller { (item.root == undefined && item.root == null ? "" : item.root), posType: item.posType, posLevel: item.posLevel, - posMasterNo: Extension.ToThaiNumber(item.orgShortName) + Extension.ToThaiNumber(String(item.posMasterNo.toLocaleString())), + posMasterNo: + Extension.ToThaiNumber(item.orgShortName) + + Extension.ToThaiNumber(String(item.posMasterNo.toLocaleString())), amount: item.amount == undefined || item.amount == null ? "๐" @@ -2045,7 +2091,7 @@ export class ReportController extends Controller { salaryPeriodId: salaryPeriodId, rootId: rootId, snapshot: "SNAP2", - group: "GROUP1" + group: "GROUP1", }, relations: ["salaryProfiles"], }); @@ -2054,7 +2100,7 @@ export class ReportController extends Controller { salaryPeriodId: salaryPeriodId, rootId: rootId, snapshot: "SNAP2", - group: "GROUP2" + group: "GROUP2", }, relations: ["salaryProfiles"], }); @@ -2062,7 +2108,7 @@ export class ReportController extends Controller { const salaryProfileSpecial = await this.salaryProfileRepository.find({ relations: ["salaryOrg"], where: { - salaryOrgId: In([salaryOrgGroup1?.id, salaryOrgGroup2?.id,]), + salaryOrgId: In([salaryOrgGroup1?.id, salaryOrgGroup2?.id]), amountSpecial: MoreThan(1), }, select: [ @@ -2081,7 +2127,7 @@ export class ReportController extends Controller { ], order: { salaryOrg: { - group: "ASC" + group: "ASC", }, posMasterNo: "ASC", }, @@ -2090,10 +2136,10 @@ export class ReportController extends Controller { const salaryProfileNoAmount = await this.salaryProfileRepository.find({ relations: ["salaryOrg"], where: { - salaryOrgId: In([salaryOrgGroup1?.id, salaryOrgGroup2?.id,]), + salaryOrgId: In([salaryOrgGroup1?.id, salaryOrgGroup2?.id]), // amountUse: IsNull() || 0, // positionSalaryAmount: IsNull() || 0, - type: "NONE" + type: "NONE", }, select: [ "id", @@ -2110,7 +2156,7 @@ export class ReportController extends Controller { ], order: { salaryOrg: { - group: "ASC" + group: "ASC", }, posMasterNo: "ASC", }, @@ -2122,8 +2168,9 @@ export class ReportController extends Controller { position: item.position, posType: item.posType, posLevel: item.posLevel, - posMasterNo: - Extension.ToThaiNumber(item.orgShortName) + Extension.ToThaiNumber(String(item.posMasterNo.toLocaleString())), + posMasterNo: + Extension.ToThaiNumber(item.orgShortName) + + Extension.ToThaiNumber(String(item.posMasterNo.toLocaleString())), amount: item.amount == undefined || item.amount == null ? "๐" @@ -2141,8 +2188,9 @@ export class ReportController extends Controller { position: item.position, posType: item.posType, posLevel: item.posLevel, - posMasterNo: - Extension.ToThaiNumber(item.orgShortName) + Extension.ToThaiNumber(String(item.posMasterNo.toLocaleString())), + posMasterNo: + Extension.ToThaiNumber(item.orgShortName) + + Extension.ToThaiNumber(String(item.posMasterNo.toLocaleString())), amount: item.amount == undefined || item.amount == null ? "๐" @@ -2281,9 +2329,12 @@ export class ReportController extends Controller { no: Extension.ToThaiNumber((index + 1).toLocaleString()), fullName: fullName, position: profile.position, - posLevel: profile.posLevel ? `${profile.posTypeShort} ${Extension.ToThaiNumber(profile.posLevel.toLocaleString())}`: null, + posLevel: profile.posLevel + ? `${profile.posTypeShort} ${Extension.ToThaiNumber(profile.posLevel.toLocaleString())}` + : null, posNumber: - Extension.ToThaiNumber(profile.orgShortName) + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), + Extension.ToThaiNumber(profile.orgShortName) + + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), amount: profile.amount ? Extension.ToThaiNumber(profile.amount.toLocaleString()) : null, reason: null, }; @@ -2362,9 +2413,12 @@ export class ReportController extends Controller { no: Extension.ToThaiNumber((index + 1).toLocaleString()), fullName: fullName, position: profile.position, - posLevel: profile.posLevel ? `${profile.posTypeShort} ${Extension.ToThaiNumber(profile.posLevel.toLocaleString())}`: null, + posLevel: profile.posLevel + ? `${profile.posTypeShort} ${Extension.ToThaiNumber(profile.posLevel.toLocaleString())}` + : null, posNumber: - Extension.ToThaiNumber(profile.orgShortName) + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), + Extension.ToThaiNumber(profile.orgShortName) + + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), amount: profile.amount ? Extension.ToThaiNumber(profile.amount.toLocaleString()) : null, score: null, reason: null, @@ -2444,9 +2498,12 @@ export class ReportController extends Controller { no: Extension.ToThaiNumber((index + 1).toLocaleString()), fullName: fullName, position: profile.position, - posLevel: profile.posLevel ? `${profile.posTypeShort} ${Extension.ToThaiNumber(profile.posLevel.toLocaleString())}`: null, + posLevel: profile.posLevel + ? `${profile.posTypeShort} ${Extension.ToThaiNumber(profile.posLevel.toLocaleString())}` + : null, posNumber: - Extension.ToThaiNumber(profile.orgShortName) + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), + Extension.ToThaiNumber(profile.orgShortName) + + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), amount: profile.amount ? Extension.ToThaiNumber(profile.amount.toLocaleString()) : null, positionSalaryAmount: profile.positionSalaryAmount ? Extension.ToThaiNumber(profile.positionSalaryAmount.toLocaleString()) @@ -2522,9 +2579,12 @@ export class ReportController extends Controller { no: Extension.ToThaiNumber((index + 1).toLocaleString()), fullName: fullName, position: profile.position, - posLevel: profile.posLevel ? `${profile.posTypeShort} ${Extension.ToThaiNumber(profile.posLevel.toLocaleString())}`: null, + posLevel: profile.posLevel + ? `${profile.posTypeShort} ${Extension.ToThaiNumber(profile.posLevel.toLocaleString())}` + : null, posNumber: - Extension.ToThaiNumber(profile.orgShortName) + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), + Extension.ToThaiNumber(profile.orgShortName) + + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), amount: profile.amount ? Extension.ToThaiNumber(profile.amount.toLocaleString()) : null, positionSalaryAmount: profile.positionSalaryAmount ? Extension.ToThaiNumber(profile.positionSalaryAmount.toLocaleString()) @@ -2603,9 +2663,12 @@ export class ReportController extends Controller { no: Extension.ToThaiNumber((index + 1).toLocaleString()), fullName: fullName, position: profile.position, - posLevel: profile.posLevel ? `${profile.posTypeShort} ${Extension.ToThaiNumber(profile.posLevel.toLocaleString())}`: null, + posLevel: profile.posLevel + ? `${profile.posTypeShort} ${Extension.ToThaiNumber(profile.posLevel.toLocaleString())}` + : null, posNumber: - Extension.ToThaiNumber(profile.orgShortName) + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), + Extension.ToThaiNumber(profile.orgShortName) + + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), amount: profile.amount ? Extension.ToThaiNumber(profile.amount.toLocaleString()) : null, positionSalaryAmount: profile.positionSalaryAmount ? Extension.ToThaiNumber(profile.positionSalaryAmount.toLocaleString()) @@ -2681,9 +2744,12 @@ export class ReportController extends Controller { no: Extension.ToThaiNumber((index + 1).toLocaleString()), fullName: fullName, position: profile.position, - posLevel: profile.posLevel ? `${profile.posTypeShort} ${Extension.ToThaiNumber(profile.posLevel.toLocaleString())}`: null, + posLevel: profile.posLevel + ? `${profile.posTypeShort} ${Extension.ToThaiNumber(profile.posLevel.toLocaleString())}` + : null, posNumber: - Extension.ToThaiNumber(profile.orgShortName) + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), + Extension.ToThaiNumber(profile.orgShortName) + + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), amount: profile.amount ? Extension.ToThaiNumber(profile.amount.toLocaleString()) : null, positionSalaryAmount: profile.positionSalaryAmount ? Extension.ToThaiNumber(profile.positionSalaryAmount.toLocaleString()) @@ -2817,7 +2883,8 @@ export class ReportController extends Controller { fullName: fullName, position: profile.position, posNumber: - Extension.ToThaiNumber(profile.orgShortName) + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), + Extension.ToThaiNumber(profile.orgShortName) + + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), amount: profile.amount ? Extension.ToThaiNumber(profile.amount.toLocaleString()) : "๐", type1: _salaryProfileEmpAPR.length > 0 @@ -3026,7 +3093,8 @@ export class ReportController extends Controller { fullName: fullName, posLevel: profile.posLevel, posNumber: - Extension.ToThaiNumber(profile.orgShortName) + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), + Extension.ToThaiNumber(profile.orgShortName) + + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), amount: profile.amount ? Extension.ToThaiNumber(profile.amount.toLocaleString()) : null, reason: null, }; @@ -3098,9 +3166,12 @@ export class ReportController extends Controller { no: Extension.ToThaiNumber((index + 1).toLocaleString()), fullName: fullName, position: profile.position, - posLevel: profile.posLevel ? `${profile.posTypeShort} ${Extension.ToThaiNumber(profile.posLevel.toLocaleString())}`: null, + posLevel: profile.posLevel + ? `${profile.posTypeShort} ${Extension.ToThaiNumber(profile.posLevel.toLocaleString())}` + : null, posNumber: - Extension.ToThaiNumber(profile.orgShortName) + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), + Extension.ToThaiNumber(profile.orgShortName) + + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), amount: profile.amount ? Extension.ToThaiNumber(profile.amount.toLocaleString()) : null, positionSalaryAmount: profile.positionSalaryAmount ? Extension.ToThaiNumber(profile.positionSalaryAmount.toLocaleString()) @@ -3179,9 +3250,12 @@ export class ReportController extends Controller { no: Extension.ToThaiNumber((index + 1).toLocaleString()), fullName: fullName, position: profile.position, - posLevel: profile.posLevel ? `${profile.posTypeShort} ${Extension.ToThaiNumber(profile.posLevel.toLocaleString())}`: null, + posLevel: profile.posLevel + ? `${profile.posTypeShort} ${Extension.ToThaiNumber(profile.posLevel.toLocaleString())}` + : null, posNumber: - Extension.ToThaiNumber(profile.orgShortName) + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), + Extension.ToThaiNumber(profile.orgShortName) + + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), amount: profile.amount ? Extension.ToThaiNumber(profile.amount.toLocaleString()) : null, score: null, //สรุปผลการประเมินฯ ระดับและคะแนน reason: null, // หมายเหตุ @@ -3253,9 +3327,12 @@ export class ReportController extends Controller { no: Extension.ToThaiNumber((index + 1).toLocaleString()), fullName: fullName, position: profile.position, - posLevel: profile.posLevel ? `${profile.posTypeShort} ${Extension.ToThaiNumber(profile.posLevel.toLocaleString())}`: null, + posLevel: profile.posLevel + ? `${profile.posTypeShort} ${Extension.ToThaiNumber(profile.posLevel.toLocaleString())}` + : null, posNumber: - Extension.ToThaiNumber(profile.orgShortName) + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), + Extension.ToThaiNumber(profile.orgShortName) + + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), amount: profile.amount ? Extension.ToThaiNumber(profile.amount.toLocaleString()) : null, positionSalaryAmount: profile.positionSalaryAmount ? Extension.ToThaiNumber(profile.positionSalaryAmount.toLocaleString()) @@ -3334,9 +3411,12 @@ export class ReportController extends Controller { no: Extension.ToThaiNumber((index + 1).toLocaleString()), fullName: fullName, position: profile.position, - posLevel: profile.posLevel ? `${profile.posTypeShort} ${Extension.ToThaiNumber(profile.posLevel.toLocaleString())}`: null, + posLevel: profile.posLevel + ? `${profile.posTypeShort} ${Extension.ToThaiNumber(profile.posLevel.toLocaleString())}` + : null, posNumber: - Extension.ToThaiNumber(profile.orgShortName) + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), + Extension.ToThaiNumber(profile.orgShortName) + + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), amount: profile.positionSalaryAmount ? Extension.ToThaiNumber(profile.positionSalaryAmount.toLocaleString()) : null, @@ -3417,9 +3497,12 @@ export class ReportController extends Controller { no: Extension.ToThaiNumber((index + 1).toLocaleString()), fullName: fullName, position: profile.position, - posLevel: profile.posLevel ? `${profile.posTypeShort} ${Extension.ToThaiNumber(profile.posLevel.toLocaleString())}`: null, + posLevel: profile.posLevel + ? `${profile.posTypeShort} ${Extension.ToThaiNumber(profile.posLevel.toLocaleString())}` + : null, posNumber: - Extension.ToThaiNumber(profile.orgShortName) + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), + Extension.ToThaiNumber(profile.orgShortName) + + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), amount: profile.amount ? Extension.ToThaiNumber(profile.amount.toLocaleString()) : null, reason: null, // หมายเหตุ }; @@ -3491,7 +3574,8 @@ export class ReportController extends Controller { fullName: fullName, posLevel: profile.posLevel, posNumber: - Extension.ToThaiNumber(profile.orgShortName) + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), + Extension.ToThaiNumber(profile.orgShortName) + + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), amount: profile.amount ? Extension.ToThaiNumber(profile.amount.toLocaleString()) : null, reason: null, }; @@ -3563,7 +3647,8 @@ export class ReportController extends Controller { fullName: fullName, posLevel: profile.posLevel, posNumber: - Extension.ToThaiNumber(profile.orgShortName) + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), + Extension.ToThaiNumber(profile.orgShortName) + + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), amount: profile.amount ? Extension.ToThaiNumber(profile.amount.toLocaleString()) : null, reason: null, }; @@ -3860,7 +3945,8 @@ export class ReportController extends Controller { fullName: fullName, position: profile.position, posNumber: - Extension.ToThaiNumber(profile.orgShortName) + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), + Extension.ToThaiNumber(profile.orgShortName) + + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), amount: profile.amount ? Extension.ToThaiNumber(profile.amount.toLocaleString()) : null, yearOld2: octPreviousYear2 == null @@ -4087,7 +4173,8 @@ export class ReportController extends Controller { position: profile.position, posLevel: profile.posLevel, posNumber: - Extension.ToThaiNumber(profile.orgShortName) + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), + Extension.ToThaiNumber(profile.orgShortName) + + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), amount: profile.amount ? Extension.ToThaiNumber(profile.amount.toLocaleString()) : null, //เมษา ปีก่อนหน้า typeOld2: @@ -4245,7 +4332,8 @@ export class ReportController extends Controller { (profile.root == undefined && profile.root == null ? "" : profile.root), posLevel: profile.posLevel, posNumber: - Extension.ToThaiNumber(profile.orgShortName) + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), + Extension.ToThaiNumber(profile.orgShortName) + + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), amount: profile.amount ? Extension.ToThaiNumber(profile.amount.toLocaleString()) : null, positionSalaryAmount: profile.positionSalaryAmount ? Extension.ToThaiNumber(profile.positionSalaryAmount.toLocaleString()) @@ -4325,7 +4413,8 @@ export class ReportController extends Controller { position: profile.position, posLevel: profile.posLevel, posNumber: - Extension.ToThaiNumber(profile.orgShortName) + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), + Extension.ToThaiNumber(profile.orgShortName) + + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), positionSalaryAmount: profile.positionSalaryAmount ? Extension.ToThaiNumber(profile.positionSalaryAmount.toLocaleString()) : null, @@ -4413,7 +4502,8 @@ export class ReportController extends Controller { (profile.root == undefined && profile.root == null ? "" : profile.root), posLevel: profile.posLevel, posNumber: - Extension.ToThaiNumber(profile.orgShortName) + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), + Extension.ToThaiNumber(profile.orgShortName) + + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), amount: profile.amount ? Extension.ToThaiNumber(profile.amount.toLocaleString()) : null, positionSalaryAmount: profile.positionSalaryAmount ? Extension.ToThaiNumber(profile.positionSalaryAmount.toLocaleString()) @@ -4492,7 +4582,8 @@ export class ReportController extends Controller { position: profile.position, posLevel: profile.posLevel, posNumber: - Extension.ToThaiNumber(profile.orgShortName) + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), + Extension.ToThaiNumber(profile.orgShortName) + + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), amount: profile.amount ? Extension.ToThaiNumber(profile.amount.toLocaleString()) : null, reason: null, score: null, @@ -4566,7 +4657,8 @@ export class ReportController extends Controller { fullName: fullName, posLevel: profile.posLevel, posNumber: - Extension.ToThaiNumber(profile.orgShortName) + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), + Extension.ToThaiNumber(profile.orgShortName) + + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), amount: profile.amount ? Extension.ToThaiNumber(profile.amount.toLocaleString()) : null, reason: null, }; @@ -4685,7 +4777,8 @@ export class ReportController extends Controller { position: profile.position, posLevel: profile.posLevel, posNumber: - Extension.ToThaiNumber(profile.orgShortName) + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), + Extension.ToThaiNumber(profile.orgShortName) + + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), amount: profile.amount ? Extension.ToThaiNumber(profile.amount.toLocaleString()) : null, typeOld2: octPreviousYear2 && octPreviousYearProfile2.length > 0 @@ -4839,7 +4932,8 @@ export class ReportController extends Controller { (profile.root == undefined && profile.root == null ? "" : profile.root), posLevel: profile.posLevel, posNumber: - Extension.ToThaiNumber(profile.orgShortName) + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), + Extension.ToThaiNumber(profile.orgShortName) + + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), amount: profile.amount ? Extension.ToThaiNumber(profile.amount.toLocaleString()) : null, positionSalaryAmount: profile.positionSalaryAmount ? Extension.ToThaiNumber(profile.positionSalaryAmount.toLocaleString()) @@ -5033,7 +5127,8 @@ export class ReportController extends Controller { position: profile.position, posLevel: profile.posLevel, posNumber: - Extension.ToThaiNumber(profile.orgShortName) + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), + Extension.ToThaiNumber(profile.orgShortName) + + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), amount: profile.amount ? Extension.ToThaiNumber(profile.amount.toLocaleString()) : null, positionSalaryAmount: profile.positionSalaryAmount ? Extension.ToThaiNumber(profile.positionSalaryAmount.toLocaleString()) @@ -5121,7 +5216,8 @@ export class ReportController extends Controller { (profile.root == undefined && profile.root == null ? "" : profile.root), posLevel: profile.posLevel, posNumber: - Extension.ToThaiNumber(profile.orgShortName) + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), + Extension.ToThaiNumber(profile.orgShortName) + + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), amount: profile.amount ? Extension.ToThaiNumber(profile.amount.toLocaleString()) : null, positionSalaryAmount: profile.positionSalaryAmount ? Extension.ToThaiNumber(profile.positionSalaryAmount.toLocaleString()) @@ -5200,7 +5296,8 @@ export class ReportController extends Controller { position: profile.position, posLevel: profile.posLevel, posNumber: - Extension.ToThaiNumber(profile.orgShortName) + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), + Extension.ToThaiNumber(profile.orgShortName) + + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), amount: profile.amount ? Extension.ToThaiNumber(profile.amount.toLocaleString()) : null, reason: null, }; @@ -5310,7 +5407,8 @@ export class ReportController extends Controller { position: profile.position, posLevel: profile.posLevel, posNumber: - Extension.ToThaiNumber(profile.orgShortName) + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), + Extension.ToThaiNumber(profile.orgShortName) + + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), amount: profile.amount ? Extension.ToThaiNumber(profile.amount.toLocaleString()) : null, positionSalaryAmount: profile.positionSalaryAmount ? Extension.ToThaiNumber(profile.positionSalaryAmount.toLocaleString()) @@ -5398,7 +5496,8 @@ export class ReportController extends Controller { (profile.root == undefined && profile.root == null ? "" : profile.root), posLevel: profile.posLevel, posNumber: - Extension.ToThaiNumber(profile.orgShortName) + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), + Extension.ToThaiNumber(profile.orgShortName) + + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), amount: profile.amount ? Extension.ToThaiNumber(profile.amount.toLocaleString()) : null, positionSalaryAmount: profile.positionSalaryAmount ? Extension.ToThaiNumber(profile.positionSalaryAmount.toLocaleString()) @@ -5484,7 +5583,8 @@ export class ReportController extends Controller { (profile.root == undefined && profile.root == null ? "" : profile.root), posLevel: profile.posLevel, posNumber: - Extension.ToThaiNumber(profile.orgShortName) + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), + Extension.ToThaiNumber(profile.orgShortName) + + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), positionSalaryAmount: profile.positionSalaryAmount ? Extension.ToThaiNumber(profile.positionSalaryAmount.toLocaleString()) : null, @@ -5574,7 +5674,8 @@ export class ReportController extends Controller { position: profile.position, posLevel: profile.posLevel, posNumber: - Extension.ToThaiNumber(profile.orgShortName) + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), + Extension.ToThaiNumber(profile.orgShortName) + + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), amount: profile.amount ? Extension.ToThaiNumber(profile.amount.toLocaleString()) : null, reason: null, }; @@ -5680,7 +5781,8 @@ export class ReportController extends Controller { fullName: fullName, posLevel: profile.posLevel, posNumber: - Extension.ToThaiNumber(profile.orgShortName) + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), + Extension.ToThaiNumber(profile.orgShortName) + + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), amount: profile.amount ? Extension.ToThaiNumber(profile.amount.toLocaleString()) : null, reason: null, }; @@ -5898,7 +6000,8 @@ export class ReportController extends Controller { position: profile.position, posLevel: profile.posLevel, posNumber: - Extension.ToThaiNumber(profile.orgShortName) + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), + Extension.ToThaiNumber(profile.orgShortName) + + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), amount: profile.amount ? Extension.ToThaiNumber(profile.amount.toLocaleString()) : null, positionSalaryAmount: profile.positionSalaryAmount ? Extension.ToThaiNumber(profile.positionSalaryAmount.toLocaleString()) diff --git a/src/controllers/SalaryPeriodController.ts b/src/controllers/SalaryPeriodController.ts index c08c963..3adbb36 100644 --- a/src/controllers/SalaryPeriodController.ts +++ b/src/controllers/SalaryPeriodController.ts @@ -2118,6 +2118,7 @@ export class SalaryPeriodController extends Controller { salaryProfileNew.isNext = salaryOld == null ? false : salaryOld.isNext; salaryProfileNew.isSpecial = salaryOld == null ? false : salaryOld.isSpecial; salaryProfileNew.isReserve = salaryOld == null ? false : salaryOld.isReserve; + salaryProfileNew.isRetired = salaryOld == null ? false : salaryOld.isRetired; } await this.salaryProfileRepository.save(salaryProfileNew); } @@ -2163,6 +2164,7 @@ export class SalaryPeriodController extends Controller { salaryProfileNew.isNext = salaryOld == null ? false : salaryOld.isNext; salaryProfileNew.isSpecial = salaryOld == null ? false : salaryOld.isSpecial; salaryProfileNew.isReserve = salaryOld == null ? false : salaryOld.isReserve; + salaryProfileNew.isRetired = salaryOld == null ? false : salaryOld.isRetired; } await this.salaryProfileEmployeeRepository.save(salaryProfileNew); } @@ -2606,8 +2608,9 @@ export class SalaryPeriodController extends Controller { salaryProfileNew.positionSalaryAmount = salaryOld == null ? 0 : salaryOld.positionSalaryAmount; salaryProfileNew.isNext = salaryOld == null ? false : salaryOld.isNext; - salaryProfileNew.type = salaryOld == null ? false : salaryOld.isSpecial; + salaryProfileNew.isSpecial = salaryOld == null ? false : salaryOld.isSpecial; salaryProfileNew.isReserve = salaryOld == null ? false : salaryOld.isReserve; + salaryProfileNew.isRetired = salaryOld == null ? false : salaryOld.isRetired; } await this.salaryProfileRepository.save(salaryProfileNew); } @@ -2651,8 +2654,9 @@ export class SalaryPeriodController extends Controller { salaryProfileNew.positionSalaryAmount = salaryOld == null ? 0 : salaryOld.positionSalaryAmount; salaryProfileNew.isNext = salaryOld == null ? false : salaryOld.isNext; - salaryProfileNew.type = salaryOld == null ? false : salaryOld.isSpecial; + salaryProfileNew.isSpecial = salaryOld == null ? false : salaryOld.isSpecial; salaryProfileNew.isReserve = salaryOld == null ? false : salaryOld.isReserve; + salaryProfileNew.isRetired = salaryOld == null ? false : salaryOld.isRetired; } await this.salaryProfileEmployeeRepository.save(salaryProfileNew); }