From 751c1a4131b48452fb151ef44df4c571b5ce395e Mon Sep 17 00:00:00 2001 From: SamSys Date: Sat, 26 Jul 2025 16:05:25 +0330 Subject: [PATCH 1/3] change checkout footer [TotalPresent and TotalWorking] --- .../Repository/RollCallMandatoryRepository.cs | 10 ++++++++-- .../Admin/Pages/Company/Checkouts/Index.cshtml.cs | 11 ++++++----- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/CompanyManagment.EFCore/Repository/RollCallMandatoryRepository.cs b/CompanyManagment.EFCore/Repository/RollCallMandatoryRepository.cs index 8f82163b..4b06cb3f 100644 --- a/CompanyManagment.EFCore/Repository/RollCallMandatoryRepository.cs +++ b/CompanyManagment.EFCore/Repository/RollCallMandatoryRepository.cs @@ -825,10 +825,16 @@ public class RollCallMandatoryRepository : RepositoryBase, IRoll #region SaveRollCall GroupedRollCalls = groupedRollCall, - TotalWorkingTimeSpan = sumSpansWhitOutleaves, + //کارکرد واقعی - محاسبات شامل مرخصی افزوده شده + TotalWorkingTimeSpan = sumSpans, + // ساعت استراحت TotalBreakTimeSpan = totalBreakTime, - TotalPresentTimeSpan = sumSpansWhitOutleaves + totalBreakTime, + // ساعت حضور - بدون مرخصی افزده شده + TotalPresentTimeSpan = sumSpansWhitOutleaves, + + // مرخصی استحقاقی TotalPaidLeave = totalLeaveSpan, + //مرخصی استعلاجی TotalSickLeave = new TimeSpan(sickLeaveTimeSpans.Sum(x => x.Ticks)), #endregion }; diff --git a/ServiceHost/Areas/Admin/Pages/Company/Checkouts/Index.cshtml.cs b/ServiceHost/Areas/Admin/Pages/Company/Checkouts/Index.cshtml.cs index 6f130f0f..18adf7f2 100644 --- a/ServiceHost/Areas/Admin/Pages/Company/Checkouts/Index.cshtml.cs +++ b/ServiceHost/Areas/Admin/Pages/Company/Checkouts/Index.cshtml.cs @@ -1028,16 +1028,17 @@ public class IndexModel : PageModel TotalDayOfBunosesCompute = bunosesPay.Bunoses > 0 ? $"{bunosesPay.TotalDayCompute}" : "0", HolidayWorking = workshop.WorkshopHolidayWorking, ShiftWork = workingHours.ShiftWork, - + //کارکرد واقعی - محاسبات شامل مرخصی افزوده شده TotalWorkingTimeSpan = mandatoryCompute.TotalWorkingTimeSpan, - + //ساعت استراحت TotalBreakTimeSpan = mandatoryCompute.TotalBreakTimeSpan, - + // ساعت حضور - بدون مرخصی افزده شده TotalPresentTimeSpan = mandatoryCompute.TotalPresentTimeSpan, - + //مدت مرخصی استحقاقی TotalPaidLeave = mandatoryCompute.TotalPaidLeave, - + //مدت مرخصی استعلاجی TotalSickLeave = mandatoryCompute.TotalSickLeave, + //لیست حضورغیاب جهت ذخیره سازی GroupedRollCalls = mandatoryCompute.GroupedRollCalls, HasInsuranceChekoutOverTime = workshop.InsuranceCheckoutOvertime From 8dc839f561d07fffdb5ab2014b485991756cf3da Mon Sep 17 00:00:00 2001 From: SamSys Date: Sat, 26 Jul 2025 20:39:56 +0330 Subject: [PATCH 2/3] financialStatment row Balance bug fixed --- .../Company/InstitutionContracts/FinancialStatments.cshtml.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ServiceHost/Areas/Admin/Pages/Company/InstitutionContracts/FinancialStatments.cshtml.cs b/ServiceHost/Areas/Admin/Pages/Company/InstitutionContracts/FinancialStatments.cshtml.cs index e947c3d9..0c1c9588 100644 --- a/ServiceHost/Areas/Admin/Pages/Company/InstitutionContracts/FinancialStatments.cshtml.cs +++ b/ServiceHost/Areas/Admin/Pages/Company/InstitutionContracts/FinancialStatments.cshtml.cs @@ -413,8 +413,8 @@ public class FinancialStatmentsModel : PageModel var currentLastTransaction = currentTransactionsList .OrderByDescending(x => x.TdateGr).Select(x => x.TdateGr) .FirstOrDefault(); - var beforeCurrent10 = allTransactions.Where(x => x.TdateGr < currentFirstTransaction).ToList(); - var afterCurrent10 = allTransactions.Where(x => x.TdateGr > currentLastTransaction).ToList(); + var beforeCurrent10 = allTransactions.Take(pageIndex).ToList(); + var afterCurrent10 = allTransactions.Skip(pageIndex+pagination).ToList(); result.I = beforeCurrent10.Count + 1; result.CurrentPageNumber = pageNumber; //محاسبه تراکنش های قبل از 10 تای جاری From 41f39fb6fa339d9ceb74775057384628a7ff02e3 Mon Sep 17 00:00:00 2001 From: MahanCh Date: Mon, 28 Jul 2025 11:53:08 +0330 Subject: [PATCH 3/3] FIX: fix WeeklyOffDays Select On Null Error --- .../CustomizeWorkshopSettingsApplication.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/CompanyManagment.Application/CustomizeWorkshopSettingsApplication.cs b/CompanyManagment.Application/CustomizeWorkshopSettingsApplication.cs index 0167d8c4..b4f19256 100644 --- a/CompanyManagment.Application/CustomizeWorkshopSettingsApplication.cs +++ b/CompanyManagment.Application/CustomizeWorkshopSettingsApplication.cs @@ -154,7 +154,7 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo } - var offDays = command.OffDays.Select(x => new WeeklyOffDay(x)).ToList(); + var offDays = command.OffDays?.Select(x => new WeeklyOffDay(x)).ToList()??[]; var record = new CustomizeWorkshopSettings(workshopId, shiftCollection, command.LeavePermittedDays, command.WorkshopShiftStatus, command.HolidayWork, offDays); @@ -390,7 +390,7 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo //var commandOffDayHashSet = command.WeeklyOffDays.ToHashSet(); var commandOffDayHashSet = command.WeeklyOffDays?.ToHashSet() ?? []; - var groupOffDayHashSet = customizeWorkshopGroupSettings.WeeklyOffDays.Select(x => x.DayOfWeek).ToHashSet(); + var groupOffDayHashSet = customizeWorkshopGroupSettings.WeeklyOffDays?.Select(x => x.DayOfWeek).ToHashSet()??[]; if (command.WorkshopShiftStatus == WorkshopShiftStatus.Regular) { @@ -669,7 +669,7 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo #endregion - var offDays = weeklyOffDays.Select(x => new WeeklyOffDay(x)).ToList(); + var offDays = weeklyOffDays?.Select(x => new WeeklyOffDay(x)).ToList()??[]; using var transActionScope = new TransactionScope(); entity.ChangeWorkshopShifts(shiftCollection, workshopShiftStatus, holidayWork, offDays); @@ -723,7 +723,7 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo //var commandOffDayHashSet = command.OffDayOfWeeks.ToHashSet(); var commandOffDayHashSet = command.OffDayOfWeeks?.ToHashSet() ?? []; - var workshopOffDayHashSet = workshopSettings.WeeklyOffDays.Select(x => x.DayOfWeek).ToHashSet(); + var workshopOffDayHashSet = workshopSettings.WeeklyOffDays?.Select(x => x.DayOfWeek).ToHashSet()??[]; if (command.WorkshopShiftStatus == WorkshopShiftStatus.Regular) { @@ -871,7 +871,7 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo bool isChanged = false; var commandOffDayHashSet = command.WeeklyOffDays?.ToHashSet()??[]; - var groupOffDayHashSet = groupSettings.WeeklyOffDays.Select(x => x.DayOfWeek).ToHashSet(); + var groupOffDayHashSet = groupSettings.WeeklyOffDays?.Select(x => x.DayOfWeek).ToHashSet()??[]; if (command.WorkshopShiftStatus == WorkshopShiftStatus.Regular) { @@ -1034,7 +1034,7 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo } - var weeklyOffDays = command.WeeklyOffDays.Select(x => new WeeklyOffDay(x)).ToList(); + var weeklyOffDays = command.WeeklyOffDays?.Select(x => new WeeklyOffDay(x)).ToList()??[]; using var transaction = new TransactionScope(); entity.SimpleEdit(employeesShifts, command.IrregularShift, command.WorkshopShiftStatus, command.BreakTime, @@ -1442,7 +1442,7 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo var commandOffDayHashSet = command.WeeklyOffDays?.ToHashSet()??[]; - var entityOffDayHashSet = entity.WeeklyOffDays.Select(x => x.DayOfWeek).ToHashSet(); + var entityOffDayHashSet = entity.WeeklyOffDays?.Select(x => x.DayOfWeek).ToHashSet()??[]; bool isChanged; if (fridayPay == entity.FridayPay && overTimePay == entity.OverTimePay && baseYearsPay == entity.BaseYearsPay && bonusesPay == entity.BonusesPay @@ -1536,7 +1536,7 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo }).ToList(), //FridayWork = entity.FridayWork, HolidayWork = entity.HolidayWork, - WeeklyOffDays = entity.WeeklyOffDays.Select(x=>x.DayOfWeek).ToList(), + WeeklyOffDays = entity.WeeklyOffDays?.Select(x=>x.DayOfWeek).ToList()??[], CustomizeRotatingShiftsViewModels = entity.CustomizeRotatingShifts.Select(x => new CustomizeRotatingShiftsViewModel() { StartTime = x.StartTime.ToString("HH:mm"),