From df390729444dbc6479195bacb86b082b2a4d082d Mon Sep 17 00:00:00 2001 From: MahanCh Date: Tue, 26 Aug 2025 13:52:21 +0330 Subject: [PATCH] feat: add employee mandatory hours to print layouts and view models --- .../Checkout/CheckoutViewModel.cs | 3 +- .../CheckoutApplication.cs | 1 + .../Repository/CheckoutRepository.cs | 4 +- .../Pages/Company/Checkouts/Details.cshtml | 14 +- .../Checkouts/PrintDetailsRollCall.cshtml | 719 +++++++++++------- .../_Partials/PrintDetailStaticRaw.cshtml | 15 +- .../_Partials/PrintDetailsRollCallRaw.cshtml | 16 +- .../Pages/Company/Checkouts/PrintAll.cshtml | 2 - .../Pages/Company/Checkouts/PrintOne.cshtml | 16 +- .../Company/Checkouts/PrintOneMobile.cshtml | 14 +- .../Company/Checkouts/PrintOneRollCall.cshtml | 59 +- .../_Partials/PrintDetailStaticRaw.cshtml | 397 ++++++---- .../_Partials/PrintDetailsRollCallRaw.cshtml | 440 +++++++---- 13 files changed, 1054 insertions(+), 646 deletions(-) diff --git a/CompanyManagment.App.Contracts/Checkout/CheckoutViewModel.cs b/CompanyManagment.App.Contracts/Checkout/CheckoutViewModel.cs index a797b4f4..3777ab46 100644 --- a/CompanyManagment.App.Contracts/Checkout/CheckoutViewModel.cs +++ b/CompanyManagment.App.Contracts/Checkout/CheckoutViewModel.cs @@ -142,7 +142,8 @@ public class CheckoutViewModel public List SalaryAidViewModels { get; set; } public CheckoutRollCallViewModel CheckoutRollCall { get; set; } public bool HasAmountConflict { get; set; } - + public string EmployeeMandatoryHoursStr { get; set; } + public TimeSpan EmployeeMandatoryHoursTimeSpan { get; set; } } public class CheckoutRollCallViewModel diff --git a/CompanyManagment.Application/CheckoutApplication.cs b/CompanyManagment.Application/CheckoutApplication.cs index 2d588780..4101295b 100644 --- a/CompanyManagment.Application/CheckoutApplication.cs +++ b/CompanyManagment.Application/CheckoutApplication.cs @@ -496,6 +496,7 @@ public class CheckoutApplication : ICheckoutApplication x.TotalPresentTimeStr = Tools.ToFarsiHoursAndMinutes((int)totalPresent.TotalHours, totalPresent.Minutes, "-"); x.TotalMandatoryTimeStr = Tools.ToFarsiHoursAndMinutes(mandatoryWholeHours, mandatoryMinutes, "-"); + } }); diff --git a/CompanyManagment.EFCore/Repository/CheckoutRepository.cs b/CompanyManagment.EFCore/Repository/CheckoutRepository.cs index ba897573..31ed49dd 100644 --- a/CompanyManagment.EFCore/Repository/CheckoutRepository.cs +++ b/CompanyManagment.EFCore/Repository/CheckoutRepository.cs @@ -981,10 +981,12 @@ public class CheckoutRepository : RepositoryBase, ICheckoutRepos Id = d.Id, SecondEndDate = d.SecondEndDate, SecondStartDate = d.SecondStartDate, - }).ToList() + }).ToList(), } : null, HasAmountConflict =x.HasAmountConflict, + EmployeeMandatoryHoursTimeSpan = x.EmployeeMandatoryHours, + EmployeeMandatoryHoursStr = Tools.ToFarsiHoursAndMinutes((int)x.EmployeeMandatoryHours.TotalHours,x.EmployeeMandatoryHours.Minutes,"-") }).SingleOrDefault(x => x.Id == item); var workshopName = _context.Workshops.FirstOrDefault(x => x.id == ch.WorkshopId); ch.WorkshopName = workshopName.WorkshopName; diff --git a/ServiceHost/Areas/Admin/Pages/Company/Checkouts/Details.cshtml b/ServiceHost/Areas/Admin/Pages/Company/Checkouts/Details.cshtml index 04966c77..95c72111 100644 --- a/ServiceHost/Areas/Admin/Pages/Company/Checkouts/Details.cshtml +++ b/ServiceHost/Areas/Admin/Pages/Company/Checkouts/Details.cshtml @@ -848,9 +848,17 @@ } - - موظفی @Model.Month @Model.Year : @Model.TotalMandatoryTimeStr - ساعات کارکرد واقعی : @Model.TotalWorkingTimeStr + + + + + + + + + +
موظفی @Model.Month @Model.Year : @Model.TotalMandatoryTimeStr موظفی پرسنل @Model.Month @Model.Year : @Model.EmployeeMandatoryHoursStr ساعات کارکرد واقعی : @Model.TotalWorkingTimeStr
+ diff --git a/ServiceHost/Areas/Admin/Pages/Company/Checkouts/PrintDetailsRollCall.cshtml b/ServiceHost/Areas/Admin/Pages/Company/Checkouts/PrintDetailsRollCall.cshtml index 56f4c764..71d7a96b 100644 --- a/ServiceHost/Areas/Admin/Pages/Company/Checkouts/PrintDetailsRollCall.cshtml +++ b/ServiceHost/Areas/Admin/Pages/Company/Checkouts/PrintDetailsRollCall.cshtml @@ -4,7 +4,7 @@ string adminVersion = _0_Framework.Application.Version.AdminVersion; } - +