From 428c90af398033b079d4578e81ea059ab3693814 Mon Sep 17 00:00:00 2001 From: chapal Date: Sun, 24 Nov 2024 15:22:42 +0600 Subject: [PATCH] Prod process --- .../Service/Bonus/ProdBonusProcessService.cs | 4 +-- HRM.Report/Class/rptBonus.cs | 29 +++++++++++-------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/HRM.DA/Service/Bonus/ProdBonusProcessService.cs b/HRM.DA/Service/Bonus/ProdBonusProcessService.cs index ff1d0dc..f3ff4a8 100644 --- a/HRM.DA/Service/Bonus/ProdBonusProcessService.cs +++ b/HRM.DA/Service/Bonus/ProdBonusProcessService.cs @@ -710,7 +710,7 @@ namespace HRM.DA { bonusIntime = dailyAtt.InTime; bonusOuttime = dailyAtt.OutTime; - if (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); if (oProductionBonusSetup.FromDate.Date == dailyAtt.AttnDate.Date) @@ -770,7 +770,7 @@ namespace HRM.DA double wh = 0; if (dailyAtt != null) { - if (dailyAtt.OutTime != DateTime.MinValue && dailyAtt.InTime != DateTime.MinValue) + if (dailyAtt.OutTime != null && dailyAtt.InTime != null && dailyAtt.OutTime != DateTime.MinValue && dailyAtt.InTime != DateTime.MinValue) { bonusIntime = dailyAtt.InTime; bonusOuttime = dailyAtt.OutTime; diff --git a/HRM.Report/Class/rptBonus.cs b/HRM.Report/Class/rptBonus.cs index 4647443..8f56dac 100644 --- a/HRM.Report/Class/rptBonus.cs +++ b/HRM.Report/Class/rptBonus.cs @@ -356,28 +356,31 @@ namespace HRM.Report } if (prodAttn != null && prodAttn.Count > 0) { + foreach (Employee item in attnEmp) { List tempAttn = prodAttn.Where(o => o.EmployeeID == item.ID).ToList();//.Sum(x => x.BonusHour); double hour = 0; + foreach (ProdBonusAttn tAtt in tempAttn) { - + + DailyAttnProcess dailyAtt = oDailyAttnProsess.FirstOrDefault(o => o.AttnDate.Date == tAtt.InTime.Date && - o.EmployeeID == item.ID && - (o.AttenType == EnumAttendanceType.Present || - o.AttenType == EnumAttendanceType.HalfDay || - o.AttenType == EnumAttendanceType.Delay || - o.AttenType == EnumAttendanceType.Early || - o.AttenType == EnumAttendanceType.Late || - o.AttenType == EnumAttendanceType.OutSideDuty)); - + o.EmployeeID == item.ID && + (o.AttenType == EnumAttendanceType.Present || + o.AttenType == EnumAttendanceType.HalfDay || + o.AttenType == EnumAttendanceType.Delay || + o.AttenType == EnumAttendanceType.Early || + o.AttenType == EnumAttendanceType.Late || + o.AttenType == EnumAttendanceType.OutSideDuty)); + double wh = 0; if (dailyAtt != null) { - - if (dailyAtt.OutTime != DateTime.MinValue && dailyAtt.InTime != DateTime.MinValue) + + if (dailyAtt.OutTime != null && dailyAtt.InTime != null && dailyAtt.OutTime != DateTime.MinValue && dailyAtt.InTime != DateTime.MinValue) { bonusIntime = dailyAtt.InTime; bonusOuttime = dailyAtt.OutTime; @@ -428,13 +431,14 @@ namespace HRM.Report } + } if (dTable.Rows.Count > 0) { GlobalFunctions.bDataFound = true; } - + DataSet dSet = new DataSet(); dTable.TableName = "PayrollDataSet_dtProdAttendance"; @@ -451,6 +455,7 @@ namespace HRM.Report //form.CommonReportViewer(null, RDLC, dSet, _reportParameters, true); ReportProcessor reportProcessor = new ReportProcessor(); return reportProcessor.CommonReportViewForReports(null, dSet, null, RDLC, _reportParameters, true, payrollTypeId, reportType); + } #endregion Production Bonus