From 97dd104429ff98d514197f533ff815036b451678 Mon Sep 17 00:00:00 2001 From: Suphonchai Phoonsawat Date: Fri, 3 Oct 2025 20:28:49 +0700 Subject: [PATCH] fix #24 --- .../Leaves/TimeAttendants/ProcessUserTimeStampRepository.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/BMA.EHR.Application/Repositories/Leaves/TimeAttendants/ProcessUserTimeStampRepository.cs b/BMA.EHR.Application/Repositories/Leaves/TimeAttendants/ProcessUserTimeStampRepository.cs index 3117a8b1..3847b9f7 100644 --- a/BMA.EHR.Application/Repositories/Leaves/TimeAttendants/ProcessUserTimeStampRepository.cs +++ b/BMA.EHR.Application/Repositories/Leaves/TimeAttendants/ProcessUserTimeStampRepository.cs @@ -222,9 +222,12 @@ namespace BMA.EHR.Application.Repositories.Leaves.TimeAttendants public async Task> GetTimeStampHistoryAsync(Guid keycloakId, int year, int page = 1, int pageSize = 10, string keyword = "") { + var fiscalDateStart = new DateTime(year - 1, 10, 1); + var fiscalDateEnd = new DateTime(year, 9, 30); + var data = await _dbContext.Set() .Where(u => u.KeycloakUserId == keycloakId) - .Where(u => u.CheckIn.Year == year) + .Where(u => u.CheckIn.Date >= fiscalDateStart && u.CheckIn.Date <= fiscalDateEnd) .OrderByDescending(u => u.CheckIn.Date) .Skip((page - 1) * pageSize) .Take(pageSize)