fix: range date of retire

This commit is contained in:
Warunee Tamkoo 2025-10-17 12:14:35 +07:00
parent a25b017bad
commit 6554636eeb
3 changed files with 6 additions and 6 deletions

View file

@ -10438,8 +10438,8 @@ 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,

View file

@ -5034,8 +5034,8 @@ export class ProfileEmployeeController extends Controller {
.leftJoinAndSelect("current_holders.positions", "positions")
// calculate range: start = 2 Oct of (year-1), end = 1 Oct of year (inclusive)
.where("profileEmployee.dateRetire BETWEEN :start AND :end", {
start: `${year - 1}-10-02`,
end: `${year}-10-01`,
start: `${year - 1}-10-01`,
end: `${year}-09-30`,
})
.andWhere(
"profileEmployee.isLeave = :isLeave AND profileEmployee.isRetirement = :isRetirement",

View file

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