From 65ce181001ae79f87d32939d863605c6d17f9350 Mon Sep 17 00:00:00 2001 From: MahanCh Date: Sat, 17 May 2025 16:45:31 +0330 Subject: [PATCH] add employer insurance confirm print feature --- .../ILeftWorkInsuranceRepository.cs | 14 +- .../InsuranceList/EditInsuranceList.cs | 5 + .../InsuranceListApplication.cs | 16 +- .../Repository/LeftWorkInsuranceRepository.cs | 229 +++-- .../InsuranceList/InsuranceConfirm.cshtml | 951 ++++++++++-------- 5 files changed, 698 insertions(+), 517 deletions(-) diff --git a/Company.Domain/LeftWorkInsuranceAgg/ILeftWorkInsuranceRepository.cs b/Company.Domain/LeftWorkInsuranceAgg/ILeftWorkInsuranceRepository.cs index 5bd39f8e..ef638a91 100644 --- a/Company.Domain/LeftWorkInsuranceAgg/ILeftWorkInsuranceRepository.cs +++ b/Company.Domain/LeftWorkInsuranceAgg/ILeftWorkInsuranceRepository.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using _0_Framework.Application; using _0_Framework.Domain; using CompanyManagment.App.Contracts.InsuranceList; +using CompanyManagment.App.Contracts.LeftWork; using CompanyManagment.App.Contracts.LeftWorkInsurance; using CompanyManagment.App.Contracts.PersonnleCode; @@ -40,5 +41,16 @@ public interface ILeftWorkInsuranceRepository : IRepository List GetEmployeeInsuranceLeftWorksAndInformation(long workshopId, DateTime startDate, DateTime endDate); - #endregion + #endregion + + #region Mahan + + /// + /// پرسنل هایی که در قرارداد ترک کار دارند ولی در بیمه ترک کاری برایشان نخورده + /// + /// + /// + List GetEmployeesWithContractExitOnly(long workshopId); + + #endregion } \ No newline at end of file diff --git a/CompanyManagment.App.Contracts/InsuranceList/EditInsuranceList.cs b/CompanyManagment.App.Contracts/InsuranceList/EditInsuranceList.cs index a9d86b20..9a45fa67 100644 --- a/CompanyManagment.App.Contracts/InsuranceList/EditInsuranceList.cs +++ b/CompanyManagment.App.Contracts/InsuranceList/EditInsuranceList.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using CompanyManagment.App.Contracts.LeftWork; namespace CompanyManagment.App.Contracts.InsuranceList; @@ -14,4 +15,8 @@ public class EditInsuranceList:CreateInsuranceList public string Population { get; set; } public long? InsuranceJobId { get; set; } + /// + /// پرسنل هایی که قرارداد ترک کار کرده اند ولی ترک کار بیمه ندارند + /// + public List LeftWorkEmployees { get; set; } } \ No newline at end of file diff --git a/CompanyManagment.Application/InsuranceListApplication.cs b/CompanyManagment.Application/InsuranceListApplication.cs index 7d05e2d3..67817ccc 100644 --- a/CompanyManagment.Application/InsuranceListApplication.cs +++ b/CompanyManagment.Application/InsuranceListApplication.cs @@ -292,12 +292,12 @@ public class InsuranceListApplication: IInsuranceListApplication var consumableItems = new YearlysalaryItemViewModel(); if (yearSalaryObj != null) { - yearlysalaryItem = _yearlySalaryItemApplication.GetItemsByYearlySalaryId(yearSalaryObj.Id) - .Where(x => x.ItemName == "مزد روزانه").FirstOrDefault(); - housingAllowance = _yearlySalaryItemApplication.GetItemsByYearlySalaryId(yearSalaryObj.Id) - .Where(x => x.ItemName == "کمک هزینه مسکن").FirstOrDefault(); - consumableItems = _yearlySalaryItemApplication.GetItemsByYearlySalaryId(yearSalaryObj.Id) - .Where(x => x.ItemName == "کمک هزینه اقلام").FirstOrDefault(); + yearlysalaryItem = _yearlySalaryItemApplication + .GetItemsByYearlySalaryId(yearSalaryObj.Id).FirstOrDefault(x => x.ItemName == "مزد روزانه"); + housingAllowance = _yearlySalaryItemApplication + .GetItemsByYearlySalaryId(yearSalaryObj.Id).FirstOrDefault(x => x.ItemName == "کمک هزینه مسکن"); + consumableItems = _yearlySalaryItemApplication + .GetItemsByYearlySalaryId(yearSalaryObj.Id).FirstOrDefault(x => x.ItemName == "کمک هزینه اقلام"); } foreach (var item in insuranceListDetails.EmployeeDetailsForInsuranceList) @@ -341,6 +341,10 @@ public class InsuranceListApplication: IInsuranceListApplication insuranceListDetails.AllInsuredShare = insuranceListDetails.InsuredShare + insuranceListDetails.EmployerShare + insuranceListDetails.UnEmploymentInsurance; + + insuranceListDetails.LeftWorkEmployees = + _leftWorkInsuranceRepository.GetEmployeesWithContractExitOnly(insuranceListDetails.WorkshopId); + return insuranceListDetails; } diff --git a/CompanyManagment.EFCore/Repository/LeftWorkInsuranceRepository.cs b/CompanyManagment.EFCore/Repository/LeftWorkInsuranceRepository.cs index 4255f632..fdd2f89e 100644 --- a/CompanyManagment.EFCore/Repository/LeftWorkInsuranceRepository.cs +++ b/CompanyManagment.EFCore/Repository/LeftWorkInsuranceRepository.cs @@ -8,6 +8,7 @@ using Company.Domain.InsuranceListAgg; using Company.Domain.LeftWorkInsuranceAgg; using Company.Domain.PersonnelCodeAgg; using CompanyManagment.App.Contracts.InsuranceList; +using CompanyManagment.App.Contracts.LeftWork; using CompanyManagment.App.Contracts.LeftWorkInsurance; using CompanyManagment.App.Contracts.PersonnleCode; using Microsoft.EntityFrameworkCore; @@ -25,15 +26,15 @@ public class LeftWorkInsuranceRepository : RepositoryBase new EditLeftWorkInsurance() - { - Id = x.id, - LeftWorkDate = x.LeftWorkDate != null ? x.LeftWorkDate.ToFarsi() : "", - StartWorkDate = x.StartWorkDate.ToFarsi(), - EmployeeFullName = x.EmployeeFullName, - WorkshopName = x.WorkshopName, - WorkshopId = x.WorkshopId, - EmployeeId = x.EmployeeId - }) + { + Id = x.id, + LeftWorkDate = x.LeftWorkDate != null ? x.LeftWorkDate.ToFarsi() : "", + StartWorkDate = x.StartWorkDate.ToFarsi(), + EmployeeFullName = x.EmployeeFullName, + WorkshopName = x.WorkshopName, + WorkshopId = x.WorkshopId, + EmployeeId = x.EmployeeId + }) .FirstOrDefault(x => x.Id == id); } @@ -89,7 +90,7 @@ public class LeftWorkInsuranceRepository : RepositoryBasex.WorkshopId == workshopId); + }).Where(x => x.WorkshopId == workshopId); return query.ToList(); } @@ -108,10 +109,10 @@ public class LeftWorkInsuranceRepository : RepositoryBase x.id == item.JobId).FirstOrDefault(); - var insuranceListIds = _context.EmployeeInsurancListDataSet.Where(x => x.EmployeeId == searchModel.EmployeeId && (x.StartWorkDate == item.StartWorkDate ||x.LeftWorkDate==item.LeftWorkDate)) - .Select(x=>x.InsuranceListId).ToList(); - var hasInsuranceList = _context.InsuranceListSet.Any(x => insuranceListIds.Contains(x.id) && x.WorkshopId==item.WorkshopId); - + var insuranceListIds = _context.EmployeeInsurancListDataSet.Where(x => x.EmployeeId == searchModel.EmployeeId && (x.StartWorkDate == item.StartWorkDate || x.LeftWorkDate == item.LeftWorkDate)) + .Select(x => x.InsuranceListId).ToList(); + var hasInsuranceList = _context.InsuranceListSet.Any(x => insuranceListIds.Contains(x.id) && x.WorkshopId == item.WorkshopId); + list.Add(new LeftWorkInsuranceViewModel() { Id = item.id, @@ -125,7 +126,7 @@ public class LeftWorkInsuranceRepository : RepositoryBasex.id==id); - if(item !=null) + var item = _context.LeftWorkInsuranceList.FirstOrDefault(x => x.id == id); + if (item != null) _context.LeftWorkInsuranceList.Remove(item); - + _context.SaveChanges(); return op.Succcedded(); } - public OperationResult RemoveAllLeftWorkInsurance(long workshopId, long employeeId) + public OperationResult RemoveAllLeftWorkInsurance(long workshopId, long employeeId) { var op = new OperationResult(); @@ -161,8 +162,8 @@ public class LeftWorkInsuranceRepository : RepositoryBase x.WorkshopId == workshopId).ToList(); foreach (var item in insuranceList) { - hasInsurance =_context.EmployeeInsurancListDataSet.Any(x => x.EmployeeId == employeeId && x.InsuranceListId==item.id); - if(hasInsurance) + hasInsurance = _context.EmployeeInsurancListDataSet.Any(x => x.EmployeeId == employeeId && x.InsuranceListId == item.id); + if (hasInsurance) break; } //tempChange @@ -174,7 +175,7 @@ public class LeftWorkInsuranceRepository : RepositoryBase 0) _context.LeftWorkInsuranceList.RemoveRange(list); - bool hasLeftWork = _context.LeftWorkList.Any(x => x.EmployeeId == employeeId && x.WorkshopId==workshopId); + bool hasLeftWork = _context.LeftWorkList.Any(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId); if (!hasLeftWork) { var personelCodeList = _context.PersonnelCodeSet.Where(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId).ToList(); @@ -186,8 +187,8 @@ public class LeftWorkInsuranceRepository : RepositoryBase" + "" +"کد پرسنلی این شخص در این کارگاه به دلیل استفاده در ترک کار قرارداد قابل حذف نمی باشد. " + ""; + { + op.Message = "حذف با موفقیت انجام شد." + "
" + "" + "کد پرسنلی این شخص در این کارگاه به دلیل استفاده در ترک کار قرارداد قابل حذف نمی باشد. " + ""; op.IsSuccedded = true; } else @@ -231,7 +232,7 @@ public class LeftWorkInsuranceRepository : RepositoryBase SearchForCreateInsuranceList(EmployeeForCreateInsuranceListSearchModel searchModel) { - List listLeftWorkInsurance = new List(); + List listLeftWorkInsurance = new List(); // IQueryable query; //if (searchModel.WorkshopIds != null && searchModel.WorkshopIds.Count > 0) @@ -286,7 +287,7 @@ public class LeftWorkInsuranceRepository : RepositoryBasex.EmployeeId==employeeId && x.WorkshopId==workshopId).OrderByDescending(x=>x.id).FirstOrDefault(); + var leftWorkInsuranceObj = _context.LeftWorkInsuranceList.Where(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId).OrderByDescending(x => x.id).FirstOrDefault(); if (leftWorkInsuranceObj != null) { @@ -327,7 +328,7 @@ public class LeftWorkInsuranceRepository : RepositoryBase x.EmployeeId == command.EmployeeId && x.WorkshopId == command.WorkshopId).FirstOrDefault(); if (personelcode != null) { - if(_context.PersonnelCodeSet.Any(x=> x.WorkshopId == command.WorkshopId && x.PersonnelCode == personelcode.PersonnelCode)) + if (_context.PersonnelCodeSet.Any(x => x.WorkshopId == command.WorkshopId && x.PersonnelCode == personelcode.PersonnelCode)) { op.Failed(" کد پرسنلی در کارگاه " + command.WorkshopName + " تکراری می باشد. "); } @@ -370,7 +371,7 @@ public class LeftWorkInsuranceRepository : RepositoryBasex.Id==removeItem.id)) + if (!item.LeftworkInsuranceViewModels.Any(x => x.Id == removeItem.id)) removeList.Add(removeItem); } foreach (var item2 in item.LeftworkInsuranceViewModels) - { + { DateTime? left = null; if (!string.IsNullOrWhiteSpace(item2.LeftWorkDate)) left = item2.LeftWorkDate.ToGeorgianDateTime(); @@ -469,7 +470,7 @@ public class LeftWorkInsuranceRepository : RepositoryBase x.EmployeeId == item2.EmployeeId && x.WorkshopId == item2.WorkshopId && x.StartWorkDate == start); - + if (!check) { @@ -477,11 +478,11 @@ public class LeftWorkInsuranceRepository : RepositoryBase x.id==item2.Id)?.FirstOrDefault(); + var leftworkInsurance = _context.LeftWorkInsuranceList.Where(x => x.id == item2.Id)?.FirstOrDefault(); leftworkInsurance.Edit(left, start, item2.WorkshopId, item2.EmployeeId, item2.JobId, item2.IncludeStatus); } } @@ -508,13 +509,13 @@ public class LeftWorkInsuranceRepository : RepositoryBase x.WorkshopId == workshopId).ToList(); foreach (var item in insuranceList) { - if(type == 1) + if (type == 1) hasInsurance = _context.EmployeeInsurancListDataSet.Any(x => x.EmployeeId == employeeId && x.InsuranceListId == item.id && x.StartWorkDate.Date >= date.Date && item.ConfirmSentlist); else hasInsurance = _context.EmployeeInsurancListDataSet.Any(x => x.EmployeeId == employeeId && x.InsuranceListId == item.id && (x.LeftWorkDate != null && ((DateTime)x.LeftWorkDate).Date == date.Date)); @@ -555,7 +556,7 @@ public class LeftWorkInsuranceRepository : RepositoryBase x.Year == year && x.Month == month && x.WorkshopId == workshopId).ToList(); if (insuranceList != null && insuranceList.Count > 0) - { + { foreach (var item in insuranceList) { if (type == 1) @@ -587,7 +588,7 @@ public class LeftWorkInsuranceRepository : RepositoryBase x.EmployeeId == employeeId && x.WorkshopId == workshopId && x.StartWorkDate < startDate) - .OrderBy(x=>x.StartWorkDate) + .OrderBy(x => x.StartWorkDate) .ToList(); if (lefts.Count > 0) { @@ -689,74 +690,110 @@ public class LeftWorkInsuranceRepository : RepositoryBasex); + var sum = totalDays.Sum(x => x); return (sum / 365); } else { return 0; } - + } #region Insurance public List GetEmployeeInsuranceLeftWorksAndInformation(long workshopId, DateTime startDate, DateTime endDate) { - if (workshopId == 0) - return []; - var query = _context.LeftWorkInsuranceList.Include(x => x.Employee) - .Where(x => x.WorkshopId == workshopId) - .Where(x => - ((x.LeftWorkDate != null && x.LeftWorkDate != DateTime.MinValue) && - ((DateTime)x.LeftWorkDate >= startDate && - (DateTime)x.LeftWorkDate <= endDate)) || - ((x.LeftWorkDate != null && x.LeftWorkDate != DateTime.MinValue) && - (DateTime)x.LeftWorkDate >= endDate) || - (x.LeftWorkDate == null || x.LeftWorkDate == DateTime.MinValue)) - .Where(x => x.StartWorkDate <= endDate) - .Join(_context.Jobs, - left => left.JobId, - job => job.id, - (left, job) => new { left, job }) - .GroupJoin(_context.InsuranceEmployeeInformationSet.AsSplitQuery(), - result => result.left.EmployeeId, - employeeInfo => employeeInfo.EmployeeId, - (result, employeeInfo) => new - { - result.left, - result.job, - employeeInfo - }) - .SelectMany(x => x.employeeInfo.DefaultIfEmpty(), (x, employeeInfo) => new { x, employeeInfo }) - .Select(result => new EmployeeDetailsForInsuranceListViewModel - { - StartWorkDateGr = result.x.left.StartWorkDate, - LeftWorkDateGr = result.x.left.LeftWorkDate, - IncludeStatus = result.x.left.IncludeStatus, - JobId = result.x.left.JobId, - JobName = result.x.job != null ? result.x.job.JobName : string.Empty, - JobCode = result.x.job != null ? result.x.job.JobCode : string.Empty, - InsuranceEmployeeInformationId = result.employeeInfo != null ? result.employeeInfo.id : 0, - EmployeeId = result.x.left.EmployeeId, - - //اطلاعات هویتی - FName = result.employeeInfo != null ? result.employeeInfo.FName : result.x.left.Employee.FName, - LName = result.employeeInfo != null ? result.employeeInfo.LName : result.x.left.Employee.LName, - FatherName = result.employeeInfo != null ? result.employeeInfo.FatherName : result.x.left.Employee.FatherName, - DateOfBirthGr = result.employeeInfo != null ? result.employeeInfo.DateOfBirth : result.x.left.Employee.DateOfBirth, - DateOfIssueGr = result.employeeInfo != null ? result.employeeInfo.DateOfIssue : result.x.left.Employee.DateOfIssue, - PlaceOfIssue = result.employeeInfo != null ? result.employeeInfo.PlaceOfIssue : result.x.left.Employee.PlaceOfIssue, - IdNumber = result.employeeInfo != null ? result.employeeInfo.IdNumber : result.x.left.Employee.IdNumber, - Gender = result.employeeInfo != null ? result.employeeInfo.Gender : result.x.left.Employee.Gender, - NationalCode = result.x.left.Employee.NationalCode, - Nationality = result.x.left.Employee.Nationality, - InsuranceCode = result.x.left.Employee.InsuranceCode, - MaritalStatus = result.x.left.Employee.MaritalStatus, - IsMaritalStatusSet = !string.IsNullOrWhiteSpace(result.x.left.Employee.MaritalStatus) - }).ToList(); + if (workshopId == 0) + return []; + var query = _context.LeftWorkInsuranceList.Include(x => x.Employee) + .Where(x => x.WorkshopId == workshopId) + .Where(x => + ((x.LeftWorkDate != null && x.LeftWorkDate != DateTime.MinValue) && + ((DateTime)x.LeftWorkDate >= startDate && + (DateTime)x.LeftWorkDate <= endDate)) || + ((x.LeftWorkDate != null && x.LeftWorkDate != DateTime.MinValue) && + (DateTime)x.LeftWorkDate >= endDate) || + (x.LeftWorkDate == null || x.LeftWorkDate == DateTime.MinValue)) + .Where(x => x.StartWorkDate <= endDate) + .Join(_context.Jobs, + left => left.JobId, + job => job.id, + (left, job) => new { left, job }) + .GroupJoin(_context.InsuranceEmployeeInformationSet.AsSplitQuery(), + result => result.left.EmployeeId, + employeeInfo => employeeInfo.EmployeeId, + (result, employeeInfo) => new + { + result.left, + result.job, + employeeInfo + }) + .SelectMany(x => x.employeeInfo.DefaultIfEmpty(), (x, employeeInfo) => new { x, employeeInfo }) + .Select(result => new EmployeeDetailsForInsuranceListViewModel + { + StartWorkDateGr = result.x.left.StartWorkDate, + LeftWorkDateGr = result.x.left.LeftWorkDate, + IncludeStatus = result.x.left.IncludeStatus, + JobId = result.x.left.JobId, + JobName = result.x.job != null ? result.x.job.JobName : string.Empty, + JobCode = result.x.job != null ? result.x.job.JobCode : string.Empty, + InsuranceEmployeeInformationId = result.employeeInfo != null ? result.employeeInfo.id : 0, + EmployeeId = result.x.left.EmployeeId, - return query; + //اطلاعات هویتی + FName = result.employeeInfo != null ? result.employeeInfo.FName : result.x.left.Employee.FName, + LName = result.employeeInfo != null ? result.employeeInfo.LName : result.x.left.Employee.LName, + FatherName = result.employeeInfo != null ? result.employeeInfo.FatherName : result.x.left.Employee.FatherName, + DateOfBirthGr = result.employeeInfo != null ? result.employeeInfo.DateOfBirth : result.x.left.Employee.DateOfBirth, + DateOfIssueGr = result.employeeInfo != null ? result.employeeInfo.DateOfIssue : result.x.left.Employee.DateOfIssue, + PlaceOfIssue = result.employeeInfo != null ? result.employeeInfo.PlaceOfIssue : result.x.left.Employee.PlaceOfIssue, + IdNumber = result.employeeInfo != null ? result.employeeInfo.IdNumber : result.x.left.Employee.IdNumber, + Gender = result.employeeInfo != null ? result.employeeInfo.Gender : result.x.left.Employee.Gender, + NationalCode = result.x.left.Employee.NationalCode, + Nationality = result.x.left.Employee.Nationality, + InsuranceCode = result.x.left.Employee.InsuranceCode, + MaritalStatus = result.x.left.Employee.MaritalStatus, + IsMaritalStatusSet = !string.IsNullOrWhiteSpace(result.x.left.Employee.MaritalStatus) + }).ToList(); + + return query; + } + + #endregion + + #region Mahan + + public List GetEmployeesWithContractExitOnly(long workshopId) + { + var leftWorkedEmployees = _context.LeftWorkList + .Where(x => x.WorkshopId == workshopId) + .GroupBy(x => x.EmployeeId) + .Select(x => new + { + EmployeeId = x.Key, + x.OrderByDescending(s => s.StartWorkDate).FirstOrDefault().LeftWorkDate + }).Where(x => x.LeftWorkDate != new DateTime(2121, 3, 21)) + .ToList(); + + var leftWorkEmployeeIds = leftWorkedEmployees.Select(x => x.EmployeeId); + + var insuranceLeftWorkWithContractExitOnly = _context.LeftWorkInsuranceList.Where(x => + x.WorkshopId == workshopId && leftWorkEmployeeIds.Contains(x.EmployeeId) && x.LeftWorkDate == null).ToList() + .Select(x => + { + var employee = leftWorkedEmployees.First(l => l.EmployeeId == x.EmployeeId); + return new LeftWorkViewModel() + { + WorkshopId = x.WorkshopId, + EmployeeId = x.EmployeeId, + EmployeeFullName = x.EmployeeFullName, + LeftWorkDate = employee.LeftWorkDate.ToFarsi(), + LeftWorkDateGr = employee.LeftWorkDate + }; + }); + + return insuranceLeftWorkWithContractExitOnly.ToList(); } #endregion diff --git a/ServiceHost/Areas/Admin/Pages/Company/InsuranceList/InsuranceConfirm.cshtml b/ServiceHost/Areas/Admin/Pages/Company/InsuranceList/InsuranceConfirm.cshtml index 9f2ca6b7..f00ecb45 100644 --- a/ServiceHost/Areas/Admin/Pages/Company/InsuranceList/InsuranceConfirm.cshtml +++ b/ServiceHost/Areas/Admin/Pages/Company/InsuranceList/InsuranceConfirm.cshtml @@ -1,4 +1,5 @@ @using _0_Framework.Application +@using CompanyManagment.App.Contracts.LeftWork @model CompanyManagment.App.Contracts.InsuranceList.EditInsuranceList @@ -39,7 +40,8 @@ align-items: center; margin: 1rem 0; } - .last-div{ + + .last-div { width: 100%; /* height: 55px; */ } @@ -71,12 +73,19 @@ margin: 0 9rem; } - @@page { + @@page { size: A4 landscape; } + .table-container-employee { + display: flex; + width: 100%; + justify-content: space-between; + } - + .trTable:nth-child(2n) { + background-color: #f1f1f1 !important; + } #printThis .table-bordered .has-left-work p, #printThis .table-bordered .has-start-work p { margin: 0; @@ -199,15 +208,15 @@ } #printThis .colgp-12 { - width: 44px; + width: 44px; } #printThis .colgp-13 { - width: 44px; + width: 44px; } #printThis .colgp-14 { - width: 40px; + width: 40px; } #printThis .table-bordered > tbody > tr:nth-child(12n) td:first-child { @@ -233,10 +242,10 @@ align-items: center; } - .titleSection p{ - margin: 0; - text-align: right; - } + .titleSection p { + margin: 0; + text-align: right; + } .titles { margin-left: auto; @@ -279,8 +288,8 @@ .asignment-field { display: flex; justify-content: flex-end; - margin-bottom: 50px !important; - margin-top: 25px !important; + margin-bottom: 60px !important; + margin-top: 15px !important; } @@ -335,9 +344,9 @@ width: 18px; } - #printThis .colgp-7 { - width: 44px; - } + #printThis .colgp-7 { + width: 44px; + } #printThis .colgp-8 { width: 44px; @@ -347,13 +356,13 @@ width: 44px; } - #printThis .colgp-10 { - width: 44px; - } + #printThis .colgp-10 { + width: 44px; + } - #printThis .colgp-11 { - width: 44px; - } + #printThis .colgp-11 { + width: 44px; + } #printThis .colgp-12 { width: 44px; @@ -374,6 +383,15 @@ #printThis .colgp-16 { width: 60px; } + + .col-md-9, .col-sm-9, .col-lg-9 { + width: 75%; + float: right; + } + + .asignment { + width: 25%; + } } @@media screen { @@ -392,8 +410,8 @@ margin: 0 !important; padding: 0 !important; overflow: clip; - -webkit-print-color-adjust:exact !important; - print-color-adjust:exact !important; + -webkit-print-color-adjust: exact !important; + print-color-adjust: exact !important; } .modal-dialog { @@ -414,7 +432,7 @@ } .size-a4 { - width: 276mm; + width: 276mm; } #printThis .table-container { @@ -429,26 +447,27 @@ width: 100%; max-height: 15cm; border: hidden !important; - border-right :0; + border-right: 0; border-left: 0; } - #printThis .table-bordered > thead > tr > th { - font-size: 10px; - color: black; - text-align: center; - vertical-align: middle; - padding: 0; - border: 1px solid black; - } + #printThis .table-bordered > thead > tr > th { + font-size: 10px; + color: black; + text-align: center; + vertical-align: middle; + padding: 0; + border: 1px solid black; + } + + #printThis .table-bordered > tbody > tr > td { + padding: 8px 2px; + text-align: center; + font-size: 1rem; + border: 1px solid black; + } - #printThis .table-bordered > tbody > tr > td { - padding: 8px 2px; - text-align: center; - font-size: 1rem; - border: 1px solid black; - } .summary { display: flex; justify-content: flex-end; @@ -476,26 +495,24 @@ color: grey !important; } - .row-color2 .fa-square:before { - color: grey !important; - } + .row-color2 .fa-square:before { + color: grey !important; + } #printThis .table-bordered .has-left-work td { background: black !important; color: white !important; } - #printThis .table-bordered .has-left-work td p{ - color: white !important; - } + #printThis .table-bordered .has-left-work td p { + color: white !important; + } #printThis .table-bordered .has-start-work td { background: grey !important; } } - - @@ -525,12 +542,24 @@
- -
-

تایید کارفرما جهت تنظیم لیست بیمه پرسنل

- + @* *@ +
+

+ * سطر به رنگ + به معنای ترک کار پرسنل می باشد. +

+

+ * سطر به رنگ به معنای شروع بکار پرسنل می باشد. +

+
+ +
+

تایید کارفرما جهت تنظیم لیست بیمه پرسنل

+
+ +
+
-
@@ -558,238 +587,332 @@ - - توضیحات - مجموع مزایای ماهانه غیرمشمول - مجموع حقوق و مزایای ماهیانه - مجموع مزایای ماهیانه - حق تاهل - دستمزد ماهانه - پایه سنوات روزانه - دستمزد روزانه - روز کارکرد - سمت - کدملی - نام و نام خانوادگی - شماره بیمه - ردیف - + + توضیحات + مجموع مزایای ماهانه غیرمشمول + مجموع حقوق و مزایای ماهیانه + مجموع مزایای ماهیانه + حق تاهل + دستمزد ماهانه + پایه سنوات روزانه + دستمزد روزانه + روز کارکرد + سمت + کدملی + نام و نام خانوادگی + شماره بیمه + ردیف + - @{ - int count_j = 0; + @{ + int count_j = 0; - // count_j = (i == 0 ? (((CountList < 12) || (i == (q - 1) && CountList!=12)) ? r : 12) : (((CountList < 12) || (i == (q - 1))) ? r : 12)); + // count_j = (i == 0 ? (((CountList < 12) || (i == (q - 1) && CountList!=12)) ? r : 12) : (((CountList < 12) || (i == (q - 1))) ? r : 12)); - if (i == 0 && ((CountList < 12) || (i == (q - 1) && CountList != 12))) - { - count_j = r; - } - else if (i == 0 && (CountList >= 12 || (i != (q - 1)))) + if (i == 0 && ((CountList < 12) || (i == (q - 1) && CountList != 12))) + { + count_j = r; + } + else if (i == 0 && (CountList >= 12 || (i != (q - 1)))) { count_j = 12; } - else if (i != 0 && ((CountList < 12) || ((i == (q - 1))&& r!=0))) - { - count_j = r; + else if (i != 0 && ((CountList < 12) || ((i == (q - 1)) && r != 0))) + { + count_j = r; + } + else + count_j = 12; + + + if (i == (q - 1)) + count_j = (i * 12) + count_j; + else + { + count_j = ((i + 1) * count_j); + } } - else - count_j = 12; - - - if (i == (q - 1)) - count_j = (i * 12) + count_j; - else + @for (int j = (i * 12); j < count_j; j++) { - count_j = ((i + 1) * count_j); - } - } - @for (int j = (i * 12); j < count_j; j++) - { @**@ - - @if (i == (q - 1)) - { - - @if (!string.IsNullOrEmpty(Model.EmployeeDetailsForInsuranceList[j].LeftWorkDate)) - { -

@Model.EmployeeDetailsForInsuranceList[j].LeftWorkDate

- } - @if (Model.EmployeeDetailsForInsuranceList[j].HasStartWorkInMonth) - { -

@Model.EmployeeDetailsForInsuranceList[j].StartWorkDate

- } - - } - else - { - - @if (!string.IsNullOrEmpty(Model.EmployeeDetailsForInsuranceList[j].LeftWorkDate)) - { -

@Model.EmployeeDetailsForInsuranceList[j].LeftWorkDate

- } - @if (Model.EmployeeDetailsForInsuranceList[j].HasStartWorkInMonth) - { -

@Model.EmployeeDetailsForInsuranceList[j].StartWorkDate

- } - - } - @Model.EmployeeDetailsForInsuranceList[j].BenefitsIncludedNonContinuous.ToMoney() - @Model.EmployeeDetailsForInsuranceList[j].BenefitsIncludedContinuous.ToMoney() - @Model.EmployeeDetailsForInsuranceList[j].MonthlyBenefits.ToMoney() - @Model.EmployeeDetailsForInsuranceList[j].MarriedAllowance.ToMoney() - @Model.EmployeeDetailsForInsuranceList[j].MonthlySalary.ToMoney() - @Model.EmployeeDetailsForInsuranceList[j].BaseYears.ToMoney() - @Model.EmployeeDetailsForInsuranceList[j].DailyWage.ToMoney() - @Model.EmployeeDetailsForInsuranceList[j].WorkingDays - @Model.EmployeeDetailsForInsuranceList[j].JobName - @Model.EmployeeDetailsForInsuranceList[j].NationalCode - @(Model.EmployeeDetailsForInsuranceList[j].FName + " " + Model.EmployeeDetailsForInsuranceList[j].LName) - @Model.EmployeeDetailsForInsuranceList[j].InsuranceCode - @* @index *@ - @if (i == (q - 1)) - { - @index - } - else - { - @index - } + + @if (i == (q - 1)) + { + + @if (!string.IsNullOrEmpty(Model.EmployeeDetailsForInsuranceList[j].LeftWorkDate)) + { +

@Model.EmployeeDetailsForInsuranceList[j].LeftWorkDate

+ } + @if (Model.EmployeeDetailsForInsuranceList[j].HasStartWorkInMonth) + { +

@Model.EmployeeDetailsForInsuranceList[j].StartWorkDate

+ } + + } + else + { + + @if (!string.IsNullOrEmpty(Model.EmployeeDetailsForInsuranceList[j].LeftWorkDate)) + { +

@Model.EmployeeDetailsForInsuranceList[j].LeftWorkDate

+ } + @if (Model.EmployeeDetailsForInsuranceList[j].HasStartWorkInMonth) + { +

@Model.EmployeeDetailsForInsuranceList[j].StartWorkDate

+ } + + } + @Model.EmployeeDetailsForInsuranceList[j].BenefitsIncludedNonContinuous.ToMoney() + @Model.EmployeeDetailsForInsuranceList[j].BenefitsIncludedContinuous.ToMoney() + @Model.EmployeeDetailsForInsuranceList[j].MonthlyBenefits.ToMoney() + @Model.EmployeeDetailsForInsuranceList[j].MarriedAllowance.ToMoney() + @Model.EmployeeDetailsForInsuranceList[j].MonthlySalary.ToMoney() + @Model.EmployeeDetailsForInsuranceList[j].BaseYears.ToMoney() + @Model.EmployeeDetailsForInsuranceList[j].DailyWage.ToMoney() + @Model.EmployeeDetailsForInsuranceList[j].WorkingDays + @Model.EmployeeDetailsForInsuranceList[j].JobName + @Model.EmployeeDetailsForInsuranceList[j].NationalCode + @(Model.EmployeeDetailsForInsuranceList[j].FName + " " + Model.EmployeeDetailsForInsuranceList[j].LName) + @Model.EmployeeDetailsForInsuranceList[j].InsuranceCode + @* @index *@ + @if (i == (q - 1)) + { + @index + } + else + { + @index + } - - index = index + 1; - } - @if (i == (q - 1) && (r>0 && r <= 8 )) - { - CountLastRow = 0; - hasLastRow = true; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @Model.EmployeeDetailsForInsuranceList.Sum(x => x.BenefitsIncludedNonContinuous).ToMoney() - @Model.EmployeeDetailsForInsuranceList.Sum(x => x.BenefitsIncludedContinuous).ToMoney() - @Model.EmployeeDetailsForInsuranceList.Sum(x => x.MonthlyBenefits).ToMoney() - @Model.EmployeeDetailsForInsuranceList.Sum(x => x.MarriedAllowance).ToMoney() - @Model.EmployeeDetailsForInsuranceList.Sum(x => x.MonthlySalary).ToMoney() - @Model.EmployeeDetailsForInsuranceList.Sum(x => x.BaseYears).ToMoney() - @Model.EmployeeDetailsForInsuranceList.Sum(x => x.DailyWage).ToMoney() - @Model.EmployeeDetailsForInsuranceList.Sum(x => x.WorkingDays) - - - - - - - } - else if (i == (q - 1) && (r>0 && r <= 9)) - { - CountLastRow=1; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - } - else if (i == (q - 1) && (r>0 && r <= 10)) - { - CountLastRow=2; - - - - - - - - - - - - - - - - - } + + index = index + 1; + } + @if (i == (q - 1) && (r > 0 && r <= 8)) + { + CountLastRow = 0; + hasLastRow = true; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @Model.EmployeeDetailsForInsuranceList.Sum(x => x.BenefitsIncludedNonContinuous).ToMoney() + @Model.EmployeeDetailsForInsuranceList.Sum(x => x.BenefitsIncludedContinuous).ToMoney() + @Model.EmployeeDetailsForInsuranceList.Sum(x => x.MonthlyBenefits).ToMoney() + @Model.EmployeeDetailsForInsuranceList.Sum(x => x.MarriedAllowance).ToMoney() + @Model.EmployeeDetailsForInsuranceList.Sum(x => x.MonthlySalary).ToMoney() + @Model.EmployeeDetailsForInsuranceList.Sum(x => x.BaseYears).ToMoney() + @Model.EmployeeDetailsForInsuranceList.Sum(x => x.DailyWage).ToMoney() + @Model.EmployeeDetailsForInsuranceList.Sum(x => x.WorkingDays) + + + + + + + } + else if (i == (q - 1) && (r > 0 && r <= 9)) + { + CountLastRow = 1; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + else if (i == (q - 1) && (r > 0 && r <= 10)) + { + CountLastRow = 2; + + + + + + + + + + + + + + + + + }
-
-
+
+ +
+ @{ + var pageStartIndex = i * 12; + var pageEndIndex = (i == q - 1) ? ((i * 12) + r) : ((i + 1) * 12); + + var pageEmployees = Model.EmployeeDetailsForInsuranceList + .Skip(pageStartIndex) + .Take(pageEndIndex - pageStartIndex) + .ToList(); + var pageEmployeeIds = pageEmployees.Select(x => x.EmployeeId).ToHashSet(); + + var leftWorkList = Model.LeftWorkEmployees + .Where(x => pageEmployeeIds.Contains(x.EmployeeId)) + .Select(x => new LeftWorkViewModel + { + EmployeeFullName = x.EmployeeFullName ?? "-", + LeftWorkDate = x.LeftWorkDate ?? "-" + }) + .ToList(); + + while (leftWorkList.Count < 12) + { + leftWorkList.Add(new LeftWorkViewModel { EmployeeFullName = "-", LeftWorkDate = "-" }); + } + + var tables = new List>(); + for (int t = 0; t < 3; t++) + { + tables.Add(leftWorkList.Skip(t * 4).Take(4).ToList()); + } + } + +

هشدار پرسنل ذیل با توجه به تاریخ مندرج با مجموعه شما هیچگونه قرارداد کاری ندارند.

+
+
+ + @for (int t = 0; t < tables.Count; t++) + { + var table = tables[t]; + + + + + + + + + + + + @foreach (var item in table) + { + + + + + } +
تاریخنام پرسنل
+ @item.LeftWorkDate + + @item.EmployeeFullName +
+ } + + + + + + @* + + + + + + + + + + + + + + +
تاریخنام پرسنل
+ - + + - +
*@ +
+
+
+ + @*

* سطر به رنگ به معنای ترک کار پرسنل می باشد. @@ -797,10 +920,10 @@

* سطر به رنگ به معنای شروع بکار پرسنل می باشد.

-
-

صفحه @(i + 1) از @((r>0 && r <= 8 )?q:q+1)

+
*@ +

صفحه @(i + 1) از @((r > 0 && r <= 8) ? q : q + 1)

-
+ @*
*@
امضا و تایید کارفرما
@@ -813,15 +936,15 @@ if (!hasLastRow) { -
+
- + @* *@

تایید کارفرما جهت تنظیم لیست بیمه پرسنل

- + @* *@
@@ -834,129 +957,42 @@
- - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - @if (CountLastRow == 0) - { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - } - else if (CountLastRow == 2) - { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - } - - else if (CountLastRow == 1) + @if (CountLastRow == 0) { @@ -973,26 +1009,113 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + else if (CountLastRow == 2) + { + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } - - - - - - - - - - - - - - - - - + else if (CountLastRow == 1) + { + + + + + + + + + + + + + + + + + } + + + + + + + + + + + + + + + + + +
توضیحات مجموع مزایای ماهانه غیرمشمول مجموع حقوق و مزایای ماهیانه مجموع مزایای ماهیانه حق تاهل دستمزد ماهانه پایه سنوات روزانه دستمزد روزانه روز کارکرد سمت کدملی نام و نام خانوادگی شماره بیمه ردیف
توضیحات مجموع مزایای ماهانه غیرمشمول مجموع حقوق و مزایای ماهیانه مجموع مزایای ماهیانه حق تاهل دستمزد ماهانه پایه سنوات روزانه دستمزد روزانه روز کارکرد سمت کدملی نام و نام خانوادگی شماره بیمه ردیف
@Model.EmployeeDetailsForInsuranceList.Sum(x => x.BenefitsIncludedNonContinuous).ToMoney()@Model.EmployeeDetailsForInsuranceList.Sum(x => x.BenefitsIncludedContinuous).ToMoney()@Model.EmployeeDetailsForInsuranceList.Sum(x => x.MonthlyBenefits).ToMoney()@Model.EmployeeDetailsForInsuranceList.Sum(x => x.MarriedAllowance).ToMoney()@Model.EmployeeDetailsForInsuranceList.Sum(x => x.MonthlySalary).ToMoney()@Model.EmployeeDetailsForInsuranceList.Sum(x => x.BaseYears).ToMoney()@Model.EmployeeDetailsForInsuranceList.Sum(x => x.DailyWage).ToMoney()@Model.EmployeeDetailsForInsuranceList.Sum(x => x.WorkingDays)
@Model.EmployeeDetailsForInsuranceList.Sum(x => x.BenefitsIncludedNonContinuous).ToMoney()@Model.EmployeeDetailsForInsuranceList.Sum(x => x.BenefitsIncludedContinuous).ToMoney()@Model.EmployeeDetailsForInsuranceList.Sum(x => x.MonthlyBenefits).ToMoney()@Model.EmployeeDetailsForInsuranceList.Sum(x => x.MarriedAllowance).ToMoney()@Model.EmployeeDetailsForInsuranceList.Sum(x => x.MonthlySalary).ToMoney()@Model.EmployeeDetailsForInsuranceList.Sum(x => x.BaseYears).ToMoney()@Model.EmployeeDetailsForInsuranceList.Sum(x => x.DailyWage).ToMoney()@Model.EmployeeDetailsForInsuranceList.Sum(x => x.WorkingDays)
@@ -1007,7 +1130,7 @@ * سطر به رنگ به معنای شروع بکار پرسنل می باشد.

-

صفحه @(q+1) از @(q+1)

+

صفحه @(q + 1) از @(q + 1)