This commit is contained in:
chapal 2025-05-06 11:14:15 +06:00
parent a0150b0eed
commit 7b04c7a3e5

View File

@ -2454,23 +2454,26 @@ namespace HRM.DA
DataSet EmpOTHours = new ShiftTermService().GetEmpOT(oPayrollType.NextPayProcessDate, trm.ID); DataSet EmpOTHours = new ShiftTermService().GetEmpOT(oPayrollType.NextPayProcessDate, trm.ID);
foreach (DataRow Dr in EmpOTHours.Tables[0].Rows) foreach (DataRow Dr in EmpOTHours.Tables[0].Rows)
{ {
Employee tempEmployee = employees.Where(emp => emp.ID.ToString() == Dr["EmployeeID"].ToString()).FirstOrDefault(); //if (Convert.ToDouble(Dr["TotalOT"])>0)
if (tempEmployee == null || tempEmployee.IsEligibleOT == false) continue; //{
Employee tempEmployee = employees.Where(emp => emp.ID.ToString() == Dr["EmployeeID"].ToString()).FirstOrDefault();
if (tempEmployee == null || tempEmployee.IsEligibleOT == false) continue;
if (tempEmployee.GradeID == null) if (tempEmployee.GradeID == null)
{ {
ErrorList.Add(new SalaryProcessStatus(tempEmployee.EmployeeNo, tempEmployee.Name, "Grade not assinged")); ErrorList.Add(new SalaryProcessStatus(tempEmployee.EmployeeNo, tempEmployee.Name, "Grade not assinged"));
continue; continue;
} }
if (Dr["TotalOT"] == DBNull.Value) if (Dr["TotalOT"] == DBNull.Value)
{ {
// ErrorList.Add(new SalaryProcessStatus(tempEmployee.EmployeeNo, tempEmployee.Name, "value can't be null ")); // ErrorList.Add(new SalaryProcessStatus(tempEmployee.EmployeeNo, tempEmployee.Name, "value can't be null "));
continue; continue;
} }
EmpOverTimes = MakeEmployeeOvertimeObj(ref EmpOverTimes, ref ErrorList, tempEmployee, termParameters, EmpOverTimes = MakeEmployeeOvertimeObj(ref EmpOverTimes, ref ErrorList, tempEmployee, termParameters,
oPayrollType, trm.ID, Convert.ToDouble(Dr["TotalOT"]), userid); oPayrollType, trm.ID, Convert.ToDouble(Dr["TotalOT"]), userid);
//}
} }
} }
} }