From efffc1667fc60a22fd1b3d587aa953f043cf733f Mon Sep 17 00:00:00 2001 From: chapal Date: Tue, 26 Nov 2024 11:33:21 +0600 Subject: [PATCH] Production bonus attendance report showing wrong hour --- HRM.DA/Service/Bonus/ProdBonusProcessService.cs | 16 ++++++++-------- HRM.Report/Class/rptBonus.cs | 6 +++--- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/HRM.DA/Service/Bonus/ProdBonusProcessService.cs b/HRM.DA/Service/Bonus/ProdBonusProcessService.cs index f3ff4a8..b217c32 100644 --- a/HRM.DA/Service/Bonus/ProdBonusProcessService.cs +++ b/HRM.DA/Service/Bonus/ProdBonusProcessService.cs @@ -713,13 +713,13 @@ namespace HRM.DA if (dailyAtt.OutTime != null && dailyAtt.InTime != null && dailyAtt.OutTime != DateTime.MinValue && dailyAtt.InTime != DateTime.MinValue) { // oShift = oShifts.FirstOrDefault(x => x.ID == dailyAtt.ShiftID); - if (oProductionBonusSetup.FromDate.Date == dailyAtt.AttnDate.Date) - bonusIntime = oProductionBonusSetup.FromDate > dailyAtt.InTime ? oProductionBonusSetup.FromDate : dailyAtt.InTime; - else if (dailyAtt.InTime.GetValueOrDefault().TimeOfDay < tAtt.InTime.TimeOfDay) + //if (oProductionBonusSetup.FromDate.Date == dailyAtt.AttnDate.Date) + // bonusIntime = oProductionBonusSetup.FromDate > dailyAtt.InTime ? oProductionBonusSetup.FromDate : dailyAtt.InTime; + if (dailyAtt.InTime.GetValueOrDefault().TimeOfDay < tAtt.InTime.TimeOfDay) bonusIntime = dailyAtt.InTime.GetValueOrDefault().Date.AddHours(tAtt.InTime.Hour).AddMinutes(tAtt.InTime.Minute); //if (oProductionBonusSetup.ToDate.Date == dailyAtt.AttnDate.Date) // 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); //else if (oShift != null && dailyAtt.InTime.GetValueOrDefault().TimeOfDay < oShift.InTime.TimeOfDay) // bonusIntime = dailyAtt.InTime.GetValueOrDefault().Date.AddHours(oShift.InTime.Hour).AddMinutes(oShift.InTime.Minute); @@ -776,13 +776,13 @@ namespace HRM.DA bonusOuttime = dailyAtt.OutTime; //oShift = oShifts.FirstOrDefault(x => x.ID == dailyAtt.ShiftID); - if (oProductionBonusSetup.FromDate.Date == dailyAtt.AttnDate.Date) - bonusIntime = oProductionBonusSetup.FromDate > dailyAtt.InTime ? oProductionBonusSetup.FromDate : dailyAtt.InTime; - else if (dailyAtt.InTime.GetValueOrDefault().TimeOfDay < tAtt.InTime.TimeOfDay) + //if (oProductionBonusSetup.FromDate.Date == dailyAtt.AttnDate.Date) + // bonusIntime = oProductionBonusSetup.FromDate > dailyAtt.InTime ? oProductionBonusSetup.FromDate : dailyAtt.InTime; + if (dailyAtt.InTime.GetValueOrDefault().TimeOfDay < tAtt.InTime.TimeOfDay) bonusIntime = dailyAtt.InTime.GetValueOrDefault().Date.AddHours(tAtt.InTime.Hour).AddMinutes(tAtt.InTime.Minute); //if (oProductionBonusSetup.ToDate.Date == dailyAtt.AttnDate.Date) // 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); //else if (oShift != null && dailyAtt.InTime.GetValueOrDefault().TimeOfDay < oShift.InTime.TimeOfDay) // bonusIntime = dailyAtt.InTime.GetValueOrDefault().Date.AddHours(oShift.InTime.Hour).AddMinutes(oShift.InTime.Minute); diff --git a/HRM.Report/Class/rptBonus.cs b/HRM.Report/Class/rptBonus.cs index 8f56dac..55778cd 100644 --- a/HRM.Report/Class/rptBonus.cs +++ b/HRM.Report/Class/rptBonus.cs @@ -392,9 +392,9 @@ namespace HRM.Report //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); - if (design.FromDate.Date == dailyAtt.AttnDate.Date) - bonusIntime = design.FromDate > dailyAtt.InTime ? design.FromDate : dailyAtt.InTime; - else if (dailyAtt.InTime.GetValueOrDefault().TimeOfDay < tAtt.InTime.TimeOfDay) + //if (design.FromDate.Date == dailyAtt.AttnDate.Date) + // bonusIntime = design.FromDate > dailyAtt.InTime ? design.FromDate : dailyAtt.InTime; + if (dailyAtt.InTime.GetValueOrDefault().TimeOfDay < tAtt.InTime.TimeOfDay) bonusIntime = dailyAtt.InTime.GetValueOrDefault().Date.AddHours(tAtt.InTime.Hour).AddMinutes(tAtt.InTime.Minute); //if (design.ToDate.Date == dailyAtt.AttnDate.Date) // bonusOuttime = design.ToDate < dailyAtt.OutTime ? design.ToDate : dailyAtt.OutTime; -- 2.40.0.windows.1