From 29447e308c1e656d6d983c5df5e7abba14598c31 Mon Sep 17 00:00:00 2001 From: Bright Date: Mon, 16 Dec 2024 11:55:34 +0700 Subject: [PATCH] =?UTF-8?q?fix=20issue=20#858=20:=20=E0=B8=81=E0=B8=A3?= =?UTF-8?q?=E0=B8=93=E0=B8=B5=E0=B8=97=E0=B8=B5=E0=B9=88=E0=B8=9F=E0=B8=B4?= =?UTF-8?q?=E0=B8=A5=E0=B8=94=E0=B9=8C=E0=B9=83=E0=B8=94=E0=B9=86=E0=B9=83?= =?UTF-8?q?=E0=B8=99=20report=20=E0=B8=A1=E0=B8=B5=E0=B8=84=E0=B9=88?= =?UTF-8?q?=E0=B8=B2=20Null=20=E0=B8=9B=E0=B8=A3=E0=B8=B1=E0=B8=9A?= =?UTF-8?q?=E0=B9=83=E0=B8=AB=E0=B9=89=E0=B9=81=E0=B8=AA=E0=B8=94=E0=B8=87?= =?UTF-8?q?=20"-"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/ReportController.ts | 92 +++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) diff --git a/src/controllers/ReportController.ts b/src/controllers/ReportController.ts index b3a11fa..6728421 100644 --- a/src/controllers/ReportController.ts +++ b/src/controllers/ReportController.ts @@ -770,6 +770,12 @@ export class ReportController extends Controller { acc.posType = x.posTypeName; acc.posLevel = x.posLevelName; acc.affiliation = affiliation; + } else { + acc.fullName = "-"; + acc.position = "-"; + acc.posType = "-"; + acc.posLevel = "-"; + acc.affiliation = "-"; } if (x.kpiPeriod.year === yearNow - 4 && x.kpiPeriod.durationKPI === "APR") { @@ -781,6 +787,11 @@ export class ReportController extends Controller { acc.yearAPR1 = x.kpiPeriod.year ? Extension.ToThaiNumber(Extension.ToThaiYear(x.kpiPeriod.year).toString()) : null; + } else { + acc.summaryPointAPR1 = "-" + acc.textPointAPR1 = "-" + acc.periodAPR1 = "-" + acc.yearAPR1 = "-" } if (x.kpiPeriod.year === yearNow - 4 && x.kpiPeriod.durationKPI === "OCT") { @@ -792,6 +803,11 @@ export class ReportController extends Controller { acc.yearOCT1 = x.kpiPeriod.year ? Extension.ToThaiNumber(Extension.ToThaiYear(x.kpiPeriod.year).toString()) : null; + } else { + acc.summaryPointOCT1 = "-" + acc.textPointOCT1 = "-" + acc.periodOCT1 = "-" + acc.yearOCT1 = "-" } if (x.kpiPeriod.year === yearNow - 3 && x.kpiPeriod.durationKPI === "APR") { @@ -803,6 +819,11 @@ export class ReportController extends Controller { acc.yearAPR2 = x.kpiPeriod.year ? Extension.ToThaiNumber(Extension.ToThaiYear(x.kpiPeriod.year).toString()) : null; + } else { + acc.summaryPointAPR2 = "-" + acc.textPointAPR2 = "-" + acc.periodAPR2 = "-" + acc.yearAPR2 = "-" } if (x.kpiPeriod.year === yearNow - 3 && x.kpiPeriod.durationKPI === "OCT") { @@ -814,6 +835,11 @@ export class ReportController extends Controller { acc.yearOCT2 = x.kpiPeriod.year ? Extension.ToThaiNumber(Extension.ToThaiYear(x.kpiPeriod.year).toString()) : null; + } else { + acc.summaryPointOCT2 = "-" + acc.textPointOCT2 = "-" + acc.periodOCT2 = "-" + acc.yearOCT2 = "-" } if (x.kpiPeriod.year === yearNow - 2 && x.kpiPeriod.durationKPI === "APR") { @@ -825,6 +851,11 @@ export class ReportController extends Controller { acc.yearAPR3 = x.kpiPeriod.year ? Extension.ToThaiNumber(Extension.ToThaiYear(x.kpiPeriod.year).toString()) : null; + } else { + acc.summaryPointAPR3 = "-" + acc.textPointAPR3 = "-" + acc.periodAPR3 = "-" + acc.yearAPR3 = "-" } if (x.kpiPeriod.year === yearNow - 2 && x.kpiPeriod.durationKPI === "OCT") { @@ -836,6 +867,11 @@ export class ReportController extends Controller { acc.yearOCT3 = x.kpiPeriod.year ? Extension.ToThaiNumber(Extension.ToThaiYear(x.kpiPeriod.year).toString()) : null; + } else { + acc.summaryPointOCT3 = "-" + acc.textPointOCT3 = "-" + acc.periodOCT3 = "-" + acc.yearOCT3 = "-" } if (x.kpiPeriod.year === yearNow - 1 && x.kpiPeriod.durationKPI === "APR") { @@ -847,6 +883,11 @@ export class ReportController extends Controller { acc.yearAPR4 = x.kpiPeriod.year ? Extension.ToThaiNumber(Extension.ToThaiYear(x.kpiPeriod.year).toString()) : null; + } else { + acc.summaryPointAPR4 = "-" + acc.textPointAPR4 = "-" + acc.periodAPR4 = "-" + acc.yearAPR4 = "-" } if (x.kpiPeriod.year === yearNow - 1 && x.kpiPeriod.durationKPI === "OCT") { @@ -858,6 +899,11 @@ export class ReportController extends Controller { acc.yearOCT4 = x.kpiPeriod.year ? Extension.ToThaiNumber(Extension.ToThaiYear(x.kpiPeriod.year).toString()) : null; + } else { + acc.summaryPointOCT4 = "-" + acc.textPointOCT4 = "-" + acc.periodOCT4 = "-" + acc.yearOCT4 = "-" } if (x.kpiPeriod.year === yearNow && x.kpiPeriod.durationKPI === "APR") { @@ -869,6 +915,11 @@ export class ReportController extends Controller { acc.yearAPR5 = x.kpiPeriod.year ? Extension.ToThaiNumber(Extension.ToThaiYear(x.kpiPeriod.year).toString()) : null; + } else { + acc.summaryPointAPR5 = "-" + acc.textPointAPR5 = "-" + acc.periodAPR5 = "-" + acc.yearAPR5 = "-" } if (x.kpiPeriod.year === yearNow && x.kpiPeriod.durationKPI === "OCT") { @@ -880,6 +931,11 @@ export class ReportController extends Controller { acc.yearOCT5 = x.kpiPeriod.year ? Extension.ToThaiNumber(Extension.ToThaiYear(x.kpiPeriod.year).toString()) : null; + } else { + acc.summaryPointOCT5 = "-" + acc.textPointOCT5 = "-" + acc.periodOCT5 = "-" + acc.yearOCT5 = "-" } return acc; @@ -1069,6 +1125,12 @@ export class ReportController extends Controller { acc.posType = x.posTypeName; acc.posLevel = x.posLevelName; acc.affiliation = affiliation; + } else { + acc.fullName = "-"; + acc.position = "-"; + acc.posType = "-"; + acc.posLevel = "-"; + acc.affiliation = "-"; } if (x.kpiPeriod.year === yearNow - 2 && x.kpiPeriod.durationKPI === "APR") { @@ -1080,6 +1142,11 @@ export class ReportController extends Controller { acc.yearAPR1 = x.kpiPeriod.year ? Extension.ToThaiNumber(Extension.ToThaiYear(x.kpiPeriod.year).toString()) : null; + } else { + acc.summaryPointAPR1 = "-" + acc.textPointAPR1 = "-" + acc.periodAPR1 = "-" + acc.yearAPR1 = "-" } if (x.kpiPeriod.year === yearNow - 2 && x.kpiPeriod.durationKPI === "OCT") { @@ -1091,6 +1158,11 @@ export class ReportController extends Controller { acc.yearOCT1 = x.kpiPeriod.year ? Extension.ToThaiNumber(Extension.ToThaiYear(x.kpiPeriod.year).toString()) : null; + } else { + acc.summaryPointOCT1 = "-" + acc.textPointOCT1 = "-" + acc.periodOCT1 = "-" + acc.yearOCT1 = "-" } if (x.kpiPeriod.year === yearNow - 1 && x.kpiPeriod.durationKPI === "APR") { @@ -1102,6 +1174,11 @@ export class ReportController extends Controller { acc.yearAPR2 = x.kpiPeriod.year ? Extension.ToThaiNumber(Extension.ToThaiYear(x.kpiPeriod.year).toString()) : null; + } else { + acc.summaryPointAPR2 = "-" + acc.textPointAPR2 = "-" + acc.periodAPR2 = "-" + acc.yearAPR2 = "-" } if (x.kpiPeriod.year === yearNow - 1 && x.kpiPeriod.durationKPI === "OCT") { @@ -1113,6 +1190,11 @@ export class ReportController extends Controller { acc.yearOCT2 = x.kpiPeriod.year ? Extension.ToThaiNumber(Extension.ToThaiYear(x.kpiPeriod.year).toString()) : null; + } else { + acc.summaryPointOCT2 = "-" + acc.textPointOCT2 = "-" + acc.periodOCT2 = "-" + acc.yearOCT2 = "-" } if (x.kpiPeriod.year === yearNow && x.kpiPeriod.durationKPI === "APR") { @@ -1124,6 +1206,11 @@ export class ReportController extends Controller { acc.yearAPR3 = x.kpiPeriod.year ? Extension.ToThaiNumber(Extension.ToThaiYear(x.kpiPeriod.year).toString()) : null; + } else { + acc.summaryPointAPR3 = "-" + acc.textPointAPR3 = "-" + acc.periodAPR3 = "-" + acc.yearAPR3 = "-" } if (x.kpiPeriod.year === yearNow && x.kpiPeriod.durationKPI === "OCT") { @@ -1135,6 +1222,11 @@ export class ReportController extends Controller { acc.yearOCT3 = x.kpiPeriod.year ? Extension.ToThaiNumber(Extension.ToThaiYear(x.kpiPeriod.year).toString()) : null; + } else { + acc.summaryPointOCT3 = "-" + acc.textPointOCT3 = "-" + acc.periodOCT3 = "-" + acc.yearOCT3 = "-" } return acc;