diff --git a/CompanyManagment.EFCore/Repository/RollCallMandatoryRepository.cs b/CompanyManagment.EFCore/Repository/RollCallMandatoryRepository.cs index 873f14a9..c84c71b4 100644 --- a/CompanyManagment.EFCore/Repository/RollCallMandatoryRepository.cs +++ b/CompanyManagment.EFCore/Repository/RollCallMandatoryRepository.cs @@ -270,14 +270,16 @@ public class RollCallMandatoryRepository : RepositoryBase, IRoll { sumSpans = sumSpans.Add(starndardHoursesPerTotalDaysSapn); - } + totalLeaveSpan = starndardHoursesPerTotalDaysSapn; + } else { sumSpans = sumSpans.Add(totalLeave); - } + totalLeaveSpan = totalLeave; + } - totalLeaveSpan = totalLeave; + } else { @@ -315,8 +317,12 @@ public class RollCallMandatoryRepository : RepositoryBase, IRoll } else { - sumLeave = leavingDayCout * new TimeSpan(7, 20, 0); - } + var dayLeave = leavingDayCout * new TimeSpan(7, 20, 0); + + sumLeave = dayLeave.Add(hoursesleaveTimeSpans); + + + } if (sumLeave > starndardHoursesPerTotalDaysSapn) @@ -334,17 +340,17 @@ public class RollCallMandatoryRepository : RepositoryBase, IRoll } //اگر مرخصی روزانه نداشت و فقط مرخصی ساعتی داشت - if (leaveSearchResult.Count == 0 && hoursesleave.Count > 0) - { - if (hoursesleaveTimeSpans > starndardHoursesPerTotalDaysSapn) - { - sumSpans = sumSpans.Add(starndardHoursesPerTotalDaysSapn); - } - else - { - sumSpans = sumSpans.Add(hoursesleaveTimeSpans); - } - } + //if (leaveSearchResult.Count == 0 && hoursesleave.Count > 0) + //{ + // if (hoursesleaveTimeSpans > starndardHoursesPerTotalDaysSapn) + // { + // sumSpans = sumSpans.Add(starndardHoursesPerTotalDaysSapn); + // } + // else + // { + // sumSpans = sumSpans.Add(hoursesleaveTimeSpans); + // } + //} Console.WriteLine(sumSpans); #endregion //***********************************// @@ -365,7 +371,7 @@ public class RollCallMandatoryRepository : RepositoryBase, IRoll //TimeSpan mandatoryHoursTimeSpan = new TimeSpan(7, 20, 0).Multiply(mandatorDays); //TimeSpan Mandatory = sumSpansWhitOutleaves.Subtract(mandatoryHoursTimeSpan); - double mandatoryWorkWithOutleaves = (sumSpansWhitOutleaves.TotalMinutes) / 60; + double mandatoryWorkWithOutleaves = (sumSpans.TotalMinutes) / 60; double overTimeWork = 0; if (mandatoryWorkWithOutleaves > mandatoryHours) {