#1832, 1830
Some checks failed
release-dev / release-dev (push) Failing after 13s

This commit is contained in:
Suphonchai Phoonsawat 2025-10-01 19:57:13 +07:00
parent 1f3632744d
commit 8d37024b6c
2 changed files with 10 additions and 3 deletions

View file

@ -324,10 +324,14 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
.Where(x => x.LeaveStatus != "DRAFT")
.OrderByDescending(x => x.CreatedAt)
.AsQueryable();
// fix issue : 1830
if (year != 0)
rawData = rawData.Where(x => x.LeaveStartDate.Year == year);
{
var startFiscalDate = new DateTime(year - 1, 10, 1);
var endFiscalDate = new DateTime(year, 9, 30);
rawData = rawData.Where(x => x.LeaveStartDate >= startFiscalDate && x.LeaveStartDate <= endFiscalDate);
}
if (type != Guid.Empty)
rawData = rawData.Where(x => x.Type.Id == type);