แก้ api ที่ดึง amount จาก profile salary เป็นจาก profile

This commit is contained in:
AdisakKanthawilang 2024-12-06 09:18:26 +07:00
parent 04c200027f
commit 6f4d6d14b7
6 changed files with 37 additions and 22 deletions

View file

@ -2950,10 +2950,11 @@ export class ProfileEmployeeController extends Controller {
orgShortName = item.orgChild4?.orgChild4ShortName;
}
const amount =
item.current_holder == null || item.current_holder.profileSalary.length == 0
? null
: item.current_holder.profileSalary.sort((a: any, b: any) => b.date - a.date)[0].amount;
// const amount =
// item.current_holder == null || item.current_holder.profileSalary.length == 0
// ? null
// : item.current_holder.profileSalary.sort((a: any, b: any) => b.date - a.date)[0].amount;
const amount = item.current_holder?item.current_holder.amount:null;
let datePeriodStart = new Date(
`${new Date().getFullYear()}-${String(new Date().getMonth() + 1).padStart(2, "0")}-${String(new Date().getDate() + 1).padStart(2, "0")}T00:00:00.000Z`,
);