From 9b81e22599ac2fc5f81e271c4bff56d7dd37161d Mon Sep 17 00:00:00 2001 From: Suphonchai Phoonsawat Date: Fri, 19 Jan 2024 08:47:46 +0700 Subject: [PATCH] fix report --- .../Controllers/LeaveReportController.cs | 10 ++++++++-- .../Controllers/LeaveRequestController.cs | 4 ++-- .../DTOs/LeaveRequest/GetLeaveRequestByIdDto.cs | 2 +- .../LeaveRequest/GetLeaveRequestForAdminByIdDto.cs | 2 +- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/BMA.EHR.Leave.Service/Controllers/LeaveReportController.cs b/BMA.EHR.Leave.Service/Controllers/LeaveReportController.cs index 38c6a4e1..18232e36 100644 --- a/BMA.EHR.Leave.Service/Controllers/LeaveReportController.cs +++ b/BMA.EHR.Leave.Service/Controllers/LeaveReportController.cs @@ -1116,7 +1116,7 @@ namespace BMA.EHR.Leave.Service.Controllers { no = count, fullName = fullName, - dutyTimeName = $"{duty.StartTimeMorning} น.", + dutyTimeName = $"{duty.StartTimeMorning} - {duty.EndTimeAfternoon} น.", checkInLocation = timeStamps == null ? "" : timeStamps.CheckInPOI, checkInTime = timeStamps == null ? "" : $"{timeStamps.CheckIn.ToString("HH:mm")} น.", @@ -1126,7 +1126,13 @@ namespace BMA.EHR.Leave.Service.Controllers $"{timeStamps.CheckOut.Value.ToString("HH:mm")} น." : "", - remark = "" + remark = timeStamps == null ? "ขาดราชการ" : "", + + checkInDate = timeStamps == null ? "" : timeStamps.CheckIn.Date.ToThaiFullDate2().ToThaiNumber(), + checkedOutDate = timeStamps == null ? "" : + timeStamps.CheckOut != null ? + timeStamps.CheckOut.Value.ToThaiFullDate2().ToThaiNumber() : + "", }; employees.Add(emp); diff --git a/BMA.EHR.Leave.Service/Controllers/LeaveRequestController.cs b/BMA.EHR.Leave.Service/Controllers/LeaveRequestController.cs index d348973f..8cbcea53 100644 --- a/BMA.EHR.Leave.Service/Controllers/LeaveRequestController.cs +++ b/BMA.EHR.Leave.Service/Controllers/LeaveRequestController.cs @@ -894,7 +894,7 @@ namespace BMA.EHR.Leave.Service.Controllers LeaveLastEnd = lastLeaveRequest == null ? null : lastLeaveRequest.LeaveEndDate, //LeaveTotal = rawData.LeaveStartDate.DiffDay(rawData.LeaveEndDate), - LeaveTotal = sumLeave - (sumWeekend + sumHoliday), + LeaveTotal = rawData.LeaveTotal, LeaveBirthDate = profile.BirthDate, @@ -1401,7 +1401,7 @@ namespace BMA.EHR.Leave.Service.Controllers //LeaveTotal = rawData.LeaveStartDate.DiffDay(rawData.LeaveEndDate), - LeaveTotal = sumLeave - (sumHoliday + sumWeekend), + LeaveTotal = rawData.LeaveTotal, LeaveBirthDate = profile.BirthDate, LeaveGovernmentDate = profile.DateAppoint == null ? null : profile.DateAppoint.Value, diff --git a/BMA.EHR.Leave.Service/DTOs/LeaveRequest/GetLeaveRequestByIdDto.cs b/BMA.EHR.Leave.Service/DTOs/LeaveRequest/GetLeaveRequestByIdDto.cs index 1cb5d161..713a1b05 100644 --- a/BMA.EHR.Leave.Service/DTOs/LeaveRequest/GetLeaveRequestByIdDto.cs +++ b/BMA.EHR.Leave.Service/DTOs/LeaveRequest/GetLeaveRequestByIdDto.cs @@ -39,7 +39,7 @@ namespace BMA.EHR.Leave.Service.DTOs.LeaveRequest public DateTime? LeaveLastEnd { get; set; } = DateTime.MinValue; - public float LeaveTotal { get; set; } = 0; + public double LeaveTotal { get; set; } = 0; public DateTime? LeaveBirthDate { get; set; } = DateTime.MinValue; diff --git a/BMA.EHR.Leave.Service/DTOs/LeaveRequest/GetLeaveRequestForAdminByIdDto.cs b/BMA.EHR.Leave.Service/DTOs/LeaveRequest/GetLeaveRequestForAdminByIdDto.cs index 6a9b6b8c..a4830fdf 100644 --- a/BMA.EHR.Leave.Service/DTOs/LeaveRequest/GetLeaveRequestForAdminByIdDto.cs +++ b/BMA.EHR.Leave.Service/DTOs/LeaveRequest/GetLeaveRequestForAdminByIdDto.cs @@ -46,7 +46,7 @@ namespace BMA.EHR.Leave.Service.DTOs.LeaveRequest public DateTime? LeaveLastEnd { get; set; } = DateTime.MinValue; - public float LeaveTotal { get; set; } = 0; + public double LeaveTotal { get; set; } = 0; public DateTime? LeaveBirthDate { get; set; } = DateTime.MinValue;