In this commit fixed the Bug #74 where when the regularization request sent it takes the date of request as checkout date
This commit is contained in:
parent
c7304dc80b
commit
a9f4610063
@ -275,7 +275,7 @@ namespace MarcoBMS.Services.Controllers
|
|||||||
|
|
||||||
if (recordAttendanceDot.MarkTime == null) return BadRequest(ApiResponse<object>.ErrorResponse("Invalid Mark Time", "Invalid Mark Time",400));
|
if (recordAttendanceDot.MarkTime == null) return BadRequest(ApiResponse<object>.ErrorResponse("Invalid Mark Time", "Invalid Mark Time",400));
|
||||||
|
|
||||||
DateTime finalDateTime = GetDateFromTimeStamp(recordAttendanceDot, recordAttendanceDot.MarkTime);
|
DateTime finalDateTime = GetDateFromTimeStamp(recordAttendanceDot.Date, recordAttendanceDot.MarkTime);
|
||||||
if (recordAttendanceDot.Comment == null) return BadRequest(ApiResponse<object>.ErrorResponse("Invalid Comment", "Invalid Comment", 400));
|
if (recordAttendanceDot.Comment == null) return BadRequest(ApiResponse<object>.ErrorResponse("Invalid Comment", "Invalid Comment", 400));
|
||||||
|
|
||||||
if (attendance != null)
|
if (attendance != null)
|
||||||
@ -298,7 +298,8 @@ namespace MarcoBMS.Services.Controllers
|
|||||||
}
|
}
|
||||||
else if (recordAttendanceDot.Action == ATTENDANCE_MARK_TYPE.REQUEST_REGULARIZE)
|
else if (recordAttendanceDot.Action == ATTENDANCE_MARK_TYPE.REQUEST_REGULARIZE)
|
||||||
{
|
{
|
||||||
|
DateTime date = attendance.AttendanceDate;
|
||||||
|
finalDateTime = GetDateFromTimeStamp(date.Date, recordAttendanceDot.MarkTime);
|
||||||
attendance.OutTime = finalDateTime;
|
attendance.OutTime = finalDateTime;
|
||||||
attendance.Activity = ATTENDANCE_MARK_TYPE.REQUEST_REGULARIZE;
|
attendance.Activity = ATTENDANCE_MARK_TYPE.REQUEST_REGULARIZE;
|
||||||
// do nothing
|
// do nothing
|
||||||
@ -399,9 +400,9 @@ namespace MarcoBMS.Services.Controllers
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static DateTime GetDateFromTimeStamp(RecordAttendanceDot recordAttendanceDot, string timeString)
|
private static DateTime GetDateFromTimeStamp(DateTime date, string timeString)
|
||||||
{
|
{
|
||||||
DateTime date = recordAttendanceDot.Date;
|
//DateTime date = recordAttendanceDot.Date;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user