diff --git a/BMA.EHR.Application/Responses/Profiles/GetProfileByKeycloakIdDto.cs b/BMA.EHR.Application/Responses/Profiles/GetProfileByKeycloakIdDto.cs index cac03fd7..84417111 100644 --- a/BMA.EHR.Application/Responses/Profiles/GetProfileByKeycloakIdDto.cs +++ b/BMA.EHR.Application/Responses/Profiles/GetProfileByKeycloakIdDto.cs @@ -40,6 +40,7 @@ namespace BMA.EHR.Application.Responses.Profiles public string? Gender { get; set; } public string? ProfileType { get; set; } + public bool? IsLeave { get; set; } } diff --git a/BMA.EHR.Leave/Controllers/LeaveReportController.cs b/BMA.EHR.Leave/Controllers/LeaveReportController.cs index 6b7e79f4..64e726e3 100644 --- a/BMA.EHR.Leave/Controllers/LeaveReportController.cs +++ b/BMA.EHR.Leave/Controllers/LeaveReportController.cs @@ -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; }