From 2e28488564605437b397761a23046a74adcbc5fa Mon Sep 17 00:00:00 2001 From: Kittapath Date: Thu, 4 Jul 2024 00:11:06 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=80=E0=B8=AB=E0=B8=95=E0=B8=B8=E0=B8=9C?= =?UTF-8?q?=E0=B8=A5=E0=B8=9A=E0=B8=8A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/ReportController.ts | 201 ++++++++++++++++++---------- 1 file changed, 129 insertions(+), 72 deletions(-) diff --git a/src/controllers/ReportController.ts b/src/controllers/ReportController.ts index ef54edfe..8c204e64 100644 --- a/src/controllers/ReportController.ts +++ b/src/controllers/ReportController.ts @@ -1122,6 +1122,7 @@ export class ReportController extends Controller { )?.posExecutive?.posExecutiveName, education: education == "" ? "" : education.degree, salary: salary == "" ? "" : salary.amount, + reason: posMaster.reason, }; if (_node == null) { const head = { @@ -1138,6 +1139,7 @@ export class ReportController extends Controller { profilePosLevel: "", education: "", salary: "", + reason: "", }; data.push(head); const _head = { @@ -1182,6 +1184,7 @@ export class ReportController extends Controller { education: node.education == null ? "" : Extension.ToThaiNumber(node.education.toString()), salary: node.salary ? Extension.ToThaiNumber(node.salary.toLocaleString()) : "", + reason: node.reason == null ? "" : Extension.ToThaiNumber(node.reason.toString()), }; data.push(_head); } else { @@ -1210,6 +1213,7 @@ export class ReportController extends Controller { profilePosLevel: "", education: "", salary: "", + reason: "", }; data.push(head); _node == null; @@ -1256,6 +1260,7 @@ export class ReportController extends Controller { education: node.education == null ? "" : Extension.ToThaiNumber(node.education.toString()), salary: node.salary ? Extension.ToThaiNumber(node.salary.toLocaleString()) : "", + reason: node.reason == null ? "" : Extension.ToThaiNumber(node.reason.toString()), }; data.push(head); } @@ -1491,6 +1496,7 @@ export class ReportController extends Controller { )?.posExecutive?.posExecutiveName, education: education == "" ? "" : education.degree, salary: salary == "" ? "" : salary.amount, + reason: posMaster.reason, }; if (_node == null) { const head = { @@ -1507,6 +1513,7 @@ export class ReportController extends Controller { profilePosLevel: "", education: "", salary: "", + reason: "", }; data.push(head); const _head = { @@ -1553,6 +1560,8 @@ export class ReportController extends Controller { ? "" : Extension.ToThaiNumber(node.education.toString()), salary: node.salary ? Extension.ToThaiNumber(node.salary.toLocaleString()) : "", + reason: + node.reason == null ? "" : Extension.ToThaiNumber(node.reason.toString()), }; data.push(_head); } else { @@ -1583,6 +1592,7 @@ export class ReportController extends Controller { profilePosLevel: "", education: "", salary: "", + reason: "", }; data.push(head); _node == null; @@ -1631,6 +1641,8 @@ export class ReportController extends Controller { ? "" : Extension.ToThaiNumber(node.education.toString()), salary: node.salary ? Extension.ToThaiNumber(node.salary.toLocaleString()) : "", + reason: + node.reason == null ? "" : Extension.ToThaiNumber(node.reason.toString()), }; data.push(head); } @@ -1866,6 +1878,7 @@ export class ReportController extends Controller { )?.posExecutive?.posExecutiveName, education: education == "" ? "" : education.degree, salary: salary == "" ? "" : salary.amount, + reason: posMaster.reason, }; if (_node == null) { const head = { @@ -1884,6 +1897,7 @@ export class ReportController extends Controller { profilePosLevel: "", education: "", salary: "", + reason: "", }; data.push(head); const _head = { @@ -1933,7 +1947,11 @@ export class ReportController extends Controller { node.education == null ? "" : Extension.ToThaiNumber(node.education.toString()), - salary: node.salary ? Extension.ToThaiNumber(node.salary.toLocaleString()) : "", + salary: node.salary + ? Extension.ToThaiNumber(node.salary.toLocaleString()) + : "", + reason: + node.reason == null ? "" : Extension.ToThaiNumber(node.reason.toString()), }; data.push(_head); } else { @@ -1964,6 +1982,7 @@ export class ReportController extends Controller { profilePosLevel: "", education: "", salary: "", + reason: "", }; data.push(head); _node == null; @@ -2015,7 +2034,11 @@ export class ReportController extends Controller { node.education == null ? "" : Extension.ToThaiNumber(node.education.toString()), - salary: node.salary ? Extension.ToThaiNumber(node.salary.toLocaleString()) : "", + salary: node.salary + ? Extension.ToThaiNumber(node.salary.toLocaleString()) + : "", + reason: + node.reason == null ? "" : Extension.ToThaiNumber(node.reason.toString()), }; data.push(head); } @@ -2253,6 +2276,7 @@ export class ReportController extends Controller { )?.posExecutive?.posExecutiveName, education: education == "" ? "" : education.degree, salary: salary == "" ? "" : salary.amount, + reason: posMaster.reason, }; if (_node == null) { const head = { @@ -2271,6 +2295,7 @@ export class ReportController extends Controller { profilePosLevel: "", education: "", salary: "", + reason: "", }; data.push(head); const _head = { @@ -2322,7 +2347,11 @@ export class ReportController extends Controller { node.education == null ? "" : Extension.ToThaiNumber(node.education.toString()), - salary: node.salary ? Extension.ToThaiNumber(node.salary.toLocaleString()) : "", + salary: node.salary + ? Extension.ToThaiNumber(node.salary.toLocaleString()) + : "", + reason: + node.reason == null ? "" : Extension.ToThaiNumber(node.reason.toString()), }; data.push(_head); } else { @@ -2354,6 +2383,7 @@ export class ReportController extends Controller { profilePosLevel: "", education: "", salary: "", + reason: "", }; data.push(head); _node == null; @@ -2407,7 +2437,11 @@ export class ReportController extends Controller { node.education == null ? "" : Extension.ToThaiNumber(node.education.toString()), - salary: node.salary ? Extension.ToThaiNumber(node.salary.toLocaleString()) : "", + salary: node.salary + ? Extension.ToThaiNumber(node.salary.toLocaleString()) + : "", + reason: + node.reason == null ? "" : Extension.ToThaiNumber(node.reason.toString()), }; data.push(head); } @@ -2644,6 +2678,7 @@ export class ReportController extends Controller { )?.posExecutive?.posExecutiveName, education: education == "" ? "" : education.degree, salary: salary == "" ? "" : salary.amount, + reason: posMaster.reason, }; if (_node == null) { const head = { @@ -2662,6 +2697,7 @@ export class ReportController extends Controller { profilePosLevel: "", education: "", salary: "", + reason: "", }; data.push(head); const _head = { @@ -2713,7 +2749,11 @@ export class ReportController extends Controller { node.education == null ? "" : Extension.ToThaiNumber(node.education.toString()), - salary: node.salary ? Extension.ToThaiNumber(node.salary.toLocaleString()) : "", + salary: node.salary + ? Extension.ToThaiNumber(node.salary.toLocaleString()) + : "", + reason: + node.reason == null ? "" : Extension.ToThaiNumber(node.reason.toString()), }; data.push(_head); } else { @@ -2745,6 +2785,7 @@ export class ReportController extends Controller { profilePosLevel: "", education: "", salary: "", + reason: "", }; data.push(head); _node == null; @@ -2798,7 +2839,11 @@ export class ReportController extends Controller { node.education == null ? "" : Extension.ToThaiNumber(node.education.toString()), - salary: node.salary ? Extension.ToThaiNumber(node.salary.toLocaleString()) : "", + salary: node.salary + ? Extension.ToThaiNumber(node.salary.toLocaleString()) + : "", + reason: + node.reason == null ? "" : Extension.ToThaiNumber(node.reason.toString()), }; data.push(head); } @@ -3140,12 +3185,12 @@ export class ReportController extends Controller { education: node.education == null ? "" : Extension.ToThaiNumber(node.education.toString()), salary: node.salary ? Extension.ToThaiNumber(node.salary.toLocaleString()) : "", - positionSalaryAmount: node.positionSalaryAmount ? Extension.ToThaiNumber( - node.positionSalaryAmount.toLocaleString(), - ) : "", - mouthSalaryAmount: node.mouthSalaryAmount ? Extension.ToThaiNumber( - node.mouthSalaryAmount.toLocaleString(), - ) : "", + positionSalaryAmount: node.positionSalaryAmount + ? Extension.ToThaiNumber(node.positionSalaryAmount.toLocaleString()) + : "", + mouthSalaryAmount: node.mouthSalaryAmount + ? Extension.ToThaiNumber(node.mouthSalaryAmount.toLocaleString()) + : "", reason: node.reason == null ? "" : Extension.ToThaiNumber(node.reason.toString()), }; data.push(_head); @@ -3193,12 +3238,12 @@ export class ReportController extends Controller { education: node.education == null ? "" : Extension.ToThaiNumber(node.education.toString()), salary: node.salary ? Extension.ToThaiNumber(node.salary.toLocaleString()) : "", - positionSalaryAmount: node.positionSalaryAmount ? Extension.ToThaiNumber( - node.positionSalaryAmount.toLocaleString(), - ) : "", - mouthSalaryAmount: node.mouthSalaryAmount ? Extension.ToThaiNumber( - node.mouthSalaryAmount.toLocaleString(), - ) : "", + positionSalaryAmount: node.positionSalaryAmount + ? Extension.ToThaiNumber(node.positionSalaryAmount.toLocaleString()) + : "", + mouthSalaryAmount: node.mouthSalaryAmount + ? Extension.ToThaiNumber(node.mouthSalaryAmount.toLocaleString()) + : "", reason: node.reason == null ? "" : Extension.ToThaiNumber(node.reason.toString()), }; data.push(head); @@ -3334,12 +3379,12 @@ export class ReportController extends Controller { ? "" : Extension.ToThaiNumber(node.education.toString()), salary: node.salary ? Extension.ToThaiNumber(node.salary.toLocaleString()) : "", - positionSalaryAmount: node.positionSalaryAmount ? Extension.ToThaiNumber( - node.positionSalaryAmount.toLocaleString(), - ) : "", - mouthSalaryAmount: node.mouthSalaryAmount ? Extension.ToThaiNumber( - node.mouthSalaryAmount.toLocaleString(), - ) : "", + positionSalaryAmount: node.positionSalaryAmount + ? Extension.ToThaiNumber(node.positionSalaryAmount.toLocaleString()) + : "", + mouthSalaryAmount: node.mouthSalaryAmount + ? Extension.ToThaiNumber(node.mouthSalaryAmount.toLocaleString()) + : "", reason: node.reason == null ? "" : Extension.ToThaiNumber(node.reason.toString()), }; @@ -3392,12 +3437,12 @@ export class ReportController extends Controller { ? "" : Extension.ToThaiNumber(node.education.toString()), salary: node.salary ? Extension.ToThaiNumber(node.salary.toLocaleString()) : "", - positionSalaryAmount: node.positionSalaryAmount ? Extension.ToThaiNumber( - node.positionSalaryAmount.toLocaleString(), - ) : "", - mouthSalaryAmount: node.mouthSalaryAmount ? Extension.ToThaiNumber( - node.mouthSalaryAmount.toLocaleString(), - ) : "", + positionSalaryAmount: node.positionSalaryAmount + ? Extension.ToThaiNumber(node.positionSalaryAmount.toLocaleString()) + : "", + mouthSalaryAmount: node.mouthSalaryAmount + ? Extension.ToThaiNumber(node.mouthSalaryAmount.toLocaleString()) + : "", reason: node.reason == null ? "" : Extension.ToThaiNumber(node.reason.toString()), }; @@ -3534,13 +3579,15 @@ export class ReportController extends Controller { node.education == null ? "" : Extension.ToThaiNumber(node.education.toString()), - salary: node.salary ? Extension.ToThaiNumber(node.salary.toLocaleString()) : "", - positionSalaryAmount: node.positionSalaryAmount ? Extension.ToThaiNumber( - node.positionSalaryAmount.toLocaleString(), - ) : "", - mouthSalaryAmount: node.mouthSalaryAmount ? Extension.ToThaiNumber( - node.mouthSalaryAmount.toLocaleString(), - ) : "", + salary: node.salary + ? Extension.ToThaiNumber(node.salary.toLocaleString()) + : "", + positionSalaryAmount: node.positionSalaryAmount + ? Extension.ToThaiNumber(node.positionSalaryAmount.toLocaleString()) + : "", + mouthSalaryAmount: node.mouthSalaryAmount + ? Extension.ToThaiNumber(node.mouthSalaryAmount.toLocaleString()) + : "", reason: node.reason == null ? "" : Extension.ToThaiNumber(node.reason.toString()), }; @@ -3595,13 +3642,15 @@ export class ReportController extends Controller { node.education == null ? "" : Extension.ToThaiNumber(node.education.toString()), - salary: node.salary ? Extension.ToThaiNumber(node.salary.toLocaleString()) : "", - positionSalaryAmount: node.positionSalaryAmount ? Extension.ToThaiNumber( - node.positionSalaryAmount.toLocaleString(), - ) : "", - mouthSalaryAmount: node.mouthSalaryAmount ? Extension.ToThaiNumber( - node.mouthSalaryAmount.toLocaleString(), - ) : "", + salary: node.salary + ? Extension.ToThaiNumber(node.salary.toLocaleString()) + : "", + positionSalaryAmount: node.positionSalaryAmount + ? Extension.ToThaiNumber(node.positionSalaryAmount.toLocaleString()) + : "", + mouthSalaryAmount: node.mouthSalaryAmount + ? Extension.ToThaiNumber(node.mouthSalaryAmount.toLocaleString()) + : "", reason: node.reason == null ? "" : Extension.ToThaiNumber(node.reason.toString()), }; @@ -3740,13 +3789,15 @@ export class ReportController extends Controller { node.education == null ? "" : Extension.ToThaiNumber(node.education.toString()), - salary: node.salary ? Extension.ToThaiNumber(node.salary.toLocaleString()) : "", - positionSalaryAmount: node.positionSalaryAmount ? Extension.ToThaiNumber( - node.positionSalaryAmount.toLocaleString(), - ) : "", - mouthSalaryAmount: node.mouthSalaryAmount ? Extension.ToThaiNumber( - node.mouthSalaryAmount.toLocaleString(), - ) : "", + salary: node.salary + ? Extension.ToThaiNumber(node.salary.toLocaleString()) + : "", + positionSalaryAmount: node.positionSalaryAmount + ? Extension.ToThaiNumber(node.positionSalaryAmount.toLocaleString()) + : "", + mouthSalaryAmount: node.mouthSalaryAmount + ? Extension.ToThaiNumber(node.mouthSalaryAmount.toLocaleString()) + : "", reason: node.reason == null ? "" : Extension.ToThaiNumber(node.reason.toString()), }; @@ -3804,13 +3855,15 @@ export class ReportController extends Controller { node.education == null ? "" : Extension.ToThaiNumber(node.education.toString()), - salary: node.salary ? Extension.ToThaiNumber(node.salary.toLocaleString()) : "", - positionSalaryAmount: node.positionSalaryAmount ? Extension.ToThaiNumber( - node.positionSalaryAmount.toLocaleString(), - ) : "", - mouthSalaryAmount: node.mouthSalaryAmount ? Extension.ToThaiNumber( - node.mouthSalaryAmount.toLocaleString(), - ) : "", + salary: node.salary + ? Extension.ToThaiNumber(node.salary.toLocaleString()) + : "", + positionSalaryAmount: node.positionSalaryAmount + ? Extension.ToThaiNumber(node.positionSalaryAmount.toLocaleString()) + : "", + mouthSalaryAmount: node.mouthSalaryAmount + ? Extension.ToThaiNumber(node.mouthSalaryAmount.toLocaleString()) + : "", reason: node.reason == null ? "" : Extension.ToThaiNumber(node.reason.toString()), }; @@ -3951,13 +4004,15 @@ export class ReportController extends Controller { node.education == null ? "" : Extension.ToThaiNumber(node.education.toString()), - salary: node.salary ? Extension.ToThaiNumber(node.salary.toLocaleString()) : "", - positionSalaryAmount: node.positionSalaryAmount ? Extension.ToThaiNumber( - node.positionSalaryAmount.toLocaleString(), - ) : "", - mouthSalaryAmount: node.mouthSalaryAmount ? Extension.ToThaiNumber( - node.mouthSalaryAmount.toLocaleString(), - ) : "", + salary: node.salary + ? Extension.ToThaiNumber(node.salary.toLocaleString()) + : "", + positionSalaryAmount: node.positionSalaryAmount + ? Extension.ToThaiNumber(node.positionSalaryAmount.toLocaleString()) + : "", + mouthSalaryAmount: node.mouthSalaryAmount + ? Extension.ToThaiNumber(node.mouthSalaryAmount.toLocaleString()) + : "", reason: node.reason == null ? "" @@ -4017,13 +4072,15 @@ export class ReportController extends Controller { node.education == null ? "" : Extension.ToThaiNumber(node.education.toString()), - salary: node.salary ? Extension.ToThaiNumber(node.salary.toLocaleString()) : "", - positionSalaryAmount: node.positionSalaryAmount ? Extension.ToThaiNumber( - node.positionSalaryAmount.toLocaleString(), - ) : "", - mouthSalaryAmount: node.mouthSalaryAmount ? Extension.ToThaiNumber( - node.mouthSalaryAmount.toLocaleString(), - ) : "", + salary: node.salary + ? Extension.ToThaiNumber(node.salary.toLocaleString()) + : "", + positionSalaryAmount: node.positionSalaryAmount + ? Extension.ToThaiNumber(node.positionSalaryAmount.toLocaleString()) + : "", + mouthSalaryAmount: node.mouthSalaryAmount + ? Extension.ToThaiNumber(node.mouthSalaryAmount.toLocaleString()) + : "", reason: node.reason == null ? ""