From 81f31d454e0b55ce97c3d5bef9fa83756647cbf3 Mon Sep 17 00:00:00 2001 From: Bright Date: Thu, 7 Mar 2024 09:35:24 +0700 Subject: [PATCH] thai number --- src/controllers/Report_1_Controller.ts | 28 +++++++++++++------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/controllers/Report_1_Controller.ts b/src/controllers/Report_1_Controller.ts index b6ea1b2..00add69 100644 --- a/src/controllers/Report_1_Controller.ts +++ b/src/controllers/Report_1_Controller.ts @@ -92,7 +92,7 @@ export class Report_1_Controller extends Controller { effectiveDate : salaryPeriod?.effectiveDate, root: salaryProfile[0]?.root, profile: salaryProfile.map((item, index) => ({ - no: index+1, + no: Extension.ToThaiNumber(String(index+1)), fullname: item.prefix + item.firstName +" "+ item.lastName, position: item.position + "/" + (item.child4==undefined && item.child4==null ? "" : item.child4+"/")+ @@ -102,8 +102,8 @@ export class Report_1_Controller extends Controller { (item.root==undefined && item.root==null ? "" : item.root), posLevel: item.posLevel, orgShortName: item.orgShortName+item.posMasterNo, - amount: item.amount == null ? 0 : item.amount, - amountSpecial: item.amountSpecial == null ? 0 : item.amountSpecial, + amount: item.amount == undefined || item.amount == null ? "๐" : Extension.ToThaiNumber(String(item.amount)), + amountSpecial: item.amountSpecial == undefined || item.amountSpecial == null ? "๐" : Extension.ToThaiNumber(String(item.amountSpecial)), score: null, //สรุปผลการประเมินฯ ระดับและคะแนน remark: null //หมายเหตุ })) @@ -167,14 +167,14 @@ export class Report_1_Controller extends Controller { }); const mapData = salaryProfile.map((item, index) => ({ - no: index+1, + no: Extension.ToThaiNumber(String(index+1)), fullname: item.prefix + item.firstName +" "+ item.lastName, position: item.position, posType: item.posType, posLevel: item.posLevel, - posMasterNo: item.posMasterNo, - amount: item.amount, - positionSalaryAmount: item.positionSalaryAmount, + posMasterNo: Extension.ToThaiNumber(String(item.posMasterNo)), + amount: item.amount == undefined || item.amount == null ? "๐" : Extension.ToThaiNumber(String(item.amount)), + positionSalaryAmount: item.positionSalaryAmount == undefined || item.positionSalaryAmount == null ? "๐" : Extension.ToThaiNumber(String(item.positionSalaryAmount)), remark: null })); @@ -253,25 +253,25 @@ export class Report_1_Controller extends Controller { const profileSpecial = salaryProfileSpecial.map((item, index) => ({ - no: index+1, + no: Extension.ToThaiNumber(String(index+1)), fullname: item.prefix + item.firstName +" "+ item.lastName, position: item.position, posType: item.posType, posLevel: item.posLevel, - posMasterNo: item.posMasterNo, - amount: item.amount, - amountSpecial: item.amountSpecial, + posMasterNo: Extension.ToThaiNumber(String(item.posMasterNo)), + amount: item.amount == undefined || item.amount == null ? "๐" : Extension.ToThaiNumber(String(item.amount)), + amountSpecial: item.amountSpecial == undefined || item.amountSpecial == null ? "๐" : Extension.ToThaiNumber(String(item.amountSpecial)), remark: null })); const profileNoAmount = salaryProfileNoAmount.map((item, index) => ({ - no: index+1, + no: Extension.ToThaiNumber(String(index+1)), fullname: item.prefix + item.firstName +" "+ item.lastName, position: item.position, posType: item.posType, posLevel: item.posLevel, - posMasterNo: item.posMasterNo, - amount: item.amount, + posMasterNo: Extension.ToThaiNumber(String(item.posMasterNo)), + amount: item.amount == undefined || item.amount == null ? "๐" : Extension.ToThaiNumber(String(item.amount)), remark: null }));