fix : Logic check เตือนกรณีเช็คอินและเช็คเอาท์แล้ว ในวันนั้นๆ
Some checks failed
release-dev / release-dev (push) Failing after 13s

This commit is contained in:
Suphonchai Phoonsawat 2024-12-15 20:10:13 +07:00
parent 30281ff2ab
commit 6a3868fd0d

View file

@ -424,17 +424,16 @@ namespace BMA.EHR.Leave.Service.Controllers
}; };
} }
else else
{
if (data.CheckOut != null)
{ {
// ถ้า check-in + check-out ไปแล้ว // ถ้า check-in + check-out ไปแล้ว
if (data.CheckIn.Date == DateTime.Now.Date) if (data.CheckOut.Value.Date == DateTime.Now.Date)
{ {
return Error("คุณได้ทำการลงเวลาเข้าและออกเรียบร้อยแล้ว คุณจะสามารถลงเวลาได้อีกครั้งในวันถัดไป"); return Error("คุณได้ทำการลงเวลาเข้าและออกเรียบร้อยแล้ว คุณจะสามารถลงเวลาได้อีกครั้งในวันถัดไป");
} }
else
if (data.CheckOut != null)
{ {
ret = new CheckInResultDto ret = new CheckInResultDto
{ {
StartTimeMorning = duty == null ? "00:00" : duty.StartTimeMorning, StartTimeMorning = duty == null ? "00:00" : duty.StartTimeMorning,
@ -446,6 +445,7 @@ namespace BMA.EHR.Leave.Service.Controllers
CheckInId = null, CheckInId = null,
}; };
} }
}
else else
{ {
ret = new CheckInResultDto ret = new CheckInResultDto