Production bonus attendance report showing wrong hour

This commit is contained in:
chapal 2024-11-26 11:33:21 +06:00
parent 4488b66be3
commit efffc1667f
2 changed files with 11 additions and 11 deletions

View File

@ -713,13 +713,13 @@ namespace HRM.DA
if (dailyAtt.OutTime != null && dailyAtt.InTime != null && dailyAtt.OutTime != DateTime.MinValue && dailyAtt.InTime != DateTime.MinValue) if (dailyAtt.OutTime != null && dailyAtt.InTime != null && dailyAtt.OutTime != DateTime.MinValue && dailyAtt.InTime != DateTime.MinValue)
{ {
// oShift = oShifts.FirstOrDefault(x => x.ID == dailyAtt.ShiftID); // oShift = oShifts.FirstOrDefault(x => x.ID == dailyAtt.ShiftID);
if (oProductionBonusSetup.FromDate.Date == dailyAtt.AttnDate.Date) //if (oProductionBonusSetup.FromDate.Date == dailyAtt.AttnDate.Date)
bonusIntime = oProductionBonusSetup.FromDate > dailyAtt.InTime ? oProductionBonusSetup.FromDate : dailyAtt.InTime; // bonusIntime = oProductionBonusSetup.FromDate > dailyAtt.InTime ? oProductionBonusSetup.FromDate : dailyAtt.InTime;
else if (dailyAtt.InTime.GetValueOrDefault().TimeOfDay < tAtt.InTime.TimeOfDay) if (dailyAtt.InTime.GetValueOrDefault().TimeOfDay < tAtt.InTime.TimeOfDay)
bonusIntime = dailyAtt.InTime.GetValueOrDefault().Date.AddHours(tAtt.InTime.Hour).AddMinutes(tAtt.InTime.Minute); bonusIntime = dailyAtt.InTime.GetValueOrDefault().Date.AddHours(tAtt.InTime.Hour).AddMinutes(tAtt.InTime.Minute);
//if (oProductionBonusSetup.ToDate.Date == dailyAtt.AttnDate.Date) //if (oProductionBonusSetup.ToDate.Date == dailyAtt.AttnDate.Date)
// bonusOuttime = oProductionBonusSetup.ToDate < dailyAtt.OutTime ? oProductionBonusSetup.ToDate : dailyAtt.OutTime; // bonusOuttime = oProductionBonusSetup.ToDate < dailyAtt.OutTime ? oProductionBonusSetup.ToDate : dailyAtt.OutTime;
else if (dailyAtt.OutTime.GetValueOrDefault().TimeOfDay > tAtt.OutTime.TimeOfDay) if (dailyAtt.OutTime.GetValueOrDefault().TimeOfDay > tAtt.OutTime.TimeOfDay)
bonusOuttime = dailyAtt.OutTime.GetValueOrDefault().Date.AddHours(tAtt.OutTime.Hour).AddMinutes(tAtt.OutTime.Minute); bonusOuttime = dailyAtt.OutTime.GetValueOrDefault().Date.AddHours(tAtt.OutTime.Hour).AddMinutes(tAtt.OutTime.Minute);
//else if (oShift != null && dailyAtt.InTime.GetValueOrDefault().TimeOfDay < oShift.InTime.TimeOfDay) //else if (oShift != null && dailyAtt.InTime.GetValueOrDefault().TimeOfDay < oShift.InTime.TimeOfDay)
// bonusIntime = dailyAtt.InTime.GetValueOrDefault().Date.AddHours(oShift.InTime.Hour).AddMinutes(oShift.InTime.Minute); // bonusIntime = dailyAtt.InTime.GetValueOrDefault().Date.AddHours(oShift.InTime.Hour).AddMinutes(oShift.InTime.Minute);
@ -776,13 +776,13 @@ namespace HRM.DA
bonusOuttime = dailyAtt.OutTime; bonusOuttime = dailyAtt.OutTime;
//oShift = oShifts.FirstOrDefault(x => x.ID == dailyAtt.ShiftID); //oShift = oShifts.FirstOrDefault(x => x.ID == dailyAtt.ShiftID);
if (oProductionBonusSetup.FromDate.Date == dailyAtt.AttnDate.Date) //if (oProductionBonusSetup.FromDate.Date == dailyAtt.AttnDate.Date)
bonusIntime = oProductionBonusSetup.FromDate > dailyAtt.InTime ? oProductionBonusSetup.FromDate : dailyAtt.InTime; // bonusIntime = oProductionBonusSetup.FromDate > dailyAtt.InTime ? oProductionBonusSetup.FromDate : dailyAtt.InTime;
else if (dailyAtt.InTime.GetValueOrDefault().TimeOfDay < tAtt.InTime.TimeOfDay) if (dailyAtt.InTime.GetValueOrDefault().TimeOfDay < tAtt.InTime.TimeOfDay)
bonusIntime = dailyAtt.InTime.GetValueOrDefault().Date.AddHours(tAtt.InTime.Hour).AddMinutes(tAtt.InTime.Minute); bonusIntime = dailyAtt.InTime.GetValueOrDefault().Date.AddHours(tAtt.InTime.Hour).AddMinutes(tAtt.InTime.Minute);
//if (oProductionBonusSetup.ToDate.Date == dailyAtt.AttnDate.Date) //if (oProductionBonusSetup.ToDate.Date == dailyAtt.AttnDate.Date)
// bonusOuttime = oProductionBonusSetup.ToDate < dailyAtt.OutTime ? oProductionBonusSetup.ToDate : dailyAtt.OutTime; // bonusOuttime = oProductionBonusSetup.ToDate < dailyAtt.OutTime ? oProductionBonusSetup.ToDate : dailyAtt.OutTime;
else if (dailyAtt.OutTime.GetValueOrDefault().TimeOfDay > tAtt.OutTime.TimeOfDay) if (dailyAtt.OutTime.GetValueOrDefault().TimeOfDay > tAtt.OutTime.TimeOfDay)
bonusOuttime = dailyAtt.OutTime.GetValueOrDefault().Date.AddHours(tAtt.OutTime.Hour).AddMinutes(tAtt.OutTime.Minute); bonusOuttime = dailyAtt.OutTime.GetValueOrDefault().Date.AddHours(tAtt.OutTime.Hour).AddMinutes(tAtt.OutTime.Minute);
//else if (oShift != null && dailyAtt.InTime.GetValueOrDefault().TimeOfDay < oShift.InTime.TimeOfDay) //else if (oShift != null && dailyAtt.InTime.GetValueOrDefault().TimeOfDay < oShift.InTime.TimeOfDay)
// bonusIntime = dailyAtt.InTime.GetValueOrDefault().Date.AddHours(oShift.InTime.Hour).AddMinutes(oShift.InTime.Minute); // bonusIntime = dailyAtt.InTime.GetValueOrDefault().Date.AddHours(oShift.InTime.Hour).AddMinutes(oShift.InTime.Minute);

View File

@ -392,9 +392,9 @@ namespace HRM.Report
//else if (oShift != null && dailyAtt.InTime.Value.TimeOfDay < oShift.InTime.TimeOfDay) //else if (oShift != null && dailyAtt.InTime.Value.TimeOfDay < oShift.InTime.TimeOfDay)
// dailyAtt.InTime = dailyAtt.InTime.Value.Date.AddHours(oShift.InTime.Hour).AddMinutes(oShift.InTime.Minute); // dailyAtt.InTime = dailyAtt.InTime.Value.Date.AddHours(oShift.InTime.Hour).AddMinutes(oShift.InTime.Minute);
if (design.FromDate.Date == dailyAtt.AttnDate.Date) //if (design.FromDate.Date == dailyAtt.AttnDate.Date)
bonusIntime = design.FromDate > dailyAtt.InTime ? design.FromDate : dailyAtt.InTime; // bonusIntime = design.FromDate > dailyAtt.InTime ? design.FromDate : dailyAtt.InTime;
else if (dailyAtt.InTime.GetValueOrDefault().TimeOfDay < tAtt.InTime.TimeOfDay) if (dailyAtt.InTime.GetValueOrDefault().TimeOfDay < tAtt.InTime.TimeOfDay)
bonusIntime = dailyAtt.InTime.GetValueOrDefault().Date.AddHours(tAtt.InTime.Hour).AddMinutes(tAtt.InTime.Minute); bonusIntime = dailyAtt.InTime.GetValueOrDefault().Date.AddHours(tAtt.InTime.Hour).AddMinutes(tAtt.InTime.Minute);
//if (design.ToDate.Date == dailyAtt.AttnDate.Date) //if (design.ToDate.Date == dailyAtt.AttnDate.Date)
// bonusOuttime = design.ToDate < dailyAtt.OutTime ? design.ToDate : dailyAtt.OutTime; // bonusOuttime = design.ToDate < dailyAtt.OutTime ? design.ToDate : dailyAtt.OutTime;