This commit is contained in:
kittapath 2024-12-26 19:58:06 +07:00
parent 6ed9e5ab1f
commit 3e5788f0f4

View file

@ -233,17 +233,16 @@ export class ProfileController extends Controller {
"refCommandNo",
"amount",
"templateDoc",
"positionLine",
],
where: { profileId: id },
order: { date: "ASC" },
});
const salarys =
salary_raw.length > 1
salary_raw.length > 1
? salary_raw.slice(1).map((item) => ({
date: item.date
? Extension.ToThaiNumber(Extension.ToThaiShortDate(item.date))
: null,
date: item.date ? Extension.ToThaiNumber(Extension.ToThaiShortDate(item.date)) : null,
positionLine: item.positionLine != null ? item.positionLine : "-",
posNo: item.posNo != null ? Extension.ToThaiNumber(item.posNo) : null,
}))
@ -252,7 +251,6 @@ export class ProfileController extends Controller {
date: "-",
positionLine: "-",
posNo: "-",
},
];
@ -269,7 +267,7 @@ export class ProfileController extends Controller {
item.startDate && item.endDate
? `${Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.startDate))} - ${Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.endDate))}`
: "-",
degree: item.degree && item.field ? `${item.degree} ${item.field}` : "-",
degree: item.degree ? item.degree : "-",
}))
: [
{
@ -301,9 +299,7 @@ export class ProfileController extends Controller {
),
date:
salary_raw.length > 0 && salary_raw[0].date != null
? Extension.ToThaiNumber(
Extension.ToThaiShortDate(salary_raw[0].date),
)
? Extension.ToThaiNumber(Extension.ToThaiShortDate(salary_raw[0].date))
: "-",
positionName: profile.position != null ? profile.position : "-",
appointText:
@ -312,15 +308,11 @@ export class ProfileController extends Controller {
: "-",
posNo:
salary_raw.length > 0 && salary_raw[0].posNo != null
? Extension.ToThaiNumber(
Extension.ToThaiNumber(salary_raw[0].posNo),
)
? Extension.ToThaiNumber(Extension.ToThaiNumber(salary_raw[0].posNo))
: "-",
positionLine:
salary_raw.length > 0 && salary_raw[0].positionLine != null
? Extension.ToThaiNumber(
Extension.ToThaiNumber(salary_raw[0].positionLine),
)
? Extension.ToThaiNumber(Extension.ToThaiNumber(salary_raw[0].positionLine))
: "-",
ocFullPath: `${_child4}${_child3}${_child2}${_child1}${_root}`,
educations: Education,
@ -608,7 +600,7 @@ export class ProfileController extends Controller {
const salarys =
salary_raw.length > 0
? salary_raw.map((item) => ({
salaryDate: item.date
salaryDate: item.date
? Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.date))
: null,
position: item.position != null ? Extension.ToThaiNumber(item.position) : null,
@ -4857,9 +4849,10 @@ export class ProfileController extends Controller {
nodeId: null,
type: profile.employeeClass,
salary: profile.amount,
posNo : root?.orgRootShortName && posMaster?.posMasterNo
? `${root?.orgRootShortName}${posMaster?.posMasterNo}`
: ""
posNo:
root?.orgRootShortName && posMaster?.posMasterNo
? `${root?.orgRootShortName}${posMaster?.posMasterNo}`
: "",
};
if (_profile.child4Id != null) {
_profile.node = 4;
@ -5001,9 +4994,10 @@ export class ProfileController extends Controller {
nodeId: null,
salary: profile ? profile.amount : null,
amountSpecial: profile ? profile.amountSpecial : null,
posNo : root?.orgRootShortName && posMaster?.posMasterNo
posNo:
root?.orgRootShortName && posMaster?.posMasterNo
? `${root?.orgRootShortName}${posMaster?.posMasterNo}`
: ""
: "",
};
if (_profile.child4Id != null) {