ปรับการคำนวน ขาด มาสาย ปกติ ถ้ามีการลาครึ่งวัน เช้า หรือ บ่าย ในส่วนตอนการปผระมวล และอนุมัติการลา
#2584
This commit is contained in:
parent
019a0a1be1
commit
2f2d7fe74c
2 changed files with 86 additions and 5 deletions
|
|
@ -1436,9 +1436,18 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
var leaveReq = await _leaveRequestRepository.GetLeavePeriodAsync(userId, currentDate.Date);
|
||||
if (leaveReq != null)
|
||||
{
|
||||
var startTimeAfternoon = duty.StartTimeAfternoon;
|
||||
var endTimeAfterNoon = duty.EndTimeAfternoon;
|
||||
var leaveRange = leaveReq.LeaveRange == null ? "" : leaveReq.LeaveRange.ToUpper();
|
||||
if (leaveRange == "MORNING" || leaveRange == "ALL")
|
||||
checkInStatus = "NORMAL";
|
||||
if(DateTime.Parse(currentDate.ToString("yyyy-MM-dd HH:mm")) >
|
||||
DateTime.Parse($"{currentDate.ToString("yyyy-MM-dd")} {startTimeAfternoon}"))
|
||||
checkInStatus = "LATE";
|
||||
else if(DateTime.Parse(currentDate.ToString("yyyy-MM-dd HH:mm")) >
|
||||
DateTime.Parse($"{currentDate.ToString("yyyy-MM-dd")} {endTimeAfterNoon}"))
|
||||
checkInStatus = "ABSENT";
|
||||
else
|
||||
checkInStatus = "NORMAL";
|
||||
else
|
||||
{
|
||||
checkInStatus = DateTime.Parse(currentDate.ToString("yyyy-MM-dd HH:mm")) >
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue