fix issue #858 : กรณีที่ฟิลด์ใดๆใน report มีค่า Null ปรับให้แสดง "-"

This commit is contained in:
Bright 2024-12-16 11:55:34 +07:00
parent 53302147ef
commit 29447e308c

View file

@ -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;