get the employees select2 changes

This commit is contained in:
MahanCh
2025-04-16 20:04:57 +03:30
parent 13080fd64c
commit cc740439ec
68 changed files with 1421 additions and 817 deletions

View File

@@ -54,6 +54,7 @@ public interface IEmployeeRepository : IRepository<long, Employee>
Employee GetIgnoreQueryFilter(long id);
Task<List<EmployeeSelectListViewModel>> WorkedEmployeesInWorkshopSelectList(long workshopId);
#endregion

View File

@@ -15,12 +15,14 @@ namespace Company.Domain.RollCallEmployeeStatusAgg
///
/// <returns></returns>
void AdjustRollCallStatusEndDates(List<AdjustRollCallEmployeesWithEmployeeLeftWork> command);
/// <summary>
/// دریافت وضعیت حضور غیاب پرسنل در تاریخ مشخص
/// </summary>
/// <param name="rollCallEmployeeId"></param>
/// <param name="date"></param>
/// <returns></returns>
bool IsActiveInPeriod(long employeeId, long workshopId, DateTime start, DateTime end);
/// <summary>
/// دریافت وضعیت حضور غیاب پرسنل در تاریخ مشخص
/// </summary>
/// <param name="rollCallEmployeeId"></param>
/// <param name="date"></param>
/// <returns></returns>
RollCallEmployeeStatus GetByRollCallEmployeeIdAndDate(long rollCallEmployeeId, DateTime date);
List<RollCallEmployeeStatusViewModel> GetActiveByWorkshopIdInDate(long workshopId, DateTime startDateGr, DateTime endDateGr);
List<RollCallEmployeeStatusViewModel> GetByWorkshopIdInDates(long workshopId, DateTime start, DateTime end);

View File

@@ -10,4 +10,6 @@ public class EmployeeSelectListViewModel
{
public long Id { get; set; }
public string EmployeeFullName { get; set; }
public bool Black { get; set; }
}

View File

@@ -72,6 +72,9 @@ public interface IEmployeeApplication
Task<GetEditEmployeeInEmployeeDocumentViewModel> GetEmployeeEditInEmployeeDocumentWorkFlow(long employeeId,
long workshopId);
Task<OperationResult> EditEmployeeInEmployeeDocumentWorkFlow(EditEmployeeInEmployeeDocument command);
Task<List<EmployeeSelectListViewModel>> WorkedEmployeesInWorkshopSelectList(long workshopId);
#endregion
}

View File

@@ -1498,5 +1498,10 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
return op.Succcedded();
}
public async Task<List<EmployeeSelectListViewModel>> WorkedEmployeesInWorkshopSelectList(long workshopId)
{
return await _EmployeeRepository.WorkedEmployeesInWorkshopSelectList(workshopId);
}
#endregion
}

View File

@@ -135,6 +135,11 @@ namespace CompanyManagment.Application
public bool IsActiveInPeriod(long employeeId, long workshopId, DateTime startDate, DateTime endDate)
{
return _employeeRollCallStatusRepository.IsActiveInPeriod(employeeId, workshopId, startDate, endDate);
}
public OperationResult Deactivate(long id)
{
OperationResult op = new();

View File

@@ -802,6 +802,46 @@ public class EmployeeRepository : RepositoryBase<long, Employee>, IEmployeeRepos
{
return _context.Employees.IgnoreQueryFilters().FirstOrDefault(x => x.id == id);
}
public async Task<List<EmployeeSelectListViewModel>> WorkedEmployeesInWorkshopSelectList(long workshopId)
{
var workshopActiveLeftWorksQuery = _context.LeftWorkList.Where(x => x.WorkshopId == workshopId);
var workshopActiveInsuranceLeftWorksQuery = _context.LeftWorkInsuranceList.Where(x => x.WorkshopId == workshopId);
var employeesQuery = _context.Employees.Where(x =>
workshopActiveLeftWorksQuery.Any(y => y.EmployeeId == x.id) ||
workshopActiveInsuranceLeftWorksQuery.Any(y => y.EmployeeId == x.id)).Select(x => new
{
leftWork = workshopActiveLeftWorksQuery.Where(l => l.EmployeeId == x.id).OrderByDescending(i => i.StartWorkDate).FirstOrDefault(),
insuranceLeftWork = workshopActiveInsuranceLeftWorksQuery.Where(i => i.EmployeeId == x.id).OrderByDescending(i => i.StartWorkDate).FirstOrDefault(),
Employee = x
});
return (await employeesQuery.ToListAsync()).Select(x =>
{
var leftWork = x.leftWork;
var insuranceLeftWork = x.insuranceLeftWork;
return new EmployeeSelectListViewModel()
{
Id = x.Employee.id,
EmployeeFullName = x.Employee.FullName,
Black = ((leftWork != null && leftWork.LeftWorkDate < DateTime.Now &&
insuranceLeftWork != null && insuranceLeftWork.LeftWorkDate != null) ||
(leftWork != null && insuranceLeftWork == null &&
leftWork.LeftWorkDate < DateTime.Now) ||
(insuranceLeftWork != null && insuranceLeftWork.LeftWorkDate != null && x.leftWork == null &&
insuranceLeftWork.LeftWorkDate != null))
? true
: false,
};
}).OrderBy(x => x.Black).ToList();
}
#endregion
#region Pooya

View File

@@ -69,6 +69,7 @@ public class RollCallEmployeeStatusRepository : RepositoryBase<long, RollCallEmp
return true;
}
public RollCallEmployeeStatus GetByRollCallEmployeeIdAndDate(long rollCallEmployeeId, DateTime date)
{
return _context.RollCallEmployeesStatus.FirstOrDefault(x => x.RollCallEmployeeId == rollCallEmployeeId && x.StartDate.Date <= date.Date && x.EndDate.Date >= date.Date);

View File

@@ -2,13 +2,21 @@
@using Version = _0_Framework.Application.Version
@model ServiceHost.Areas.Client.Pages.Company.Checkouts.IndexModel
@{
string clientVersion = _0_Framework.Application.Version.StyleVersion;
Layout = "Shared/_ClientLayout";
ViewData["Title"] = " - " + "فیش حقوقی";
int i = 0;
}
@section Styles {
<link href="~/AssetsClient/css/table-style.css?ver=@Version.StyleVersion" rel="stylesheet" />
<link href="~/AssetsClient/css/table-responsive.css?ver=@Version.StyleVersion" rel="stylesheet" />
<link href="~/AssetsClient/css/select2.css?ver=@Version.StyleVersion" rel="stylesheet" />
<link href="~/AssetsClient/css/datetimepicker.css?ver=@Version.StyleVersion" rel="stylesheet" />
<link href="~/AssetsClient/css/dropdown.css?ver=@Version.StyleVersion" rel="stylesheet" />
<link href="~/AssetsClient/css/filter-search.css?ver=@Version.StyleVersion" rel="stylesheet" />
<link href="~/AssetsClient/css/table-style.css?ver=@clientVersion" rel="stylesheet" />
<link href="~/AssetsClient/css/table-responsive.css?ver=@clientVersion" rel="stylesheet" />
<link href="~/AssetsClient/css/select2.css?ver=@clientVersion" rel="stylesheet" />
<link href="~/AssetsClient/css/datetimepicker.css?ver=@clientVersion" rel="stylesheet" />
<link href="~/AssetsClient/css/dropdown.css?ver=@clientVersion" rel="stylesheet" />
<link href="~/AssetsClient/css/filter-search.css?ver=@clientVersion" rel="stylesheet" />
<style>
#my-scrollbar {
@@ -67,12 +75,6 @@
</style>
}
@{
Layout = "Shared/_ClientLayout";
ViewData["Title"] = " - " + "فیش حقوقی";
int i = 0;
}
<input type="hidden" name="pageIndex" id="pageIndex" value="@Model.PageIndex" />
<input type="hidden" name="workshopIds" id="workshopIds" value="@Model.WorkshopId" />
<input type="hidden" name="employeeId" id="employeeId" value="@Model.EmployeeId" />
@@ -96,7 +98,7 @@
</div>
</div>
<div>
<a asp-page="/Company/Workshop/Index" class="back-btn" type="button">
<a asp-page="/Index" class="back-btn" type="button">
<span>بازگشت</span>
</a>
</div>
@@ -184,7 +186,8 @@
<option value="0"> انتخاب پرسنل </option>
@foreach (var person in @Model.Employees)
{
<option style="font-family: 'IranSans' !important;" value="@person.Id"> @person.EmployeeFullName</option>
var black = person.Black ? "blackSelect" : "";
<option style="font-family: 'IranSans' !important;" class="@(black)" value="@person.Id"> @person.EmployeeFullName</option>
}
</select>
</div>
@@ -505,7 +508,8 @@
<option value="0"> انتخاب پرسنل </option>
@foreach (var person in @Model.Employees)
{
<option style="font-family: 'IranSans' !important;" value="@person.Id"> @person.EmployeeFullName</option>
var black = person.Black ? "blackSelect" : "";
<option style="font-family: 'IranSans' !important;" class="@(black)" value="@person.Id"> @person.EmployeeFullName</option>
}
</select>
</div>
@@ -648,21 +652,21 @@
</div>
<!-- End Modal From Bottom For Advance Search -->
@section Script {
<script src="~/AssetsClient/js/dropdown.js?ver=@Version.StyleVersion"></script>
<script src="~/assetsclient/js/site.js?ver=@Version.StyleVersion"></script>
<script src="~/AssetsClient/js/dropdown.js?ver=@clientVersion"></script>
<script src="~/assetsclient/js/site.js?ver=clientVersion"></script>
<script src="~/assetsclient/js/smooth-scrollbar.js"></script>
<script>
var antiForgeryToken = $(`@Html.AntiForgeryToken()`).val();
var urlLoadAllToPrintUrlAjax = `@Url.Page("./Index", "LoadAllToPrint")`;
var PaginationUrlAjax = `@Url.Page("./Index", "Pagination")`;
var PrintOneUrl = `#showmodal=@Url.Page("/Company/Checkouts/Index", "PrintOne")`;
var PrintOneMobileUrl = `#showmodal=@Url.Page("/Company/Checkouts/Index", "PrintOneMobile")`;
var PrintOneUrl = `@Url.Page("/Company/Checkouts/Index", "PrintOne")`;
var PrintOneMobileUrl = `@Url.Page("/Company/Checkouts/Index", "PrintOneMobile")`;
var CheckoutPrintAllUrl = `@Url.Page("/Company/Checkouts/CheckoutPrintAll")`;
console.log(urlLoadAllToPrintUrlAjax);
var itemsYearList = @Html.Raw(Json.Serialize(Model.YearlyList.OrderBy(x => x)));
</script>
<script src="~/assetsclient/pages/checkouts/js/index.js"></script>
<script src="~/assetsclient/pages/checkouts/js/index.js?ver=@clientVersion"></script>
}

View File

@@ -8,188 +8,193 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using System.Security.Claims;
using _0_Framework.Infrastructure;
namespace ServiceHost.Areas.Client.Pages.Company.Checkouts
{
[Authorize]
public class IndexModel : PageModel
{
#region Entities
[Authorize]
[NeedsPermission(SubAccountPermissionHelper.CheckoutListPermissionCode)]
public class IndexModel : PageModel
{
#region Entities
public List<CheckoutViewModel> Checkouts;
public CheckoutSearchModel SearchModel;
public List<EmployeeSelectListViewModel> Employees;
public string Year;
public string Month;
public long EmployeeId;
public string ContarctStart;
public string ContarctEnd;
public long WorkshopId;
public string Sorting;
public string WorkshopName { get; set; }
public List<string> YearlyList;
private readonly ICheckoutApplication _checkoutApplication;
private readonly IWorkshopApplication _workshopApplication;
private readonly IYearlySalaryApplication _yearlySalaryApplication;
private readonly IPasswordHasher _passwordHasher;
private readonly IRollCallApplication rollCallApplication;
public int PageIndex;
public List<CheckoutViewModel> Checkouts;
public CheckoutSearchModel SearchModel;
public List<EmployeeSelectListViewModel> Employees;
public string Year;
public string Month;
public long EmployeeId;
public string ContarctStart;
public string ContarctEnd;
public long WorkshopId;
public string Sorting;
public string WorkshopName { get; set; }
public List<string> YearlyList;
private readonly ICheckoutApplication _checkoutApplication;
private readonly IWorkshopApplication _workshopApplication;
private readonly IEmployeeApplication _employeeApplication;
private readonly IYearlySalaryApplication _yearlySalaryApplication;
private readonly IPasswordHasher _passwordHasher;
private readonly IRollCallApplication rollCallApplication;
public int PageIndex;
#endregion
#endregion
public IndexModel(IWorkshopApplication workshopApplication,
IEmployeeApplication employeeApplication,
IYearlySalaryApplication yearlySalaryApplication,
ICheckoutApplication checkoutApplication, IPasswordHasher passwordHasher, IRollCallApplication rollCallApplication)
{
public IndexModel(IWorkshopApplication workshopApplication,
IEmployeeApplication employeeApplication,
IYearlySalaryApplication yearlySalaryApplication,
ICheckoutApplication checkoutApplication, IPasswordHasher passwordHasher, IRollCallApplication rollCallApplication)
{
_workshopApplication = workshopApplication;
_workshopApplication = workshopApplication;
_employeeApplication = employeeApplication;
_yearlySalaryApplication = yearlySalaryApplication;
_yearlySalaryApplication = yearlySalaryApplication;
_checkoutApplication = checkoutApplication;
_passwordHasher = passwordHasher;
this.rollCallApplication = rollCallApplication;
}
_checkoutApplication = checkoutApplication;
_passwordHasher = passwordHasher;
this.rollCallApplication = rollCallApplication;
}
#region FirstLoad-OnGet
#region FirstLoad-OnGet
public IActionResult OnGet(CheckoutSearchModel searchModel)
{
var workshopHash = User.FindFirstValue("WorkshopSlug");
var workshopId = _passwordHasher.SlugDecrypt(workshopHash);
if (workshopId > 0)
{
searchModel.Sorting = string.IsNullOrWhiteSpace(searchModel.Sorting)
? "CreationDate-Max"
: searchModel.Sorting;
searchModel.PageIndex = 0;
Year = searchModel.Year;
Month = searchModel.Month;
ContarctStart = searchModel.ContractStart;
ContarctEnd = searchModel.ContractEnd;
EmployeeId = searchModel.EmployeeId;
WorkshopId = workshopId == 0 ? searchModel.WorkshopId : workshopId;
searchModel.WorkshopId = WorkshopId;
Sorting = string.IsNullOrWhiteSpace(searchModel.Sorting) ? "CreationDate-Max" : searchModel.Sorting;
var workshopInfo = _workshopApplication.GetWorkshopInfo(WorkshopId);
WorkshopName = workshopInfo.WorkshopFullName;
Employees = workshopInfo.EmployeeList.Select(x => new EmployeeSelectListViewModel()
{ Id = x.Id, EmployeeFullName = x.EmployeeFullName }).ToList();
public async Task<IActionResult> OnGet(CheckoutSearchModel searchModel)
{
var workshopHash = User.FindFirstValue("WorkshopSlug");
var workshopId = _passwordHasher.SlugDecrypt(workshopHash);
if (workshopId > 0)
{
searchModel.Sorting = string.IsNullOrWhiteSpace(searchModel.Sorting)
? "CreationDate-Max"
: searchModel.Sorting;
searchModel.PageIndex = 0;
Year = searchModel.Year;
Month = searchModel.Month;
ContarctStart = searchModel.ContractStart;
ContarctEnd = searchModel.ContractEnd;
EmployeeId = searchModel.EmployeeId;
WorkshopId = workshopId == 0 ? searchModel.WorkshopId : workshopId;
searchModel.WorkshopId = WorkshopId;
Sorting = string.IsNullOrWhiteSpace(searchModel.Sorting) ? "CreationDate-Max" : searchModel.Sorting;
var workshopInfo = _workshopApplication.GetWorkshopInfo(WorkshopId);
WorkshopName = workshopInfo.WorkshopFullName;
//Employees = workshopInfo.EmployeeList.Select(x => new EmployeeSelectListViewModel()
//{ Id = x.Id, EmployeeFullName = x.EmployeeFullName }).ToList();
Employees = await _employeeApplication.WorkedEmployeesInWorkshopSelectList(workshopId);
Checkouts = _checkoutApplication.SearchForClient(searchModel);
PageIndex = Checkouts.Count;
YearlyList =
_yearlySalaryApplication.GetYears();
SearchModel = new CheckoutSearchModel()
{
Year = string.IsNullOrWhiteSpace(searchModel.Year) ? " " : searchModel.Year,
Month = string.IsNullOrWhiteSpace(searchModel.Month) ? " " : searchModel.Month,
ContractStart = searchModel.ContractStart,
ContractEnd = searchModel.ContractEnd,
EmployeeId = searchModel.EmployeeId,
Sorting = searchModel.Sorting,
PageIndex = Checkouts.Count;
YearlyList =
_yearlySalaryApplication.GetYears();
SearchModel = new CheckoutSearchModel()
{
Year = string.IsNullOrWhiteSpace(searchModel.Year) ? " " : searchModel.Year,
Month = string.IsNullOrWhiteSpace(searchModel.Month) ? " " : searchModel.Month,
ContractStart = searchModel.ContractStart,
ContractEnd = searchModel.ContractEnd,
EmployeeId = searchModel.EmployeeId,
Sorting = searchModel.Sorting,
};
return Page();
}
else
{
return Redirect("error/401");
}
}
};
return Page();
}
else
{
return Redirect("error/401");
}
}
#endregion
#endregion
#region Pagination
#region Pagination
public IActionResult OnGetPagination(int pageIndex, long workshopId, long employeeId, string year, string month, string start, string end, string sorting)
{
var searchModel = new CheckoutSearchModel()
{
PageIndex = pageIndex,
WorkshopId = workshopId,
EmployeeId = employeeId,
Year = year,
Month = month,
ContractStart = start,
ContractEnd = end,
Sorting = sorting
};
public IActionResult OnGetPagination(int pageIndex, long workshopId, long employeeId, string year, string month, string start, string end, string sorting)
{
var searchModel = new CheckoutSearchModel()
{
PageIndex = pageIndex,
WorkshopId = workshopId,
EmployeeId = employeeId,
Year = year,
Month = month,
ContractStart = start,
ContractEnd = end,
Sorting = sorting
};
var search = _checkoutApplication.SearchForClient(searchModel);
var search = _checkoutApplication.SearchForClient(searchModel);
return new JsonResult(new
{
contractResultViewModels = search,
pageIndex = search.Count
return new JsonResult(new
{
contractResultViewModels = search,
pageIndex = search.Count
});
});
}
}
#endregion
#endregion
#region PrintOne
#region PrintOne
public IActionResult OnGetPrintOne(long id)
{
public IActionResult OnGetPrintOne(long id)
{
var res = _checkoutApplication.PrintOne(id);
var res = _checkoutApplication.PrintOne(id);
if (res.HasRollCall)
return Partial("PrintOneRollCall", res);
return Partial("PrintOne", res);
}
}
#endregion
#endregion
#region PrintOneMobile
public IActionResult OnGetPrintOneMobile(long id)
{
#region PrintOneMobile
public IActionResult OnGetPrintOneMobile(long id)
{
var res = _checkoutApplication.PrintOne(id);
var res = _checkoutApplication.PrintOne(id);
if (res.HasRollCall)
return Partial("PrintOneRollCall", res);
return Partial("PrintOneMobile", res);
}
}
#endregion
#endregion
#region LoadAllToPrint
public IActionResult OnGetLoadAllToPrint(long workshopId, long employeeId, string year, string month)
{
var searchModel = new CheckoutSearchModel()
{
SearchAll = true,
WorkshopId = workshopId,
EmployeeId = employeeId,
Year = year,
Month = month,
#region LoadAllToPrint
public IActionResult OnGetLoadAllToPrint(long workshopId, long employeeId, string year, string month)
{
var searchModel = new CheckoutSearchModel()
{
SearchAll = true,
WorkshopId = workshopId,
EmployeeId = employeeId,
Year = year,
Month = month,
};
};
var search = _checkoutApplication.SearchForClient(searchModel);
var search = _checkoutApplication.SearchForClient(searchModel);
return new JsonResult(new
{
contractResultViewModels = search,
pageIndex = search.Count
return new JsonResult(new
{
contractResultViewModels = search,
pageIndex = search.Count
});
});
}
#endregion
}
}
#endregion
}
public class Person
{
public string FirstName { get; set; }
public string LastName { get; set; }
public int Age { get; set; }
}
public class Person
{
public string FirstName { get; set; }
public string LastName { get; set; }
public int Age { get; set; }
}
}

View File

@@ -104,7 +104,7 @@
</div>
</div>
<div>
<a asp-page="/Company/Workshop/Index" class="back-btn" type="button">
<a asp-page="/Index" class="back-btn" type="button">
<span>بازگشت</span>
</a>
</div>
@@ -167,7 +167,8 @@
<option value="0"> انتخاب پرسنل </option>
@foreach (var person in @Model.Employees)
{
<option style="font-family: 'IranSans' !important;" value="@person.Id"> @person.EmployeeFullName</option>
var black = person.Black ? "blackSelect" : "";
<option style="font-family: 'IranSans' !important;" class="@(black)" value="@person.Id"> @person.EmployeeFullName</option>
}
</select>
</div>
@@ -507,7 +508,8 @@
<option value="0"> انتخاب پرسنل </option>
@foreach (var person in @Model.Employees)
{
<option style="font-family: 'IranSans' !important;" value="@person.Id"> @person.EmployeeFullName</option>
var black = person.Black ? "blackSelect" : "";
<option style="font-family: 'IranSans' !important;" class="@(black)" value="@person.Id"> @person.EmployeeFullName</option>
}
</select>
</div>
@@ -1782,13 +1784,25 @@
}
$("#getPersonnel").select2({
language: "fa",
dir: "rtl"
dir: "rtl",
templateResult: function (data, container) {
if (data.element) {
$(container).addClass($(data.element).attr("class"));
}
return data.text;
}
});
$("#getPersonneModal").select2({
language: "fa",
dir: "rtl",
dropdownParent: $("#searchModal")
dropdownParent: $('#searchModal'),
templateResult: function (data, container) {
if (data.element) {
$(container).addClass($(data.element).attr("class"));
}
return data.text;
}
});
// $(".date").mask("0000/00/00");
@@ -2205,14 +2219,13 @@
<script>
function printOne(id) {
var parametr = '&id=' + id;
var url = '#showmodal=@Url.Page("/Company/Contracts/Index", "PrintOne")';
window.location.href = url + parametr;
var url = '@Url.Page("/Company/Contracts/Index", "PrintOne")';
AjaxUrlContentModal(url + parametr);
}
function printOneMobile(id) {
var parametr = '&id=' + id;
var url = '#showmodal=@Url.Page("/Company/Contracts/Index", "PrintOneMobile")';
window.location.href = url + parametr;
var url = '@Url.Page("/Company/Contracts/Index", "PrintOneMobile")';
AjaxUrlContentModal(url + parametr);
}
function printAll() {

View File

@@ -7,6 +7,7 @@ using System.Runtime.Versioning;
using System.Security.Claims;
using System.Text;
using _0_Framework.Application;
using _0_Framework.Infrastructure;
using Company.Domain.CheckoutAgg;
using Company.Domain.ContarctingPartyAgg;
using Company.Domain.ContractAgg;
@@ -40,6 +41,8 @@ using ServiceHost.Pages;
namespace ServiceHost.Areas.Client.Pages.Company.Contracts
{
[Authorize]
[NeedsPermission(SubAccountPermissionHelper.ContractListPermissionCode)]
public class IndexModel : PageModel
{
#region Entities
@@ -65,6 +68,7 @@ namespace ServiceHost.Areas.Client.Pages.Company.Contracts
public List<string> YearlyList;
private readonly IContractApplication _contractApplication;
private readonly IWorkshopApplication _workshopApplication;
private readonly IEmployeeApplication _employeeApplication;
private readonly IYearlySalaryApplication _yearlySalaryApplication;
private readonly IPasswordHasher _passwordHasher;
public int PageIndex;
@@ -73,17 +77,18 @@ namespace ServiceHost.Areas.Client.Pages.Company.Contracts
#endregion
public IndexModel(IContractApplication contractApplication, IWorkshopApplication workshopApplication, IYearlySalaryApplication yearlySalaryApplication, IPasswordHasher passwordHasher)
public IndexModel(IContractApplication contractApplication, IWorkshopApplication workshopApplication, IYearlySalaryApplication yearlySalaryApplication, IPasswordHasher passwordHasher, IEmployeeApplication employeeApplication)
{
_contractApplication = contractApplication;
_workshopApplication = workshopApplication;
_yearlySalaryApplication = yearlySalaryApplication;
_passwordHasher = passwordHasher;
_employeeApplication = employeeApplication;
}
#region FirstLoad-OnGet
public IActionResult OnGet(ContractSearchModel searchModel)
public async Task<IActionResult> OnGet(ContractSearchModel searchModel)
{
if (User.Identity.IsAuthenticated)
{
@@ -102,8 +107,9 @@ namespace ServiceHost.Areas.Client.Pages.Company.Contracts
Sorting = string.IsNullOrWhiteSpace(searchModel.Sorting) ? "CreationDate-Max" : searchModel.Sorting;
var workshopInfo = _workshopApplication.GetWorkshopInfo(WorkshopId);
WorkshopName = workshopInfo.WorkshopFullName;
Employees = workshopInfo.EmployeeList.Select(x => new EmployeeSelectListViewModel()
{ Id = x.Id, EmployeeFullName = x.EmployeeFullName }).ToList();
//Employees = workshopInfo.EmployeeList.Select(x => new EmployeeSelectListViewModel()
//{ Id = x.Id, EmployeeFullName = x.EmployeeFullName }).ToList();
Employees = await _employeeApplication.WorkedEmployeesInWorkshopSelectList(workshopId);
Contracts = _contractApplication.SearchForClient(searchModel);
PageIndex = Contracts.Count;
YearlyList = _yearlySalaryApplication.GetYears();

View File

@@ -110,7 +110,7 @@
</div>
</div>
<div>
<a asp-page="/Company/CustomizeCheckout/Index" class="back-btn" type="button">
<a asp-page="/Index" class="back-btn" type="button">
<span>بازگشت</span>
</a>
</div>
@@ -259,7 +259,7 @@
</svg>
<span>پرینت گروهی</span>
</button>
<button onclick="downloadExcelAll()" class="btn-excel text-nowrap" type="button" Permission="@SubAccountPermissionHelper.ExcelCustomizeCheckoutTempPermissionCode">
<button onclick="showExcelAllModal()" class="btn-excel text-nowrap" type="button" Permission="@SubAccountPermissionHelper.ExcelCustomizeCheckoutTempPermissionCode">
<svg width="20" height="20" viewBox="0 0 400 400" xmlns="http://www.w3.org/2000/svg" fill="#000000">
<g id="SVGRepo_bgCarrier" stroke-width="1"></g>
<g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g>
@@ -325,7 +325,7 @@
</svg>
<span>پرینت گروهی</span>
</button>
<button onclick="downloadExcelAll()" class="btn-excel text-nowrap" type="button" Permission="@SubAccountPermissionHelper.ExcelCustomizeCheckoutTempPermissionCode">
<button onclick="showExcelAllModal()" class="btn-excel text-nowrap" type="button" Permission="@SubAccountPermissionHelper.ExcelCustomizeCheckoutTempPermissionCode">
<svg width="20" height="20" viewBox="0 0 400 400" xmlns="http://www.w3.org/2000/svg" fill="#000000">
<g id="SVGRepo_bgCarrier" stroke-width="1"></g>
<g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g>

View File

@@ -101,9 +101,9 @@ namespace ServiceHost.Areas.Client.Pages.Company.CustomizeCheckout
});
}
public IActionResult OnGetEmployeeList()
public async Task<IActionResult> OnGetEmployeeList()
{
var result = _employeeApplication.GetWorkingEmployeesByWorkshopId(_workshopId);
var result = await _employeeApplication.WorkedEmployeesInWorkshopSelectList(_workshopId);
return new JsonResult(new
{
success = true,

View File

@@ -101,7 +101,7 @@
</div>
</div>
<div>
<a asp-page="/Company/CustomizeCheckout/Index" class="back-btn" type="button">
<a asp-page="/Index" class="back-btn" type="button">
<span>بازگشت</span>
</a>
</div>
@@ -179,7 +179,7 @@
<path d="M7 14.5l5-5 5 5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>
</svg>
<ul class="dropdown p-2 border">
<li class="item" value-data="@CustomizeCheckoutOrderByEnum.ContractStartDesc">شروع قرارداد - بزرگ به کوچک</li> ds
<li class="item" value-data="@CustomizeCheckoutOrderByEnum.ContractStartDesc">شروع قرارداد - بزرگ به کوچک</li>
<li class="item" value-data="@CustomizeCheckoutOrderByEnum.ContractStart">شروع قرارداد - کوچک به بزرگ</li>
<li class="item" value-data="@CustomizeCheckoutOrderByEnum.ContractNo">شماره قرارداد - کوچک به بزرگ</li>
<li class="item" value-data="@CustomizeCheckoutOrderByEnum.ContractNoDesc">شماره قرارداد - بزرگ به کوچک</li>
@@ -257,7 +257,7 @@
<span>پرینت گروهی</span>
</button>
<button onclick="excelDownloadAll()" class="btn-excel text-nowrap me-1" type="button" Permission="@SubAccountPermissionHelper.ExcelCustomizeCheckoutPermissionCode">
<button onclick="showExcelAllModal()" class="btn-excel text-nowrap me-1" type="button" Permission="@SubAccountPermissionHelper.ExcelCustomizeCheckoutPermissionCode">
<svg width="20" height="20" viewBox="0 0 400 400" xmlns="http://www.w3.org/2000/svg" fill="#000000">
<g id="SVGRepo_bgCarrier" stroke-width="1"></g>
<g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g>
@@ -324,7 +324,7 @@
</svg>
<span>پرینت گروهی</span>
</button>
<button onclick="excelDownloadAll()" class="btn-excel text-nowrap" type="button" Permission="@SubAccountPermissionHelper.ExcelCustomizeCheckoutPermissionCode">
<button onclick="showExcelAllModal()" class="btn-excel text-nowrap" type="button" Permission="@SubAccountPermissionHelper.ExcelCustomizeCheckoutPermissionCode">
<svg width="20" height="20" viewBox="0 0 400 400" xmlns="http://www.w3.org/2000/svg" fill="#000000">
<g id="SVGRepo_bgCarrier" stroke-width="1"></g>
<g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g>

View File

@@ -325,9 +325,9 @@ public class CheckoutUnofficialModel : PageModel
});
}
public IActionResult OnGetEmployeeList()
public async Task<IActionResult> OnGetEmployeeList()
{
var result = _employeeApplication.GetWorkingEmployeesByWorkshopId(_workshopId);
var result = await _employeeApplication.WorkedEmployeesInWorkshopSelectList(_workshopId);
return new JsonResult(new
{
success = true,

View File

@@ -90,7 +90,7 @@
</div>
</div>
<div>
<a asp-page="/Company/CustomizeCheckout/Index" class="back-btn" type="button">
<a asp-page="/Index" class="back-btn" type="button">
<span>بازگشت</span>
</a>
</div>
@@ -220,7 +220,13 @@
$(document).ready(function () {
$(".select2Option").select2({
language: "fa",
dir: "rtl"
dir: "rtl",
templateResult: function (data, container) {
if (data.element) {
$(container).addClass($(data.element).attr("class"));
}
return data.text;
}
});
$(document).on('click', ".openAction", function () {

View File

@@ -707,7 +707,13 @@
$(".select2Option").select2({
language: "fa",
dir: "rtl",
dropdownParent: $('#MainModal')
dropdownParent: $('#MainModal'),
templateResult: function (data, container) {
if (data.element) {
$(container).addClass($(data.element).attr("class"));
}
return data.text;
}
});
ajaxPersonals();
@@ -718,10 +724,11 @@
success: function (response) {
$('#cardSectionLeave').addClass('blur');
$("#cardSectionLeave div *").prop('disabled', true);
var employees = response.connectedPersonnel.connectedPersonnelViewModels;
var employees = response.data;
var employeeOptionsHtml = '<option value="">انتخاب پرسنل ...</option>';
employees.forEach(function (employee) {
employeeOptionsHtml += '<option value="' + employee.employeeId + '">' + employee.personName + '</option>';
var black = employee.black ? "blackSelect" : "";
employeeOptionsHtml += `<option class="${black}" value="${employee.id}">${employee.employeeFullName}</option>`;
});
$('#employeeSelect').html(employeeOptionsHtml);
},

View File

@@ -134,7 +134,7 @@
</div>
</div>
<div>
<a asp-page="/Company/Employees/Index" class="back-btn" type="button">
<a asp-page="/Index" class="back-btn" type="button">
<span>بازگشت</span>
</a>
</div>
@@ -197,13 +197,13 @@
<div class="row justify-content-between g-1 mt-1">
<div Permission="@SubAccountPermissionHelper.AddEmployeePermissionCode" class="col-6">
<button class="btn-create w-100" onclick="openCreateEmployeeModal()">
<button class="btn-create w-100" onclick="openCreateEmployeeModal()">
<span>ایجاد پرسنل</span>
</button>
</div>
<div Permission="@SubAccountPermissionHelper.LeftWorkEmployeePermissionCode" class="col-6">
<button class="btn-create w-100" onclick="openCreateLeftWorkEmployeeModal()">
<button class="btn-create w-100" onclick="openCreateLeftWorkEmployeeModal()">
<span>اعلام ترک کار</span>
</button>
</div>
@@ -235,7 +235,7 @@
<div class="container-fluid d-none d-md-block" style="padding: 0px 6px">
<div class="row d-none d-md-flex align-items-center my-1 px-0">
<div class="col-4 pe-0">
<button Permission="@SubAccountPermissionHelper.AddEmployeePermissionCode" type="button" class="btn-create text-nowrap" onclick="openCreateEmployeeModal()">
<button Permission="@SubAccountPermissionHelper.AddEmployeePermissionCode" type="button" class="btn-create text-nowrap" onclick="openCreateEmployeeModal()">
<svg width="20" height="20" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="11" cy="11" r="8.25" stroke-width="1.5" stroke="white" />
<path d="M11 13.75L11 8.25" stroke-width="1.5" stroke="white" stroke-linecap="round" />

View File

@@ -283,9 +283,9 @@ namespace ServiceHost.Areas.Client.Pages.Company.Employees
return Partial("ModalCreateLeftWorkEmployee", command);
}
public IActionResult OnGetEmployeeList()
public async Task<IActionResult> OnGetEmployeeList()
{
var employees = _employeeApplication.GetWorkingEmployeesByWorkshopId(_workshopId);
var employees = await _employeeApplication.WorkedEmployeesInWorkshopSelectList(_workshopId);
return new JsonResult(new
{

View File

@@ -317,39 +317,50 @@ namespace ServiceHost.Areas.Client.Pages.Company.Employees
}
}
public IActionResult OnGetEmployeeList()
public async Task<IActionResult> OnGetEmployeeList()
{
var workshopSlug = User.FindFirstValue("WorkshopSlug");
var workshopId = _passwordHasher.SlugDecrypt(workshopSlug);
if (workshopId > 0)
{
var result = _workshopApplication.GetConnectedPersonnels(workshopId);
var r = result.GroupBy(x => x.PersonName).Select(x => x.First()).ToList();
ConnectedPersonnel = new ConnectedPersonnelViewModel()
{
ConnectedPersonnelViewModels = r.OrderBy(x => x.Black ? 1 : 0).ThenBy(x => x.PersonelCode).ToList(),
};
var employees = await _employeeApplication.WorkedEmployeesInWorkshopSelectList(workshopId);
// لیست پرسنلی که قرارداد ندارند
//var filteredBlackResult = _workshopApplication.GetConnectedPersonnels(workshopId)
// .Where(x => !x.Black && x.ContractPerson)
// .GroupBy(x => x.EmployeeId)
// .Select(x => x.First())
// .OrderBy(x => x.PersonelCode)
// .ToList();
//var result = _workshopApplication.GetConnectedPersonnels(workshopId);
//var r = result.GroupBy(x => x.PersonName).Select(x => x.First()).ToList();
//ConnectedPersonnel = new ConnectedPersonnelViewModel()
//{
// ConnectedPersonnelViewModels = filteredBlackResult,
//};
//ConnectedPersonnel = new ConnectedPersonnelViewModel()
//{
// ConnectedPersonnelViewModels = r.OrderBy(x => x.Black ? 1 : 0).ThenBy(x => x.PersonelCode).ToList(),
//};
return new JsonResult(new { ConnectedPersonnel });
// لیست پرسنلی که قرارداد ندارند
//var filteredBlackResult = _workshopApplication.GetConnectedPersonnels(workshopId)
// .Where(x => !x.Black && x.ContractPerson)
// .GroupBy(x => x.EmployeeId)
// .Select(x => x.First())
// .OrderBy(x => x.PersonelCode)
// .ToList();
//ConnectedPersonnel = new ConnectedPersonnelViewModel()
//{
// ConnectedPersonnelViewModels = filteredBlackResult,
//};
return new JsonResult(new
{
success = true,
data = employees
});
}
else
{
return new JsonResult(new { ConnectedPersonnel = new ConnectedPersonnelViewModel() });
}
return new JsonResult(new
{
success = true,
data = "داده ای یافت نشد!"
});
}
}
public IActionResult OnGetLeaveCreate()

View File

@@ -140,7 +140,7 @@
</div>
</div>
<div>
<a asp-page="/Company/Employees/Index" class="back-btn" type="button">
<a asp-page="/Index" class="back-btn" type="button">
<span>بازگشت</span>
</a>
</div>
@@ -2629,7 +2629,13 @@
$($('#employeeSelectMobile').val()).select2({
formatSelection: formatSelection,
width: 300
width: 300,
templateResult: function (data, container) {
if (data.element) {
$(container).addClass($(data.element).attr("class"));
}
return data.text;
}
});
var workshopId = $('#WorkshopId').val();
@@ -2640,12 +2646,12 @@
type: 'GET',
data: { workshopId: workshopId },
success: function (response) {
var employees = response.personleList.connectedPersonnelViewModels;
var employees = response.data;
var employeeOptionsHtml = `<option value="" ${employeeIdSelected == 0 ? 'selected' : ''}>انتخاب پرسنل ...</option>`;
var employeeOptionsHtml = `<option value="" ${employeeIdSelected === 0 ? 'selected' : ''}>انتخاب پرسنل ...</option>`;
employees.forEach(function (employee) {
var black = employee.black ? "blackSelect" : "";
employeeOptionsHtml += `<option class="${black}" value="${employee.employeeId}" ${employeeIdSelected === employee.employeeId ? 'selected' : ''}>${employee.personName}</option>`;
employeeOptionsHtml += `<option class="${black}" value="${employee.id}" ${employeeIdSelected === employee.id ? 'selected' : ''}>${employee.employeeFullName}</option>`;
});
$('#employeeSelect').html(employeeOptionsHtml);
$('#employeeSelectMobile').html(employeeOptionsHtml);

View File

@@ -355,30 +355,39 @@ namespace ServiceHost.Areas.Client.Pages.Company.Employees
#endregion
#region Load All Personal by ajax (EmployeeList)
public IActionResult OnGetEmployeeList(long workshopId)
{
var result = _workshopApplication.GetConnectedPersonnels(workshopId);
var r = result.GroupBy(x => x.PersonName).Select(x => x.First()).ToList();
public async Task<IActionResult> OnGetEmployeeList(long workshopId)
{
var employees = await _employeeApplication.WorkedEmployeesInWorkshopSelectList(workshopId);
personleList = new ConnectedPersonnelViewModel()
{
ConnectedPersonnelViewModels = r.OrderBy(x => x.Black ? 1 : 0).ThenBy(x => x.PersonelCode).ToList(),
};
//var result = _workshopApplication.GetConnectedPersonnels(workshopId);
// var r = result.GroupBy(x => x.PersonName).Select(x => x.First()).ToList();
// لیست پرسنلی که قرارداد ندارند
//var filteredBlackResult = _workshopApplication.GetConnectedPersonnels(workshopId)
// .Where(x => !x.Black && x.ContractPerson)
// .GroupBy(x => x.EmployeeId)
// .Select(x => x.First())
// .OrderBy(x => x.PersonelCode)
// .ToList();
// personleList = new ConnectedPersonnelViewModel()
// {
// ConnectedPersonnelViewModels = r.OrderBy(x => x.Black ? 1 : 0).ThenBy(x => x.PersonelCode).ToList(),
// };
//personleList = new ConnectedPersonnelViewModel()
//{
// ConnectedPersonnelViewModels = filteredBlackResult,
//};
// لیست پرسنلی که قرارداد ندارند
//var filteredBlackResult = _workshopApplication.GetConnectedPersonnels(workshopId)
// .Where(x => !x.Black && x.ContractPerson)
// .GroupBy(x => x.EmployeeId)
// .Select(x => x.First())
// .OrderBy(x => x.PersonelCode)
// .ToList();
return new JsonResult(new { personleList });
//personleList = new ConnectedPersonnelViewModel()
//{
// ConnectedPersonnelViewModels = filteredBlackResult,
//};
//return new JsonResult(new { personleList });
return new JsonResult(new
{
success = true,
data = employees
});
}
#endregion

View File

@@ -856,11 +856,11 @@
success: function (response) {
$('#cardSectionLeave').addClass('blur');
$("#cardSectionLeave div *").prop('disabled', true);
var employees = response.connectedPersonnel.connectedPersonnelViewModels;
var employees = response.data;
var employeeOptionsHtml = '<option value="">انتخاب پرسنل ...</option>';
employees.forEach(function (employee) {
var black = employee.black ? "blackSelect" : "";
employeeOptionsHtml += `<option class="${black}" value="${employee.employeeId}">${employee.personName}</option>`;
employeeOptionsHtml += `<option class="${black}" value="${employee.id}">${employee.employeeFullName}</option>`;
});
$('#employeeSelect').html(employeeOptionsHtml);
},

View File

@@ -35,7 +35,7 @@
</div>
</div>
<div>
<a asp-page="/Company/Employees/Index" class="back-btn" type="button">
<a asp-page="/Index" class="back-btn" type="button">
<span>بازگشت</span>
</a>
</div>
@@ -262,7 +262,7 @@
<div id="MainModal" class="modal fade" tabindex="-1" data-bs-backdrop="static" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
<div class="modal-dialog modal-dialog-centered modal-dialog-scrollable Modal-width">
<div class="modal-dialog modal-dialog-centered Modal-width">
<div class="modal-content" id="ModalContent">
</div>
</div>

View File

@@ -52,9 +52,9 @@ namespace ServiceHost.Areas.Client.Pages.Company.EmployeesBankInfo
WorkshopFullName = workshop.WorkshopFullName;
}
public IActionResult OnGetEmployeeListAjax()
public async Task<IActionResult> OnGetEmployeeListAjax()
{
var resultData = _employeeApplication.GetWorkingEmployeesByWorkshopId(_workshopId);
var resultData = await _employeeApplication.WorkedEmployeesInWorkshopSelectList(_workshopId);
return new JsonResult(new
{
success = true,

View File

@@ -30,7 +30,7 @@
</div>
</div>
<div>
<a asp-page="/Company/Employees/Index" class="back-btn" type="button">
<a asp-page="/Index" class="back-btn" type="button">
<span>بازگشت</span>
</a>
</div>

View File

@@ -37,7 +37,7 @@
</div>
</div>
<div>
<a asp-page="/Company/Employees/Index" class="back-btn" type="button">
<a asp-page="/Index" class="back-btn" type="button">
<span>بازگشت</span>
</a>
</div>

View File

@@ -75,9 +75,9 @@ namespace ServiceHost.Areas.Client.Pages.Company.Fine
});
}
public IActionResult OnGetEmployeeList()
public async Task<IActionResult> OnGetEmployeeList()
{
var employees = _employeeApplication.GetWorkingEmployeesByWorkshopId(_workshopId);
var employees = await _employeeApplication.WorkedEmployeesInWorkshopSelectList(_workshopId);
return new JsonResult(new
{

View File

@@ -63,7 +63,7 @@
</div>
</div>
<div>
<a asp-page="/Company/Workshop/Index" class="back-btn" type="button">
<a asp-page="/Index" class="back-btn" type="button">
<span>بازگشت</span>
</a>
</div>
@@ -274,7 +274,7 @@
<div class="Rtable-cell--content d-flex justify-content-end align-items-center">
<div class="Rtable-cell--heading d-block text-center">
<a class="btn-print lessThan992" type="button" href="#showmodal=@Url.Page("./Index", "PrintOneMobile", new { Id = item.Id })">
<a class="btn-print lessThan992" type="button" onclick="AjaxUrlContentModal('@Url.Page("./Index", "PrintOneMobile", new { Id = item.Id })');">
<svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" viewBox="0 0 20 20" fill="none" stroke="currentColor">
<path d="M15.0001 11.2493H15.139C16.0279 11.2493 16.4723 11.2493 16.759 10.9866C16.7805 10.967 16.801 10.9464 16.8207 10.9249C17.0834 10.6382 17.0834 10.1938 17.0834 9.3049V9.3049C17.0834 7.52714 17.0834 6.63826 16.558 6.06484C16.5187 6.02194 16.4775 5.98077 16.4346 5.94146C15.8612 5.41602 14.9723 5.41602 13.1945 5.41602H6.91675C5.03113 5.41602 4.08832 5.41602 3.50253 6.0018C2.91675 6.58759 2.91675 7.5304 2.91675 9.41602V10.2493C2.91675 10.7208 2.91675 10.9565 3.06319 11.1029C3.20964 11.2493 3.44534 11.2493 3.91675 11.2493H5.00008"/>
<path d="M5.41675 16.3903L5.41675 9.91732C5.41675 8.97451 5.41675 8.5031 5.70964 8.21021C6.00253 7.91732 6.47394 7.91732 7.41675 7.91732L12.5834 7.91732C13.5262 7.91732 13.9976 7.91732 14.2905 8.21021C14.5834 8.5031 14.5834 8.97451 14.5834 9.91732L14.5834 16.3903C14.5834 16.7068 14.5834 16.8651 14.4796 16.9399C14.3758 17.0148 14.2256 16.9647 13.9253 16.8646L12.2572 16.3086C12.1712 16.2799 12.1282 16.2656 12.0839 16.2669C12.0396 16.2682 11.9975 16.285 11.9134 16.3187L10.1858 17.0097C10.0941 17.0464 10.0482 17.0647 10.0001 17.0647C9.95194 17.0647 9.90609 17.0464 9.81439 17.0097L8.0868 16.3187C8.00267 16.285 7.9606 16.2682 7.91627 16.2669C7.87194 16.2656 7.82896 16.2799 7.74299 16.3086L6.07486 16.8646C5.77455 16.9647 5.62439 17.0148 5.52057 16.9399C5.41675 16.8651 5.41675 16.7068 5.41675 16.3903Z"/>
@@ -292,7 +292,7 @@
<div class="Rtable-cell d-md-block d-none">
<div class="Rtable-cell--content align-items-center d-flex d-md-block text-end">
<a class="btn-print moreThan992" type="button" href="#showmodal=@Url.Page("./Index", "PrintOne", new { Id = item.Id })">
<button class="btn-print moreThan992" type="button" onclick="AjaxUrlContentModal('@Url.Page("./Index", "PrintOne", new { Id = item.Id })')">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke="currentColor">
<path d="M15.0001 11.2493H15.139C16.0279 11.2493 16.4723 11.2493 16.759 10.9866C16.7805 10.967 16.801 10.9464 16.8207 10.9249C17.0834 10.6382 17.0834 10.1938 17.0834 9.3049V9.3049C17.0834 7.52714 17.0834 6.63826 16.558 6.06484C16.5187 6.02194 16.4775 5.98077 16.4346 5.94146C15.8612 5.41602 14.9723 5.41602 13.1945 5.41602H6.91675C5.03113 5.41602 4.08832 5.41602 3.50253 6.0018C2.91675 6.58759 2.91675 7.5304 2.91675 9.41602V10.2493C2.91675 10.7208 2.91675 10.9565 3.06319 11.1029C3.20964 11.2493 3.44534 11.2493 3.91675 11.2493H5.00008"/>
<path d="M5.41675 16.3903L5.41675 9.91732C5.41675 8.97451 5.41675 8.5031 5.70964 8.21021C6.00253 7.91732 6.47394 7.91732 7.41675 7.91732L12.5834 7.91732C13.5262 7.91732 13.9976 7.91732 14.2905 8.21021C14.5834 8.5031 14.5834 8.97451 14.5834 9.91732L14.5834 16.3903C14.5834 16.7068 14.5834 16.8651 14.4796 16.9399C14.3758 17.0148 14.2256 16.9647 13.9253 16.8646L12.2572 16.3086C12.1712 16.2799 12.1282 16.2656 12.0839 16.2669C12.0396 16.2682 11.9975 16.285 11.9134 16.3187L10.1858 17.0097C10.0941 17.0464 10.0482 17.0647 10.0001 17.0647C9.95194 17.0647 9.90609 17.0464 9.81439 17.0097L8.0868 16.3187C8.00267 16.285 7.9606 16.2682 7.91627 16.2669C7.87194 16.2656 7.82896 16.2799 7.74299 16.3086L6.07486 16.8646C5.77455 16.9647 5.62439 17.0148 5.52057 16.9399C5.41675 16.8651 5.41675 16.7068 5.41675 16.3903Z"/>
@@ -300,9 +300,9 @@
<path d="M7.91675 13.75L12.0834 13.75" stroke-linecap="round"/>
<path d="M14.5834 5.41732V5.41732C14.5834 3.97799 14.5834 3.25833 14.1954 2.76756C14.1087 2.65791 14.0095 2.55874 13.8998 2.47204C13.4091 2.08398 12.6894 2.08398 11.2501 2.08398H8.75008C7.31076 2.08398 6.5911 2.08398 6.10032 2.47204C5.99068 2.55874 5.8915 2.65791 5.8048 2.76756C5.41675 3.25833 5.41675 3.97799 5.41675 5.41732V5.41732"/>
</svg>
</a>
</button>
<a class="btn-print lessThan992" type="button" href="#showmodal=@Url.Page("./Index", "PrintOneMobile", new { Id = item.Id })">
<button class="btn-print lessThan992" type="button" onclick="AjaxUrlContentModal('@Url.Page("./Index", "PrintOneMobile", new { Id = item.Id })')">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke="currentColor">
<path d="M15.0001 11.2493H15.139C16.0279 11.2493 16.4723 11.2493 16.759 10.9866C16.7805 10.967 16.801 10.9464 16.8207 10.9249C17.0834 10.6382 17.0834 10.1938 17.0834 9.3049V9.3049C17.0834 7.52714 17.0834 6.63826 16.558 6.06484C16.5187 6.02194 16.4775 5.98077 16.4346 5.94146C15.8612 5.41602 14.9723 5.41602 13.1945 5.41602H6.91675C5.03113 5.41602 4.08832 5.41602 3.50253 6.0018C2.91675 6.58759 2.91675 7.5304 2.91675 9.41602V10.2493C2.91675 10.7208 2.91675 10.9565 3.06319 11.1029C3.20964 11.2493 3.44534 11.2493 3.91675 11.2493H5.00008" />
<path d="M5.41675 16.3903L5.41675 9.91732C5.41675 8.97451 5.41675 8.5031 5.70964 8.21021C6.00253 7.91732 6.47394 7.91732 7.41675 7.91732L12.5834 7.91732C13.5262 7.91732 13.9976 7.91732 14.2905 8.21021C14.5834 8.5031 14.5834 8.97451 14.5834 9.91732L14.5834 16.3903C14.5834 16.7068 14.5834 16.8651 14.4796 16.9399C14.3758 17.0148 14.2256 16.9647 13.9253 16.8646L12.2572 16.3086C12.1712 16.2799 12.1282 16.2656 12.0839 16.2669C12.0396 16.2682 11.9975 16.285 11.9134 16.3187L10.1858 17.0097C10.0941 17.0464 10.0482 17.0647 10.0001 17.0647C9.95194 17.0647 9.90609 17.0464 9.81439 17.0097L8.0868 16.3187C8.00267 16.285 7.9606 16.2682 7.91627 16.2669C7.87194 16.2656 7.82896 16.2799 7.74299 16.3086L6.07486 16.8646C5.77455 16.9647 5.62439 17.0148 5.52057 16.9399C5.41675 16.8651 5.41675 16.7068 5.41675 16.3903Z" />
@@ -310,7 +310,7 @@
<path d="M7.91675 13.75L12.0834 13.75" stroke-linecap="round" />
<path d="M14.5834 5.41732V5.41732C14.5834 3.97799 14.5834 3.25833 14.1954 2.76756C14.1087 2.65791 14.0095 2.55874 13.8998 2.47204C13.4091 2.08398 12.6894 2.08398 11.2501 2.08398H8.75008C7.31076 2.08398 6.5911 2.08398 6.10032 2.47204C5.99068 2.55874 5.8915 2.65791 5.8048 2.76756C5.41675 3.25833 5.41675 3.97799 5.41675 5.41732V5.41732" />
</svg>
</a>
</button>
</div>
</div>
</div>

View File

@@ -36,7 +36,7 @@
</div>
</div>
<div>
<a asp-page="/Company/Employees/Index" class="back-btn" type="button">
<a asp-page="/Index" class="back-btn" type="button">
<span>بازگشت</span>
</a>
</div>

View File

@@ -78,7 +78,7 @@ namespace ServiceHost.Areas.Client.Pages.Company.Loan
});
}
public IActionResult OnGetEmployeeList()
public async Task<IActionResult> OnGetEmployeeList()
{
var workshopHash = User.FindFirstValue("WorkshopSlug");
var workshopId = _passwordHasher.SlugDecrypt(workshopHash);
@@ -89,10 +89,7 @@ namespace ServiceHost.Areas.Client.Pages.Company.Loan
message = "کارگاه ای یافت نشد",
});
var employees = _employeeApplication.GetWorkingEmployeesByWorkshopId(workshopId);
var employees = await _employeeApplication.WorkedEmployeesInWorkshopSelectList(workshopId);
return new JsonResult(new
{

View File

@@ -1,4 +1,4 @@
@page "{workshopHash}/{employeeHash}"
@page
@model ServiceHost.Areas.Client.Pages.Company.PaymentToEmployee.IndexModel
@using _0_Framework.Application
@using Version = _0_Framework.Application.Version
@@ -20,6 +20,7 @@
<link href="~/AssetsClient/css/datetimepicker.css?ver=@Version.StyleVersion" rel="stylesheet" />
<link href="~/AssetsClient/css/dropdown.css?ver=@Version.StyleVersion" rel="stylesheet" />
<link href="~/AssetsClient/css/filter-search.css?ver=@Version.StyleVersion" rel="stylesheet" />
<link href="~/AssetsClient/css/select2.css?ver=@Version.StyleVersion" rel="stylesheet" />
<!-- sweet alerts -->
<link href="~/AdminTheme/assets/sweet-alert/sweet-alert.min.css" rel="stylesheet">
@@ -61,7 +62,7 @@
</div>
</div>
<div>
<a asp-page="/Company/Employees/Index" asp-route-id="@Model.WorkshopId" class="back-btn" type="button">
<a asp-page="/Index" asp-route-id="@Model.WorkshopId" class="back-btn" type="button">
<span>بازگشت</span>
</a>
</div>
@@ -73,7 +74,7 @@
<!-- Search Box -->
<form role="form" method="get" name="search-theme-form1" id="search-theme-form1" autocomplete="off">
@* <form role="form" method="get" name="search-theme-form1" id="search-theme-form1" autocomplete="off"> *@
<input type="hidden" asp-for="WorkshopId" />
<input type="hidden" asp-for="EmployeeId" />
@@ -87,6 +88,11 @@
<div class="col-12" data-title="جستجو لیست پرداخت حقوق" data-intro="شما در این لیست پرداختی ها میتوانید جستجو کنید.">
<div class="d-grid search-insurance-section gap-2">
<div class="d-flex col-span-12 lg-col-span-4 xl-col-span-3 gap-2">
<div class="col-5">
<select class="form-select select2Option" aria-label="انتخاب پرسنل ..." asp-for="EmployeeId" id="employeeSelect">
</select>
</div>
<div class="wrapper-dropdown-year btn-dropdown" id="dropdown-year" style="width: 100px;">
<span class="selected-display" id="destination-year">سال</span>
<svg class="arrow" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="transition-all ml-auto rotate-180">
@@ -124,16 +130,16 @@
</ul>
<input type="hidden" id="sendDropdownMonth" asp-for="SearchModel.Month"/>
</div>
<button class="btn-search btn-w-size btn-search-click text-nowrap d-flex align-items-center justify-content-center" id="searchBtn" type="submit">
<button class="btn-search btn-w-size btn-search-click text-nowrap d-flex align-items-center justify-content-center" id="searchBtn" type="submit">
<span>جستجو</span>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
<circle cx="11" cy="11" r="6" stroke="white" />
<path d="M20 20L17 17" stroke="white" stroke-linecap="round" />
<circle cx="11" cy="11" r="6" stroke="white"/>
<path d="M20 20L17 17" stroke="white" stroke-linecap="round"/>
</svg>
</button>
<a asp-page="/Company/PaymentToEmployee/Index" asp-route-workshopId="@Model.WorkshopId" asp-route-employeeId="@Model.EmployeeId" class="btn-clear-filter btn-w-size text-nowrap d-flex align-items-center justify-content-center disable">
<span>حذف جستجو</span>
</a>
</button>
<a asp-page="/Company/PaymentToEmployee/Index" asp-route-workshopId="@Model.WorkshopId" asp-route-employeeId="@Model.EmployeeId" class="btn-clear-filter btn-w-size text-nowrap d-flex align-items-center justify-content-center disable">
<span>حذف جستجو</span>
</a>
</div>
</div>
</div>
@@ -141,8 +147,10 @@
</div>
</div>
</div>
</form>
<!-- End Search Box -->
@* </form> *@
<!-- End Search Box -->
<!-- List Items -->
<div class="container-fluid">
<div class="row p-lg-2 p-auto">
@@ -192,7 +200,7 @@
</div>
@if(@Model.PaymentToEmployeeSearch.Count > 0)
{
<div>
<div>
<button onclick="printAllWithoutCheckout()" class="btn-print-all" type="button">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none">
<path d="M15.0001 11.2493H15.139C16.0279 11.2493 16.4723 11.2493 16.759 10.9866C16.7805 10.967 16.801 10.9464 16.8207 10.9249C17.0834 10.6382 17.0834 10.1938 17.0834 9.3049V9.3049C17.0834 7.52714 17.0834 6.63826 16.558 6.06484C16.5187 6.02194 16.4775 5.98077 16.4346 5.94146C15.8612 5.41602 14.9723 5.41602 13.1945 5.41602H6.91675C5.03113 5.41602 4.08832 5.41602 3.50253 6.0018C2.91675 6.58759 2.91675 7.5304 2.91675 9.41602V10.2493C2.91675 10.7208 2.91675 10.9565 3.06319 11.1029C3.20964 11.2493 3.44534 11.2493 3.91675 11.2493H5.00008" stroke="#1E293B" />
@@ -216,290 +224,262 @@
</div>
}
</div>
<div class="Rtable Rtable--5cols Rtable--collapse personal-payment-grid-list">
<div class="Rtable-row Rtable-row--head align-items-center d-grid gap-2 grid-cols-12">
<div class="d-flex col-span-2">
<div class="Rtable-cell column-heading width1">سال</div>
<div class="Rtable-cell column-heading width2">ماه</div>
</div>
<div class="d-flex col-span-7">
<div class="Rtable-cell column-heading width3">تاریخ پرداخت</div>
<div class="Rtable-cell column-heading width4">بانک مبداء</div>
<div class="Rtable-cell column-heading width5">بانک مقصد</div>
<div class="Rtable-cell column-heading width6">مبلغ (ریال)</div>
<div class="Rtable-cell column-heading width7"></div>
</div>
<div class="d-flex col-span-3">
<div class="Rtable-cell column-heading width8">جمع پرداختی</div>
<div class="Rtable-cell column-heading width9">نمایش فیش حقوقی</div>
</div>
</div>
<div class="Rtable Rtable--5cols Rtable--collapse personal-payment-grid-list">
<div class="Rtable-row Rtable-row--head align-items-center d-grid gap-2 grid-cols-12">
<div class="d-flex col-span-2">
<div class="Rtable-cell column-heading width1">سال</div>
<div class="Rtable-cell column-heading width2">ماه</div>
</div>
<div class="d-flex col-span-7">
<div class="Rtable-cell column-heading width3">تاریخ پرداخت</div>
<div class="Rtable-cell column-heading width4">بانک مبداء</div>
<div class="Rtable-cell column-heading width5">بانک مقصد</div>
<div class="Rtable-cell column-heading width6">مبلغ (ریال)</div>
<div class="Rtable-cell column-heading width7"></div>
</div>
<div class="d-flex col-span-3">
<div class="Rtable-cell column-heading width8">جمع پرداختی</div>
<div class="Rtable-cell column-heading width9">نمایش فیش حقوقی</div>
</div>
</div>
<div class="w-100 personal-payment-scroll" id="EmployeesPaymentListIntro">
<!-- this empty div must be initial for color -->
<div></div>
<!-- this empty div must be initial for color -->
@if (Model.PaymentToEmployeeSearch.Count > 0)
{
@foreach (var paymentList in Model.PaymentToEmployeeSearch)
{
<div class="w-100 personal-payment-scroll" id="loadPaymentToEmployeeAjax">
<!-- this empty div must be initial for color -->
<div></div>
<!-- this empty div must be initial for color -->
<div class="personal-grid-row d-grid gap-2 grid-cols-12 w-100">
<div class="Rtable-row align-items-center col-span-2">
<div class="Rtable-cell width1">
<div class="Rtable-cell--content">
@paymentList.Year
</div>
</div>
<div class="Rtable-cell width2">
<div class="Rtable-cell--content">
@paymentList.Month
</div>
</div>
</div>
@* @if (Model.PaymentToEmployeeSearch.Count > 0)
{
@foreach (var paymentList in Model.PaymentToEmployeeSearch)
{
<div class="col-span-7">
@if (paymentList.PaymentToEmployeeItemList.Count > 0)
{
@foreach (var paymentItem in paymentList.PaymentToEmployeeItemList)
{
var StylePadding = "";
@if (paymentList.PaymentToEmployeeItemList.Count == 1)
{
StylePadding = "padding: 36px 5px 36px 5px;";
}
@if (paymentList.PaymentToEmployeeItemList.Count == 2)
{
StylePadding = "padding: 18px 5px 18px 5px;";
}
@if (paymentList.PaymentToEmployeeItemList.Count == 3)
{
StylePadding = "padding: 6px 5px 6px 5px;";
}
<div class="personal-grid-row d-grid gap-2 grid-cols-12 w-100">
<div class="Rtable-row align-items-center w-100" style="@StylePadding">
<div class="Rtable-cell width3">
<div class="Rtable-cell--content">
<div class="Rtable-cell--content">
@paymentItem.PayDateFa
</div>
</div>
</div>
<div class="Rtable-cell width4">
<div class="Rtable-cell--content">
<p class="m-0">@paymentItem.SourceBankName</p>
<p class="m-0">@paymentItem.SourceBankAccountNumber</p>
</div>
</div>
<div class="Rtable-cell width5">
<div class="Rtable-cell--content">
<p class="m-0">@paymentItem.DestinationBankName</p>
<p class="m-0">@paymentItem.DestinationBankAccountNumber</p>
</div>
</div>
<div class="Rtable-cell width6">
<div class="Rtable-cell--content">
@(paymentItem.PaymentFa) ريال
</div>
</div>
<div class="Rtable-row align-items-center col-span-2">
<div class="Rtable-cell width1">
<div class="Rtable-cell--content">
@paymentList.Year
</div>
</div>
<div class="Rtable-cell width2">
<div class="Rtable-cell--content">
@paymentList.Month
</div>
</div>
</div>
<div class="col-span-7">
@if (paymentList.PaymentToEmployeeItemList.Count > 0)
{
@foreach (var paymentItem in paymentList.PaymentToEmployeeItemList)
{
var StylePadding = "";
@if (paymentList.PaymentToEmployeeItemList.Count == 1)
{
StylePadding = "padding: 36px 5px 36px 5px;";
}
@if (paymentList.PaymentToEmployeeItemList.Count == 2)
{
StylePadding = "padding: 18px 5px 18px 5px;";
}
@if (paymentList.PaymentToEmployeeItemList.Count == 3)
{
StylePadding = "padding: 6px 5px 6px 5px;";
}
<div class="Rtable-row align-items-center w-100" style="@StylePadding">
<div class="Rtable-cell width3">
<div class="Rtable-cell--content">
<div class="Rtable-cell--content">
@paymentItem.PayDateFa
</div>
</div>
</div>
<div class="Rtable-cell width4">
<div class="Rtable-cell--content">
<p class="m-0">@paymentItem.SourceBankName</p>
<p class="m-0">@paymentItem.SourceBankAccountNumber</p>
</div>
</div>
<div class="Rtable-cell width5">
<div class="Rtable-cell--content">
<p class="m-0">@paymentItem.DestinationBankName</p>
<p class="m-0">@paymentItem.DestinationBankAccountNumber</p>
</div>
</div>
<div class="Rtable-cell width6">
<div class="Rtable-cell--content">
@(paymentItem.PaymentFa) ريال
</div>
</div>
<div class="Rtable-cell width7">
<div class="Rtable-cell--content d-flex alien-items-center justify-content-end">
<div class="editButtonFind">
<button onclick="checkIfValidToEdit(@paymentItem.Id)" data-mobile-paymentid="@paymentItem.Id" class="btn-edit position-relative">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 22 22" fill="none" stroke="currentColor">
<path d="M12.0433 6.49955L12.0214 6.52145L5.53808 13.0047C5.52706 13.0158 5.51612 13.0267 5.50525 13.0375C5.34278 13.1996 5.19895 13.3432 5.09758 13.5222L5.5266 13.7651L5.09758 13.5222C4.99622 13.7012 4.94714 13.8984 4.89171 14.1211C4.88801 14.136 4.88427 14.151 4.88049 14.1662L4.30029 16.4869L4.78351 16.6077L4.30029 16.4869C4.29808 16.4958 4.29585 16.5047 4.29361 16.5136C4.25437 16.6703 4.21246 16.8377 4.19871 16.9782C4.18357 17.1329 4.1871 17.394 4.39651 17.6034C4.60592 17.8128 4.86698 17.8163 5.02171 17.8012C5.16225 17.7875 5.32958 17.7456 5.48627 17.7063C5.49521 17.7041 5.50411 17.7018 5.51297 17.6996L7.83376 17.1194C7.84888 17.1156 7.86388 17.1119 7.87878 17.1082C8.10151 17.0528 8.29868 17.0037 8.47772 16.9023C8.65675 16.801 8.80027 16.6571 8.9624 16.4947C8.97324 16.4838 8.98416 16.4729 8.99519 16.4618L15.4785 9.97855L15.5004 9.95666C15.796 9.6611 16.0507 9.40638 16.2296 9.17534C16.4208 8.9284 16.5695 8.65435 16.5843 8.31531C16.5862 8.27179 16.5862 8.22821 16.5843 8.18469C16.5695 7.84565 16.4208 7.5716 16.2296 7.32466C16.0507 7.09362 15.796 6.8389 15.5004 6.54334L15.4785 6.52145L15.4566 6.49954C15.161 6.20396 14.9063 5.94922 14.6753 5.77034C14.4283 5.57917 14.1543 5.43041 13.8152 5.41564C13.7717 5.41374 13.7281 5.41374 13.6846 5.41564C13.3456 5.43041 13.0715 5.57917 12.8246 5.77034C12.5935 5.94922 12.3388 6.20396 12.0433 6.49955Z" />
<path d="M11.4583 6.87484L14.2083 5.0415L16.9583 7.7915L15.1249 10.5415L11.4583 6.87484Z" />
</svg>
<span class="mx-1">ویرایش</span>
</button>
</div>
<div class="Rtable-cell width7">
<div class="Rtable-cell--content d-flex alien-items-center justify-content-end">
<div class="editButtonFind">
<button onclick="checkIfValidToEdit(@paymentItem.Id)" data-mobile-paymentid="@paymentItem.Id" class="btn-edit position-relative">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 22 22" fill="none" stroke="currentColor">
<path d="M12.0433 6.49955L12.0214 6.52145L5.53808 13.0047C5.52706 13.0158 5.51612 13.0267 5.50525 13.0375C5.34278 13.1996 5.19895 13.3432 5.09758 13.5222L5.5266 13.7651L5.09758 13.5222C4.99622 13.7012 4.94714 13.8984 4.89171 14.1211C4.88801 14.136 4.88427 14.151 4.88049 14.1662L4.30029 16.4869L4.78351 16.6077L4.30029 16.4869C4.29808 16.4958 4.29585 16.5047 4.29361 16.5136C4.25437 16.6703 4.21246 16.8377 4.19871 16.9782C4.18357 17.1329 4.1871 17.394 4.39651 17.6034C4.60592 17.8128 4.86698 17.8163 5.02171 17.8012C5.16225 17.7875 5.32958 17.7456 5.48627 17.7063C5.49521 17.7041 5.50411 17.7018 5.51297 17.6996L7.83376 17.1194C7.84888 17.1156 7.86388 17.1119 7.87878 17.1082C8.10151 17.0528 8.29868 17.0037 8.47772 16.9023C8.65675 16.801 8.80027 16.6571 8.9624 16.4947C8.97324 16.4838 8.98416 16.4729 8.99519 16.4618L15.4785 9.97855L15.5004 9.95666C15.796 9.6611 16.0507 9.40638 16.2296 9.17534C16.4208 8.9284 16.5695 8.65435 16.5843 8.31531C16.5862 8.27179 16.5862 8.22821 16.5843 8.18469C16.5695 7.84565 16.4208 7.5716 16.2296 7.32466C16.0507 7.09362 15.796 6.8389 15.5004 6.54334L15.4785 6.52145L15.4566 6.49954C15.161 6.20396 14.9063 5.94922 14.6753 5.77034C14.4283 5.57917 14.1543 5.43041 13.8152 5.41564C13.7717 5.41374 13.7281 5.41374 13.6846 5.41564C13.3456 5.43041 13.0715 5.57917 12.8246 5.77034C12.5935 5.94922 12.3388 6.20396 12.0433 6.49955Z"/>
<path d="M11.4583 6.87484L14.2083 5.0415L16.9583 7.7915L15.1249 10.5415L11.4583 6.87484Z"/>
</svg>
<span class="mx-1">ویرایش</span>
</button>
</div>
<form asp-page="./Index" class="d-flex" asp-page-handler="RemovePaymentToEmployee" autocomplete="off"
method="post"
data-ajax="true"
data-callback=""
data-action="ReloadLeave">
<button type="button" class="btn-delete RemovePayment">
<div style="display: none">
<input type="hidden" asp-for="@paymentItem.Id" id="paymentItemId_@paymentItem.Id" name="id" />
@* <input type="hidden" asp-for="EmployeeId" />
<input type="hidden" asp-for="WorkshopId" /> *@
<input type="submit" id="sendFinaly_@paymentItem.Id" style="display: none" />
</div>
<form asp-page="./Index" class="d-flex" asp-page-handler="RemovePaymentToEmployee" autocomplete="off"
method="post"
data-ajax="true"
data-callback=""
data-action="ReloadLeave">
<button type="button" class="btn-delete RemovePayment">
<div style="display: none">
<input type="hidden" asp-for="@paymentItem.Id" id="paymentItemId_@paymentItem.Id" name="id"/>
<input type="submit" id="sendFinaly_@paymentItem.Id" style="display: none"/>
</div>
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 22 22" fill="none" stroke="currentColor">
<path d="M8.70825 13.2915L8.70825 10.5415" stroke-linecap="round" />
<path d="M13.2917 13.2915L13.2917 10.5415" stroke-linecap="round" />
<path d="M2.75 5.9585H19.25V5.9585C18.122 5.9585 17.558 5.9585 17.1279 6.17946C16.7561 6.3704 16.4536 6.67297 16.2626 7.04469C16.0417 7.47488 16.0417 8.03886 16.0417 9.16683V13.8752C16.0417 15.7608 16.0417 16.7036 15.4559 17.2894C14.8701 17.8752 13.9273 17.8752 12.0417 17.8752H9.95833C8.07271 17.8752 7.12991 17.8752 6.54412 17.2894C5.95833 16.7036 5.95833 15.7608 5.95833 13.8752V9.16683C5.95833 8.03886 5.95833 7.47488 5.73737 7.04469C5.54643 6.67297 5.24386 6.3704 4.87214 6.17946C4.44195 5.9585 3.87797 5.9585 2.75 5.9585V5.9585Z" stroke-linecap="round" />
<path d="M8.70841 3.20839C8.70841 3.20839 9.16675 2.2915 11.0001 2.2915C12.8334 2.2915 13.2917 3.20817 13.2917 3.20817" stroke-linecap="round" />
</svg>
<span class="mx-1">حذف</span>
</button>
</form>
</div>
</div>
</div>
}
}
else
{
<div class="Rtable-row align-items-center w-100" style="padding: 40px 10px 40px 10px;">
<div class="Rtable-cell width3">
<div class="Rtable-cell--content">
<div class="Rtable-cell--content">
-
</div>
</div>
</div>
<div class="Rtable-cell width4">
<div class="Rtable-cell--content">
<p class="m-0">-</p>
</div>
</div>
<div class="Rtable-cell width5">
<div class="Rtable-cell--content">
<p class="m-0">-</p>
</div>
</div>
<div class="Rtable-cell width6">
<div class="Rtable-cell--content">
-
</div>
</div>
<div class="Rtable-cell width7">
<div class="Rtable-cell--content">
</div>
</div>
</div>
}
</div>
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 22 22" fill="none" stroke="currentColor">
<path d="M8.70825 13.2915L8.70825 10.5415" stroke-linecap="round"/>
<path d="M13.2917 13.2915L13.2917 10.5415" stroke-linecap="round"/>
<path d="M2.75 5.9585H19.25V5.9585C18.122 5.9585 17.558 5.9585 17.1279 6.17946C16.7561 6.3704 16.4536 6.67297 16.2626 7.04469C16.0417 7.47488 16.0417 8.03886 16.0417 9.16683V13.8752C16.0417 15.7608 16.0417 16.7036 15.4559 17.2894C14.8701 17.8752 13.9273 17.8752 12.0417 17.8752H9.95833C8.07271 17.8752 7.12991 17.8752 6.54412 17.2894C5.95833 16.7036 5.95833 15.7608 5.95833 13.8752V9.16683C5.95833 8.03886 5.95833 7.47488 5.73737 7.04469C5.54643 6.67297 5.24386 6.3704 4.87214 6.17946C4.44195 5.9585 3.87797 5.9585 2.75 5.9585V5.9585Z" stroke-linecap="round"/>
<path d="M8.70841 3.20839C8.70841 3.20839 9.16675 2.2915 11.0001 2.2915C12.8334 2.2915 13.2917 3.20817 13.2917 3.20817" stroke-linecap="round"/>
</svg>
<span class="mx-1">حذف</span>
</button>
</form>
</div>
</div>
</div>
}
}
else
{
<div class="Rtable-row align-items-center w-100" style="padding: 40px 10px 40px 10px;">
<div class="Rtable-cell width3">
<div class="Rtable-cell--content">
<div class="Rtable-cell--content">
-
</div>
</div>
</div>
<div class="Rtable-cell width4">
<div class="Rtable-cell--content">
<p class="m-0">-</p>
</div>
</div>
<div class="Rtable-cell width5">
<div class="Rtable-cell--content">
<p class="m-0">-</p>
</div>
</div>
<div class="Rtable-cell width6">
<div class="Rtable-cell--content">
-
</div>
</div>
<div class="Rtable-cell width7">
<div class="Rtable-cell--content">
</div>
</div>
</div>
}
</div>
<div class="Rtable-row align-items-center col-span-3 position-relative">
<div class="Rtable-cell width8">
<div class="Rtable-cell--content">
@* <div class="text-price">@paymentList.BonusesPay</div> *@
@* <p class="my-1 ">جمع پرداختی</p> *@
<p class="my-0 text-price">
@{
if (!string.IsNullOrWhiteSpace(paymentList.PaymentToEmployeeTotalPayment))
{
<span>@paymentList.PaymentToEmployeeTotalPayment ریال</span>
}
else
{
<span>
-
</span>
}
}
</p>
</div>
<p class="mt-2 mb-0">
@{
if (!string.IsNullOrWhiteSpace(paymentList.ComputePaymentToEmployeeTotalPayment))
{
<span>@paymentList.ComputePaymentToEmployeeTotalPayment ریال</span>
}
else
{
<span>
-
</span>
}
}
</p>
</div>
<div class="Rtable-cell width9">
<div class="Rtable-cell--content">
@* <p class="my-1 ">نمایش فیش حقوقی</p> *@
<p class="my-0 text-price checkout">
@{
if (!string.IsNullOrWhiteSpace(paymentList.CheckoutTotalPayment))
{
<span>@paymentList.CheckoutTotalPayment ریال</span>
}
else
{
<span>
-
</span>
}
}
</p>
</div>
<p class="mt-2 mb-0">
@{
if (!string.IsNullOrWhiteSpace(paymentList.ComputeCheckoutTotalPayment))
{
<span>@paymentList.ComputeCheckoutTotalPayment ریال</span>
}
else
{
<span>
-
</span>
}
}
</p>
</div>
<div class="Rtable-row align-items-center col-span-3 position-relative">
<div class="Rtable-cell width8">
<div class="Rtable-cell--content">
<p class="my-0 text-price">
@{
if (!string.IsNullOrWhiteSpace(paymentList.PaymentToEmployeeTotalPayment))
{
<span>@paymentList.PaymentToEmployeeTotalPayment ریال</span>
}
else
{
<span>
-
</span>
}
}
</p>
</div>
<p class="mt-2 mb-0">
@{
if (!string.IsNullOrWhiteSpace(paymentList.ComputePaymentToEmployeeTotalPayment))
{
<span>@paymentList.ComputePaymentToEmployeeTotalPayment ریال</span>
}
else
{
<span>
-
</span>
}
}
</p>
</div>
<div class="Rtable-cell width9">
<div class="Rtable-cell--content">
<p class="my-0 text-price checkout">
@{
if (!string.IsNullOrWhiteSpace(paymentList.CheckoutTotalPayment))
{
<span>@paymentList.CheckoutTotalPayment ریال</span>
}
else
{
<span>
-
</span>
}
}
</p>
</div>
<p class="mt-2 mb-0">
@{
if (!string.IsNullOrWhiteSpace(paymentList.ComputeCheckoutTotalPayment))
{
<span>@paymentList.ComputeCheckoutTotalPayment ریال</span>
}
else
{
<span>
-
</span>
}
}
</p>
</div>
@* <div class="d-flex all-sum-price">
<p class="my-0 mx-2">مجموع: </p>
<p class="my-0 mx-2">@paymentList.TotalPayment</p>
</div> *@
</div>
</div>
</div>
}
}
else
{
<div class="empty text-center bg-white d-flex align-items-center justify-content-center" style="position: relative !important;">
<div class="">
<img src="~/assetsclient/images/empty.png" alt="" class="img-fluid" style="height: 230px;"/>
<h5>اطلاعاتی وجود ندارد.</h5>
</div>
</div>
}
</div>
</div>
</div>
}
}
else
{
<div class="empty text-center bg-white d-flex align-items-center justify-content-center" style="position: relative !important;">
<div class="">
<img src="~/assetsclient/images/empty.png" alt="" class="img-fluid" style="height: 230px;"/>
<h5>اطلاعاتی وجود ندارد.</h5>
</div>
</div>
} *@
</div>
</div>
<!-- Start Result box or Summarry box -->
@* <div class="d-grid gap-2 grid-cols-12 justify-content-end personal-payment-result1">
<div class="col-span-2">
</div>
<div class="col-span-7">
</div>
<div class="col-span-3">
<div class="d-flex align-items-center justify-content-end">
<div class="d-flex mx-1 result-pay">
<p class="my-0">74,000,000</p>
</div>
<div class="d-flex mx-1 result-pay">
<p class="my-0">74,000,000</p>
</div>
<div class="d-flex mx-1 result-pay">
<p class="my-0">74,000,000</p>
</div>
</div>
</div>
</div> *@
<div class="d-grid gap-2 grid-cols-12 personal-payment-result2">
<div class="col-span-2">
</div>
@@ -507,14 +487,14 @@
<div class="d-flex align-items-center justify-content-end">
<p class="my-0">مجموع پرداختی های کارفرما</p>
<div class="d-flex mx-1 result-pay">
<p class="my-0">@Model.SumOfPayment</p>
<p class="my-0" id="SumOfPayment"></p>
</div>
</div>
</div>
<div class="col-span-3">
<div class="d-flex align-items-center justify-content-start">
<div class="d-flex mx-1 result-pay">
<p class="my-0">@Model.SumOfCheckout</p>
<p class="my-0" id="SumOfCheckout"></p>
</div>
<p class="my-0">مجموع مطالبات پرسنل</p>
</div>
@@ -957,37 +937,52 @@
<script>
$(document).ready(function () {
$(".select2Option").select2({
language: "fa",
dir: "rtl",
templateResult: function (data, container) {
if (data.element) {
$(container).addClass($(data.element).attr("class"));
}
return data.text;
}
});
ajaxPersonals();
//******************** فیلتر کردن برای جستجو ********************
var filterPersonnel = $('#employeeSelect').val();
var filterYear = $('#year').val();
var filterMonth = $('#month').val();
if (filterYear != '' || filterMonth != '') {
if (filterPersonnel != 0 && filterYear != '' && filterMonth != '') {
$('.btn-clear-filter').removeClass('disable');
} else {
$('.btn-clear-filter').addClass('disable');
}
$(document).on('click',
'.btn-search-click',
function () {
$('#filterRemove').show();
});
$(document).on('click',
'.btn-view-all',
function () {
$(this).hide();
$('.search-box input').val('');
$('.search-box .form-select').val(null);
$('#yearText').text('سال');
$('#monthText').text('ماه');
middleYearIndex = 2;
selectedMonth = 1;
});
$(document).on('click', '.btn-search-click', function () {
// $('#filterRemove').show();
personnelId = $('#employeeSelect').val();
loadPaymentToEmployee(personnelId)
});
$(document).on('click', '.btn-view-all',function () {
$(this).hide();
$('.search-box input').val('');
$('.search-box .form-select').val(null);
$('#yearText').text('سال');
$('#monthText').text('ماه');
middleYearIndex = 2;
selectedMonth = 1;
});
//******************** فیلتر کردن برای جستجو ********************
// باز شدن جزئیات در موبایل
$(".openAction").click(function () {
$(this).next().find(".operations-btns").slideToggle(500);
@@ -1667,9 +1662,277 @@
//******************** برای حذف مبلغ در موبایل ********************
});
function ajaxPersonals() {
$.ajax({
url: '@Url.Page("/Company/PaymentToEmployee/Index", "EmployeeList")',
type: 'GET',
success: function (response) {
// $('#cardSectionLeave').addClass('blur');
// $("#cardSectionLeave div *").prop('disabled', true);
var employees = response.data;
var employeeOptionsHtml = '<option value="">انتخاب پرسنل ...</option>';
employees.forEach(function (employee) {
var black = employee.black ? "blackSelect" : "";
employeeOptionsHtml += `<option class="${black}" value="${employee.id}">${employee.employeeFullName}</option>`;
});
$('#employeeSelect').html(employeeOptionsHtml);
},
error: function (xhr, status, error) {
console.error(xhr.responseText);
}
});
}
function loadPaymentToEmployee(personnelId) {
console.log(personnelId);
var year = $('#year').val();
var month = $('#month').val();
var html = '';
$.ajax({
async: false,
contentType: 'charset=utf-8',
dataType: 'json',
type: 'GET',
url: '@Url.Page("/Company/PaymentToEmployee/Index", "PaymentToEmployeeByAjax")',
data: {
personnelId: personnelId,
year: year,
month: month
},
headers: { "RequestVerificationToken": $('@Html.AntiForgeryToken()').val() },
success: function (response) {
console.log(response);
var responseData = response;
if (responseData.length > 0) {
responseData.forEach(function (paymentList) {
html += `<div class="personal-grid-row d-grid gap-2 grid-cols-12 w-100">
<div class="Rtable-row align-items-center col-span-2">
<div class="Rtable-cell width1">
<div class="Rtable-cell--content">
${paymentList.year}
</div>
</div>
<div class="Rtable-cell width2">
<div class="Rtable-cell--content">
${paymentList.month}
</div>
</div>
</div>
<div class="col-span-7">`;
if (paymentList.paymentToEmployeeItemList.lenght > 0)
{
paymentList.paymentToEmployeeItemList.forEach(function (paymentItem) {
var StylePadding = "";
if (paymentList.paymentToEmployeeItemList.Count == 1)
{
StylePadding = "padding: 36px 5px 36px 5px;";
}
if (paymentList.paymentToEmployeeItemList.Count == 2)
{
StylePadding = "padding: 18px 5px 18px 5px;";
}
if (paymentList.paymentToEmployeeItemList.Count == 3)
{
StylePadding = "padding: 6px 5px 6px 5px;";
}
html += `<div class="Rtable-row align-items-center w-100" style="${StylePadding}">
<div class="Rtable-cell width3">
<div class="Rtable-cell--content">
<div class="Rtable-cell--content">
${paymentItem.payDateFa}
</div>
</div>
</div>
<div class="Rtable-cell width4">
<div class="Rtable-cell--content">
<p class="m-0">${paymentItem.sourceBankName}</p>
<p class="m-0">${paymentItem.sourceBankAccountNumber}</p>
</div>
</div>
<div class="Rtable-cell width5">
<div class="Rtable-cell--content">
<p class="m-0">${paymentItem.destinationBankName}</p>
<p class="m-0">${paymentItem.destinationBankAccountNumber}</p>
</div>
</div>
<div class="Rtable-cell width6">
<div class="Rtable-cell--content">
${paymentItem.paymentFa} ريال
</div>
</div>
<div class="Rtable-cell width7">
<div class="Rtable-cell--content d-flex alien-items-center justify-content-end">
<div class="editButtonFind">
<button onclick="checkIfValidToEdit(${paymentItem.id})" data-mobile-paymentid="${paymentItem.id}" class="btn-edit position-relative">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 22 22" fill="none" stroke="currentColor">
<path d="M12.0433 6.49955L12.0214 6.52145L5.53808 13.0047C5.52706 13.0158 5.51612 13.0267 5.50525 13.0375C5.34278 13.1996 5.19895 13.3432 5.09758 13.5222L5.5266 13.7651L5.09758 13.5222C4.99622 13.7012 4.94714 13.8984 4.89171 14.1211C4.88801 14.136 4.88427 14.151 4.88049 14.1662L4.30029 16.4869L4.78351 16.6077L4.30029 16.4869C4.29808 16.4958 4.29585 16.5047 4.29361 16.5136C4.25437 16.6703 4.21246 16.8377 4.19871 16.9782C4.18357 17.1329 4.1871 17.394 4.39651 17.6034C4.60592 17.8128 4.86698 17.8163 5.02171 17.8012C5.16225 17.7875 5.32958 17.7456 5.48627 17.7063C5.49521 17.7041 5.50411 17.7018 5.51297 17.6996L7.83376 17.1194C7.84888 17.1156 7.86388 17.1119 7.87878 17.1082C8.10151 17.0528 8.29868 17.0037 8.47772 16.9023C8.65675 16.801 8.80027 16.6571 8.9624 16.4947C8.97324 16.4838 8.98416 16.4729 8.99519 16.4618L15.4785 9.97855L15.5004 9.95666C15.796 9.6611 16.0507 9.40638 16.2296 9.17534C16.4208 8.9284 16.5695 8.65435 16.5843 8.31531C16.5862 8.27179 16.5862 8.22821 16.5843 8.18469C16.5695 7.84565 16.4208 7.5716 16.2296 7.32466C16.0507 7.09362 15.796 6.8389 15.5004 6.54334L15.4785 6.52145L15.4566 6.49954C15.161 6.20396 14.9063 5.94922 14.6753 5.77034C14.4283 5.57917 14.1543 5.43041 13.8152 5.41564C13.7717 5.41374 13.7281 5.41374 13.6846 5.41564C13.3456 5.43041 13.0715 5.57917 12.8246 5.77034C12.5935 5.94922 12.3388 6.20396 12.0433 6.49955Z"/>
<path d="M11.4583 6.87484L14.2083 5.0415L16.9583 7.7915L15.1249 10.5415L11.4583 6.87484Z"/>
</svg>
<span class="mx-1">ویرایش</span>
</button>
</div>
<form asp-page="./Index" class="d-flex" asp-page-handler="RemovePaymentToEmployee" autocomplete="off"
method="post"
data-ajax="true"
data-callback=""
data-action="ReloadLeave">
<button type="button" class="btn-delete RemovePayment">
<div style="display: none">
<input type="hidden" value="${paymentItem.id}" id="paymentItemId_${paymentItem.id}" name="id"/>
<input type="submit" id="sendFinaly_${paymentItem.id}" style="display: none"/>
</div>
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 22 22" fill="none" stroke="currentColor">
<path d="M8.70825 13.2915L8.70825 10.5415" stroke-linecap="round"/>
<path d="M13.2917 13.2915L13.2917 10.5415" stroke-linecap="round"/>
<path d="M2.75 5.9585H19.25V5.9585C18.122 5.9585 17.558 5.9585 17.1279 6.17946C16.7561 6.3704 16.4536 6.67297 16.2626 7.04469C16.0417 7.47488 16.0417 8.03886 16.0417 9.16683V13.8752C16.0417 15.7608 16.0417 16.7036 15.4559 17.2894C14.8701 17.8752 13.9273 17.8752 12.0417 17.8752H9.95833C8.07271 17.8752 7.12991 17.8752 6.54412 17.2894C5.95833 16.7036 5.95833 15.7608 5.95833 13.8752V9.16683C5.95833 8.03886 5.95833 7.47488 5.73737 7.04469C5.54643 6.67297 5.24386 6.3704 4.87214 6.17946C4.44195 5.9585 3.87797 5.9585 2.75 5.9585V5.9585Z" stroke-linecap="round"/>
<path d="M8.70841 3.20839C8.70841 3.20839 9.16675 2.2915 11.0001 2.2915C12.8334 2.2915 13.2917 3.20817 13.2917 3.20817" stroke-linecap="round"/>
</svg>
<span class="mx-1">حذف</span>
</button>
</form>
</div>
</div>
</div>`;
});
}
else
{
html += `<div class="Rtable-row align-items-center w-100" style="padding: 40px 10px 40px 10px;">
<div class="Rtable-cell width3">
<div class="Rtable-cell--content">
<div class="Rtable-cell--content">
-
</div>
</div>
</div>
<div class="Rtable-cell width4">
<div class="Rtable-cell--content">
<p class="m-0">-</p>
</div>
</div>
<div class="Rtable-cell width5">
<div class="Rtable-cell--content">
<p class="m-0">-</p>
</div>
</div>
<div class="Rtable-cell width6">
<div class="Rtable-cell--content">
-
</div>
</div>
<div class="Rtable-cell width7">
<div class="Rtable-cell--content">
</div>
</div>
</div>`;
}
html += `</div>
<div class="Rtable-row align-items-center col-span-3 position-relative">
<div class="Rtable-cell width8">
<div class="Rtable-cell--content">
<p class="my-0 text-price">`;
if (!string.IsNullOrWhiteSpace(paymentList.PaymentToEmployeeTotalPayment))
{
html += `<span>${paymentList.paymentToEmployeeTotalPayment} ریال</span>`;
}
else
{
html += `
<span>
-
</span>`;
}
html += `</p>
</div>
<p class="mt-2 mb-0">`;
if (paymentList.computePaymentToEmployeeTotalPayment !== "")
{
html += `<span>${paymentList.computePaymentToEmployeeTotalPayment} ریال</span>`;
}
else
{
html += `<span>
-
</span>`;
}
html += `</p>
</div>
<div class="Rtable-cell width9">
<div class="Rtable-cell--content">
<p class="my-0 text-price checkout">`;
if (paymentList.checkoutTotalPayment !== "")
{
html += `<span>${paymentList.checkoutTotalPayment} ریال</span>`;
}
else
{
html += `
<span>
-
</span>`;
}
html += `</p>
</div>
<p class="mt-2 mb-0">`;
if (paymentList.computeCheckoutTotalPayment !== "")
{
html += `<span>${paymentList.computeCheckoutTotalPayment} ریال</span>`;
}
else
{
html += `
<span>
-
</span>`;
}
html += `</p>
</div>
</div>
</div>`;
});
} else {
html += `<div class="text-center bg-white d-flex align-items-center justify-content-center">
<div class="">
<img src="/assetsclient/images/empty.png" alt="" class="img-fluid" />
<h5>اطلاعاتی وجود ندارد.</h5>
</div>
</div>`;
}
$('#loadPaymentToEmployeeAjax').html(html);
},
failure: function (response) {
console.log(response);
}
});
}
//******************** عملیات مربوط به پرینت ********************

View File

@@ -1,7 +1,9 @@
using System.Security.Claims;
using _0_Framework.Application;
using CompanyManagment.App.Contracts.Employee;
using CompanyManagment.App.Contracts.Leave;
using CompanyManagment.App.Contracts.PaymentToEmployee;
using CompanyManagment.App.Contracts.RollCall;
using CompanyManagment.App.Contracts.Workshop;
using CompanyManagment.App.Contracts.YearlySalary;
using Microsoft.AspNetCore.Mvc;
@@ -23,6 +25,7 @@ namespace ServiceHost.Areas.Client.Pages.Company.PaymentToEmployee
public CreatePaymentToEmployee Command;
public string SumOfCheckout;
public string SumOfPayment;
public ConnectedPersonnelViewModel ConnectedPersonnel;
private readonly IWorkshopApplication _workshopApplication;
private readonly IEmployeeApplication _employeeApplication;
@@ -43,16 +46,18 @@ namespace ServiceHost.Areas.Client.Pages.Company.PaymentToEmployee
}
#endregion
#region Get PeymentToEmployee Data
#region Get PaymentToEmployee Data
public IActionResult OnGet(string workshopHash, string employeeHash, PaymentToEmployeeSearchModel searchModel)
public IActionResult OnGet(string employeeHash, PaymentToEmployeeSearchModel searchModel)
{
var workshopId = _passwordHasher.SlugDecrypt(workshopHash);
var workshopHash = User.FindFirstValue("WorkshopSlug");
var workshopId = _passwordHasher.SlugDecrypt(workshopHash);
if (workshopId > 0)
{
var workshop = _workshopApplication.GetDetails(workshopId);
var employeeId=_passwordHasher.SlugDecrypt(employeeHash);
if (employeeId > 0)
//var employeeId=_passwordHasher.SlugDecrypt(employeeHash);
var employeeId = 86;
if (employeeId > 0)
{
var employee = _employeeApplication.GetDetails(employeeId);
@@ -68,7 +73,7 @@ namespace ServiceHost.Areas.Client.Pages.Company.PaymentToEmployee
PaymentToEmployeeSearch = _paymentToEmployeeApplication.searchClient(search);
WorkshopFullName = _authHelper.GetWorkshopName();
EmployeeFullName = employee.EmployeeFullName;
EmployeeFullName = employee.EmployeeFullName;
WorkshopId = workshopId;
EmployeeId = employeeId;
YearlyList = _yearlySalaryApplication.GetYears();
@@ -99,16 +104,68 @@ namespace ServiceHost.Areas.Client.Pages.Company.PaymentToEmployee
#endregion
#region Create PaymentToEmployee
public IActionResult OnGetCreate(long employeeId, long workshopId)
{
var command = new CreatePaymentToEmployee()
{
EmployeeId = employeeId,
WorkshopId = workshopId
};
return Partial("Create", command);
#region Get PaymentToEmployee Data By Ajax
public IActionResult OnGetPaymentToEmployeeByAjax(PaymentToEmployeeSearchModel searchModel)
{
var workshopHash = User.FindFirstValue("WorkshopSlug");
var workshopId = _passwordHasher.SlugDecrypt(workshopHash);
if (workshopId > 0)
{
var workshop = _workshopApplication.GetDetails(workshopId);
if (searchModel.EmployeeId > 0)
{
var employee = _employeeApplication.GetDetails(searchModel.EmployeeId);
var search = new PaymentToEmployeeSearchModel()
{
WorkshopId = workshopId,
EmployeeId = searchModel.EmployeeId,
Year = searchModel.Year,
Month = searchModel.Month,
};
SearchModel = search;
var data = _paymentToEmployeeApplication.searchClient(search);
SumOfCheckout = PaymentToEmployeeSearch.Sum(sum => sum.CheckoutTotalPaymentDouble)
.ToMoneyNullable();
SumOfPayment = PaymentToEmployeeSearch.Sum(sum => sum.PaymentToEmployeeTotalPaymentDouble)
.ToMoneyNullable();
return new JsonResult(new
{
isSuccess = true,
data = data,
SumOfCheckout,
SumOfPayment
});
}
else
{
return new JsonResult(new
{
isSuccess = false,
message = "داده ای یافت نشده!"
});
}
}
else
{
return new JsonResult(new
{
isSuccess = false,
message = "داده ای یافت نشده!"
});
}
}
#endregion
#region Create PaymentToEmployee
public IActionResult OnGetCreate()
{
return Partial("Create");
}
#endregion
@@ -212,5 +269,43 @@ namespace ServiceHost.Areas.Client.Pages.Company.PaymentToEmployee
return Partial("PrintAllWithoutCheckout", final);
}
#endregion
public async Task<IActionResult> OnGetEmployeeList()
{
var workshopSlug = User.FindFirstValue("WorkshopSlug");
var workshopId = _passwordHasher.SlugDecrypt(workshopSlug);
if (workshopId > 0)
{
var employees = await _employeeApplication.WorkedEmployeesInWorkshopSelectList(workshopId);
//var result = _workshopApplication.GetConnectedPersonnels(workshopId);
//var r = result.GroupBy(x => x.PersonName).Select(x => x.First()).ToList();
//ConnectedPersonnel = new ConnectedPersonnelViewModel()
//{
// ConnectedPersonnelViewModels = r.OrderBy(x => x.Black ? 1 : 0).ThenBy(x => x.PersonelCode).ToList(),
//};
//return new JsonResult(new { ConnectedPersonnel });
return new JsonResult(new
{
success = true,
data = employees
});
}
else
{
//return new JsonResult(new { ConnectedPersonnel = new ConnectedPersonnelViewModel() });
return new JsonResult(new
{
success = true,
data = "داده ای یافت نشد!"
});
}
}
}
}

View File

@@ -276,7 +276,7 @@
</div>
</div>
<div>
<a asp-page="/Company/Reports/Index" class="back-btn" type="button">
<a asp-page="/Index" class="back-btn" type="button">
<span>بازگشت</span>
</a>
</div>
@@ -349,7 +349,8 @@
<option value="0"> انتخاب پرسنل </option>
@foreach (var person in @Model.Employees)
{
<option style="font-family: 'IranSans' !important;" value="@person.Id"> @person.EmployeeFullName</option>
var black = @person.Black ? "blackSelect" : "";
<option style="font-family: 'IranSans' !important;" class="@(black)" value="@person.Id"> @person.EmployeeFullName</option>
}
</select>
</div>
@@ -1087,7 +1088,8 @@
<option value="0"> انتخاب پرسنل </option>
@foreach (var person in @Model.Employees)
{
<option style="font-family: 'IranSans' !important;" value="@person.Id"> @person.EmployeeFullName</option>
var black = @person.Black ? "blackSelect" : "";
<option style="font-family: 'IranSans' !important;" class="@(black)" value="@person.Id"> @person.EmployeeFullName</option>
}
</select>
</div>
@@ -1255,14 +1257,26 @@
$("#getPersonnel").select2({
language: "fa",
dir: "rtl"
dir: "rtl",
templateResult: function (data, container) {
if (data.element) {
$(container).addClass($(data.element).attr("class"));
}
return data.text;
}
});
$("#getPersonneModal").select2({
language: "fa",
dir: "rtl",
dropdownParent: $('#searchModal')
dropdownParent: $('#searchModal'),
templateResult: function (data, container) {
if (data.element) {
$(container).addClass($(data.element).attr("class"));
}
return data.text;
}
});
// $('#getPersonnel, #dropdown-month, #dropdown-year').change(function () {

View File

@@ -15,15 +15,19 @@ using Microsoft.AspNetCore.Mvc.RazorPages;
using ServiceHost.Pages;
using System.Security.Claims;
using _0_Framework.Infrastructure;
using CompanyManagment.App.Contracts.Employer;
using Microsoft.AspNetCore.Authorization;
namespace ServiceHost.Areas.Client.Pages.Company.Reports
{
[Authorize]
[NeedsPermission(SubAccountPermissionHelper.CheckoutReportPermissionCode)]
public class CheckoutReportModel : PageModel
{
private readonly IReportClientApplication _reportClientApplication;
private readonly IPasswordHasher _passwordHasher;
private readonly IWorkshopApplication _workshopApplication;
private readonly IEmployeeApplication _employeeApplication;
private readonly IYearlySalaryApplication _yearlySalaryApplication;
public List<CheckoutReportViewModel> CheckoutReportViewModels;
@@ -40,59 +44,55 @@ namespace ServiceHost.Areas.Client.Pages.Company.Reports
public List<string> YearlyList;
public List<EmployeeSelectListViewModel> Employees;
public CheckoutReportModel(IPasswordHasher passwordHasher, IReportClientApplication reportClientApplication, IWorkshopApplication workshopApplication, IYearlySalaryApplication yearlySalaryApplication)
public CheckoutReportModel(IPasswordHasher passwordHasher, IReportClientApplication reportClientApplication, IWorkshopApplication workshopApplication, IYearlySalaryApplication yearlySalaryApplication, IEmployeeApplication employeeApplication)
{
_passwordHasher = passwordHasher;
_reportClientApplication = reportClientApplication;
_workshopApplication = workshopApplication;
_yearlySalaryApplication = yearlySalaryApplication;
_employeeApplication = employeeApplication;
}
public IActionResult OnGet(CheckoutReportSearchModel searchModel)
public async Task<IActionResult> OnGet(CheckoutReportSearchModel searchModel)
{
if (User.Identity.IsAuthenticated)
var workshopSlugCliam = User.FindFirstValue("WorkshopSlug");
var workshopId = _passwordHasher.SlugDecrypt(workshopSlugCliam);
if (workshopId > 0)
{
var workshopSlugCliam = User.FindFirstValue("WorkshopSlug");
var workshopId = _passwordHasher.SlugDecrypt(workshopSlugCliam);
if (workshopId > 0)
var workshopInfo = _workshopApplication.GetWorkshopInfo(workshopId);
Year = searchModel.Year;
Month = searchModel.Month;
EmployeeId = searchModel.EmployeeId;
WorkshopId = workshopId;
WorkshopHash = workshopSlugCliam;
WorkshopFullName = workshopInfo.WorkshopFullName;
CheckoutReportViewModels = _reportClientApplication.GetAllCheckoutReport(workshopId, searchModel);
checkoutReportTotals = _reportClientApplication.GetAllSumCheckoutReport(workshopId, searchModel);
HasCheckoutReport = CheckoutReportViewModels.Count > 0 ? true : false;
PageIndex = CheckoutReportViewModels.Count;
YearlyList = _yearlySalaryApplication.GetYears();
SearchModel = new CheckoutReportSearchModel()
{
var workshopInfo = _workshopApplication.GetWorkshopInfo(workshopId);
Year = searchModel.Year;
Month = searchModel.Month;
EmployeeId = searchModel.EmployeeId;
WorkshopId = workshopId;
WorkshopHash = workshopSlugCliam;
WorkshopFullName = workshopInfo.WorkshopFullName;
CheckoutReportViewModels = _reportClientApplication.GetAllCheckoutReport(workshopId, searchModel);
checkoutReportTotals = _reportClientApplication.GetAllSumCheckoutReport(workshopId, searchModel);
HasCheckoutReport = CheckoutReportViewModels.Count > 0 ? true : false;
PageIndex = CheckoutReportViewModels.Count;
Year = string.IsNullOrWhiteSpace(searchModel.Year) ? " " : searchModel.Year,
Month = string.IsNullOrWhiteSpace(searchModel.Month) ? " " : searchModel.Month,
EmployeeId = searchModel.EmployeeId,
};
YearlyList = _yearlySalaryApplication.GetYears();
Employees = await _employeeApplication.WorkedEmployeesInWorkshopSelectList(workshopId);
SearchModel = new CheckoutReportSearchModel()
{
Year = string.IsNullOrWhiteSpace(searchModel.Year) ? " " : searchModel.Year,
Month = string.IsNullOrWhiteSpace(searchModel.Month) ? " " : searchModel.Month,
EmployeeId = searchModel.EmployeeId,
};
//Employees = workshopInfo.EmployeeList.Select(x => new EmployeeSelectListViewModel()
//{
// Id = x.Id,
// EmployeeFullName = x.EmployeeFullName
//}).ToList();
Employees = workshopInfo.EmployeeList.Select(x => new EmployeeSelectListViewModel()
{
Id = x.Id,
EmployeeFullName = x.EmployeeFullName
}).ToList();
return Page();
}
else
{
return Redirect("/error/404");
}
return Page();
}
else
{
return Redirect("/error/404");
return Redirect("/error/404");
}
}

View File

@@ -36,7 +36,7 @@
</div>
</div>
<div>
<a asp-page="/Company/Employees/Index" class="back-btn" type="button">
<a asp-page="/Index" class="back-btn" type="button">
<span>بازگشت</span>
</a>
</div>

View File

@@ -73,9 +73,9 @@ namespace ServiceHost.Areas.Client.Pages.Company.Reward
});
}
public IActionResult OnGetEmployeeList()
public async Task<IActionResult> OnGetEmployeeList()
{
var employees = _employeeApplication.GetWorkingEmployeesByWorkshopId(_workshopId);
var employees = await _employeeApplication.WorkedEmployeesInWorkshopSelectList(_workshopId);
return new JsonResult(new
{

View File

@@ -121,7 +121,7 @@
</div>
</div>
<div>
<a asp-page="/Company/RollCall/Index" class="back-btn" type="button">
<a asp-page="/Index" class="back-btn" type="button">
<span>بازگشت</span>
</a>
</div>

View File

@@ -138,7 +138,7 @@
</div>
</div>
<div>
<a asp-page="/Company/RollCall/Index" class="back-btn" type="button">
<a asp-page="/Index" class="back-btn" type="button">
<span>بازگشت</span>
</a>
</div>

View File

@@ -38,7 +38,7 @@
</div>
</div>
<div>
<a asp-page="/Company/RollCall/Index" class="back-btn" type="button">
<a asp-page="/Index" class="back-btn" type="button">
<span>بازگشت</span>
</a>
</div>

View File

@@ -74,7 +74,7 @@
</div>
</div>
<div>
<a asp-page="/Company/RollCall/Index" class="back-btn" type="button">
<a asp-page="/Index" class="back-btn" type="button">
<span>بازگشت</span>
</a>
</div>

View File

@@ -29,7 +29,7 @@
</div>
</div>
<div>
<a asp-page="/Company/RollCall/Index" class="back-btn" type="button">
<a asp-page="/Index" class="back-btn" type="button">
<span>بازگشت</span>
</a>
</div>
@@ -67,7 +67,7 @@
<path d="M20 20L17 17" stroke="white" stroke-linecap="round" />
</svg>
</button>
<a asp-page="/Company/RollCall/CaseHistory" class="btn-clear-filter btn-w-size text-nowrap d-flex align-items-center justify-content-center disable" id="filterRemove" style="padding: 7px 10px;">
<a asp-page="/Company/RollCall/Grouping" class="btn-clear-filter btn-w-size text-nowrap d-flex align-items-center justify-content-center disable" id="filterRemove" style="padding: 7px 10px;">
<span>حذف جستجو</span>
</a>

View File

@@ -25,7 +25,7 @@
</div>
</div>
<div>
<a asp-page="/Company/RollCall/Index" class="back-btn" type="button">
<a asp-page="/Index" class="back-btn" type="button">
<span>بازگشت</span>
</a>
</div>

View File

@@ -37,7 +37,7 @@
</div>
</div>
<div>
<a asp-page="/Company/Employees/Index" class="back-btn" type="button">
<a asp-page="/Index" class="back-btn" type="button">
<span>بازگشت</span>
</a>
</div>

View File

@@ -75,9 +75,9 @@ namespace ServiceHost.Areas.Client.Pages.Company.SalaryAid
});
}
public IActionResult OnGetEmployeeList()
public async Task<IActionResult> OnGetEmployeeList()
{
var employees = _employeeApplication.GetWorkingEmployeesByWorkshopId(_workshopId);
var employees = await _employeeApplication.WorkedEmployeesInWorkshopSelectList(_workshopId);
return new JsonResult(new
{

View File

@@ -32,7 +32,7 @@
</div>
</div>
<div>
<a asp-page="/Company/Index" class="back-btn" type="button">
<a asp-page="/Index" class="back-btn" type="button">
<span>بازگشت</span>
</a>
</div>

View File

@@ -143,7 +143,11 @@
<script>
$(document).ready(function () {
$('.loadingButton').on('click', function () {
$('.loadingButton').on('click', function (e) {
if (e.ctrlKey || e.metaKey) {
return;
}
var button = $(this);
var loadingDiv = button.find('.loading');
loadingDiv.show();

View File

@@ -90,7 +90,11 @@ namespace ServiceHost.Areas.Client.Pages
_passwordHasher = passwordHasher;
}
public void OnGet()
public int AllPercent = 80;
public string RollCallServiceDeadline;
public bool CheckRollCallService;
public void OnGet()
{
var account = _authHelper.CurrentAccountInfo();
profilePicture = account.ProfilePhoto;
@@ -197,12 +201,28 @@ namespace ServiceHost.Areas.Client.Pages
CalenderViewModels = calenderList;
#endregion
}
#endregion
#region RollCall Service
var rollCall = _rollCallServiceApplication.GetActiveServiceByWorkshopId(workshopIDecrypt);
if (rollCall == null)
{
RollCallServiceDeadline = "-";
CheckRollCallService = false;
}
else
{
RollCallServiceDeadline = rollCall.EndService.ToFarsi().ToFarsiDuration2();
CheckRollCallService = true;
}
#endregion
}
#region Get Employee & Workshop List by JSON
public IActionResult OnGetWorkshopList(WorkshopSearchModel searchModel)
#region Get Employee & Workshop List by JSON
public IActionResult OnGetWorkshopList(WorkshopSearchModel searchModel)
{
Workshops = _workshopApplication.SearchForClient(searchModel).ToList();
var selectedWorkshop = _workshopApplication.SearchForClient(searchModel).OrderByDescending(x => x.PersonnelCount).FirstOrDefault();
@@ -247,39 +267,47 @@ namespace ServiceHost.Areas.Client.Pages
}
}
public IActionResult OnGetEmployeeList()
public async Task<IActionResult> OnGetEmployeeList()
{
var workshopSlug = User.FindFirst("WorkshopSlug").Value;
var workshopId = _passwordHasher.SlugDecrypt(workshopSlug);
if (workshopId > 0)
{
var result = _workshopApplication.GetConnectedPersonnels(workshopId);
var r = result.GroupBy(x => x.PersonName).Select(x => x.First()).ToList();
//var result = _workshopApplication.GetConnectedPersonnels(workshopId);
//var r = result.GroupBy(x => x.PersonName).Select(x => x.First()).ToList();
Employees = new ConnectedPersonnelViewModel()
{
ConnectedPersonnelViewModels = r.OrderBy(x => x.Black ? 1 : 0).ThenBy(x => x.PersonelCode).ToList(),
};
//Employees = new ConnectedPersonnelViewModel()
//{
// ConnectedPersonnelViewModels = r.OrderBy(x => x.Black ? 1 : 0).ThenBy(x => x.PersonelCode).ToList(),
//};
// لیست پرسنلی که قرارداد ندارند
//var filteredBlackResult = _workshopApplication.GetConnectedPersonnels(workshopId)
// .Where(x => !x.Black && x.ContractPerson)
// .GroupBy(x => x.EmployeeId)
// .Select(x => x.First())
// .OrderBy(x => x.PersonelCode)
// .ToList();
// لیست پرسنلی که قرارداد ندارند
//var filteredBlackResult = _workshopApplication.GetConnectedPersonnels(workshopId)
// .Where(x => !x.Black && x.ContractPerson)
// .GroupBy(x => x.EmployeeId)
// .Select(x => x.First())
// .OrderBy(x => x.PersonelCode)
// .ToList();
//Employees = new ConnectedPersonnelViewModel()
//{
// ConnectedPersonnelViewModels = filteredBlackResult,
//};
//Employees = new ConnectedPersonnelViewModel()
//{
// ConnectedPersonnelViewModels = filteredBlackResult,
//};
return new JsonResult(new { Employees });
var employees = await _employeeApplication.WorkedEmployeesInWorkshopSelectList(workshopId);
return new JsonResult(new
{
success = true,
data = employees
});
}
else
{
return new JsonResult(new { Employees = new ConnectedPersonnelViewModel() });
return new JsonResult(new
{
success = false,
message = "داده ای یافت نشد!"
});
}
}
#endregion
@@ -551,11 +579,11 @@ namespace ServiceHost.Areas.Client.Pages
#region Add Left Work
public IActionResult OnGetLeftWorkEmployeeList()
public async Task<IActionResult> OnGetLeftWorkEmployeeList()
{
var workshopSlug = User.FindFirst("WorkshopSlug")?.Value;
long workshopIDecrypt = _passwordHasher.SlugDecrypt(workshopSlug);
var employees = _employeeApplication.GetWorkingEmployeesByWorkshopId(workshopIDecrypt);
var employees = await _employeeApplication.WorkedEmployeesInWorkshopSelectList(workshopIDecrypt);
return new JsonResult(new
{

View File

@@ -179,10 +179,6 @@
.invalidTime {
color: #b91c1c !important;
}
.blackSelect {
background-color: #cbd5e1;
}
</style>
<script src="~/assetsclient/libs/cleave/cleave.min.js"></script>

View File

@@ -108,7 +108,14 @@
$(".select2Option").select2({
language: "fa",
dir: "rtl"
dir: "rtl",
//dropdownParent: $('#MainModal'),
templateResult: function (data, container) {
if (data.element) {
$(container).addClass($(data.element).attr("class"));
}
return data.text;
}
});
});
@@ -143,7 +150,8 @@
var employees = response.employees.connectedPersonnelViewModels;
var employeeOptionsHtml = '';
employees.forEach(function (employee) {
employeeOptionsHtml += '<option value="' + employee.employeeId + '">' + employee.personName + '</option>';
var black = employee.black ? "blackSelect" : "";
employeeOptionsHtml += `<option class="${black}" value="${employee.id}">${employee.employeeFullName}</option>`;
});
$('#employeeSelect').html(employeeOptionsHtml);
},

View File

@@ -218,24 +218,27 @@
<!-- End Header -->
<!-- Static bottom menu -->
<div class="container-fluid position-fixed bottom-0 text-center d-lg-none d-block static-menu">
<div class="row @(hasPermissionWorkFlow ? "row-cols-4" : "row-cols-3") bg-white menu-bottom text-center">
<div class="row @(hasPermissionWorkFlow ? "row-cols-3" : "row-cols-3") bg-white menu-bottom text-center">
<div class="col toggle">
<a class="bg-transparent">
<svg width="40" height="40" viewBox="0 0 25 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path stroke-width="1.3" d="M9.875 20.5H5.875C5.05114 20.5 4.375 19.8239 4.375 19V5C4.375 4.17614 5.05114 3.5 5.875 3.5H9.875C10.6989 3.5 11.375 4.17614 11.375 5V19C11.375 19.8239 10.6989 20.5 9.875 20.5ZM19.875 20.5H15.875C15.0511 20.5 14.375 19.8239 14.375 19V14C14.375 13.1761 15.0511 12.5 15.875 12.5H19.875C20.6989 12.5 21.375 13.1761 21.375 14V19C21.375 19.8239 20.6989 20.5 19.875 20.5ZM21.375 5V8C21.375 8.82386 20.6989 9.5 19.875 9.5H15.875C15.0511 9.5 14.375 8.82386 14.375 8V5C14.375 4.17614 15.0511 3.5 15.875 3.5H19.875C20.6989 3.5 21.375 4.17614 21.375 5Z" stroke="#14B8A6" />
</svg>
<a class="bg-transparent position-relative d-flex align-items-center justify-content-center flex-column">
<div style="width: 45px;display: flex;align-items: center;justify-content: center;position: relative;height: 40px;">
<svg width="40" height="40" viewBox="0 0 25 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path stroke-width="1.3" d="M9.875 20.5H5.875C5.05114 20.5 4.375 19.8239 4.375 19V5C4.375 4.17614 5.05114 3.5 5.875 3.5H9.875C10.6989 3.5 11.375 4.17614 11.375 5V19C11.375 19.8239 10.6989 20.5 9.875 20.5ZM19.875 20.5H15.875C15.0511 20.5 14.375 19.8239 14.375 19V14C14.375 13.1761 15.0511 12.5 15.875 12.5H19.875C20.6989 12.5 21.375 13.1761 21.375 14V19C21.375 19.8239 20.6989 20.5 19.875 20.5ZM21.375 5V8C21.375 8.82386 20.6989 9.5 19.875 9.5H15.875C15.0511 9.5 14.375 8.82386 14.375 8V5C14.375 4.17614 15.0511 3.5 15.875 3.5H19.875C20.6989 3.5 21.375 4.17614 21.375 5Z" stroke="#14B8A6" />
</svg>
@* <svg width="40" height="40" viewBox="0 0 25 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_104_122)">
<path d="M9.875 21H5.875C4.775 21 3.875 20.1 3.875 19V5C3.875 3.9 4.775 3 5.875 3H9.875C10.975 3 11.875 3.9 11.875 5V19C11.875 20.1 10.975 21 9.875 21ZM15.875 21H19.875C20.975 21 21.875 20.1 21.875 19V14C21.875 12.9 20.975 12 19.875 12H15.875C14.775 12 13.875 12.9 13.875 14V19C13.875 20.1 14.775 21 15.875 21ZM21.875 8V5C21.875 3.9 20.975 3 19.875 3H15.875C14.775 3 13.875 3.9 13.875 5V8C13.875 9.1 14.775 10 15.875 10H19.875C20.975 10 21.875 9.1 21.875 8Z" fill="#14B8A6"/>
<circle cx="23.375" cy="1.5" r="1.5" fill="#14B8A6"/>
</g>
<defs>
<clipPath id="clip0_104_122">
<rect width="24" height="24" fill="white" transform="translate(0.875)"/>
</clipPath>
</defs>
</svg> *@
@* <svg width="40" height="40" viewBox="0 0 25 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_104_122)">
<path d="M9.875 21H5.875C4.775 21 3.875 20.1 3.875 19V5C3.875 3.9 4.775 3 5.875 3H9.875C10.975 3 11.875 3.9 11.875 5V19C11.875 20.1 10.975 21 9.875 21ZM15.875 21H19.875C20.975 21 21.875 20.1 21.875 19V14C21.875 12.9 20.975 12 19.875 12H15.875C14.775 12 13.875 12.9 13.875 14V19C13.875 20.1 14.775 21 15.875 21ZM21.875 8V5C21.875 3.9 20.975 3 19.875 3H15.875C14.775 3 13.875 3.9 13.875 5V8C13.875 9.1 14.775 10 15.875 10H19.875C20.975 10 21.875 9.1 21.875 8Z" fill="#14B8A6"/>
<circle cx="23.375" cy="1.5" r="1.5" fill="#14B8A6"/>
</g>
<defs>
<clipPath id="clip0_104_122">
<rect width="24" height="24" fill="white" transform="translate(0.875)"/>
</clipPath>
</defs>
</svg> *@
<span id="_countWorkFlowMenuMobile" class="alert-number"></span>
</div>
<span class="d-block">خدمات</span>
</a>
</div>
@@ -253,7 +256,7 @@
</a>
</div>
<div class="col" Permission="@SubAccountPermissionHelper.WorkFlowOperationsPermissionCode">
@* <div class="col" Permission="@SubAccountPermissionHelper.WorkFlowOperationsPermissionCode">
<a class="bg-transparent position-relative d-flex align-items-center justify-content-center flex-column" asp-page="/Company/WorkFlow/Index">
<div style="width: 45px;display: flex;align-items: center;justify-content: center;position: relative;height: 40px;">
<svg width="42" height="42" viewBox="-4.08 -4.08 32.16 32.16" fill="none" xmlns="http://www.w3.org/2000/svg">
@@ -270,7 +273,7 @@
</div>
<span>کارپوشه</span>
</a>
</div>
</div> *@
@* <div class="col">
<a class="bg-transparent" asp-page="/Company/Profile/Profile">
<svg width="40" height="40" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">

View File

@@ -1,3 +1,7 @@
.blackSelect {
background-color: #cbd5e1;
}
.select2-dropdown {
border: 1px solid #DADADA;
border-radius: 0 0 7px 7px !important;

View File

@@ -144,7 +144,7 @@ $(document).ready(function () {
var filterStart = $('#start').val();
var filterEnd = $('#end').val();
if (filterEmployeeId !== 0 || filterYear !== '' || filterMonth !== '' || filterStart !== '' || filterEnd !== '') {
if (filterEmployeeId !== "0" || filterYear !== '' || filterMonth !== '' || filterStart !== '' || filterEnd !== '') {
$('.btn-clear-filter').removeClass('disable');
} else {
$('.btn-clear-filter').addClass('disable');
@@ -1129,13 +1129,25 @@ $("#overlaySearchAdvance").click(function () {
}
$("#getPersonnel").select2({
language: "fa",
dir: "rtl"
dir: "rtl",
templateResult: function (data, container) {
if (data.element) {
$(container).addClass($(data.element).attr("class"));
}
return data.text;
}
});
$("#getPersonneModal").select2({
language: "fa",
dir: "rtl",
dropdownParent: $("#searchModal")
dropdownParent: $('#searchModal'),
templateResult: function (data, container) {
if (data.element) {
$(container).addClass($(data.element).attr("class"));
}
return data.text;
}
});
// $(".date").mask("0000/00/00");
@@ -1559,14 +1571,13 @@ $(window).scroll(function () {
function printOne(id) {
var parametr = '&id=' + id;
var url = PrintOneUrl;
window.location.href = url + parametr;
AjaxUrlContentModal(url + parametr);
}
function printOneMobile(id) {
var parametr = '&id=' + id;
var url = PrintOneMobileUrl;
window.location.href = url + parametr;
AjaxUrlContentModal(url + parametr);
}
function printAll() {

View File

@@ -79,7 +79,13 @@ $(document).ready(function () {
$(".select2Option").select2({
language: "fa",
dir: "rtl"
dir: "rtl",
templateResult: function (data, container) {
if (data.element) {
$(container).addClass($(data.element).attr("class"));
}
return data.text;
}
});
$(".select2OptionMobile").select2({
@@ -1692,35 +1698,6 @@ function showExcelAllModal() {
function downloadExcelAll() {
var idlist = "";
var year = $('#Year').val();
var month = $('#Month').val();
if (year === '0' || month === '0') {
$('#dropdown-year').addClass("errored");
$('#dropdown-month').addClass("errored");
$('.alert-msg').show();
$('.alert-msg p').text('لطفا سال و ماه را انتخاب نموده و جستجو نمایید');
setTimeout(function () {
$('.alert-msg').hide();
$('.alert-msg p').text('');
$('#dropdown-year').removeClass("errored");
$('#dropdown-month').removeClass("errored");
}, 3500);
return
}
if (!($('input:checkbox').is(":checked"))) {
$('.alert-msg').show();
$('.alert-msg p').text('هیچ موردی انتخاب نشده است.');
setTimeout(function () {
$('.alert-msg').hide();
$('.alert-msg p').text('');
}, 3500);
return
}
$('.foo').each(function () {
if ($(this).is(":checked")) {
@@ -1829,7 +1806,8 @@ function ajaxPersonals() {
var employees = response.data;
var employeeOptionsHtml = '<option value="0">انتخاب پرسنل ...</option>';
employees.forEach(function (employee) {
employeeOptionsHtml += `<option value="${employee.id}" ${selectEmplyeeID == employee.id ? 'selected' : ''}>${employee.employeeFullName}</option>`;
var black = employee.black ? "blackSelect" : "";
employeeOptionsHtml += `<option class="${black}" value="${employee.id}" ${selectEmplyeeID == employee.id ? 'selected' : ''}>${employee.employeeFullName}</option>`;
});
$('#getPersonnel').html(employeeOptionsHtml);
$('#getPersonnelMobile').html(employeeOptionsHtml);

View File

@@ -1236,7 +1236,13 @@ $(document).ready(function () {
$(".select2Option").select2({
language: "fa",
dir: "rtl"
dir: "rtl",
templateResult: function (data, container) {
if (data.element) {
$(container).addClass($(data.element).attr("class"));
}
return data.text;
}
});
$(".select2OptionMobile").select2({
@@ -1674,36 +1680,8 @@ function showExcelAllModal() {
window.location.href = showCheckoutExcelModalUrl;
}
function excelDownloadAll() {
function downloadExcelAll() {
var idlist = "";
var year = $('#Year').val();
var month = $('#Month').val();
if (year === '0' || month === '0') {
$('#dropdown-year').addClass("errored");
$('#dropdown-month').addClass("errored");
$('.alert-msg').show();
$('.alert-msg p').text('لطفا سال و ماه را انتخاب نموده و جستجو نمایید');
setTimeout(function () {
$('.alert-msg').hide();
$('.alert-msg p').text('');
$('#dropdown-year').removeClass("errored");
$('#dropdown-month').removeClass("errored");
}, 3500);
return
}
if (!($('input:checkbox').is(":checked"))) {
$('.alert-msg').show();
$('.alert-msg p').text('هیچ موردی انتخاب نشده است.');
setTimeout(function () {
$('.alert-msg').hide();
$('.alert-msg p').text('');
}, 3500);
return
}
$('.foo').each(function () {
if ($(this).is(":checked")) {
@@ -1714,47 +1692,22 @@ function excelDownloadAll() {
}
});
var filterArray = [];
$("input[name='filter[]']:checked").each(function () {
filterArray.push($(this).val());
});
if (idlist !== "") {
//var url = CheckoutExcelAllUrl + "&idList=" + idlist;
var url = CheckoutExcelAllUrl + "&idList=" + encodeURIComponent(idlist);
var yearFa = '&yearFa=' + year;
var monthFa = '&monthFa=' + month;
var url = CheckoutExcelAllUrl + '&idlist=' + idlist;
//console.log(url + '?checkoutId=' + idlist + yearFa + monthFa);
filterArray.forEach(function (filter) {
url += "&filter=" + encodeURIComponent(filter);
});
window.open(url, "_blank");
}
}
//function downloadExcelAll() {
// var idlist = "";
// $('.foo').each(function () {
// if ($(this).is(":checked")) {
// var a = $(this).val();
// var b = a + "+";
// idlist += b;
// }
// });
// var filterArray = [];
// $("input[name='filter[]']:checked").each(function () {
// filterArray.push($(this).val());
// });
// if (idlist !== "") {
// //var url = CheckoutExcelAllUrl + "&idList=" + idlist;
// var url = CheckoutExcelAllUrl + "&idList=" + encodeURIComponent(idlist);
// filterArray.forEach(function (filter) {
// url += "&filter=" + encodeURIComponent(filter);
// });
// window.open(url, "_blank");
// }
//}
function printAllMobile() {
var idlist = "";
@@ -1824,7 +1777,8 @@ function ajaxPersonals() {
var employees = response.data;
var employeeOptionsHtml = '<option value="0">انتخاب پرسنل ...</option>';
employees.forEach(function (employee) {
employeeOptionsHtml += `<option value="${employee.id}" ${selectEmplyeeID == employee.id ? 'selected' : ''}>${employee.employeeFullName}</option>`;
var black = employee.black ? "blackSelect" : "";
employeeOptionsHtml += `<option class="${black}" value="${employee.id}" ${selectEmplyeeID == employee.id ? 'selected' : ''}>${employee.employeeFullName}</option>`;
});
$('#getPersonnel').html(employeeOptionsHtml);
$('#getPersonnelMobile').html(employeeOptionsHtml);

View File

@@ -190,7 +190,8 @@ function ajaxPersonals() {
var employees = response.data;
var employeeOptionsHtml = '<option value="" disabled selected>انتخاب پرسنل ...</option>';
employees.forEach(function (employee) {
employeeOptionsHtml += `<option value="${employee.id}">${employee.employeeFullName}</option>`;
var black = employee.black ? "blackSelect" : "";
employeeOptionsHtml += `<option class="${black}" value="${employee.id}">${employee.employeeFullName}</option>`;
});
$('#employeeSelect').html(employeeOptionsHtml);
} else {

View File

@@ -629,12 +629,11 @@ function ajaxPersonals() {
success: function (response) {
$('#cardSectionLeave').addClass('blur');
$("#cardSectionLeave div *").prop('disabled', true);
var employees = response.connectedPersonnel.connectedPersonnelViewModels;
var employees = response.data;
var employeeOptionsHtml = '<option value="">انتخاب پرسنل ...</option>';
employees.forEach(function (employee) {
var black = employee.black ? "blackSelect" : "";
employeeOptionsHtml += `<option class="${black}" value="${employee.employeeId}">${employee.personName}</option>`;
employees.forEach(function (employee) {
var black = employee.black ? "blackSelect" : "";
employeeOptionsHtml += `<option class="${black}" value="${employee.id}">${employee.employeeFullName}</option>`;
});
$('#employeeSelectList').html(employeeOptionsHtml);
},

View File

@@ -25,7 +25,13 @@ $(document).ready(function () {
$(".select2OptionIndex").select2({
language: "fa",
dir: "rtl"
dir: "rtl",
templateResult: function (data, container) {
if (data.element) {
$(container).addClass($(data.element).attr("class"));
}
return data.text;
}
});
$(".select2OptionIndexMobile").select2({
@@ -283,7 +289,8 @@ function ajaxPersonals() {
var employees = response.data;
var employeeOptionsHtml = '<option value="0">انتخاب پرسنل ...</option>';
employees.forEach(function (employee) {
employeeOptionsHtml += `<option value="${employee.id}">${employee.employeeFullName}</option>`;
var black = employee.black ? "blackSelect" : "";
employeeOptionsHtml += `<option class="${black}" value="${employee.id}">${employee.employeeFullName}</option>`;
});
$('#employeeSelectIndex').html(employeeOptionsHtml);
$('#employeeSelectIndexMobile').html(employeeOptionsHtml);

View File

@@ -14,7 +14,13 @@ $(document).ready(function () {
$(".select2OptionIndex").select2({
language: "fa",
dir: "rtl"
dir: "rtl",
templateResult: function (data, container) {
if (data.element) {
$(container).addClass($(data.element).attr("class"));
}
return data.text;
}
});
$(".select2OptionIndexMobile").select2({
@@ -252,7 +258,8 @@ function ajaxPersonals() {
var employees = response.data;
var employeeOptionsHtml = '<option value="0">انتخاب پرسنل ...</option>';
employees.forEach(function (employee) {
employeeOptionsHtml += `<option value="${employee.id}">${employee.employeeFullName}</option>`;
var black = employee.black ? "blackSelect" : "";
employeeOptionsHtml += `<option class="${black}" value="${employee.id}">${employee.employeeFullName}</option>`;
});
$('#employeeSelectIndex').html(employeeOptionsHtml);
$('#employeeSelectIndexMobile').html(employeeOptionsHtml);

View File

@@ -1,5 +1,36 @@
var urlPathname = location.pathname;
document.querySelectorAll('.scroll-container-amount').forEach(container => {
let isDown = false;
let startX;
let scrollLeft;
container.addEventListener('mousedown', (e) => {
isDown = true;
startX = e.pageX - container.offsetLeft;
scrollLeft = container.scrollLeft;
container.style.cursor = "grabbing";
});
container.addEventListener('mouseleave', () => {
isDown = false;
container.style.cursor = "grab";
});
container.addEventListener('mouseup', () => {
isDown = false;
container.style.cursor = "grab";
});
container.addEventListener('mousemove', (e) => {
if (!isDown) return;
e.preventDefault();
const x = e.pageX - container.offsetLeft;
const walk = (x - startX) * 2;
container.scrollLeft = scrollLeft - walk;
});
});
$(document).ready(function () {
$('.loading').hide();
@@ -94,7 +125,8 @@ function ajaxPersonals() {
var employees = response.data;
var employeeOptionsHtml = '<option value="" disabled>انتخاب پرسنل ...</option>';
employees.forEach(function (employee) {
employeeOptionsHtml += `<option value="${employee.id}">${employee.employeeFullName}</option>`;
var black = employee.black ? "blackSelect" : "";
employeeOptionsHtml += `<option class="${black}" value="${employee.id}">${employee.employeeFullName}</option>`;
});
$('#employeeSelect').html(employeeOptionsHtml);
} else {

View File

@@ -726,7 +726,7 @@ function ajaxPersonals() {
var employeeOptionsHtml = '<option value="">انتخاب پرسنل ...</option>';
employees.forEach(function (employee) {
var black = employee.black ? "blackSelect" : "";
employeeOptionsHtml += `<option class="${black}" value="${employee.employeeId}">${employee.personName}</option>`;
employeeOptionsHtml += `<option class="${black}" value="${employee.id}">${employee.employeeFullName}</option>`;
});
$('#employeeSelect').html(employeeOptionsHtml);
},

View File

@@ -13,7 +13,13 @@ $(document).ready(function () {
$(".select2OptionIndex").select2({
language: "fa",
dir: "rtl"
dir: "rtl",
templateResult: function (data, container) {
if (data.element) {
$(container).addClass($(data.element).attr("class"));
}
return data.text;
}
});
$(".select2OptionIndexMobile").select2({
@@ -256,7 +262,8 @@ function ajaxPersonals() {
var employees = response.data;
var employeeOptionsHtml = '<option value="0">انتخاب پرسنل ...</option>';
employees.forEach(function (employee) {
employeeOptionsHtml += `<option value="${employee.id}">${employee.employeeFullName}</option>`;
var black = employee.black ? "blackSelect" : "";
employeeOptionsHtml += `<option class="${black}" value="${employee.id}">${employee.employeeFullName}</option>`;
});
$('#employeeSelectIndex').html(employeeOptionsHtml);
$('#employeeSelectIndexMobile').html(employeeOptionsHtml);

View File

@@ -126,7 +126,8 @@ function ajaxPersonals() {
var employees = response.data;
var employeeOptionsHtml = '<option value="" disabled>انتخاب پرسنل ...</option>';
employees.forEach(function (employee) {
employeeOptionsHtml += `<option value="${employee.id}">${employee.employeeFullName}</option>`;
var black = employee.black ? "blackSelect" : "";
employeeOptionsHtml += `<option class="${black}" value="${employee.id}">${employee.employeeFullName}</option>`;
});
$('#employeeSelect').html(employeeOptionsHtml);
} else {

View File

@@ -15,7 +15,13 @@ $(document).ready(function () {
$(".select2OptionIndex").select2({
language: "fa",
dir: "rtl"
dir: "rtl",
templateResult: function (data, container) {
if (data.element) {
$(container).addClass($(data.element).attr("class"));
}
return data.text;
}
});
$(".select2OptionIndexMobile").select2({
@@ -260,7 +266,8 @@ function ajaxPersonals() {
var employees = response.data;
var employeeOptionsHtml = '<option value="0">انتخاب پرسنل ...</option>';
employees.forEach(function (employee) {
employeeOptionsHtml += `<option value="${employee.id}">${employee.employeeFullName}</option>`;
var black = employee.black ? "blackSelect" : "";
employeeOptionsHtml += `<option class="${black}" value="${employee.id}">${employee.employeeFullName}</option>`;
});
$('#employeeSelectIndex').html(employeeOptionsHtml);
$('#employeeSelectIndexMobile').html(employeeOptionsHtml);

View File

@@ -1,5 +1,36 @@
var urlPathname = location.pathname;
document.querySelectorAll('.scroll-container-amount').forEach(container => {
let isDown = false;
let startX;
let scrollLeft;
container.addEventListener('mousedown', (e) => {
isDown = true;
startX = e.pageX - container.offsetLeft;
scrollLeft = container.scrollLeft;
container.style.cursor = "grabbing";
});
container.addEventListener('mouseleave', () => {
isDown = false;
container.style.cursor = "grab";
});
container.addEventListener('mouseup', () => {
isDown = false;
container.style.cursor = "grab";
});
container.addEventListener('mousemove', (e) => {
if (!isDown) return;
e.preventDefault();
const x = e.pageX - container.offsetLeft;
const walk = (x - startX) * 2;
container.scrollLeft = scrollLeft - walk;
});
});
$(document).ready(function () {
$('.loading').hide();
@@ -89,7 +120,8 @@ function ajaxPersonals() {
var employees = response.data;
var employeeOptionsHtml = '<option value="" disabled>انتخاب پرسنل ...</option>';
employees.forEach(function (employee) {
employeeOptionsHtml += `<option value="${employee.id}">${employee.employeeFullName}</option>`;
var black = employee.black ? "blackSelect" : "";
employeeOptionsHtml += `<option class="${black}" value="${employee.id}">${employee.employeeFullName}</option>`;
});
$('#employeeSelect').html(employeeOptionsHtml);
} else {

View File

@@ -15,7 +15,13 @@ $(document).ready(function () {
$(".select2OptionIndex").select2({
language: "fa",
dir: "rtl"
dir: "rtl",
templateResult: function (data, container) {
if (data.element) {
$(container).addClass($(data.element).attr("class"));
}
return data.text;
}
});
$(".select2OptionIndexMobile").select2({
@@ -179,6 +185,27 @@ $(document).on('click', '.btn-search-click, .btn-search-click-mobile', function
return;
}
if (((searchName.val() === "0") && ((searchStartDateTime === '' && searchEndDateTime === '')))) {
if (isMobile) {
$('#start-date-mobile').addClass("errored");
$('#end-date-mobile').addClass("errored");
} else {
$('#start-date').addClass("errored");
$('#end-date').addClass("errored");
$('.select2.select2-container .select2-selection').addClass("errored");
}
$('.alert-msg').show();
$('.alert-msg p').text('برای جستجوی تاریخ، می بایست تاریخ شروع و پایان یا پرسنل را مشخص نمایید');
setTimeout(function () {
$('.alert-msg').hide();
$('.alert-msg p').text('');
$('#start-date, #end-date, .select2.select2-container .select2-selection ,#start-date-mobile, #end-date-mobile').removeClass("errored");
}, 3500);
return;
}
$('.btn-clear-filter').removeClass('disable');
if (searchName.val() === "0" && searchStartDateTime === "" && searchEndDateTime === "") {
$('.btn-clear-filter').addClass('disable');
@@ -259,7 +286,8 @@ function ajaxPersonals() {
var employees = response.data;
var employeeOptionsHtml = '<option value="0">انتخاب پرسنل ...</option>';
employees.forEach(function (employee) {
employeeOptionsHtml += `<option value="${employee.id}">${employee.employeeFullName}</option>`;
var black = employee.black ? "blackSelect" : "";
employeeOptionsHtml += `<option class="${black}" value="${employee.id}">${employee.employeeFullName}</option>`;
});
$('#employeeSelectIndex').html(employeeOptionsHtml);
$('#employeeSelectIndexMobile').html(employeeOptionsHtml);
@@ -557,7 +585,8 @@ function htmlLoadWithEmployeeDataByDate(loadSalaryAidListData) {
if (loadSalaryAidListData.length > 0) {
loadSalaryAidListData.forEach(function (itemSalaryAids) {
n = 1;
html += `<div></div>
//<div></div>
html += `
<div class="salaryAid-grid-list personal-grid-row d-grid gap-2 grid-cols-12 w-100">
<div class="Rtable-row align-items-center col-span-2">
<div class="Rtable-cell width1">
@@ -689,7 +718,7 @@ function htmlLoadWithEmployeeDataByDate(loadSalaryAidListData) {
});
html += `</div>`
html += `</div>`;
html += `
<div class="Rtable-row align-items-center col-span-2">
<div class="Rtable-cell width1 ">

View File

@@ -120,7 +120,8 @@ function ajaxPersonals() {
var employees = response.data;
var employeeOptionsHtml = '<option value="" disabled>انتخاب پرسنل ...</option>';
employees.forEach(function (employee) {
employeeOptionsHtml += `<option value="${employee.id}">${employee.employeeFullName}</option>`;
var black = employee.black ? "blackSelect" : "";
employeeOptionsHtml += `<option class="${black}" value="${employee.id}">${employee.employeeFullName}</option>`;
});
$('#employeeSelect').html(employeeOptionsHtml);
} else {