Update LeaveController to conditionally set check-out time based on existing value and duty schedule
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m14s
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m14s
This commit is contained in:
parent
9bd6017ded
commit
ecf5ada7ed
1 changed files with 6 additions and 1 deletions
|
|
@ -3655,7 +3655,12 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
if (req.CheckOutStatus == "NORMAL" )
|
if (req.CheckOutStatus == "NORMAL" )
|
||||||
{
|
{
|
||||||
var checkOutTime = data.CheckOut != null ? data.CheckOut.Value : data.CheckIn;
|
var checkOutTime = data.CheckOut != null ? data.CheckOut.Value : data.CheckIn;
|
||||||
data.CheckOut = DateTime.Parse($"{checkOutTime.Date.ToString("yyyy-MM-dd")} {duty.EndTimeAfternoon}");
|
var oldCheckOutTime = data.CheckOut != null ? data.CheckOut.Value : DateTime.Now;
|
||||||
|
var roundCheckOutTime = DateTime.Parse($"{checkOutTime.Date.ToString("yyyy-MM-dd")} {duty.EndTimeAfternoon}");
|
||||||
|
if (oldCheckOutTime < roundCheckOutTime)
|
||||||
|
{
|
||||||
|
data.CheckOut = roundCheckOutTime;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue