Merge branch 'develop' into adiDev

This commit is contained in:
Adisak 2025-10-17 13:52:06 +07:00
commit 897dda67ad
3 changed files with 26 additions and 8 deletions

View file

@ -10438,8 +10438,12 @@ export class ProfileController extends Controller {
.leftJoinAndSelect("positions.posExecutive", "posExecutive")
// calculate range: start = 2 Oct of (year-1), end = 1 Oct of year (inclusive)
.where("profile.dateRetire BETWEEN :start AND :end", {
start: `${year - 1}-10-02`,
end: `${year}-10-01`,
start: `${year - 1}-10-01`,
end: `${year}-09-30`,
})
.andWhere("profile.isLeave = :isLeave AND profile.isRetirement = :isRetirement", {
isLeave: false,
isRetirement: false,
})
.getMany();

View file

@ -5033,10 +5033,17 @@ export class ProfileEmployeeController extends Controller {
.leftJoinAndSelect("current_holders.orgChild4", "orgChild4")
.leftJoinAndSelect("current_holders.positions", "positions")
// calculate range: start = 2 Oct of (year-1), end = 1 Oct of year (inclusive)
.where("profile.dateRetire BETWEEN :start AND :end", {
start: `${year - 1}-10-02`,
end: `${year}-10-01`,
.where("profileEmployee.dateRetire BETWEEN :start AND :end", {
start: `${year - 1}-10-01`,
end: `${year}-09-30`,
})
.andWhere(
"profileEmployee.isLeave = :isLeave AND profileEmployee.isRetirement = :isRetirement",
{
isLeave: false,
isRetirement: false,
},
)
.getMany();
if (!profiles || profiles.length === 0) {

View file

@ -3230,10 +3230,17 @@ export class ProfileEmployeeTempController extends Controller {
.leftJoinAndSelect("current_holders.positions", "positions")
// .leftJoinAndSelect("positions.posExecutive", "posExecutive")
// calculate range: start = 2 Oct of (year-1), end = 1 Oct of year (inclusive)
.where("profile.dateRetire BETWEEN :start AND :end", {
start: `${year - 1}-10-02`,
end: `${year}-10-01`,
.where("profileEmployee.dateRetire BETWEEN :start AND :end", {
start: `${year - 1}-10-01`,
end: `${year}-09-30`,
})
.andWhere(
"profileEmployee.isLeave = :isLeave AND profileEmployee.isRetirement = :isRetirement",
{
isLeave: false,
isRetirement: false,
},
)
.getMany();
if (!profiles || profiles.length === 0) {