diff --git a/src/controllers/ReportController.ts b/src/controllers/ReportController.ts index 57da8a4..da08fcb 100644 --- a/src/controllers/ReportController.ts +++ b/src/controllers/ReportController.ts @@ -2307,7 +2307,7 @@ export class ReportController extends Controller { relations: ["salaryOrg"], where: { salaryOrgId: In([salaryOrg?.id]), - amountSpecial: MoreThan(1), + amountSpecial: MoreThan(0), }, select: [ "id", @@ -2383,7 +2383,7 @@ export class ReportController extends Controller { item.amountSpecial == undefined || item.amountSpecial == null ? "๐" : Extension.ToThaiNumber(String(item.amountSpecial.toLocaleString())), - remark: null, + remark: item.remark ?? null, })); const profileNoAmount = salaryProfileNoAmount.map((item, index) => ({ @@ -2405,7 +2405,7 @@ export class ReportController extends Controller { item.amount == undefined || item.amount == null ? "๐" : Extension.ToThaiNumber(String(item.amount.toLocaleString())), - remark: null, + remark: item.remark ?? null, })); return new HttpSuccess({ @@ -2534,16 +2534,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 ? `${profile.posTypeShort} ${Extension.ToThaiNumber(profile.posLevel.toLocaleString())}` @@ -2618,16 +2619,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 ? `${profile.posTypeShort} ${Extension.ToThaiNumber(profile.posLevel.toLocaleString())}` @@ -2702,16 +2704,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 ? `${profile.posTypeShort} ${Extension.ToThaiNumber(profile.posLevel.toLocaleString())}` @@ -2783,16 +2786,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 ? `${profile.posTypeShort} ${Extension.ToThaiNumber(profile.posLevel.toLocaleString())}` @@ -2869,16 +2873,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 ? `${profile.posTypeShort} ${Extension.ToThaiNumber(profile.posLevel.toLocaleString())}` @@ -2950,16 +2955,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 ? `${profile.posTypeShort} ${Extension.ToThaiNumber(profile.posLevel.toLocaleString())}` @@ -3088,16 +3094,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, posNumber: Extension.ToThaiNumber(profile.orgShortName) + @@ -3228,16 +3235,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(String(profile.posLevel.toLocaleString())) @@ -3374,16 +3382,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 ? `${profile.posTypeShort} ${Extension.ToThaiNumber(profile.posLevel.toLocaleString())}` @@ -3458,16 +3467,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 ? `${profile.posTypeShort} ${Extension.ToThaiNumber(profile.posLevel.toLocaleString())}` @@ -3536,16 +3546,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 ? `${profile.posTypeShort} ${Extension.ToThaiNumber(profile.posLevel.toLocaleString())}` @@ -3612,16 +3623,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 ? `${profile.posTypeShort} ${Extension.ToThaiNumber(profile.posLevel.toLocaleString())}` @@ -4089,16 +4101,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, posNumber: Extension.ToThaiNumber(profile.orgShortName) + @@ -4316,16 +4329,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: Extension.ToThaiNumber(profile.posLevel.toLocaleString()), posNumber: @@ -4473,16 +4487,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 + "/" + @@ -4566,16 +4581,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: @@ -4653,16 +4669,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 + "/" +