Fix TimeStamp Report

This commit is contained in:
Suphonchai Phoonsawat 2024-08-30 14:05:58 +07:00 committed by Bright
parent 67f6be635c
commit b3c752d2e6
3 changed files with 24 additions and 18 deletions

View file

@ -1062,6 +1062,10 @@ namespace BMA.EHR.Leave.Service.Controllers
{
//var profile = await _userProfileRepository.SearchProfile(null, null, null);
var profile = await _userProfileRepository.GetProfileWithKeycloak(AccessToken);
if(profile.Count > 0)
{
profile = profile.Where(p => p.IsLeave == false).ToList();
}
var date = req.StartDate.Date;
var holidays = await _holidayRepository.GetHolidayAsync(req.StartDate.Date, req.EndDate.Date);
@ -1206,9 +1210,9 @@ namespace BMA.EHR.Leave.Service.Controllers
workTotal += 1;
if (!timeStamps.IsLocationCheckIn)
{
if(timeStamps.CheckInLocationName!.Contains("ปฏิบัติงานที่บ้าน"))
if(timeStamps.CheckInLocationName == "ปฏิบัติงานที่บ้าน")
wfhTotal += 1;
else if (timeStamps.CheckInLocationName!.Contains("ประชุม"))
else if (timeStamps.CheckInLocationName == "ไปประชุม/อบรม/สัมมนา/ปฏิบัติงานที่บ้านนอกสถานที่")
seminarTotal += 1;
}