From 318088a940de528d5287ddf53fbb1200628c3776 Mon Sep 17 00:00:00 2001 From: AdisakKanthawilang Date: Fri, 12 Jul 2024 10:22:36 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=81=E0=B8=A2=E0=B8=81=E0=B8=8A=E0=B8=B7?= =?UTF-8?q?=E0=B9=88=E0=B8=AD=E0=B8=AA=E0=B8=B1=E0=B8=87=E0=B8=81=E0=B8=B1?= =?UTF-8?q?=E0=B8=94=20emp?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/ReportController.ts | 75 +++++++++++++++++------------ 1 file changed, 45 insertions(+), 30 deletions(-) diff --git a/src/controllers/ReportController.ts b/src/controllers/ReportController.ts index 19ac180..57b4bb3 100644 --- a/src/controllers/ReportController.ts +++ b/src/controllers/ReportController.ts @@ -4764,16 +4764,18 @@ export class ReportController extends Controller { profile.child2, profile.child1, profile.root, - `${profile.prefix}${profile.firstName} ${profile.lastName}`, ]; - const fullName = fullNameParts + const affiliation = fullNameParts .filter((part) => part !== undefined && part !== null) .join("/"); + const fullName = `${profile.prefix}${profile.firstName} ${profile.lastName}`; + return { no: Extension.ToThaiNumber((index + 1).toLocaleString()), fullName: fullName, + affiliation: affiliation, position: profile.position, posLevel: profile.posLevel, posNumber: @@ -4845,16 +4847,17 @@ export class ReportController extends Controller { profile.child2, profile.child1, profile.root, - `${profile.prefix}${profile.firstName} ${profile.lastName}`, ]; - const fullName = fullNameParts + const affiliation = fullNameParts .filter((part) => part !== undefined && part !== null) .join("/"); + const fullName = `${profile.prefix}${profile.firstName} ${profile.lastName}`; return { no: Extension.ToThaiNumber((index + 1).toLocaleString()), fullName: fullName, + affiliation: affiliation, posLevel: profile.posLevel, posNumber: Extension.ToThaiNumber(profile.orgShortName) + @@ -4969,16 +4972,17 @@ export class ReportController extends Controller { profile.child2, profile.child1, profile.root, - `${profile.prefix}${profile.firstName} ${profile.lastName}`, ]; - const fullName = fullNameParts + const affiliation = fullNameParts .filter((part) => part !== undefined && part !== null) .join("/"); + const fullName = `${profile.prefix}${profile.firstName} ${profile.lastName}`; return { no: Extension.ToThaiNumber((index + 1).toLocaleString()), fullName: fullName, + affiliation: affiliation, position: profile.position, posLevel: profile.posLevel, posNumber: @@ -5122,16 +5126,17 @@ export class ReportController extends Controller { profile.child2, profile.child1, profile.root, - `${profile.prefix}${profile.firstName} ${profile.lastName}`, ]; - const fullName = fullNameParts + const affiliation = fullNameParts .filter((part) => part !== undefined && part !== null) .join("/"); + const fullName = `${profile.prefix}${profile.firstName} ${profile.lastName}`; return { no: Extension.ToThaiNumber((index + 1).toLocaleString()), fullName: fullName, + affiliation: affiliation, position: profile.position + "/" + @@ -5210,22 +5215,23 @@ export class ReportController extends Controller { const agency = _salaryPeriod[0] == null ? "" : _salaryPeriod[0].root; const formattedData = _salaryPeriod.map((profile, index) => { - const fullNameParts = [ + const fullNameParts = [ profile.child4, profile.child3, profile.child2, profile.child1, profile.root, - `${profile.prefix}${profile.firstName} ${profile.lastName}`, ]; - const fullName = fullNameParts + const affiliation = fullNameParts .filter((part) => part !== undefined && part !== null) .join("/"); + const fullName = `${profile.prefix}${profile.firstName} ${profile.lastName}`; return { no: Extension.ToThaiNumber((index + 1).toLocaleString()), fullName: fullName, + affiliation: affiliation, position: profile.position, posLevel: profile.posLevel ? Extension.ToThaiNumber(profile.posLevel.toLocaleString()) @@ -5320,22 +5326,23 @@ export class ReportController extends Controller { const agency = salaryProfile[0] == null ? "" : salaryProfile[0].root; const formattedData = salaryProfile.map((profile, index) => { - const fullNameParts = [ + const fullNameParts = [ profile.child4, profile.child3, profile.child2, profile.child1, profile.root, - `${profile.prefix}${profile.firstName} ${profile.lastName}`, ]; - const fullName = fullNameParts + const affiliation = fullNameParts .filter((part) => part !== undefined && part !== null) .join("/"); + const fullName = `${profile.prefix}${profile.firstName} ${profile.lastName}`; return { no: Extension.ToThaiNumber((index + 1).toLocaleString()), fullName: fullName, + affiliation: affiliation, position: profile.position, posLevel: profile.posLevel, posNumber: @@ -5402,22 +5409,23 @@ export class ReportController extends Controller { const agency = _salaryProfileEmp[0] == null ? "" : _salaryProfileEmp[0].root; const formattedData = _salaryProfileEmp.map((profile, index) => { - const fullNameParts = [ + const fullNameParts = [ profile.child4, profile.child3, profile.child2, profile.child1, profile.root, - `${profile.prefix}${profile.firstName} ${profile.lastName}`, ]; - const fullName = fullNameParts + const affiliation = fullNameParts .filter((part) => part !== undefined && part !== null) .join("/"); + const fullName = `${profile.prefix}${profile.firstName} ${profile.lastName}`; return { no: Extension.ToThaiNumber((index + 1).toLocaleString()), fullName: fullName, + affiliation: affiliation, position: profile.position + "/" + @@ -5495,16 +5503,17 @@ export class ReportController extends Controller { profile.child2, profile.child1, profile.root, - `${profile.prefix}${profile.firstName} ${profile.lastName}`, ]; - const fullName = fullNameParts + const affiliation = fullNameParts .filter((part) => part !== undefined && part !== null) .join("/"); - + const fullName = `${profile.prefix}${profile.firstName} ${profile.lastName}`; + return { no: Extension.ToThaiNumber((index + 1).toLocaleString()), fullName: fullName, + affiliation: affiliation, position: profile.position, posLevel: profile.posLevel ? Extension.ToThaiNumber(profile.posLevel.toLocaleString()) @@ -5608,16 +5617,17 @@ export class ReportController extends Controller { profile.child2, profile.child1, profile.root, - `${profile.prefix}${profile.firstName} ${profile.lastName}`, ]; - const fullName = fullNameParts + const affiliation = fullNameParts .filter((part) => part !== undefined && part !== null) .join("/"); + const fullName = `${profile.prefix}${profile.firstName} ${profile.lastName}`; return { no: Extension.ToThaiNumber((index + 1).toLocaleString()), fullName: fullName, + affiliation: affiliation, position: profile.position, posLevel: profile.posLevel ? Extension.ToThaiNumber(profile.posLevel.toLocaleString()) @@ -5692,16 +5702,17 @@ export class ReportController extends Controller { profile.child2, profile.child1, profile.root, - `${profile.prefix}${profile.firstName} ${profile.lastName}`, ]; - const fullName = fullNameParts + const affiliation = fullNameParts .filter((part) => part !== undefined && part !== null) .join("/"); + const fullName = `${profile.prefix}${profile.firstName} ${profile.lastName}`; return { no: Extension.ToThaiNumber((index + 1).toLocaleString()), fullName: fullName, + affiliation: affiliation, position: profile.position + "/" + @@ -5781,16 +5792,17 @@ export class ReportController extends Controller { profile.child2, profile.child1, profile.root, - `${profile.prefix}${profile.firstName} ${profile.lastName}`, ]; - const fullName = fullNameParts + const affiliation = fullNameParts .filter((part) => part !== undefined && part !== null) .join("/"); + const fullName = `${profile.prefix}${profile.firstName} ${profile.lastName}`; return { no: Extension.ToThaiNumber((index + 1).toLocaleString()), fullName: fullName, + affiliation: affiliation, position: profile.position + "/" + @@ -5881,16 +5893,18 @@ export class ReportController extends Controller { profile.child2, profile.child1, profile.root, - `${profile.prefix}${profile.firstName} ${profile.lastName}`, ]; - const fullName = fullNameParts + const affiliation = fullNameParts .filter((part) => part !== undefined && part !== null) .join("/"); + const fullName = `${profile.prefix}${profile.firstName} ${profile.lastName}`; + return { no: Extension.ToThaiNumber((index + 1).toLocaleString()), fullName: fullName, + affiliation: affiliation, position: profile.position, posLevel: profile.posLevel ? Extension.ToThaiNumber(profile.posLevel.toLocaleString()) @@ -6214,16 +6228,17 @@ export class ReportController extends Controller { profile.child2, profile.child1, profile.root, - `${profile.prefix}${profile.firstName} ${profile.lastName}`, ]; - const fullName = fullNameParts + const affiliation = fullNameParts .filter((part) => part !== undefined && part !== null) .join("/"); + const fullName = `${profile.prefix}${profile.firstName} ${profile.lastName}`; return { no: Extension.ToThaiNumber((index + 1).toLocaleString()), fullName: fullName, + affiliation: affiliation, position: profile.position, posLevel: profile.posLevel ? Extension.ToThaiNumber(profile.posLevel.toLocaleString())