workflow Holidays bug fixed
This commit is contained in:
@@ -554,7 +554,7 @@ public class RollCallApplication : IRollCallApplication
|
||||
//---
|
||||
|
||||
|
||||
if (result == null || !result.All(x => employeeStatuses.Any(y => x.Start >= y.StartDateGr || x.End <= y.EndDateGr)))
|
||||
if (result == null || !result.All(newRollcall => employeeStatuses.Any(status => newRollcall.Start >= status.StartDateGr && newRollcall.End <= status.EndDateGr)))
|
||||
return operation.Failed("کارمند در بازه وارد شده غیر فعال است");
|
||||
|
||||
|
||||
|
||||
@@ -89,7 +89,8 @@ public class HolidayItemRepository : RepositoryBase<long, HolidayItem>, IHoliday
|
||||
Id = x.id,
|
||||
Holidaydate = x.Holidaydate.ToFarsi(),
|
||||
HolidayId = x.HolidayId,
|
||||
HolidayYear = x.HolidayYear
|
||||
HolidayYear = x.HolidayYear,
|
||||
HolidaydateGr = x.Holidaydate
|
||||
});
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.HolidayYear))
|
||||
query = query.Where(x => x.HolidayYear.Contains(searchModel.HolidayYear));
|
||||
|
||||
@@ -792,9 +792,10 @@ public class RollCallRepository : RepositoryBase<long, RollCall>, IRollCallRepos
|
||||
{
|
||||
|
||||
List<RollCallEmployee> activatedEmployeesListInDay = new();
|
||||
bool isHoliday = totalHolidays.Any(x => x.HolidaydateGr == day);
|
||||
|
||||
//in working days everyone should be present
|
||||
if (day.DayOfWeek != DayOfWeek.Friday && totalHolidays.All(x => x.HolidaydateGr != day))
|
||||
if (day.DayOfWeek != DayOfWeek.Friday && !isHoliday)
|
||||
{
|
||||
activatedEmployeesListInDay = activatedEmployeesList;
|
||||
}
|
||||
@@ -832,7 +833,7 @@ public class RollCallRepository : RepositoryBase<long, RollCall>, IRollCallRepos
|
||||
Id = x.id,
|
||||
WorkshopId = x.WorkshopId
|
||||
}),
|
||||
IsHoliday = _holidayItemApplication.IsHoliday(day),
|
||||
IsHoliday = isHoliday,
|
||||
IsFriday = day.DayOfWeek == DayOfWeek.Friday
|
||||
};
|
||||
result.Add(item);
|
||||
|
||||
Reference in New Issue
Block a user