diff --git a/CompanyManagment.App.Contracts/Checkout/CreateCheckout.cs b/CompanyManagment.App.Contracts/Checkout/CreateCheckout.cs index d1d0a5a4..57f9691c 100644 --- a/CompanyManagment.App.Contracts/Checkout/CreateCheckout.cs +++ b/CompanyManagment.App.Contracts/Checkout/CreateCheckout.cs @@ -160,6 +160,8 @@ public class CreateCheckout public TimeSpan TotalPaidLeave { get; set; } public TimeSpan TotalSickLeave { get; set; } + public bool HasLeft { get; set; } + /// /// دستمزد روزانه خام بعد از تاثیر ساعت کار diff --git a/CompanyManagment.Application/CheckoutApplication.cs b/CompanyManagment.Application/CheckoutApplication.cs index 5c5ff7e4..78714756 100644 --- a/CompanyManagment.Application/CheckoutApplication.cs +++ b/CompanyManagment.Application/CheckoutApplication.cs @@ -213,11 +213,11 @@ public class CheckoutApplication : ICheckoutApplication .Select(x => new CheckoutSalaryAid(x.Amount, x.SalaryAidDateTimeGe, x.SalaryAidDateTimeFa, x.CalculationDateTimeGe, x.CalculationDateTimeFa, x.Id)).ToList(); command.SalaryAidDeduction = salaryAids.Sum(x => x.Amount.MoneyToDouble()); - - + var loanInstallments = _rollCallMandatoryRepository.LoanInstallmentForCheckout(command.EmployeeId, - command.WorkshopId, command.ContractStartGr, command.ContractEndGr) - .Select(x => new CheckoutLoanInstallment(x.Amount, x.Month, x.Year, x.IsActive, x.RemainingAmount, x.LoanAmount, x.Id)).ToList(); + command.WorkshopId, command.ContractStartGr, command.HasLeft ? DateTime.MaxValue : command.ContractEndGr) + .Select(x => + new CheckoutLoanInstallment(x.Amount, x.Month, x.Year, x.IsActive, x.RemainingAmount, x.LoanAmount, x.Id)).ToList(); command.InstallmentDeduction = loanInstallments.Sum(x => x.AmountForMonth.MoneyToDouble()); diff --git a/CompanyManagment.Application/CustomizeCheckoutApplication.cs b/CompanyManagment.Application/CustomizeCheckoutApplication.cs index 7e325e2c..b82e3be1 100644 --- a/CompanyManagment.Application/CustomizeCheckoutApplication.cs +++ b/CompanyManagment.Application/CustomizeCheckoutApplication.cs @@ -319,7 +319,10 @@ namespace CompanyManagment.Application if (workshopId == 170) { - var exceptionEmployeeIds = _customizeWorkshopGroupSettingsRepository.GetEmployeeSettingsByGroupSettingsId(117).Select(x => x.EmployeeId).ToList(); + var exceptionEmployeeIds = _customizeWorkshopGroupSettingsRepository + .GetEmployeeSettingsByGroupSettingsId(117) + .Select(x => x.EmployeeId) + .Where(x=> workshopLeftWorksInMonth.Select(l=>l.EmployeeId).Contains(x)).ToList(); foreach (var employeesId in exceptionEmployeeIds) { diff --git a/CompanyManagment.Application/CustomizeCheckoutTempApplication.cs b/CompanyManagment.Application/CustomizeCheckoutTempApplication.cs index a6fb6511..750e9a96 100644 --- a/CompanyManagment.Application/CustomizeCheckoutTempApplication.cs +++ b/CompanyManagment.Application/CustomizeCheckoutTempApplication.cs @@ -249,7 +249,10 @@ namespace CompanyManagment.Application if (workshopId == 170) { - var exceptionEmployeeIds = _customizeWorkshopGroupSettingsRepository.GetEmployeeSettingsByGroupSettingsId(117).Select(x => x.EmployeeId).ToList(); + var exceptionEmployeeIds = _customizeWorkshopGroupSettingsRepository + .GetEmployeeSettingsByGroupSettingsId(117) + .Select(x => x.EmployeeId) + .Where(x=> workshopLeftWorksInMonth.Select(l=>l.EmployeeId).Contains(x)).ToList(); foreach (var employeesId in exceptionEmployeeIds) { diff --git a/CompanyManagment.EFCore/Repository/InsuranceListRepository.cs b/CompanyManagment.EFCore/Repository/InsuranceListRepository.cs index 0ecbe40a..1419fd36 100644 --- a/CompanyManagment.EFCore/Repository/InsuranceListRepository.cs +++ b/CompanyManagment.EFCore/Repository/InsuranceListRepository.cs @@ -1345,8 +1345,12 @@ public class InsuranceListRepository : RepositoryBase, IIns public List GetEmployeeInsuranceDataForEdit(long insuranceListId, DateTime startDate, DateTime endDate) { - var res = _context.EmployeeInsurancListDataSet + var employeeDataQuery = _context.EmployeeInsurancListDataSet .Where(x => x.InsuranceListId == insuranceListId) + .Join(_context.InsuranceListSet, + employeeInsurancListData => employeeInsurancListData.InsuranceListId, + insuranceList => insuranceList.id, + (employeeInsurancListData, insuranceList) => new{employeeInsurancListData,insuranceList}) .Join(_context.LeftWorkInsuranceList .Where(x => ((x.LeftWorkDate != null && x.LeftWorkDate != DateTime.MinValue) && @@ -1357,14 +1361,18 @@ public class InsuranceListRepository : RepositoryBase, IIns (x.LeftWorkDate == null || x.LeftWorkDate == DateTime.MinValue)) .Where(x => x.StartWorkDate <= endDate) .Include(x => x.Employee), - employeeData => employeeData.EmployeeId, - leftwork => leftwork.EmployeeId, - (employeeData, leftwork) => new { employeeData, leftwork }) - .Join(_context.Jobs, + employeeData =>new { employeeData.employeeInsurancListData.EmployeeId,employeeData.insuranceList.WorkshopId}, + leftwork => new {leftwork.EmployeeId,leftwork.WorkshopId}, + (employeeData, leftwork) + => new { employeeData = employeeData.employeeInsurancListData, leftwork }); + + var employeeJobs =employeeDataQuery.Join(_context.Jobs, result => result.leftwork.JobId, job => job.id, - (result, job) => new { result, job }) - .GroupJoin(_context.InsuranceEmployeeInformationSet.AsSplitQuery(), + (result, job) => new { result, job }); + + + var res =employeeJobs.GroupJoin(_context.InsuranceEmployeeInformationSet.AsSplitQuery(), allResult => allResult.result.employeeData.EmployeeId, employeeInfo => employeeInfo.EmployeeId, (allResult, employeeInfo) => new diff --git a/CompanyManagment.EFCore/Repository/LoanRepository.cs b/CompanyManagment.EFCore/Repository/LoanRepository.cs index 6f23763e..366fdde6 100644 --- a/CompanyManagment.EFCore/Repository/LoanRepository.cs +++ b/CompanyManagment.EFCore/Repository/LoanRepository.cs @@ -35,9 +35,11 @@ public class LoanRepository : RepositoryBase, ILoanRepository var startDate = loan.LoanInstallments.MinBy(x => x.InstallmentDate).InstallmentDate; var endDate = loan.LoanInstallments.MaxBy(x => x.InstallmentDate).InstallmentDate; - - var customizeCheckouts =await _companyContext.CustomizeCheckouts.Where(x => x.WorkshopId == loan.WorkshopId && x.EmployeeId == loan.EmployeeId && - x.ContractStart <= endDate && x.ContractEnd >= startDate).Select(x=> new {x.MonthInt, x.YearInt}).ToListAsync(); + var pc = new PersianCalendar(); + var checkouts = (await _companyContext.CheckoutSet + .Where(x => x.WorkshopId == loan.WorkshopId && x.EmployeeId == loan.EmployeeId && + startDate <= x.ContractEnd && endDate >= x.ContractEnd).AsNoTracking() + .SelectMany(x => x.LoanInstallments).ToListAsync()); var result = new LoanDetailsViewModel() { @@ -51,7 +53,7 @@ public class LoanRepository : RepositoryBase, ILoanRepository Id = x.Id, InstallmentAmount = x.AmountForMonth.ToMoney(), InstallmentDate = x.InstallmentDate.ToFarsi(), - IsPaid = customizeCheckouts.Any(c => c.MonthInt.ToString() == x.Month && c.YearInt.ToString() == x.Year) + IsPaid = checkouts.Any(c => c.EntityId == x.Id), }).ToList() }; diff --git a/ServiceHost/Areas/Admin/Pages/Accounts/Account/CreateRole.cshtml b/ServiceHost/Areas/Admin/Pages/Accounts/Account/CreateRole.cshtml index 30a37640..fca01fe8 100644 --- a/ServiceHost/Areas/Admin/Pages/Accounts/Account/CreateRole.cshtml +++ b/ServiceHost/Areas/Admin/Pages/Accounts/Account/CreateRole.cshtml @@ -230,9 +230,12 @@
-
- -
+
+ +
+
+ +
diff --git a/ServiceHost/Areas/Admin/Pages/Accounts/Account/EditRole.cshtml b/ServiceHost/Areas/Admin/Pages/Accounts/Account/EditRole.cshtml index 6f17ca6b..025f5756 100644 --- a/ServiceHost/Areas/Admin/Pages/Accounts/Account/EditRole.cshtml +++ b/ServiceHost/Areas/Admin/Pages/Accounts/Account/EditRole.cshtml @@ -230,9 +230,12 @@
-
- -
+
+ +
+
+ +
diff --git a/ServiceHost/Areas/Admin/Pages/Company/Checkouts/Index.cshtml.cs b/ServiceHost/Areas/Admin/Pages/Company/Checkouts/Index.cshtml.cs index 2c3deda5..a7a2904a 100644 --- a/ServiceHost/Areas/Admin/Pages/Company/Checkouts/Index.cshtml.cs +++ b/ServiceHost/Areas/Admin/Pages/Company/Checkouts/Index.cshtml.cs @@ -1089,6 +1089,8 @@ public class IndexModel : PageModel EmployeeMandatoryHours = mandatoryCompute.EmployeeMandatoryHours, HasInsuranceChekoutOverTime = workshop.InsuranceCheckoutOvertime, + HasLeft = separation.HasLeft + BaseYearAffected = mandatoryCompute.BaseYearAffected, diff --git a/ServiceHost/Areas/Admin/Pages/Company/Workshops/CreateWorkshop.cshtml b/ServiceHost/Areas/Admin/Pages/Company/Workshops/CreateWorkshop.cshtml index 12066b96..928e334d 100644 --- a/ServiceHost/Areas/Admin/Pages/Company/Workshops/CreateWorkshop.cshtml +++ b/ServiceHost/Areas/Admin/Pages/Company/Workshops/CreateWorkshop.cshtml @@ -299,10 +299,23 @@
- + + +
- + +
diff --git a/ServiceHost/Pages/contact-us/Index.cshtml b/ServiceHost/Pages/contact-us/Index.cshtml index e3469289..24c73869 100644 --- a/ServiceHost/Pages/contact-us/Index.cshtml +++ b/ServiceHost/Pages/contact-us/Index.cshtml @@ -196,13 +196,13 @@
نشانی گزارشگیر
-
منطقه آزاد انزلی، مجتمع ونوس طبقه اول، قرفه ۵۵۰
+
رشت - خیابان حاجی آباد - روبروی پارکینگ بزرگ حاجی آباد - ابتدای کوچه سپهدار - ساختمان دادماش - طبقه پنجم - واحد 17
شماره تماس
-
۰۱۳۳۲۳۲۸۸۸۶
-
۰۱۳۳۲۳۲۸۸۸۷
-
۰۱۳۳۳۲۴۴۹۲۶
-
۰۱۳۳۳۲۳۸۷۷۷
+
01333238777
+
01333328886
+
01333328887
+