From b2a725ae5491d573baa276642c3c114b3268dec1 Mon Sep 17 00:00:00 2001 From: Bright Date: Fri, 13 Jun 2025 14:15:15 +0700 Subject: [PATCH] =?UTF-8?q?Fix=20Invalid=20Evaluate=20=E0=B8=A3=E0=B8=B2?= =?UTF-8?q?=E0=B8=A2=E0=B8=87=E0=B8=B2=E0=B8=99=E0=B8=9B=E0=B8=A3=E0=B8=B0?= =?UTF-8?q?=E0=B9=80=E0=B8=A1=E0=B8=B4=E0=B8=99=20#1,=20#5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/ReportController.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/controllers/ReportController.ts b/src/controllers/ReportController.ts index 287e9af..7984dae 100644 --- a/src/controllers/ReportController.ts +++ b/src/controllers/ReportController.ts @@ -318,7 +318,7 @@ export class ReoportController { lastOneYear: Extension.ToThaiNumber((thaiYear - 1).toString()), currentYear: Extension.ToThaiNumber(thaiYear.toString()), }; - let _orgNoNewLine = (org ? org : "-").replace(/\n/g, " "); + let _orgNoNewLine = (evaluation.oc ? evaluation.oc : "-").replace(/\n/g, " "); let topic10 = evaluation.type == "EXPERT" || evaluation.type == "EXPERTISE" ? "หน่วยงาน" : evaluation.type == "SPECIAL_EXPERT" ? "กรุงเทพมหานคร" : "หน่วยงาน"; let footer10 = evaluation.type == "EXPERT" || evaluation.type == "EXPERTISE" ? "หัวหน้าหน่วยงาน" : evaluation.type == "SPECIAL_EXPERT" ? "ปลัดกรุงเทพมหานคร" : "หัวหน้าหน่วยงาน"; let typeTh = evaluation.type == "EXPERT" ? "ชำนาญการ" : evaluation.type == "EXPERTISE" ? "เชียวชาญ" : evaluation.type == "SPECIAL_EXPERT" ? "ชำนาญการพิเศษ":""; @@ -339,12 +339,12 @@ export class ReoportController { posAndTypeTh: (evaluation.position ? `${evaluation.position}` : "" ) + (typeTh ? `${typeTh}` : ""), posNo: evaluation.posNo ? Extension.ToThaiNumber(evaluation.posNo) : "", posNoWithSym: evaluation.posNo ? `(${Extension.ToThaiNumber(evaluation.posNo)})` : "", - oc: evaluation.oc ? evaluation.oc : "-", + oc: evaluation.oc ? evaluation.oc.replace(/\n/g, " ") : "-", org: org ? org : "-", //สังกัด orgNoNewLine: _orgNoNewLine ? _orgNoNewLine : "-", //สังกัดแบบไม่เว้นวรรค root: root ? root : "-", //หน่วยงาน - salary: evaluation.salary ? Extension.ToThaiNumber(evaluation.salary) : "-", - salaryWithPrefix: evaluation.salary ? "อัตราเงินเดือนปัจจุบัน" +" "+ Extension.ToThaiNumber(evaluation.salary) : "-", + salary: evaluation.salary ? Extension.ToThaiNumber(Number(evaluation.salary).toLocaleString()) : "-", + salaryWithPrefix: evaluation.salary ? "อัตราเงินเดือนปัจจุบัน" +" "+ Extension.ToThaiNumber(Number(evaluation.salary).toLocaleString()) : "-", positionLevel: evaluation.positionLevel ? evaluation.positionLevel : "", detailAnnounceStep5Body: evaluation.detailAnnounceStep5Body, detailAnnounceStep5Footer: evaluation.detailAnnounceStep5Footer, @@ -521,9 +521,9 @@ export class ReoportController { commanderAboveOrg: evaluation.commanderAboveOrg ? evaluation.commanderAboveOrg : "-", commanderAboveOrgOld: evaluation.commanderAboveOrgOld ? evaluation.commanderAboveOrgOld : "-", commanderPositionSign: (evaluation.commanderPosition ? evaluation.commanderPosition : "") + (evaluation.commanderOrg ? " " + evaluation.commanderOrg : "") - + (evaluation.commanderPosition || evaluation.commanderOrg ? `\n` + "ขณะดำรงตำแหน่ง" : "") + (evaluation.commanderPositionOld ? " " + evaluation.commanderPositionOld:"") + (evaluation.commanderOrgOld ? " " + evaluation.commanderOrgOld : ""), + + (evaluation.commanderPosition || evaluation.commanderOrg ? `\n` : "") + (evaluation.commanderPositionOld ? `ขณะดำรงตำแหน่ง ${evaluation.commanderPositionOld}` : "") + (evaluation.commanderOrgOld ? " " + evaluation.commanderOrgOld : ""), commanderAbovePositionSign: (evaluation.commanderAbovePosition ? evaluation.commanderAbovePosition : "") + (evaluation.commanderAboveOrg ? " " + evaluation.commanderAboveOrg : "") - + (evaluation.commanderAbovePosition || evaluation.commanderAboveOrg ? `\n` + "ขณะดำรงตำแหน่ง" : "") + (evaluation.commanderAbovePositionOld ? " " + evaluation.commanderAbovePositionOld: "") + (evaluation.commanderAboveOrgOld ? " " + evaluation.commanderAboveOrgOld : ""), + + (evaluation.commanderAbovePosition || evaluation.commanderAboveOrg ? `\n`: "") + (evaluation.commanderAbovePositionOld ? `ขณะดำรงตำแหน่ง ${evaluation.commanderAbovePositionOld}` : "") + (evaluation.commanderAboveOrgOld ? " " + evaluation.commanderAboveOrgOld : ""), years: years, };