Fix บัญชี 2 ปรับลำดับการแสดงวุฒิ Issue #1336

This commit is contained in:
Bright 2025-06-30 15:25:25 +07:00
parent 231736c938
commit f80e53804a

View file

@ -3729,13 +3729,21 @@ export class ReportController extends Controller {
posMaster.current_holder.profileEducations != null &&
posMaster.current_holder.profileEducations.length > 0
) {
let _education: any = posMaster.current_holder.profileEducations.sort(
(a, b) =>
(b.finishDate == null ? 0 : b.finishDate.getTime()) -
(a.finishDate == null ? 0 : a.finishDate.getTime()),
);
let _education: any = posMaster.current_holder.profileEducations
.filter(x => x.isEducation == true || x.isUse == true)
.sort(
(a, b) => {
// (b.finishDate == null ? 0 : b.finishDate.getTime()) -
// (a.finishDate == null ? 0 : a.finishDate.getTime()),
if (a.isEducation !== b.isEducation) {
return a.isEducation ? -1 : 1
}
return b.level - a.level
}
);
if (_education.length > 0) {
education = _education[0];
// education = _education[0];
education = _education.map((e:any) => e.degree).join(", ")
}
}
let salary: any = "";
@ -3873,7 +3881,7 @@ export class ReportController extends Controller {
: positionMasterProfileOld.positions.find(
(x: any) => x.positionIsSelected == true,
)?.posExecutive?.posExecutiveName,
education: education == "" ? "" : education.degree,
education: education == "" ? "" : education,
salary: salary == "" ? "" : salary.amount,
reason: posMaster.reason,
};
@ -4103,13 +4111,18 @@ export class ReportController extends Controller {
posMaster.current_holder.profileEducations != null &&
posMaster.current_holder.profileEducations.length > 0
) {
let _education: any = posMaster.current_holder.profileEducations.sort(
(a, b) =>
(b.finishDate == null ? 0 : b.finishDate.getTime()) -
(a.finishDate == null ? 0 : a.finishDate.getTime()),
);
let _education: any = posMaster.current_holder.profileEducations
.filter(x => x.isEducation == true || x.isUse == true)
.sort(
(a, b) => {
if (a.isEducation !== b.isEducation) {
return a.isEducation ? -1 : 1
}
return b.level - a.level
}
);
if (_education.length > 0) {
education = _education[0];
education = _education.map((e:any) => e.degree).join(", ")
}
}
let salary: any = "";
@ -4247,7 +4260,7 @@ export class ReportController extends Controller {
: positionMasterProfileOld.positions.find(
(x: any) => x.positionIsSelected == true,
)?.posExecutive?.posExecutiveName,
education: education == "" ? "" : education.degree,
education: education == "" ? "" : education,
salary: salary == "" ? "" : salary.amount,
reason: posMaster.reason,
};
@ -4485,13 +4498,18 @@ export class ReportController extends Controller {
posMaster.current_holder.profileEducations != null &&
posMaster.current_holder.profileEducations.length > 0
) {
let _education: any = posMaster.current_holder.profileEducations.sort(
(a, b) =>
(b.finishDate == null ? 0 : b.finishDate.getTime()) -
(a.finishDate == null ? 0 : a.finishDate.getTime()),
);
let _education: any = posMaster.current_holder.profileEducations
.filter(x => x.isEducation == true || x.isUse == true)
.sort(
(a, b) => {
if (a.isEducation !== b.isEducation) {
return a.isEducation ? -1 : 1
}
return b.level - a.level
}
);
if (_education.length > 0) {
education = _education[0];
education = _education.map((e:any) => e.degree).join(", ")
}
}
let salary: any = "";
@ -4629,7 +4647,7 @@ export class ReportController extends Controller {
: positionMasterProfileOld.positions.find(
(x: any) => x.positionIsSelected == true,
)?.posExecutive?.posExecutiveName,
education: education == "" ? "" : education.degree,
education: education == "" ? "" : education,
salary: salary == "" ? "" : salary.amount,
reason: posMaster.reason,
};
@ -4883,13 +4901,18 @@ export class ReportController extends Controller {
posMaster.current_holder.profileEducations != null &&
posMaster.current_holder.profileEducations.length > 0
) {
let _education: any = posMaster.current_holder.profileEducations.sort(
(a, b) =>
(b.finishDate == null ? 0 : b.finishDate.getTime()) -
(a.finishDate == null ? 0 : a.finishDate.getTime()),
);
let _education: any = posMaster.current_holder.profileEducations
.filter(x => x.isEducation == true || x.isUse == true)
.sort(
(a, b) => {
if (a.isEducation !== b.isEducation) {
return a.isEducation ? -1 : 1
}
return b.level - a.level
}
);
if (_education.length > 0) {
education = _education[0];
education = _education.map((e:any) => e.degree).join(", ")
}
}
let salary: any = "";
@ -5027,7 +5050,7 @@ export class ReportController extends Controller {
: positionMasterProfileOld.positions.find(
(x: any) => x.positionIsSelected == true,
)?.posExecutive?.posExecutiveName,
education: education == "" ? "" : education.degree,
education: education == "" ? "" : education,
salary: salary == "" ? "" : salary.amount,
reason: posMaster.reason,
};
@ -5285,13 +5308,18 @@ export class ReportController extends Controller {
posMaster.current_holder.profileEducations != null &&
posMaster.current_holder.profileEducations.length > 0
) {
let _education: any = posMaster.current_holder.profileEducations.sort(
(a, b) =>
(b.finishDate == null ? 0 : b.finishDate.getTime()) -
(a.finishDate == null ? 0 : a.finishDate.getTime()),
);
let _education: any = posMaster.current_holder.profileEducations
.filter(x => x.isEducation == true || x.isUse == true)
.sort(
(a, b) => {
if (a.isEducation !== b.isEducation) {
return a.isEducation ? -1 : 1
}
return b.level - a.level
}
);
if (_education.length > 0) {
education = _education[0];
education = _education.map((e:any) => e.degree).join(", ")
}
}
let salary: any = "";
@ -5429,7 +5457,7 @@ export class ReportController extends Controller {
: positionMasterProfileOld.positions.find(
(x: any) => x.positionIsSelected == true,
)?.posExecutive?.posExecutiveName,
education: education == "" ? "" : education.degree,
education: education == "" ? "" : education,
salary: salary == "" ? "" : salary.amount,
reason: posMaster.reason,
};