Merge branch 'develop' of github.com:Frappet/hrms-api-org into develop

This commit is contained in:
kittapath 2025-03-05 16:58:24 +07:00
commit 95a7c5809f
6 changed files with 392 additions and 46 deletions

View file

@ -1164,7 +1164,11 @@ export class ProfileController extends Controller {
"amount",
"remark",
],
where: { profileId: id },
where: {
profileId: id,
commandCode: In(["5","6"]),
isEntry: false
},
order: { order: "ASC" },
});
@ -1321,7 +1325,11 @@ export class ProfileController extends Controller {
];
const position_raw = await this.salaryRepo.find({
where: { profileId: id },
where: {
profileId: id,
commandCode: In(["1", "2", "3", "4", "8", "10", "11", "12", "15", "16"]),
isEntry: false
},
order: { order: "ASC" },
});
const positionList =
@ -1350,7 +1358,6 @@ export class ProfileController extends Controller {
{
commandDateAffect: "-",
commandDateSign: "-",
refCommandNo: "-",
posNo: "-",
position: "-",
posType: "-",
@ -1449,49 +1456,48 @@ export class ProfileController extends Controller {
const profileAbility =
profileAbility_raw.length > 0
? profileAbility_raw.map((item) => ({
field: item.field ? item.field : "",
detail: item.detail ? item.detail : "",
}))
: [
{
field: "-",
detail: "-",
},
];
const sum = profiles
? Extension.ToThaiNumber(
(
Number(profiles.amount) +
Number(profiles.positionSalaryAmount) +
Number(profiles.mouthSalaryAmount) +
Number(profiles.amountSpecial)
).toLocaleString(),
)
: "";
const fullCurrentAddress = profiles
? Extension.ToThaiNumber(
profiles.currentAddress +
" ตำบล/แขวง " +
profiles.currentSubDistrict.name +
" อำเภอ/เขต " +
profiles.currentDistrict.name +
" จังหวัด " +
profiles.currentProvince.name +
profiles.currentZipCode,
)
: "";
const fullRegistrationAddress = profiles
? Extension.ToThaiNumber(
profiles.registrationAddress +
" ตำบล/แขวง " +
profiles.registrationSubDistrict.name +
" อำเภอ/เขต " +
profiles.registrationDistrict.name +
" จังหวัด " +
profiles.registrationProvince.name +
profiles.registrationZipCode,
)
: "";
field: item.field?item.field:"",
detail: item.detail?item.detail:"",
}))
: [
{
field: "-",
detail: "-",
},
];
const otherIncome_raw = await this.salaryRepo.find({
where: {
profileId: id,
commandCode: "7",
isEntry: false
},
order: { order: "ASC" },
});
const otherIncome =
otherIncome_raw.length > 0
? otherIncome_raw.map((item) => ({
commandDateAffect: item.commandDateAffect?Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.commandDateAffect)):"",
commandDateSign: item.commandDateSign?Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.commandDateSign)):"",
commandNo: item.commandNo?Extension.ToThaiNumber(item.commandNo):"",
position: item.positionName,
posLevel: item.positionLevel?Extension.ToThaiNumber(item.positionLevel):"",
amount: item.amount?Extension.ToThaiNumber(Number(item.amount).toLocaleString()):"",
}))
: [
{
commandDateAffect: "-",
commandDateSign: "-",
commandNo: "-",
position: "-",
posLevel: "-",
amount: "-",
},
];
const sum = profiles?Extension.ToThaiNumber((Number(profiles.amount) + Number(profiles.positionSalaryAmount) + Number(profiles.mouthSalaryAmount) + Number(profiles.amountSpecial)).toLocaleString()):"";
const fullCurrentAddress = profiles?Extension.ToThaiNumber(profiles.currentAddress + " ตำบล/แขวง " + profiles.currentSubDistrict.name + " อำเภอ/เขต " + profiles.currentDistrict.name + " จังหวัด " + profiles.currentProvince.name + profiles.currentZipCode):"";
const fullRegistrationAddress = profiles?Extension.ToThaiNumber(profiles.registrationAddress + " ตำบล/แขวง " + profiles.registrationSubDistrict.name + " อำเภอ/เขต " + profiles.registrationDistrict.name + " จังหวัด " + profiles.registrationProvince.name + profiles.registrationZipCode):"";
const data = {
fullName: `${profiles?.prefix}${profiles?.firstName} ${profiles?.lastName}`,
prefix: profiles?.prefix != null ? profiles.prefix : "",
@ -1635,6 +1641,7 @@ export class ProfileController extends Controller {
duty,
assessments,
profileAbility,
otherIncome
};
return new HttpSuccess({