update GetLastEffectRound method to accept effectiveDate parameter and adjust usage in LeaveReportController

This commit is contained in:
Suphonchai Phoonsawat 2026-01-09 18:57:24 +07:00
parent a540912202
commit 99accd44e3
2 changed files with 5 additions and 4 deletions

View file

@ -1768,7 +1768,8 @@ namespace BMA.EHR.Leave.Service.Controllers
// return Error("ไม่พบรอบการลงเวลา Default", StatusCodes.Status404NotFound);
//}
var effectiveDate = await _userDutyTimeRepository.GetLastEffectRound(p.Id);
// ให้ใช้วันที่จาก loop date แทน
var effectiveDate = await _userDutyTimeRepository.GetLastEffectRound(p.Id, dd.date);
var roundId = effectiveDate != null ? effectiveDate.DutyTimeId : Guid.Empty;
var userRound = await _dutyTimeRepository.GetByIdAsync(roundId);