diff --git a/CompanyManagment.EFCore/Repository/RollCallMandatoryRepository.cs b/CompanyManagment.EFCore/Repository/RollCallMandatoryRepository.cs index 3f871b77..2c321f56 100644 --- a/CompanyManagment.EFCore/Repository/RollCallMandatoryRepository.cs +++ b/CompanyManagment.EFCore/Repository/RollCallMandatoryRepository.cs @@ -2417,9 +2417,9 @@ CreateWorkingHoursTemp command, bool holidayWorking) return new CustomizeCheckoutMandatoryViewModel() { MonthlySalary = dailyWage * mandatoryDays, - ShiftStatus = customizeWorkshopEmployeeSettings.WorkshopShiftStatus, - SettingSalary = customizeWorkshopEmployeeSettings.Salary, - DailyWage = dailyWage + //ShiftStatus = customizeWorkshopEmployeeSettings.WorkshopShiftStatus, + //SettingSalary = customizeWorkshopEmployeeSettings.Salary, + //DailyWage = dailyWage }; } diff --git a/ServiceHost/Areas/Client/Pages/Company/CustomizeCheckout/CheckoutTemporary.cshtml b/ServiceHost/Areas/Client/Pages/Company/CustomizeCheckout/CheckoutTemporary.cshtml index bcae97cc..ab430d45 100644 --- a/ServiceHost/Areas/Client/Pages/Company/CustomizeCheckout/CheckoutTemporary.cshtml +++ b/ServiceHost/Areas/Client/Pages/Company/CustomizeCheckout/CheckoutTemporary.cshtml @@ -453,7 +453,7 @@ - + @@ -506,7 +506,7 @@ @item.ContractEndFa - + diff --git a/ServiceHost/Areas/Client/Pages/Company/CustomizeCheckout/CheckoutTemporary.cshtml.cs b/ServiceHost/Areas/Client/Pages/Company/CustomizeCheckout/CheckoutTemporary.cshtml.cs index 20d76419..72a74312 100644 --- a/ServiceHost/Areas/Client/Pages/Company/CustomizeCheckout/CheckoutTemporary.cshtml.cs +++ b/ServiceHost/Areas/Client/Pages/Company/CustomizeCheckout/CheckoutTemporary.cshtml.cs @@ -10,6 +10,7 @@ using System.Security.Claims; using System.Text.RegularExpressions; using _0_Framework.Infrastructure; using CompanyManagment.App.Contracts.Bank; +using Microsoft.Extensions.Configuration.UserSecrets; namespace ServiceHost.Areas.Client.Pages.Company.CustomizeCheckout { @@ -23,6 +24,7 @@ namespace ServiceHost.Areas.Client.Pages.Company.CustomizeCheckout private readonly IBankApplication _bankApplication; private readonly IPasswordHasher _passwordHasher; private readonly IHttpContextAccessor _httpContextAccessor; + private readonly IAuthHelper _authHelper; private readonly long _workshopId; public string WorkshopFullName; @@ -31,7 +33,7 @@ namespace ServiceHost.Areas.Client.Pages.Company.CustomizeCheckout public List YearlyList; - public CheckoutTemporaryModel(IWorkshopApplication workshopApplication, IHttpContextAccessor httpContextAccessor, IYearlySalaryApplication yearlySalaryApplication, IPasswordHasher passwordHasher, ICustomizeCheckoutTempApplication customizeCheckoutTempApplication, IEmployeeApplication employeeApplication, IBankApplication bankApplication) + public CheckoutTemporaryModel(IWorkshopApplication workshopApplication, IHttpContextAccessor httpContextAccessor, IYearlySalaryApplication yearlySalaryApplication, IPasswordHasher passwordHasher, ICustomizeCheckoutTempApplication customizeCheckoutTempApplication, IEmployeeApplication employeeApplication, IBankApplication bankApplication, IAuthHelper authHelper) { _workshopApplication = workshopApplication; _httpContextAccessor = httpContextAccessor; @@ -40,6 +42,7 @@ namespace ServiceHost.Areas.Client.Pages.Company.CustomizeCheckout _customizeCheckoutTempApplication = customizeCheckoutTempApplication; _employeeApplication = employeeApplication; _bankApplication = bankApplication; + _authHelper = authHelper; var workshopHash = _httpContextAccessor.HttpContext?.User.FindFirstValue("WorkshopSlug"); _workshopId = _passwordHasher.SlugDecrypt(workshopHash); @@ -82,6 +85,9 @@ namespace ServiceHost.Areas.Client.Pages.Company.CustomizeCheckout public IActionResult OnGetCheckoutList(SearchCustomizeCheckout searchModel) { + var permission = _authHelper.GetPermissions(); + string printPermission = permission.Any(x => x == SubAccountPermissionHelper.PrintCustomizeCheckoutTempPermissionCode) ? "true" : "false"; + string deletePermission = permission.Any(x => x == SubAccountPermissionHelper.DeleteCustomizeCheckoutTempPermissionCode) ? "true" : "false"; searchModel.WorkshopId = _workshopId; var resultData = _customizeCheckoutTempApplication.Search(searchModel).ToList(); @@ -89,7 +95,9 @@ namespace ServiceHost.Areas.Client.Pages.Company.CustomizeCheckout { success = true, data = resultData, - pageIndex = resultData.Count() + pageIndex = resultData.Count(), + printPermission = printPermission, + deletePermission = deletePermission, }); } diff --git a/ServiceHost/Areas/Client/Pages/Company/CustomizeCheckout/CheckoutUnofficial.cshtml b/ServiceHost/Areas/Client/Pages/Company/CustomizeCheckout/CheckoutUnofficial.cshtml index e720deec..736f2e90 100644 --- a/ServiceHost/Areas/Client/Pages/Company/CustomizeCheckout/CheckoutUnofficial.cshtml +++ b/ServiceHost/Areas/Client/Pages/Company/CustomizeCheckout/CheckoutUnofficial.cshtml @@ -515,7 +515,7 @@ - + diff --git a/ServiceHost/Areas/Client/Pages/Company/CustomizeCheckout/CheckoutUnofficial.cshtml.cs b/ServiceHost/Areas/Client/Pages/Company/CustomizeCheckout/CheckoutUnofficial.cshtml.cs index b3ecf21e..bd7f065f 100644 --- a/ServiceHost/Areas/Client/Pages/Company/CustomizeCheckout/CheckoutUnofficial.cshtml.cs +++ b/ServiceHost/Areas/Client/Pages/Company/CustomizeCheckout/CheckoutUnofficial.cshtml.cs @@ -12,6 +12,7 @@ using System.Security.Cryptography; using System.Text.RegularExpressions; using _0_Framework.Infrastructure; using CompanyManagment.App.Contracts.Bank; +using System.Linq; namespace ServiceHost.Areas.Client.Pages.Company.CustomizeCheckout; @@ -296,6 +297,10 @@ public class CheckoutUnofficialModel : PageModel //} public IActionResult OnGetCustomizeCheckoutsList(SearchCustomizeCheckout searchModel) { + var permission = _authHelper.GetPermissions(); + string printPermission = permission.Any(x=> x == SubAccountPermissionHelper.PrintCustomizeCheckoutPermissionCode) ? "true" : "false"; + string deletePermission = permission.Any(x => x == SubAccountPermissionHelper.DeleteCustomizeCheckoutPermissionCode) ? "true" : "false"; + var search = new SearchCustomizeCheckout() { WorkshopId = _workshopId, @@ -314,7 +319,9 @@ public class CheckoutUnofficialModel : PageModel { success = true, data = resultData, - pageIndex = resultData.Count() + pageIndex = resultData.Count(), + printPermission = printPermission, + deletePermission = deletePermission, }); } diff --git a/ServiceHost/wwwroot/AssetsClient/pages/CustomizeCheckout/js/CheckoutTemporary.js b/ServiceHost/wwwroot/AssetsClient/pages/CustomizeCheckout/js/CheckoutTemporary.js index 90d8047b..b2f9e9c9 100644 --- a/ServiceHost/wwwroot/AssetsClient/pages/CustomizeCheckout/js/CheckoutTemporary.js +++ b/ServiceHost/wwwroot/AssetsClient/pages/CustomizeCheckout/js/CheckoutTemporary.js @@ -1486,41 +1486,45 @@ function loadMore() { ${item.contractEndFa} - - - - - - - - - - - - - - - - - حذف - + ${response.printPermission === "true" ? ` + + + + + + + + + + + + + ` : ``} + + ${response.deletePermission === "true" ? ` + + + + + + + + + حذف + + + ` : ``} + - - - - - - - - - - + ${response.printPermission === "true" ? ` + + @@ -1530,7 +1534,20 @@ function loadMore() { - + + + + + + + + + + + ` : ``} + ${response.deletePermission === "true" ? ` + + @@ -1539,6 +1556,11 @@ function loadMore() { حذف + + ` : ``} + + + diff --git a/ServiceHost/wwwroot/AssetsClient/pages/CustomizeCheckout/js/CheckoutUnofficial.js b/ServiceHost/wwwroot/AssetsClient/pages/CustomizeCheckout/js/CheckoutUnofficial.js index 3518811f..d2446bc4 100644 --- a/ServiceHost/wwwroot/AssetsClient/pages/CustomizeCheckout/js/CheckoutUnofficial.js +++ b/ServiceHost/wwwroot/AssetsClient/pages/CustomizeCheckout/js/CheckoutUnofficial.js @@ -2,7 +2,7 @@ let $checkAll = $("#checkAll2"); let $checkboxes = $(".foo"); - + $checkAll.on("change", function () { $checkboxes.prop("checked", this.checked); @@ -150,7 +150,7 @@ $(document).on('click', '.btn-search-click', function (event) { const selectedMonth = $('#sendDropdownMonth').val(); const isYearMonthSelected = selectedYear === "0" && selectedMonth === "0"; - if (!isYearMonthSelected && (selectedYear === "0" || selectedMonth === "0") ) { + if (!isYearMonthSelected && (selectedYear === "0" || selectedMonth === "0")) { $('#dropdown-year').addClass("errored"); $('#dropdown-month').addClass("errored"); @@ -175,7 +175,7 @@ $(document).on('click', '.btn-search-click', function (event) { const endDate = $('.end-date').val(); const isStartEndDateSelected = startDate.trim() === "" && endDate.trim() === ""; - if (!isStartEndDateSelected && (startDate.trim() === "" || endDate.trim() === "") ) { + if (!isStartEndDateSelected && (startDate.trim() === "" || endDate.trim() === "")) { $('.start-date').addClass("errored"); $('.end-date').addClass("errored"); @@ -223,7 +223,7 @@ $(document).ready(function () { } else { $('.btn-clear-filter').addClass('disable'); } - if(filterStart !== '') { + if (filterStart !== '') { $('#start-date').text(filterStart); } if (filterEnd !== '') { @@ -1447,7 +1447,7 @@ function loadMore() { ${item.salaryAidDeduction} - + مبلغ قابل پرداخت ${item.totalPayment} ریال @@ -1481,41 +1481,43 @@ function loadMore() { ${item.contractEndFa} - - - - - - - - - + ${response.printPermission === "true" ? ` - - - - - - - - حذف - + + + + + + + + + + + + ` : ``} + ${response.deletePermission === "true" ? ` + + + + + + + + حذف + + + ` : ``} + + - - - - - - - - - - + ${response.printPermission === "true" ? ` + + @@ -1525,6 +1527,10 @@ function loadMore() { + + ` : ``} + ${response.deletePermission === "true" ? ` + @@ -1534,6 +1540,11 @@ function loadMore() { حذف + + + ` : ``} + +