diff --git a/Company.Domain/RollCallAgg/IRollCallRepository.cs b/Company.Domain/RollCallAgg/IRollCallRepository.cs index e2ca6eee..f93420a8 100644 --- a/Company.Domain/RollCallAgg/IRollCallRepository.cs +++ b/Company.Domain/RollCallAgg/IRollCallRepository.cs @@ -14,31 +14,30 @@ namespace Company.Domain.RollCallAgg EditRollCall GetByEmployeeIdAndWorkshopId(long employeeId, long workshopId); EditRollCall GetById(long id); - - - - - #region Pooya + + List GetOverlappedRollCallsWithLeaveInDates(long workshopId, DateTime start, + DateTime end); + + List GetWorkshopAbsentHistory(long workshopId, DateTime startSearch, - DateTime endSearch); - List GetEmployeeRollCallsHistoryAllByDate(long workshopId, long employeeId, DateTime start, DateTime end); + DateTime endSearch); void RemoveEmployeeRollCallsInDate(long workshopId, long employeeId, DateTime date); RollCallsByDateViewModel GetWorkshopRollCallHistory(RollCallSearchModel searchModel); CurrentDayRollCall GetWorkshopCurrentDayRollCalls(long workshopId); List GetEmployeeRollCallsForMonth(long employeeId, long workshopId, DateTime startDate, DateTime endDate); - List GetEmployeeRollCallsHistoryAll(long workshopId, long employeeId, DateTime start, DateTime end); - EmployeeRollCallsByMonthViewModel GetEmployeeRollCallsHistory(long employeeId, long workshopId, + List GetEmployeeRollCallsHistoryAllInDates(long workshopId, long employeeId, DateTime start, DateTime end); + + EmployeeRollCallsByMonthViewModel GetEmployeeRollCallsHistory(long employeeId, long workshopId, DateTime? startDateTime, DateTime? endDateTime, DateTime? exactDateTime, DateTime? monthIndex); void AddRange(List rollCalls); - + void UpdateRange(List rollCalls); List GetWorkshopEmployeeRollCallsForDate(long workshopId, long employeeId, DateTime date); - /// /// این متد تمام حضور غیاب های کات شده توسط بک گراند سرویس را به صورت تعداد روزانه برمیگرداند /// @@ -48,22 +47,17 @@ namespace Company.Domain.RollCallAgg /// لیستی از تعداد و روز آن List GetRollCallWorkFlowsCutByBgService(long workshopId, DateTime start, DateTime end); - /// - /// تمامی حضور غیاب های کات شده توسط بک گراند سرویس را برمیگرداند - /// - /// - /// - /// - int GetCountCutRollCallByBgService(long accId, long workshopId); + IEnumerable GetNotSlicedRollCallsByWorkshopId(long workshopId, DateTime durationStart, DateTime durationEnd); - - RollCallViewModel GetDetails(long rollCallId); + List GetRange(IEnumerable rollCallIds); + + List GetUndefinedRollCallWorkFlowsInDates(long workshopId, DateTime durationStart, DateTime durationEnd); TimeSpan GetEmployeeRollCallTimeSpanForDuration(long employeeId, long workshopId, DateTime start, DateTime end); - #endregion - long Flag(long employeeId, long workshopId); + #endregion + long Flag(long employeeId, long workshopId); /// /// چک می کند که اگر کارگر به تازگی خروج یا ورود زده است اجازه ثبت مجدد ندهد @@ -72,5 +66,7 @@ namespace Company.Domain.RollCallAgg /// /// string CheckRepeat(long employeeId, long workshopId); + + RollCallViewModel GetDetails(long rollCallId); } } diff --git a/CompanyManagment.App.Contracts/RollCall/CheckoutDailyRollCallViewModel.cs b/CompanyManagment.App.Contracts/RollCall/CheckoutDailyRollCallViewModel.cs index 5a3a09ca..ee7c9baa 100644 --- a/CompanyManagment.App.Contracts/RollCall/CheckoutDailyRollCallViewModel.cs +++ b/CompanyManagment.App.Contracts/RollCall/CheckoutDailyRollCallViewModel.cs @@ -19,8 +19,10 @@ namespace CompanyManagment.App.Contracts.RollCall public string TotalWorkingHours { get; set; } public string DayOfWeek { get; set; } + public TimeSpan BreakTimeTimeSpan { get; set; } + public string BreakTimeString { get; set; } - } + } #endregion } diff --git a/CompanyManagment.App.Contracts/RollCall/IRollCallApplication.cs b/CompanyManagment.App.Contracts/RollCall/IRollCallApplication.cs index f6e326c9..4f1b9423 100644 --- a/CompanyManagment.App.Contracts/RollCall/IRollCallApplication.cs +++ b/CompanyManagment.App.Contracts/RollCall/IRollCallApplication.cs @@ -17,7 +17,7 @@ namespace CompanyManagment.App.Contracts.RollCall EditRollCall GetById(long id); - List Search(RollCallSearchModel searchModel); + @@ -94,14 +94,6 @@ namespace CompanyManagment.App.Contracts.RollCall /// لیستی از تعداد و روز آن List GetRollCallWorkFlowsCutByBgService(long workshopId, DateTime start, DateTime end); - /// - /// تمامی حضور غیاب های کات شده توسط بک گراند سرویس را برمیگرداند - /// - /// - /// - /// - int GetCountCutRollCallByBgService(long accId, long workshopId); - IEnumerable GetNotSlicedRollCallsByWorkshopId(long workshopId, DateTime durationStart, DateTime durationEnd); RollCallViewModel GetDetails(long rollCallId); #endregion diff --git a/CompanyManagment.App.Contracts/RollCall/OverlappedRollCallWithLeave.cs b/CompanyManagment.App.Contracts/RollCall/OverlappedRollCallWithLeave.cs new file mode 100644 index 00000000..b6ffe862 --- /dev/null +++ b/CompanyManagment.App.Contracts/RollCall/OverlappedRollCallWithLeave.cs @@ -0,0 +1,17 @@ +using System; + +namespace CompanyManagment.App.Contracts.RollCall; + +public class OverlappedRollCallWithLeave +{ + public long RollCallId { get; set; } + public long EmployeeId { get; set; } + public long LeaveId { get; set; } + public string EmployeeFullName { get; set; } + public DateTime StartOfOverlapDateTime { get; set; } + public DateTime EndOfOverlapDateTime { get; set; } + public string StartOfOverlapDateFa { get; set; } + public string EndOfOverlapDateFa { get; set; } + public string StartOfOverlapTime { get; set; } + public string EndOfOverlapTime { get; set; } +} \ No newline at end of file diff --git a/CompanyManagment.App.Contracts/RollCall/RollCallViewModel.cs b/CompanyManagment.App.Contracts/RollCall/RollCallViewModel.cs index 89562c65..32101935 100644 --- a/CompanyManagment.App.Contracts/RollCall/RollCallViewModel.cs +++ b/CompanyManagment.App.Contracts/RollCall/RollCallViewModel.cs @@ -13,7 +13,9 @@ public class RollCallViewModel public string EmployeeFullName { get; set; } public string DateFa { get; set; } public DateTime DateGr { get; set; } - public DateTime? StartDate { get; set; } + public string StartDayOfWeekFa { get; set; } + public string EndDayOfWeekFa { get; set; } + public DateTime? StartDate { get; set; } public DateTime? EndDate { get; set; } public TimeSpan ShiftSpan { get; set; } public DateTime CreationDate { get; set; } diff --git a/CompanyManagment.App.Contracts/RollCall/RollCallsByDateViewModel.cs b/CompanyManagment.App.Contracts/RollCall/RollCallsByDateViewModel.cs index bf76a815..680baf82 100644 --- a/CompanyManagment.App.Contracts/RollCall/RollCallsByDateViewModel.cs +++ b/CompanyManagment.App.Contracts/RollCall/RollCallsByDateViewModel.cs @@ -8,7 +8,8 @@ namespace CompanyManagment.App.Contracts.RollCall public string DateFa { get; set; } public DateTime DateGr { get; set; } public IEnumerable ActiveEmployees { get; set; } - public string DayOfWeekFa { get; set; } + public int ActiveEmployeesCount { get; set; } + public string DayOfWeekFa { get; set; } public bool IsHoliday { get; set; } public bool IsFriday { get; set; } } diff --git a/CompanyManagment.Application/LeaveApplication.cs b/CompanyManagment.Application/LeaveApplication.cs index 6263f2f3..0a518b01 100644 --- a/CompanyManagment.Application/LeaveApplication.cs +++ b/CompanyManagment.Application/LeaveApplication.cs @@ -396,7 +396,7 @@ public class LeaveApplication : ILeaveApplication public OperationResult ValidateNewLeaveWithExistingRollCalls(long workshopId, long employeeId, string paidLeaveType, DateTime start, DateTime end) { OperationResult op = new(); - var rollCallsInDate = _rollCallRepository.GetEmployeeRollCallsHistoryAllByDate(workshopId, employeeId, start, end); + var rollCallsInDate = _rollCallRepository.GetEmployeeRollCallsHistoryAllInDates(workshopId, employeeId, start, end); if (paidLeaveType == "ساعتی") { if (rollCallsInDate.Any(x => x.EndDate >= start && x.StartDate <= end)) diff --git a/CompanyManagment.Application/RollCallApplication.cs b/CompanyManagment.Application/RollCallApplication.cs index 0c7ecc6a..d809cd43 100644 --- a/CompanyManagment.Application/RollCallApplication.cs +++ b/CompanyManagment.Application/RollCallApplication.cs @@ -70,10 +70,7 @@ public class RollCallApplication : IRollCallApplication return _rollCallRepository.GetById(id); } - public List Search(RollCallSearchModel searchModel) - { - return _rollCallRepository.Search(searchModel); - } + #region Pooya @@ -353,13 +350,9 @@ public class RollCallApplication : IRollCallApplication public List GetRollCallWorkFlowsCutByBgService(long workshopId, DateTime start, DateTime end) { return _rollCallRepository.GetRollCallWorkFlowsCutByBgService(workshopId, start, end); - } - public int GetCountCutRollCallByBgService(long accId, long workshopId) - { - return _rollCallRepository.GetCountCutRollCallByBgService(accId, workshopId); - } + public RollCallViewModel GetDetails(long rollCallId) diff --git a/CompanyManagment.EFCore/Repository/RollCallMandatoryRepository.cs b/CompanyManagment.EFCore/Repository/RollCallMandatoryRepository.cs index 199ed7cb..7057c1c7 100644 --- a/CompanyManagment.EFCore/Repository/RollCallMandatoryRepository.cs +++ b/CompanyManagment.EFCore/Repository/RollCallMandatoryRepository.cs @@ -505,17 +505,18 @@ CreateWorkingHoursTemp command, long leavId) return res; } - private TimeSpan CalculateBreakTime(BreakTime breakTime, TimeSpan sumOneDaySpan) + public static TimeSpan CalculateBreakTime(BreakTime breakTime, TimeSpan sumOneDaySpan) { if (breakTime.BreakTimeType != BreakTimeType.WithTime) - return TimeSpan.Zero; + return new TimeSpan(); var breakTimeSpan = breakTime.BreakTimeValue.ToTimeSpan(); if (breakTimeSpan * 2 >= sumOneDaySpan) - return TimeSpan.Zero; + return new TimeSpan(); return breakTimeSpan; ; + } public TimeSpan AfterSubtract(CreateWorkingHoursTemp command, TimeSpan sumOneDaySpan, DateTime creationDate) diff --git a/CompanyManagment.EFCore/Repository/RollCallRepository.cs b/CompanyManagment.EFCore/Repository/RollCallRepository.cs index 844baf72..9798bbca 100644 --- a/CompanyManagment.EFCore/Repository/RollCallRepository.cs +++ b/CompanyManagment.EFCore/Repository/RollCallRepository.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Globalization; using System.Linq; using _0_Framework.Application; +using _0_Framework.Domain.CustomizeCheckoutShared.Base; +using _0_Framework.Domain.CustomizeCheckoutShared.ValueObjects; using _0_Framework.InfraStructure; using Company.Domain.RollCallAgg; using CompanyManagment.App.Contracts.HolidayItem; @@ -32,15 +34,19 @@ public class RollCallRepository : RepositoryBase, IRollCallRepos throw new NotImplementedException(); } - + #region Pooya + + public List GetRollCallWorkFlowsCutByBgService(long workshopId, DateTime start, DateTime end) { + var personnelCode = _context.PersonnelCodeSet.Where(x => x.WorkshopId == workshopId); + var rollCalls = _context.RollCalls - .Where(x => x.RollCallModifyType == RollCallModifyType.CutByBgService && x.WorkshopId == workshopId && + .Where(x => personnelCode.Any(y => y.EmployeeId == x.EmployeeId) && x.RollCallModifyType == RollCallModifyType.CutByBgService && x.WorkshopId == workshopId && x.StartDate.Value.Date >= start.Date && x.StartDate.Value.Date <= end.Date).ToList(); var names = _context.RollCallEmployees.Where(x => x.WorkshopId == workshopId) @@ -65,45 +71,19 @@ public class RollCallRepository : RepositoryBase, IRollCallRepos .ToList(); } - - - public int GetCountCutRollCallByBgService(long accId, long workshopId) - { - return _context.RollCalls.Where(x => - x.WorkshopId == workshopId && x.RollCallModifyType == RollCallModifyType.CutByBgService) - .GroupBy(x => x.StartDate!.Value.Date) - .Count(); - } - - public IEnumerable GetNotSlicedRollCallsByWorkshopId(long workshopId, DateTime durationStart, DateTime durationEnd) - { - if (durationEnd.Date >= DateTime.Now.Date) - durationEnd = DateTime.Now.AddDays(-1).Date; - - var names = _context.RollCallEmployees.Where(x => x.WorkshopId == workshopId).ToList(); - - var rollCalls = _context.RollCalls.Where(x => x.WorkshopId == workshopId && - x.StartDate.Value.Date >= durationStart && x.StartDate.Value.Date <= durationEnd && x.EndDate.HasValue).ToList(); - if (rollCalls == null || !rollCalls.Any()) - return new List(); - return rollCalls.GroupBy(x => x.StartDate.Value.Date).SelectMany(x => - x.GroupBy(y => y.EmployeeId).Where(y => y.Count() == 1) - .SelectMany(y => y)).Select(x => new RollCallViewModel - { - Id = x.id, - StartDate = x.StartDate.Value, - EndDate = x.EndDate.Value, - EmployeeId = x.EmployeeId, - DateGr = x.StartDate.Value.Date, - EmployeeFullName = names.FirstOrDefault(y => y.EmployeeId == x.EmployeeId)?.EmployeeFullName ?? "" - }); - } - - //حضور غیاب فیش حقوقی + //حضور غیاب در پرینت فیش حقوقی رسمی public List GetEmployeeRollCallsForMonth(long employeeId, long workshopId, DateTime startMonthDay, DateTime endMonthDay) { + //گرفتن ساعت استراحت پرسنل از تنظیمات + #region breakTime + BaseCustomizeEntity settings = _context.CustomizeWorkshopEmployeeSettings.AsSplitQuery().FirstOrDefault(x => + x.WorkshopId == workshopId && x.EmployeeId == employeeId); + //اگر ساعت استراحت پرسنل وجود نداشت صفر است + var breakTime = settings == null ? new BreakTime(false, new TimeOnly()) : settings.BreakTime; + #endregion + var rollCalls = _context.RollCalls.Where(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId && x.StartDate != null && x.EndDate != null && x.RollCallModifyType != RollCallModifyType.Undefined && x.StartDate.Value.Date >= startMonthDay && x.StartDate.Value.Date <= endMonthDay).ToList(); @@ -144,7 +124,13 @@ public class RollCallRepository : RepositoryBase, IRollCallRepos var presentDays = rollCalls.GroupBy(x => x.StartDate!.Value.Date).Select(x => { + var orderedRollcalls = x.OrderBy(y => y.StartDate!.Value); + + var rollCallTimeSpanPerDay = + new TimeSpan(x.Where(y => y.EndDate != null).Sum(y => (y.EndDate - y.StartDate)!.Value.Ticks)); + var breakTimePerDay = RollCallMandatoryRepository.CalculateBreakTime(breakTime, rollCallTimeSpanPerDay); + return new CheckoutDailyRollCallViewModel() { StartDate1 = orderedRollcalls.FirstOrDefault().StartDate.Value.ToString("HH:mm"), @@ -153,8 +139,10 @@ public class RollCallRepository : RepositoryBase, IRollCallRepos StartDate2 = orderedRollcalls.Skip(1).FirstOrDefault()?.StartDate?.ToString("HH:mm") ?? "", EndDate2 = orderedRollcalls.Skip(1).FirstOrDefault()?.EndDate?.ToString("HH:mm") ?? "", - TotalhourseSpan = - new TimeSpan(x.Where(y => y.EndDate != null).Sum(y => (y.EndDate - y.StartDate)!.Value.Ticks)), + TotalhourseSpan = rollCallTimeSpanPerDay - breakTimePerDay, + + BreakTimeTimeSpan = breakTimePerDay, + DayOfWeek = x.Key.DayOfWeek.DayOfWeeKToPersian(), RollCallDateFa = x.Key.Date.ToFarsi(), DateTimeGr = x.Key.Date, @@ -170,6 +158,7 @@ public class RollCallRepository : RepositoryBase, IRollCallRepos EndDate2 = x.EndDate2, StartDate2 = x.StartDate2, TotalWorkingHours = $"{(int)(x.TotalhourseSpan.TotalHours)}:{x.TotalhourseSpan.Minutes.ToString("00")}", + BreakTimeString = $"{(int)(x.BreakTimeTimeSpan.TotalHours)}:{x.BreakTimeTimeSpan.Minutes.ToString("00")}", DayOfWeek = x.DayOfWeek, RollCallDateFa = x.RollCallDateFa, DateTimeGr = x.DateTimeGr, @@ -180,46 +169,37 @@ public class RollCallRepository : RepositoryBase, IRollCallRepos return presentDays.Concat(absentRecords).OrderBy(x => x.DateTimeGr).ToList(); } - - - - public List GetEmployeeRollCallsHistoryAll(long workshopId, long employeeId, DateTime start, DateTime end) - { - return _context.RollCalls.Where(x => x.WorkshopId == workshopId && x.EmployeeId == employeeId && x.EndDate.Value >= start && - x.StartDate.Value <= end) - .Select(x => new RollCallViewModel - { - EmployeeId = employeeId, - WorkshopId = workshopId, - StartDate = x.StartDate, - EndDate = x.EndDate - }).ToList(); - } - - + //محاسبه کارکرد پرسنل در هنگام جستجو public TimeSpan GetEmployeeRollCallTimeSpanForDuration(long employeeId, long workshopId, DateTime start, DateTime end) { - var rollCalls = _context.RollCalls.Where(x => - x.EmployeeId == employeeId && x.WorkshopId == workshopId && x.StartDate != null && x.EndDate != null && x.RollCallModifyType != RollCallModifyType.Undefined && - x.StartDate.Value.Date >= start && x.StartDate.Value.Date <= end).ToList(); + var rollCalls = _context.RollCalls.Where(x => + x.EmployeeId == employeeId && x.WorkshopId == workshopId && x.StartDate != null && x.EndDate != null && x.RollCallModifyType != RollCallModifyType.Undefined && + x.StartDate.Value.Date >= start && x.StartDate.Value.Date <= end).ToList(); - return new TimeSpan(rollCalls.Sum(x => (x.EndDate - x.StartDate).Value.Ticks)); + + return new TimeSpan(rollCalls.Sum(x => (x.EndDate - x.StartDate).Value.Ticks)); } - //جستجوی سوابق حضور غیاب بر اساس کارمند - public EmployeeRollCallsByMonthViewModel GetEmployeeRollCallsHistory(long employeeId, long workshopId, + + + + //جستجوی سوابق حضور غیاب بر اساس کارمند + public EmployeeRollCallsByMonthViewModel GetEmployeeRollCallsHistory(long employeeId, long workshopId, DateTime? startDateTime, DateTime? endDateTime, DateTime? exactDateTime, DateTime? dateIndex) { + if (!_context.PersonnelCodeSet.Any(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId)) + return null; + //get RollCallEmployee and RollCallEmployeeStatus for that employee in that workshop var employeeRollCallStatuses = _context.RollCallEmployees.Include(x => x.EmployeesStatus) .FirstOrDefault(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId); //if none was found return empty - if (employeeRollCallStatuses == null) - return new(); + if (employeeRollCallStatuses == null || employeeRollCallStatuses.EmployeesStatus == null || !employeeRollCallStatuses.EmployeesStatus.Any()) + return null; //this list will have all the months which employee was active in var activeMonths = new List(); @@ -286,7 +266,8 @@ public class RollCallRepository : RepositoryBase, IRollCallRepos var leavesQuery = _context.LeaveList.Where(x => (x.LeaveType == "استعلاجی" || (x.LeaveType == "استحقاقی" && x.PaidLeaveType == "روزانه")) && x.IsAccepted && - x.EndLeave >= selectedMonthFirstDay && x.StartLeave < nextMonthFirstDay && x.WorkshopId == workshopId && x.EmployeeId == employeeId); + x.EndLeave >= selectedMonthFirstDay && x.StartLeave < nextMonthFirstDay && + x.WorkshopId == workshopId && x.EmployeeId == employeeId); var rollCalls = _context.RollCalls.Where(x => x.EmployeeId == employeeId && !leavesQuery.Any(y => @@ -295,11 +276,11 @@ public class RollCallRepository : RepositoryBase, IRollCallRepos x.StartDate >= selectedMonthFirstDay && x.StartDate < nextMonthFirstDay && x.RollCallModifyType != RollCallModifyType.Undefined); //changeByfarrokhi - //#region changeByfarrokhi - //var rollCalls = _context.RollCalls.Where(x => - //x.EmployeeId == employeeId && - //x.WorkshopId == workshopId && x.StartDate != null && - //x.StartDate >= selectedMonthFirstDay && x.StartDate < nextMonthFirstDay && x.RollCallModifyType != RollCallModifyType.Undefined); + // #region changeByfarrokhi + // var rollCalls = _context.RollCalls.Where(x => + // x.EmployeeId == employeeId && + // x.WorkshopId == workshopId && x.StartDate != null && + // x.StartDate >= selectedMonthFirstDay && x.StartDate < nextMonthFirstDay && x.RollCallModifyType != RollCallModifyType.Undefined); //#endregion var personnelCode = @@ -322,7 +303,7 @@ public class RollCallRepository : RepositoryBase, IRollCallRepos if (exactDateTime.HasValue || (startDateTime.HasValue && endDateTime.HasValue)) completeDaysList = completeDaysList.Where(x => x.Date >= startSearch.Date && x.Date <= endSearch.Date); - var result = completeDaysList.Where(x => !rollCallsList.Any(y => y.StartDate.Value.Date == x.Date && y.EndDate == null) && + var result = completeDaysList.Where(x => !rollCallsList.Any(y => y.StartDate.Value.Date == x.Date.Date && y.EndDate == null) && statusesOfMonth.Any(y => x >= y.StartDate.Date && x <= y.EndDate.Date)) .Select(x => { @@ -353,9 +334,9 @@ public class RollCallRepository : RepositoryBase, IRollCallRepos DayOfWeekFa = x.DateGr.DayOfWeek.DayOfWeeKToPersian(), IsHoliday = _holidayItemApplication.IsHoliday(x.DateGr), IsAbsent = !x.RollCallTimesList.Any(), - HasLeave = x.HasLeave, RollCallTimesList = x.RollCallTimesList, - TotalWorkingHours = $"{(int)x.TotalWorkingHoursSpan.TotalHours}:{x.TotalWorkingHoursSpan.Minutes.ToString("00")}", + HasLeave = x.HasLeave, + TotalWorkingHours = $"{(int)x.TotalWorkingHoursSpan.TotalHours}:{x.TotalWorkingHoursSpan.Minutes.ToString("00")}" }).ToList(); return new EmployeeRollCallsByMonthViewModel() { @@ -368,70 +349,14 @@ public class RollCallRepository : RepositoryBase, IRollCallRepos }; } - public void AddRange(List rollCalls) + //Without Paginate + public List GetEmployeeRollCallsHistoryAllInDates(long workshopId, long employeeId, DateTime start, DateTime end) { - _context.RollCalls.AddRange(rollCalls); - } + var withPersonnelCode = _context.PersonnelCodeSet.Where(x => x.WorkshopId == workshopId); - //سوابق غیبت - public List GetWorkshopAbsentHistory(long workshopId, DateTime startSearch, DateTime endSearch) - { - if (endSearch.Date == DateTime.Now.Date) - endSearch = endSearch.AddDays(-1); - //get leaves for workshop that have been activated in dateIndex date - var leavesQuery = _context.LeaveList.Where(x => x.WorkshopId == workshopId && - x.IsAccepted && (x.LeaveType == "استعلاجی" || (x.LeaveType == "استحقاقی" && x.PaidLeaveType == "روزانه")) && - x.EndLeave.Date >= startSearch.Date && x.StartLeave.Date <= endSearch.Date); - - //roll calls for current workshop where shift start is in dateIndex date (filters today's shifts) - var rollCallsQuery = _context.RollCalls - .Where(x => x.WorkshopId == workshopId && x.StartDate.HasValue && - x.StartDate.Value.Date >= startSearch.Date && x.StartDate.Value.Date <= endSearch.Date && - x.RollCallModifyType != RollCallModifyType.Undefined); - - - - //get active employees of workshop in dateIndex date - var activeEmployeesQuery = - _context.RollCallEmployees.Include(x => x.EmployeesStatus) - .Where(x => x.WorkshopId == workshopId && x.EmployeesStatus.Any(y => y.EndDate.Date >= startSearch && y.StartDate.Date <= endSearch)); - var rollCallsList = rollCallsQuery.ToList(); - var activatedEmployeesList = activeEmployeesQuery.ToList(); - var leavesList = leavesQuery.ToList(); - - - - int daysCount = (int)((endSearch.Date - startSearch.Date).TotalDays + 1); - List days = Enumerable.Range(0, daysCount).Select(x => startSearch.Date.AddDays(x)).ToList(); - List result = new(); - foreach (var day in days) - { - var item = new RollCallsByDateViewModel() - { - DateGr = day, - DateFa = day.ToFarsi(), - ActiveEmployees = activatedEmployeesList.Where(x => x.EmployeesStatus.Any(y => y.StartDate.Date <= day && y.EndDate.Date >= day) && - !leavesList.Any(y => y.EmployeeId == x.EmployeeId && y.StartLeave.Date <= day && y.EndLeave.Date >= day) && - !rollCallsList.Any(rc => rc.EmployeeId == x.EmployeeId && rc.StartDate.Value.Date == day.Date)) - .Select(x => new RollCallViewModel() - { - EmployeeId = x.EmployeeId, - EmployeeFullName = x.EmployeeFullName, - Id = x.id, - WorkshopId = x.WorkshopId - }), - IsHoliday = _holidayItemApplication.IsHoliday(day), - IsFriday = day.DayOfWeek == DayOfWeek.Friday - }; - result.Add(item); - } - return result; - } - - public List GetEmployeeRollCallsHistoryAllByDate(long workshopId, long employeeId, DateTime start, DateTime end) - { return _context.RollCalls.Where(x => x.WorkshopId == workshopId && x.EmployeeId == employeeId && - x.EndDate.Value.Date >= start.Date && x.StartDate.Value.Date <= end.Date) + withPersonnelCode.Any(y => y.EmployeeId == x.EmployeeId) && + (x.EndDate == null || x.EndDate.Value.Date >= start.Date) && x.StartDate.Value.Date <= end.Date) .Select(x => new RollCallViewModel { EmployeeId = employeeId, @@ -441,6 +366,7 @@ public class RollCallRepository : RepositoryBase, IRollCallRepos }).ToList(); } + //سوابق حضور غیاب کارگاه public RollCallsByDateViewModel GetWorkshopRollCallHistory(RollCallSearchModel searchModel) { @@ -487,20 +413,18 @@ public class RollCallRepository : RepositoryBase, IRollCallRepos //roll calls for current workshop where shift start is in dateIndex date (filters today's shifts) var rollCallsQuery = _context.RollCalls - .Where(x => x.WorkshopId == searchModel.WorkshopId && x.StartDate.HasValue && x.StartDate < DateTime.Now.Date && + .Where(x => x.WorkshopId == searchModel.WorkshopId && x.StartDate.HasValue && x.RollCallModifyType != RollCallModifyType.Undefined && x.StartDate < DateTime.Now.Date && x.StartDate.Value.Date == dateIndex.Date); + var personnelCodeQuery = _context.PersonnelCodeSet.Where(x => x.WorkshopId == searchModel.WorkshopId); //get active employees of workshop in dateIndex date var activeEmployeesQuery = _context.RollCallEmployees.Include(x => x.EmployeesStatus) - .Where(x => x.WorkshopId == searchModel.WorkshopId && x.EmployeesStatus.Any(y => y.EndDate.Date >= dateIndex && y.StartDate.Date <= dateIndex) + .Where(x => x.WorkshopId == searchModel.WorkshopId && personnelCodeQuery.Any(y => y.EmployeeId == x.EmployeeId) && + x.EmployeesStatus.Any(y => y.EndDate.Date >= dateIndex && y.StartDate.Date <= dateIndex) && !rollCallsQuery.Any(rc => rc.EmployeeId == x.EmployeeId && !rc.EndDate.HasValue)); - - - - if (searchModel.EmployeeId > 0) { rollCallsQuery = rollCallsQuery.Where(x => x.EmployeeId == searchModel.EmployeeId); @@ -509,8 +433,7 @@ public class RollCallRepository : RepositoryBase, IRollCallRepos } - var personnelCodeList = - _context.PersonnelCodeSet.Where(x => activeEmployeesQuery.Any(y => y.EmployeeId == x.EmployeeId && y.WorkshopId == x.WorkshopId)); + var personnelCodeList = personnelCodeQuery.ToList(); var activatedEmployeesList = activeEmployeesQuery.ToList(); rollCallsQuery = rollCallsQuery.Where(x => x.EndDate.HasValue); var rollCallsList = rollCallsQuery.ToList(); @@ -554,11 +477,124 @@ public class RollCallRepository : RepositoryBase, IRollCallRepos HasLeave = x.HasLeave, IsAbsent = x.IsAbsent, PersonnelCode = x.PersonnelCode, - TotalWorkingHours = $"{(int)x.TotalWorkingHoursSpan.TotalHours}:{(x.TotalWorkingHoursSpan.Minutes):00}" + TotalWorkingHours = $"{(int)x.TotalWorkingHoursSpan.TotalHours}:{(x.TotalWorkingHoursSpan.Minutes).ToString("00")}" }); return result; } + + public RollCallsByDateViewModel GetWorkshopRollCallHistoryCollapsed(RollCallSearchModel searchModel) + { + + //initialize + + DateTime searchDurationEnd = DateTime.Now.AddDays(-1).Date; + DateTime searchDurationStart = searchDurationEnd.AddDays(-16); + + + + //override if user has entered inputs (dates must be validated in the application layer) + if (!string.IsNullOrWhiteSpace(searchModel.StarDateFa) && !string.IsNullOrWhiteSpace(searchModel.StarDateFa)) + { + searchDurationEnd = searchModel.EndDateFa.ToGeorgianDateTime().Date; + searchDurationStart = searchModel.StarDateFa.ToGeorgianDateTime().AddDays(-1).Date; + } + + + + else + if (!string.IsNullOrWhiteSpace(searchModel.ExactDateFa)) + { + searchDurationEnd = searchModel.ExactDateFa.ToGeorgianDateTime().Date; + searchDurationStart = searchModel.ExactDateFa.ToGeorgianDateTime().AddDays(-1).Date; + } + + + if (searchDurationEnd < searchDurationStart) + return new(); + + + + DateTime dateIndex = searchDurationEnd.AddDays(-1 * (searchModel.DateIndex)).Date; + + if (dateIndex <= searchDurationStart) + return new(); + + var activeEmployeesList = + _context.RollCallEmployees.Include(x => x.EmployeesStatus) + .Where(x => x.WorkshopId == searchModel.WorkshopId && + x.EmployeesStatus.Any(y => y.EndDate.Date >= dateIndex && y.StartDate.Date <= dateIndex)).ToList(); + + var result = new RollCallsByDateViewModel() + { + DateGr = dateIndex, + DayOfWeekFa = dateIndex.DayOfWeek.DayOfWeeKToPersian(), + IsHoliday = _holidayItemApplication.IsHoliday(dateIndex), + DateFa = dateIndex.ToFarsi(), + ActiveEmployeesCount = activeEmployeesList.Count() + }; + return result; + } + //سوابق غیبت + public List GetWorkshopAbsentHistory(long workshopId, DateTime startSearch, DateTime endSearch) + { + if (endSearch.Date == DateTime.Now.Date) + endSearch = endSearch.AddDays(-1); + //get leaves for workshop that have been activated in dateIndex date + var leavesQuery = _context.LeaveList.Where(x => x.WorkshopId == workshopId && + x.IsAccepted && (x.LeaveType == "استعلاجی" || (x.LeaveType == "استحقاقی" && x.PaidLeaveType == "روزانه")) && + x.EndLeave.Date >= startSearch.Date && x.StartLeave.Date <= endSearch.Date); + + //roll calls for current workshop where shift start is in dateIndex date (filters today's shifts) + var rollCallsQuery = _context.RollCalls + .Where(x => x.WorkshopId == workshopId && x.StartDate.HasValue && + x.StartDate.Value.Date >= startSearch.Date && x.StartDate.Value.Date <= endSearch.Date && + x.RollCallModifyType != RollCallModifyType.Undefined); + + + var withPersonnelCode = _context.PersonnelCodeSet.Where(x => x.WorkshopId == workshopId); + + //get active employees of workshop in dateIndex date + var activeEmployeesQuery = + _context.RollCallEmployees.Include(x => x.EmployeesStatus) + .Where(x => x.WorkshopId == workshopId && + x.EmployeesStatus.Any(y => y.EndDate.Date >= startSearch && y.StartDate.Date <= endSearch) && + withPersonnelCode.Any(y => y.EmployeeId == x.EmployeeId)); + + + var rollCallsList = rollCallsQuery.ToList(); + var activatedEmployeesList = activeEmployeesQuery.ToList(); + var leavesList = leavesQuery.ToList(); + + + + int daysCount = (int)((endSearch.Date - startSearch.Date).TotalDays + 1); + List days = Enumerable.Range(0, daysCount).Select(x => startSearch.Date.AddDays(x)).ToList(); + List result = new(); + foreach (var day in days) + { + var item = new RollCallsByDateViewModel() + { + DateGr = day, + DateFa = day.ToFarsi(), + ActiveEmployees = activatedEmployeesList.Where(x => x.EmployeesStatus.Any(y => y.StartDate.Date <= day && y.EndDate.Date >= day) && + !leavesList.Any(y => y.EmployeeId == x.EmployeeId && y.StartLeave.Date <= day && y.EndLeave.Date >= day) && + !rollCallsList.Any(rc => rc.EmployeeId == x.EmployeeId && rc.StartDate.Value.Date == day.Date)) + .Select(x => new RollCallViewModel() + { + EmployeeId = x.EmployeeId, + EmployeeFullName = x.EmployeeFullName, + Id = x.id, + WorkshopId = x.WorkshopId + }), + IsHoliday = _holidayItemApplication.IsHoliday(day), + IsFriday = day.DayOfWeek == DayOfWeek.Friday + }; + result.Add(item); + } + return result; + } + //گزارش آنلاین حضور غیاب کارگاه public CurrentDayRollCall GetWorkshopCurrentDayRollCalls(long workshopId) { @@ -583,14 +619,13 @@ public class RollCallRepository : RepositoryBase, IRollCallRepos //get activated employees var activeEmployees = _context.RollCallEmployees.Include(x => x.EmployeesStatus) - .Where(x => x.WorkshopId == workshopId && x.IsActiveString == "true" && x.EmployeesStatus.Any(y => - y.StartDate.Date <= date && - y.EndDate.Date >= date)); + .Where(x => x.WorkshopId == workshopId && personnelCodes.Any(y => y.EmployeeId == x.EmployeeId) && + x.EmployeesStatus.Any(y => y.StartDate.Date <= date && y.EndDate.Date >= date)); //get today's roll calls var rollCallsQuery = _context.RollCalls.Where(x => - x.WorkshopId == workshopId && (x.StartDate.Value.Date == date || x.EndDate == null)); + x.WorkshopId == workshopId && (x.StartDate.Value.Date == date || x.EndDate == null) && x.RollCallModifyType != RollCallModifyType.Undefined); @@ -663,6 +698,67 @@ public class RollCallRepository : RepositoryBase, IRollCallRepos .ThenByDescending(x => x.RollCallTimesList.Max(y => y.StartDate)).ToList() }; } + public void AddRange(List rollCalls) + { + _context.RollCalls.AddRange(rollCalls); + } + + //تداخل مرخصی در کارپوشه + public List GetOverlappedRollCallsWithLeaveInDates(long workshopId, DateTime start, + DateTime end) + { + + var rollCalls = _context.RollCalls.Where(x => x.WorkshopId == workshopId && x.EndDate.Value.Date >= start.Date && + x.StartDate.Value.Date <= end).ToList(); + + var leaves = + _context.LeaveList.Where(x => x.WorkshopId == workshopId && x.EndLeave >= start && x.StartLeave <= end).ToList(); + + + + var overlappedRollCalls = rollCalls.Where(x => leaves.Any(y => x.EmployeeId == y.EmployeeId && + x.EndDate.Value >= y.StartLeave && + x.StartDate.Value <= y.EndLeave)); + + + + var result = overlappedRollCalls.Select(x => + { + var leave = leaves.FirstOrDefault(y => x.EmployeeId == y.EmployeeId && + x.EndDate.Value >= y.StartLeave && + x.StartDate.Value <= y.EndLeave); + return new OverlappedRollCallWithLeave() + { + RollCallId = x.id, + LeaveId = leave.id, + StartOfOverlapDateTime = leave.StartLeave > x.StartDate.Value ? leave.StartLeave : x.StartDate.Value, + EndOfOverlapDateTime = leave.EndLeave < x.EndDate ? leave.EndLeave : x.EndDate.Value, + EmployeeFullName = x.EmployeeFullName, + EmployeeId = x.EmployeeId + }; + }).ToList(); + + return result.Select(x => new OverlappedRollCallWithLeave() + { + RollCallId = x.RollCallId, + LeaveId = x.LeaveId, + StartOfOverlapDateTime = x.StartOfOverlapDateTime, + EndOfOverlapDateTime = x.EndOfOverlapDateTime, + StartOfOverlapDateFa = x.StartOfOverlapDateTime.ToFarsi(), + EndOfOverlapDateFa = x.EndOfOverlapDateTime.ToFarsi(), + EndOfOverlapTime = x.EndOfOverlapDateTime.ToString("HH:mm"), + StartOfOverlapTime = x.StartOfOverlapDateTime.ToString("HH:mm"), + EmployeeFullName = x.EmployeeFullName, + EmployeeId = x.EmployeeId + + }).ToList(); + } + + + public void UpdateRange(List rollCalls) + { + _context.RollCalls.UpdateRange(rollCalls); + } public void RemoveEmployeeRollCallsInDate(long workshopId, long employeeId, DateTime date) { @@ -699,29 +795,83 @@ public class RollCallRepository : RepositoryBase, IRollCallRepos DateFa = x.DateFa, StartDateFa = x.StartDateFa, EndDateFa = x.EndDateFa, - EmployeeId = names.FirstOrDefault(e => e.EmployeeId == employeeId)!.EmployeeId, - EmployeeFullName = names.FirstOrDefault(e => e.EmployeeId == employeeId)!.EmployeeFullName + EmployeeId = employeeId, + EmployeeFullName = names.FirstOrDefault(e => e.EmployeeId == employeeId)!.EmployeeFullName, + DayOfWeekFa = x.StartDate.Value.DayOfWeek.DayOfWeeKToPersian(), + StartDayOfWeekFa = x.StartDate.Value.DayOfWeek.DayOfWeeKToPersian(), + EndDayOfWeekFa = x.EndDate.Value.DayOfWeek.DayOfWeeKToPersian(), + TotalWorkingHoursSpan = x.EndDate.Value - x.StartDate.Value }).ToList(); } - - public RollCallViewModel GetDetails(long rollCallId) + public IEnumerable GetNotSlicedRollCallsByWorkshopId(long workshopId, DateTime durationStart, DateTime durationEnd) { - var entity = _context.RollCalls.FirstOrDefault(x => x.id == rollCallId); - if (entity == null) - return null; - var name = _context.RollCallEmployees.FirstOrDefault(x => x.WorkshopId == entity.WorkshopId && x.EmployeeId == entity.EmployeeId).EmployeeFullName; - return new RollCallViewModel - { - WorkshopId = entity.WorkshopId, - EmployeeId = entity.EmployeeId, - StartDate = entity.StartDate.Value, - EndDate = entity.EndDate.Value, - EmployeeFullName = name, - Id = entity.id, - DateGr = entity.StartDate.Value.Date - }; - } + if (durationEnd.Date >= DateTime.Now.Date) + durationEnd = DateTime.Now.AddDays(-1).Date; + var names = _context.RollCallEmployees.Where(x => x.WorkshopId == workshopId).ToList(); + + var rollCalls = _context.RollCalls.Where(x => x.WorkshopId == workshopId && + x.StartDate.Value.Date >= durationStart && x.StartDate.Value.Date <= durationEnd && x.EndDate.HasValue).ToList(); + if (rollCalls == null || !rollCalls.Any()) + return new List(); + return rollCalls.GroupBy(x => x.StartDate.Value.Date).SelectMany(x => + x.GroupBy(y => y.EmployeeId).Where(y => y.Count() == 1) + .SelectMany(y => y)).Select(x => new RollCallViewModel + { + Id = x.id, + StartDate = x.StartDate.Value, + EndDate = x.EndDate.Value, + EmployeeId = x.EmployeeId, + DateGr = x.StartDate.Value.Date, + EmployeeFullName = names.FirstOrDefault(y => y.EmployeeId == x.EmployeeId)?.EmployeeFullName ?? "" + }); + + } + public List GetRange(IEnumerable rollCallIds) + { + var query = _context.RollCalls.Where(x => rollCallIds.Contains(x.id)); + var names = _context.RollCallEmployees.Where(x => query.Any(y => y.EmployeeId == x.EmployeeId && y.WorkshopId == x.WorkshopId)).ToList(); + + + return query.Select(x => new RollCallViewModel + { + StartDate = x.StartDate.Value, + EndDate = x.EndDate.Value, + Id = x.id, + EmployeeFullName = names.FirstOrDefault(y => y.EmployeeId == x.EmployeeId && y.WorkshopId == x.WorkshopId).EmployeeFullName + }).ToList(); + } + public List GetUndefinedRollCallWorkFlowsInDates(long workshopId, DateTime start, DateTime end) + { + { + var rollCalls = _context.RollCalls.IgnoreQueryFilters() + .Where(x => x.RollCallModifyType == RollCallModifyType.Undefined && x.WorkshopId == workshopId && + x.StartDate.Value.Date >= start.Date && x.StartDate.Value.Date <= end.Date).ToList(); + + var names = _context.RollCallEmployees.Where(x => x.WorkshopId == workshopId) + .Select(x => new { x.EmployeeId, x.WorkshopId, x.EmployeeFullName }).ToList(); + + + var result = rollCalls.GroupBy(x => x.StartDate!.Value.Date) + .Select(g => new RollCallsByDateViewModel() + { + DateGr = g.Key, + DateFa = g.Key.ToFarsi(), + DayOfWeekFa = g.Key.DayOfWeek.DayOfWeeKToPersian(), + ActiveEmployees = g.Select(x => new RollCallViewModel() + { + EmployeeId = x.EmployeeId, + EmployeeFullName = names.FirstOrDefault(y => y.EmployeeId == x.EmployeeId)?.EmployeeFullName ?? "", + WorkshopId = x.WorkshopId, + Id = x.id, + StartDate = x.StartDate, + EndDate = x.EndDate + }) + }) + .ToList(); + return result; + } + } #endregion public long Flag(long employeeId, long workshopId) { @@ -777,4 +927,23 @@ public class RollCallRepository : RepositoryBase, IRollCallRepos } } + + + public RollCallViewModel GetDetails(long rollCallId) + { + var entity = _context.RollCalls.FirstOrDefault(x => x.id == rollCallId); + if (entity == null) + return null; + var name = _context.RollCallEmployees.FirstOrDefault(x => x.WorkshopId == entity.WorkshopId && x.EmployeeId == entity.EmployeeId).EmployeeFullName; + return new RollCallViewModel + { + WorkshopId = entity.WorkshopId, + EmployeeId = entity.EmployeeId, + StartDate = entity.StartDate.Value, + EndDate = entity.EndDate.Value, + EmployeeFullName = name, + Id = entity.id, + DateGr = entity.StartDate.Value.Date + }; + } } \ No newline at end of file diff --git a/ServiceHost/Areas/Admin/Pages/Company/Checkouts/PrintDetailsRollCall.cshtml b/ServiceHost/Areas/Admin/Pages/Company/Checkouts/PrintDetailsRollCall.cshtml index 92ae4dfe..7539c77a 100644 --- a/ServiceHost/Areas/Admin/Pages/Company/Checkouts/PrintDetailsRollCall.cshtml +++ b/ServiceHost/Areas/Admin/Pages/Company/Checkouts/PrintDetailsRollCall.cshtml @@ -309,12 +309,13 @@ تاریخ - ورود - خروج - ورود - خروج - منقطع - ساعت کارکرد + ورود + خروج + ورود + خروج + استراحت + منقطع + ساعت کارکرد @@ -326,6 +327,7 @@ @Model.MonthlyRollCall[i].EndDate1 @Model.MonthlyRollCall[i].StartDate2 @Model.MonthlyRollCall[i].EndDate2 + @Model.MonthlyRollCall[i].BreakTimeString @if (@Model.MonthlyRollCall[i].IsSliced) { @@ -350,12 +352,13 @@ تاریخ - ورود - خروج - ورود - خروج - منقطع - ساعت کارکرد + ورود + خروج + ورود + خروج + استراحت + منقطع + ساعت کارکرد @@ -370,6 +373,7 @@ @day.EndDate1 @day.StartDate2 @day.EndDate2 + @day.BreakTimeString @if (day.IsSliced) { diff --git a/ServiceHost/Areas/Admin/Pages/Company/Checkouts/_Partials/PrintDetailsRollCallRaw.cshtml b/ServiceHost/Areas/Admin/Pages/Company/Checkouts/_Partials/PrintDetailsRollCallRaw.cshtml index 72569d15..10256756 100644 --- a/ServiceHost/Areas/Admin/Pages/Company/Checkouts/_Partials/PrintDetailsRollCallRaw.cshtml +++ b/ServiceHost/Areas/Admin/Pages/Company/Checkouts/_Partials/PrintDetailsRollCallRaw.cshtml @@ -306,12 +306,13 @@ تاریخ - ورود - خروج - ورود - خروج - منقطع - ساعت کارکرد + ورود + خروج + ورود + خروج + استراحت + منقطع + ساعت کارکرد @@ -323,6 +324,7 @@ @Model.MonthlyRollCall[i].EndDate1 @Model.MonthlyRollCall[i].StartDate2 @Model.MonthlyRollCall[i].EndDate2 + @Model.MonthlyRollCall[i].BreakTimeString @if (@Model.MonthlyRollCall[i].IsSliced) { @@ -347,12 +349,13 @@ تاریخ - ورود - خروج - ورود - خروج - منقطع - ساعت کارکرد + ورود + خروج + ورود + خروج + استراحت + منقطع + ساعت کارکرد @@ -367,6 +370,7 @@ @day.EndDate1 @day.StartDate2 @day.EndDate2 + @day.BreakTimeString @if (day.IsSliced) { diff --git a/ServiceHost/Areas/Client/Pages/Company/Checkouts/PrintOneRollCall.cshtml b/ServiceHost/Areas/Client/Pages/Company/Checkouts/PrintOneRollCall.cshtml index 67894a20..c75d5f60 100644 --- a/ServiceHost/Areas/Client/Pages/Company/Checkouts/PrintOneRollCall.cshtml +++ b/ServiceHost/Areas/Client/Pages/Company/Checkouts/PrintOneRollCall.cshtml @@ -309,12 +309,13 @@ تاریخ - ورود - خروج - ورود - خروج - منقطع - ساعت کارکرد + ورود + خروج + ورود + خروج + استراحت + منقطع + ساعت کارکرد @@ -326,6 +327,7 @@ @Model.MonthlyRollCall[i].EndDate1 @Model.MonthlyRollCall[i].StartDate2 @Model.MonthlyRollCall[i].EndDate2 + @Model.MonthlyRollCall[i].BreakTimeString @if (@Model.MonthlyRollCall[i].IsSliced) { @@ -350,12 +352,13 @@ تاریخ - ورود - خروج - ورود - خروج - منقطع - ساعت کارکرد + ورود + خروج + ورود + خروج + استراحت + منقطع + ساعت کارکرد @@ -370,6 +373,7 @@ @day.EndDate1 @day.StartDate2 @day.EndDate2 + @day.BreakTimeString @if (day.IsSliced) { diff --git a/ServiceHost/Areas/Client/Pages/Company/Checkouts/_Partials/PrintDetailsRollCallRaw.cshtml b/ServiceHost/Areas/Client/Pages/Company/Checkouts/_Partials/PrintDetailsRollCallRaw.cshtml index 6cc9a668..7b13f045 100644 --- a/ServiceHost/Areas/Client/Pages/Company/Checkouts/_Partials/PrintDetailsRollCallRaw.cshtml +++ b/ServiceHost/Areas/Client/Pages/Company/Checkouts/_Partials/PrintDetailsRollCallRaw.cshtml @@ -296,12 +296,13 @@ تاریخ - ورود - خروج - ورود - خروج - منقطع - ساعت کارکرد + ورود + خروج + ورود + خروج + استراحت + منقطع + ساعت کارکرد @@ -313,6 +314,7 @@ @Model.MonthlyRollCall[i].EndDate1 @Model.MonthlyRollCall[i].StartDate2 @Model.MonthlyRollCall[i].EndDate2 + @Model.MonthlyRollCall[i].BreakTimeString @if (@Model.MonthlyRollCall[i].IsSliced) { @@ -337,12 +339,13 @@ تاریخ - ورود - خروج - ورود - خروج - منقطع - ساعت کارکرد + ورود + خروج + ورود + خروج + استراحت + منقطع + ساعت کارکرد @@ -357,6 +360,7 @@ @day.EndDate1 @day.StartDate2 @day.EndDate2 + @day.BreakTimeString @if (day.IsSliced) {