From 511970f61a15992585ee376ba84b4c8e9d82235f Mon Sep 17 00:00:00 2001 From: Bright Date: Fri, 22 Mar 2024 12:04:57 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=9B=E0=B8=A3=E0=B8=B1=E0=B8=9A=20gov1-03?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/ReportController.ts | 46 +++++++++++++++++++++-------- 1 file changed, 33 insertions(+), 13 deletions(-) diff --git a/src/controllers/ReportController.ts b/src/controllers/ReportController.ts index f3ae545..b3fa5e6 100644 --- a/src/controllers/ReportController.ts +++ b/src/controllers/ReportController.ts @@ -1057,15 +1057,23 @@ export class ReportController extends Controller { : Extension.ToThaiNumber(String(item.amount.toLocaleString())), salaryIncrease1: salaryProfile1.length > 0 - ? salaryProfile1 - .filter((profile) => profile.citizenId === item.citizenId) - .map((profile) => profile.amount) + ? (() => { + const filteredAmount = salaryProfile1 + .filter((profile) => profile.citizenId === item.citizenId) + .map((profile) => profile.amount); + const Amount = filteredAmount[0]; + return Amount === undefined || Amount === null ? "๐" : Extension.ToThaiNumber(Amount?.toLocaleString()); + })() : "๐", //การเลื่อนเงินเดือนปีก่อนๆหน้า salaryIncrease2: salaryProfile2.length > 0 - ? salaryProfile2 - .filter((profile) => profile.citizenId === item.citizenId) - .map((profile) => profile.amount) + ? (() => { + const filteredAmount = salaryProfile2 + .filter((profile) => profile.citizenId === item.citizenId) + .map((profile) => profile.amount); + const Amount = filteredAmount[0]; + return Amount === undefined || Amount === null ? "๐" : Extension.ToThaiNumber(Amount?.toLocaleString()); + })() : "๐", //การเลื่อนเงินเดือนปีก่อนหน้า score: null, //ผลการประเมินฯ remark: null, //หมายเหตุ @@ -1221,21 +1229,33 @@ export class ReportController extends Controller { : Extension.ToThaiNumber(String(item.amount.toLocaleString())), salaryIncrease1: salaryProfile1.length > 0 - ? salaryProfile1 - .filter((profile) => profile.citizenId === item.citizenId) - .map((profile) => profile.amount) + ? (() => { + const filteredAmount = salaryProfile1 + .filter((profile) => profile.citizenId === item.citizenId) + .map((profile) => profile.amount); + const Amount = filteredAmount[0]; + return Amount === undefined || Amount === null ? "๐" : Extension.ToThaiNumber(Amount?.toLocaleString()); + })() : "๐", //การเลื่อนเงินเดือนปีก่อนๆหน้า salaryIncrease2: salaryProfile2.length > 0 - ? salaryProfile2 + ? (() => { + const filteredAmount = salaryProfile2 .filter((profile) => profile.citizenId === item.citizenId) - .map((profile) => profile.amount) + .map((profile) => profile.amount); + const Amount = filteredAmount[0]; + return Amount === undefined || Amount === null ? "๐" : Extension.ToThaiNumber(Amount?.toLocaleString()); + })() : "๐", //การเลื่อนเงินเดือนปีก่อนหน้า salaryIncreaseAPR: salaryProfile_APR.length > 0 - ? salaryProfile_APR + ? (() => { + const filteredAmount = salaryProfile_APR .filter((profile) => profile.citizenId === item.citizenId) - .map((profile) => profile.amount) + .map((profile) => profile.amount); + const Amount = filteredAmount[0]; + return Amount === undefined || Amount === null ? "๐" : Extension.ToThaiNumber(Amount?.toLocaleString()); + })() : "๐", //การเลื่อนเงินเดือนรอบเมษา Type: item.type === "FULL" ? "หนึ่งขั้น" : "หนึ่งขั้นครึ่ง", score1: null, //ผลการประเมินฯ ครั้งที่ 1