Merge From Upload/Dad-Mehr to master
This commit is contained in:
@@ -8,7 +8,8 @@ namespace _0_Framework.Application
|
||||
Client,
|
||||
SubAccount,
|
||||
Camera,
|
||||
Admin
|
||||
Admin,
|
||||
System
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -54,6 +54,7 @@ public interface IEmployeeRepository : IRepository<long, Employee>
|
||||
|
||||
Employee GetIgnoreQueryFilter(long id);
|
||||
|
||||
Task<List<EmployeeSelectListViewModel>> WorkedEmployeesInWorkshopSelectList(long workshopId);
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -6,7 +6,11 @@ namespace Company.Domain.FineAgg;
|
||||
|
||||
public class Fine:EntityBase
|
||||
{
|
||||
public Fine(long employeeId, long workshopId, string title, double amount,DateTime fineDate)
|
||||
private Fine()
|
||||
{
|
||||
|
||||
}
|
||||
public Fine(long employeeId, long workshopId, string title, double amount,DateTime fineDate, long createdByAccountId, UserType createdByUserType)
|
||||
{
|
||||
EmployeeId = employeeId;
|
||||
WorkshopId = workshopId;
|
||||
@@ -15,6 +19,9 @@ public class Fine:EntityBase
|
||||
IsActive = IsActive.True;
|
||||
FineDate = fineDate;
|
||||
|
||||
CreatedByUserType = createdByUserType;
|
||||
CreatedByAccountId = createdByAccountId;
|
||||
|
||||
}
|
||||
|
||||
public long EmployeeId { get; private set; }
|
||||
@@ -24,7 +31,23 @@ public class Fine:EntityBase
|
||||
public IsActive IsActive { get; private set; }
|
||||
public DateTime FineDate { get; private set; }
|
||||
|
||||
public void DeActive()
|
||||
|
||||
/// <summary>
|
||||
/// شخصی که جریمه را ساخته است
|
||||
/// </summary>
|
||||
public long CreatedByAccountId { get; private set; }
|
||||
public UserType CreatedByUserType { get; private set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// شخصی که جریمه را ویرایش کرده است
|
||||
/// </summary>
|
||||
public long LastModifiedByAccountId { get; private set; }
|
||||
public UserType LastModifiedByUserType { get; private set; }
|
||||
|
||||
|
||||
|
||||
public void DeActive()
|
||||
{
|
||||
IsActive = IsActive.False;
|
||||
}
|
||||
@@ -34,14 +57,15 @@ public class Fine:EntityBase
|
||||
IsActive = IsActive.True;
|
||||
}
|
||||
|
||||
public void Edit(long employeeId, long workshopId, string title, double amount,DateTime fineDate)
|
||||
public void Edit(long employeeId, long workshopId, string title, double amount,DateTime fineDate, long modifiedByAccountId, UserType modifiedByUserType)
|
||||
{
|
||||
EmployeeId = employeeId;
|
||||
WorkshopId = workshopId;
|
||||
Title = title;
|
||||
Amount = amount;
|
||||
FineDate = fineDate;
|
||||
|
||||
LastModifiedByAccountId = modifiedByAccountId;
|
||||
LastModifiedByUserType = modifiedByUserType;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -12,4 +12,14 @@ public interface IFineRepository : IRepository<long, Fine>
|
||||
void Remove(Fine entity);
|
||||
void RemoveRange(IEnumerable<Fine> entityEnumerable);
|
||||
|
||||
|
||||
#region Pooya
|
||||
|
||||
/// <summary>
|
||||
/// گروهبندی بر اساس ماه هنگام جستجو با انتخاب کارمند
|
||||
/// </summary>
|
||||
FinesGroupedViewModel GetSearchListAsGrouped(FineSearchViewModel searchModel);
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
@@ -9,12 +9,14 @@ namespace Company.Domain.LoanAgg.Entities;
|
||||
|
||||
public class Loan : EntityBase
|
||||
{
|
||||
private Loan()
|
||||
private Loan(long createdByAccountId, UserType createdByUserType)
|
||||
{
|
||||
CreatedByAccountId = createdByAccountId;
|
||||
CreatedByUserType = createdByUserType;
|
||||
}
|
||||
|
||||
public Loan(long employeeId, long workshopId, DateTime startDateTime,
|
||||
string count, double amount, double amountPerMonth,ICollection<LoanInstallment> loanInstallments, bool getRounded, DateTime loanGrantDate)
|
||||
string count, double amount, double amountPerMonth,ICollection<LoanInstallment> loanInstallments, bool getRounded, DateTime loanGrantDate, long createdByAccountId, UserType createdByUserType)
|
||||
{
|
||||
EmployeeId = employeeId;
|
||||
WorkshopId = workshopId;
|
||||
@@ -25,6 +27,8 @@ public class Loan : EntityBase
|
||||
LoanInstallments = loanInstallments;
|
||||
GetRounded = getRounded;
|
||||
LoanGrantDate = loanGrantDate;
|
||||
CreatedByAccountId = createdByAccountId;
|
||||
CreatedByUserType = createdByUserType;
|
||||
//for (int i = 0; i < Convert.ToInt32(count); i++)
|
||||
//{
|
||||
// LoanInstallment newInstallment = new(amountPerMonth, month.ToString("00"), year.ToString("0000"));
|
||||
@@ -64,7 +68,11 @@ public class Loan : EntityBase
|
||||
public bool GetRounded { get; private set; }
|
||||
public ICollection<LoanInstallment> LoanInstallments { get; private set; }
|
||||
|
||||
public void DeActiveInstallment(string year, string month)
|
||||
|
||||
public long CreatedByAccountId { get; private set; }
|
||||
public UserType CreatedByUserType { get; private set; }
|
||||
|
||||
public void DeActiveInstallment(string year, string month)
|
||||
{
|
||||
|
||||
var installment = LoanInstallments.FirstOrDefault(x => x.Month == month && x.Year == year);
|
||||
|
||||
@@ -2,14 +2,17 @@
|
||||
using Company.Domain.LoanAgg.Entities;
|
||||
using CompanyManagment.App.Contracts.Loan;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Company.Domain.LoanAgg;
|
||||
|
||||
public interface ILoanRepository:IRepository<long,Loan>
|
||||
{
|
||||
List<LoanViewModel> GetSearchList(LoanSearchViewModel searchViewModel);
|
||||
LoanViewModel GetDetails(long id);
|
||||
Task<LoanDetailsViewModel> GetDetails(long id);
|
||||
void Remove(Loan entity);
|
||||
List<Loan> GetBy(IEnumerable<long> ids);
|
||||
void RemoveRange(IEnumerable<Loan> loans);
|
||||
|
||||
LoanGroupedViewModel GetSearchListAsGrouped(LoanSearchViewModel searchModel);
|
||||
}
|
||||
@@ -18,6 +18,6 @@ public interface IRewardRepository : IRepository<long, Reward>
|
||||
/// <summary>
|
||||
/// گروهبندی بر اساس ماه هنگام جستجو با انتخاب کارمند
|
||||
/// </summary>
|
||||
List<MonthlyGroupedEmployeeRewardsViewModel> GetSearchListByEmployee(RewardSearchModel searchModel);
|
||||
RewardsGroupedViewModel GetSearchListAsGrouped(RewardSearchModel searchModel);
|
||||
#endregion
|
||||
}
|
||||
@@ -8,18 +8,19 @@ namespace Company.Domain.RewardAgg;
|
||||
|
||||
public class Reward:EntityBase
|
||||
{
|
||||
private Reward(string title)
|
||||
private Reward()
|
||||
{
|
||||
Title = title;
|
||||
|
||||
}
|
||||
|
||||
public Reward(long employeeId, long workshopId, double amount, string description, long rewardedByAccountId, DateTime grantDate, string title , RewardType type = RewardType.None)
|
||||
public Reward(long employeeId, long workshopId, double amount, string description, long rewardedByAccountId,UserType userType, DateTime grantDate, string title , RewardType type = RewardType.None)
|
||||
{
|
||||
EmployeeId = employeeId;
|
||||
WorkshopId = workshopId;
|
||||
Amount = amount;
|
||||
Description = description;
|
||||
RewardedByAccountId = rewardedByAccountId;
|
||||
CreatedByAccountId = rewardedByAccountId;
|
||||
CreatedByUserType = userType;
|
||||
GrantDate = grantDate;
|
||||
Title = title;
|
||||
IsActive = IsActive.True;
|
||||
@@ -45,24 +46,35 @@ public class Reward:EntityBase
|
||||
public string Description { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// شخصی که پاداش را داده است
|
||||
/// شخصی که پاداش را ساخته است
|
||||
/// </summary>
|
||||
public long RewardedByAccountId { get; private set; }
|
||||
public long CreatedByAccountId { get; private set; }
|
||||
public UserType CreatedByUserType { get;private set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ اعطای پاداش
|
||||
/// شخصی که پاداش را ویرایش کرده است
|
||||
/// </summary>
|
||||
public DateTime GrantDate { get; set; }
|
||||
public long LastModifiedByAccountId { get; private set; }
|
||||
public UserType LastModifiedByUserType { get; private set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ اعطای پاداش
|
||||
/// </summary>
|
||||
public DateTime GrantDate { get; set; }
|
||||
|
||||
public RewardType RewardType { get; set; }
|
||||
|
||||
public IsActive IsActive { get; private set; }
|
||||
|
||||
public void Edit(double amount, string description, long rewardedByAccountId, DateTime grantDate,string title)
|
||||
|
||||
public void Edit(double amount, string description, long modifiedByAccountId, UserType userType, DateTime grantDate,string title)
|
||||
{
|
||||
Amount = amount;
|
||||
Description = description;
|
||||
RewardedByAccountId = rewardedByAccountId;
|
||||
LastModifiedByAccountId = modifiedByAccountId;
|
||||
LastModifiedByUserType = userType;
|
||||
GrantDate = grantDate;
|
||||
Title = title;
|
||||
}
|
||||
|
||||
@@ -15,12 +15,13 @@ namespace Company.Domain.RollCallEmployeeStatusAgg
|
||||
///
|
||||
/// <returns></returns>
|
||||
void AdjustRollCallStatusEndDates(List<AdjustRollCallEmployeesWithEmployeeLeftWork> command);
|
||||
/// <summary>
|
||||
/// دریافت وضعیت حضور غیاب پرسنل در تاریخ مشخص
|
||||
/// </summary>
|
||||
/// <param name="rollCallEmployeeId"></param>
|
||||
/// <param name="date"></param>
|
||||
/// <returns></returns>
|
||||
|
||||
/// <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);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
using _0_Framework.Domain;
|
||||
using CompanyManagment.App.Contracts.Reward;
|
||||
using CompanyManagment.App.Contracts.SalaryAid;
|
||||
|
||||
namespace Company.Domain.SalaryAidAgg;
|
||||
@@ -11,4 +12,13 @@ public interface ISalaryAidRepository:IRepository<long,SalaryAid>
|
||||
void Remove(SalaryAid entity);
|
||||
List<SalaryAid> GetBy(IEnumerable<long> ids);
|
||||
void RemoveRange(IEnumerable<SalaryAid> salaryAids);
|
||||
|
||||
#region Pooya
|
||||
|
||||
/// <summary>
|
||||
/// گروهبندی بر اساس ماه هنگام جستجو با انتخاب کارمند
|
||||
/// </summary>
|
||||
|
||||
SalaryAidsGroupedViewModel GetSearchListAsGrouped(SalaryAidSearchViewModel searchModel);
|
||||
#endregion
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Domain;
|
||||
using Hangfire.Annotations;
|
||||
|
||||
@@ -6,15 +7,18 @@ namespace Company.Domain.SalaryAidAgg;
|
||||
|
||||
public class SalaryAid:EntityBase
|
||||
{
|
||||
private SalaryAid(){}
|
||||
|
||||
|
||||
public SalaryAid(long employeeId, long workshopId, double amount, DateTime salaryAidDateTime)
|
||||
private SalaryAid()
|
||||
{
|
||||
|
||||
}
|
||||
public SalaryAid(long employeeId, long workshopId, double amount, DateTime salaryAidDateTime, long createdByAccountId, UserType createdByUserType)
|
||||
{
|
||||
EmployeeId = employeeId;
|
||||
WorkshopId = workshopId;
|
||||
Amount = amount;
|
||||
SalaryAidDateTime = salaryAidDateTime;
|
||||
CreatedByUserType = createdByUserType;
|
||||
CreatedByAccountId = createdByAccountId;
|
||||
}
|
||||
|
||||
public long EmployeeId { get; private set; }
|
||||
@@ -22,9 +26,21 @@ public class SalaryAid:EntityBase
|
||||
public double Amount { get; private set; }
|
||||
public DateTime SalaryAidDateTime { get; private set; }
|
||||
|
||||
public void Edit(double amount, DateTime salaryAidTime)
|
||||
|
||||
public long CreatedByAccountId { get; private set; }
|
||||
public UserType CreatedByUserType { get; private set; }
|
||||
|
||||
|
||||
|
||||
public long LastModifiedByAccountId { get; private set; }
|
||||
public UserType LastModifiedByUserType { get; private set; }
|
||||
|
||||
|
||||
public void Edit(double amount, DateTime salaryAidTime, long modifiedByAccountId, UserType modifiedByUserType)
|
||||
{
|
||||
Amount = amount;
|
||||
SalaryAidDateTime = salaryAidTime;
|
||||
LastModifiedByAccountId = modifiedByAccountId;
|
||||
LastModifiedByUserType = modifiedByUserType;
|
||||
}
|
||||
}
|
||||
@@ -10,4 +10,6 @@ public class EmployeeSelectListViewModel
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public string EmployeeFullName { get; set; }
|
||||
public bool Black { get; set; }
|
||||
|
||||
}
|
||||
@@ -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
|
||||
|
||||
}
|
||||
@@ -13,4 +13,5 @@ public class FineSearchViewModel
|
||||
public int PageIndex { get; set; }
|
||||
public string StartDate { get; set; }
|
||||
public string EndDate { get; set; }
|
||||
public bool ShowAsGrouped { get; set; }
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using _0_Framework.Application;
|
||||
using CompanyManagment.App.Contracts.Loan;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.Fine;
|
||||
|
||||
@@ -15,4 +16,7 @@ public class FineViewModel
|
||||
public string FineDate { get; set; }
|
||||
public IsActive IsActive { get; set; }
|
||||
public string CreationDate { get; set; }
|
||||
public string YearFa { get; set; }
|
||||
public string MonthFa { get; set; }
|
||||
public double AmountDouble { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.Fine;
|
||||
|
||||
public class FinesGroupedByDateViewModel
|
||||
{
|
||||
public string MonthFa { get; set; }
|
||||
public string YearFa { get; set; }
|
||||
public List<FinesGroupedByDateViewModelItems> Fines { get; set; }
|
||||
public string TotalAmount { get; set; }
|
||||
}
|
||||
public class FinesGroupedByDateViewModelItems
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public string EmployeeName { get; set; }
|
||||
public string PersonnelCode { get; set; }
|
||||
public string Title { get; set; }
|
||||
public string Amount { get; set; }
|
||||
public string FineDateTimeFa { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.Fine;
|
||||
|
||||
public class FinesGroupedByEmployeeViewModel
|
||||
{
|
||||
public string EmployeeName { get; set; }
|
||||
public List<FinesGroupedByEmployeeViewModelItems> Fines { get; set; }
|
||||
public string TotalAmount { get; set; }
|
||||
public long EmployeeId { get; set; }
|
||||
}
|
||||
|
||||
public class FinesGroupedByEmployeeViewModelItems
|
||||
{
|
||||
public string FineDateTimeFa { get; set; }
|
||||
public string Title { get; set; }
|
||||
public string Amount { get; set; }
|
||||
public long Id { get; set; }
|
||||
public string PersonnelCode { get; set; }
|
||||
}
|
||||
15
CompanyManagment.App.Contracts/Fine/FinesGroupedViewModel.cs
Normal file
15
CompanyManagment.App.Contracts/Fine/FinesGroupedViewModel.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System.Collections.Generic;
|
||||
using CompanyManagment.App.Contracts.EmployeeInsurancListData;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.Fine;
|
||||
|
||||
public class FinesGroupedViewModel
|
||||
{
|
||||
|
||||
public List<FinesGroupedByDateViewModel> GroupedByDate { get; set; }
|
||||
public List<FinesGroupedByEmployeeViewModel> GroupedByEmployee { get; set; }
|
||||
public List<FineViewModel> FineListViewModels { get; set; }
|
||||
|
||||
}
|
||||
|
||||
@@ -11,4 +11,12 @@ public interface IFineApplication
|
||||
EditFineViewModel GetDetails(long id);
|
||||
OperationResult Remove(long id);
|
||||
OperationResult RemoveRange(List<long> ids);
|
||||
#region Pooya
|
||||
|
||||
/// <summary>
|
||||
/// گروهبندی بر اساس ماه هنگام جستجو با انتخاب کارمند
|
||||
/// </summary>
|
||||
FinesGroupedViewModel GetSearchListAsGrouped(FineSearchViewModel searchModel);
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -1,14 +1,26 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.Loan;
|
||||
|
||||
public interface ILoanApplication
|
||||
{
|
||||
List<LoanViewModel> GetSearchList(LoanSearchViewModel searchViewModel);
|
||||
LoanViewModel GetDetails(long id);
|
||||
Task<LoanDetailsViewModel> GetDetails(long id);
|
||||
OperationResult Create(CreateLoanViewModel command);
|
||||
List<LoanInstallmentViewModel> CalculateLoanInstallment(string amount , int installmentCount,string loanStartDate,bool getRounded);
|
||||
OperationResult Remove(long id);
|
||||
OperationResult RemoveRange(IEnumerable<long> ids);
|
||||
}
|
||||
|
||||
LoanGroupedViewModel GetSearchListAsGrouped(LoanSearchViewModel searchModel);
|
||||
}
|
||||
|
||||
public class LoanGroupedViewModel
|
||||
{
|
||||
public List<LoanGroupedByDateViewModel> GroupedByDate { get; set; }
|
||||
public List<LoanGroupedByEmployeeViewModel>GroupedByEmployee { get; set; }
|
||||
public List<LoanViewModel> LoanListViewModel { get; set; }
|
||||
}
|
||||
|
||||
|
||||
22
CompanyManagment.App.Contracts/Loan/LoanDetailsViewModel.cs
Normal file
22
CompanyManagment.App.Contracts/Loan/LoanDetailsViewModel.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.Loan;
|
||||
|
||||
public class LoanDetailsViewModel
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public string EmployeeFullName { get; set; }
|
||||
public string LoanGrantDate { get; set; }
|
||||
public string InstallmentCount { get; set; }
|
||||
public string TotalLoanAmount { get; set; }
|
||||
public string TotalPaidAmount { get; set; }
|
||||
public string TotalRemainingAmount { get; set; }
|
||||
public List<LoanInstallmentDetailsViewModel> Installments { get; set; }
|
||||
}
|
||||
public class LoanInstallmentDetailsViewModel
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public string InstallmentDate { get; set; }
|
||||
public string InstallmentAmount { get; set; }
|
||||
public bool IsPaid { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.Loan;
|
||||
|
||||
public class LoanGroupedByDateViewModel
|
||||
{
|
||||
public string MonthFa { get; set; }
|
||||
public string YearFa { get; set; }
|
||||
public string TotalAmount { get; set; }
|
||||
public List<LoanGroupedByDateViewModelItems> LoanItems { get; set; }
|
||||
}
|
||||
|
||||
public class LoanGroupedByDateViewModelItems
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public string EmployeeName { get; set; }
|
||||
public string PersonnelCode { get; set; }
|
||||
public string AmountPerMonth { get; set; }
|
||||
public string LoanStartDate { get; set; }
|
||||
public string TotalAmountFa { get; set; }
|
||||
public string InstallmentCount { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.Loan;
|
||||
|
||||
public class LoanGroupedByEmployeeViewModel
|
||||
{
|
||||
public string EmployeeName { get; set; }
|
||||
public string TotalAmount { get; set; }
|
||||
public List<LoanGroupedByEmployeeViewModelItems> LoanItems { get; set; }
|
||||
}
|
||||
public class LoanGroupedByEmployeeViewModelItems
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public string PersonnelCode { get; set; }
|
||||
public string AmountPerMonth { get; set; }
|
||||
public string LoanDateTimeFa { get; set; }
|
||||
public string TotalAmountFa { get; set; }
|
||||
public string InstallmentCount { get; set; }
|
||||
}
|
||||
@@ -16,4 +16,5 @@ public class LoanSearchViewModel
|
||||
public string EndDate { get; set; }
|
||||
|
||||
public int PageIndex { get; set; }
|
||||
public bool ShowAsGrouped { get; set; }
|
||||
}
|
||||
|
||||
@@ -19,4 +19,7 @@ public class LoanViewModel
|
||||
public List<LoanInstallmentViewModel> Installment { get; set; }
|
||||
public string PersonnelCode { get; set; }
|
||||
public DateTime CreationDate { get; set; }
|
||||
public double AmountDouble { get; set; }
|
||||
public string MonthFa { get; set; }
|
||||
public string YearFa { get; set; }
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using _0_Framework.Application;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.Reward;
|
||||
|
||||
@@ -12,14 +13,15 @@ public class CreateRewardViewModel
|
||||
/// </summary>
|
||||
public string Amount { get; set; }
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// توضیحات
|
||||
/// </summary>
|
||||
public string Description { get; set; }
|
||||
/// <summary>
|
||||
/// شخصی که پاداش را داده است
|
||||
/// </summary>
|
||||
public long RewardedByAccountId { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
public string GrantDate { get; set; }
|
||||
public string Title { get; set; }
|
||||
|
||||
@@ -17,7 +17,7 @@ public interface IRewardApplication
|
||||
/// <summary>
|
||||
/// گروهبندی بر اساس ماه هنگام جستجو با انتخاب کارمند
|
||||
/// </summary>
|
||||
List<MonthlyGroupedEmployeeRewardsViewModel> GetSearchListByEmployee(RewardSearchModel searchModel);
|
||||
RewardsGroupedViewModel GetSearchListAsGrouped(RewardSearchModel searchModel);
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.Reward;
|
||||
|
||||
public class MonthlyGroupedEmployeeRewardsViewModel
|
||||
{
|
||||
public long EmployeeId { get; set; }
|
||||
public string PersonnelCode { get; set; }
|
||||
public string MonthFa { get; set; }
|
||||
public string YearFa { get; set; }
|
||||
public List<RewardViewModel> Rewards { get; set; }
|
||||
public string MonthFaName { get; set; }
|
||||
}
|
||||
@@ -13,4 +13,5 @@ public class RewardSearchModel
|
||||
public string StartDate { get; set; }
|
||||
public string EndDate { get; set; }
|
||||
public int PageIndex { get; set; }
|
||||
public bool ShowAsGrouped { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Security.Cryptography;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.Reward;
|
||||
|
||||
public class RewardsGroupedByDate
|
||||
{
|
||||
public string Month { get; set; }
|
||||
public string Year { get; set; }
|
||||
public List<RewardsGroupedByDateItems> Rewards { get; set; }
|
||||
public string TotalAmount { get; set; }
|
||||
}
|
||||
public class RewardsGroupedByDateItems
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public string EmployeeName { get; set; }
|
||||
public string PersonnelCode { get; set; }
|
||||
public string Title { get; set; }
|
||||
public string Amount { get; set; }
|
||||
public string Description { get; set; }
|
||||
public string GrantDateFa { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.Reward;
|
||||
|
||||
public class RewardsGroupedByEmployeeViewModel
|
||||
{
|
||||
public string EmployeeName { get; set; }
|
||||
public long EmployeeId { get; set; }
|
||||
public List<RewardsGroupedByEmployeeViewModelItems> Rewards { get; set; }
|
||||
public string TotalAmount { get; set; }
|
||||
}
|
||||
|
||||
public class RewardsGroupedByEmployeeViewModelItems
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public string PersonnelCode { get; set; }
|
||||
public string Title { get; set; }
|
||||
public string Amount { get; set; }
|
||||
public string Description { get; set; }
|
||||
public string GrantDate { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.Reward;
|
||||
|
||||
public class RewardsGroupedViewModel
|
||||
{
|
||||
public List<RewardsGroupedByEmployeeViewModel> RewardsGroupedByEmployee { get; set; }
|
||||
public List<RewardsGroupedByDate> RewardsGroupedByDate { get; set; }
|
||||
public List<RewardViewModel> RewardListViewModels { get; set; }
|
||||
}
|
||||
|
||||
|
||||
@@ -9,4 +9,6 @@ public class RollCallTimeViewModel
|
||||
public TimeSpan TotalHours { get; set; }
|
||||
public DateTime StartDateGr { get; set; }
|
||||
public DateTime EndDateGr { get; set; }
|
||||
public string EntryTimeDifferences { get; set; }
|
||||
public string ExitTimeDifferences { get; set; }
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using CompanyManagment.App.Contracts.Reward;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.SalaryAid;
|
||||
|
||||
@@ -14,5 +15,12 @@ public interface ISalaryAidApplication
|
||||
OperationResult Remove(long id);
|
||||
OperationResult RemoveRange(IEnumerable<long> ids);
|
||||
|
||||
#region Pooya
|
||||
/// <summary>
|
||||
/// گروهبندی بر اساس ماه هنگام جستجو با انتخاب کارمند
|
||||
/// </summary>
|
||||
SalaryAidsGroupedViewModel GetSearchListAsGrouped(SalaryAidSearchViewModel searchModel);
|
||||
#endregion
|
||||
|
||||
Task<OperationResult> CreateRange(List<CreateSalaryAidViewModel> commands);
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.SalaryAid;
|
||||
|
||||
public class SalaryAidGroupedByDateViewModel
|
||||
{
|
||||
public string MonthFa { get; set; }
|
||||
public string YearFa { get; set; }
|
||||
public List<SalaryAidGroupedByDateViewModelItems> SalaryAidViewModels { get; set; }
|
||||
public string TotalAmount { get; set; }
|
||||
|
||||
}
|
||||
public class SalaryAidGroupedByDateViewModelItems
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public string EmployeeName { get; set; }
|
||||
public string PersonnelCode { get; set; }
|
||||
public string Amount { get; set; }
|
||||
public string SalaryAidDateTimeFa { get; set; }
|
||||
}
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.SalaryAid;
|
||||
|
||||
public class SalaryAidGroupedByEmployeeViewModel
|
||||
{
|
||||
public string EmployeeName { get; set; }
|
||||
public long EmployeeId { get; set; }
|
||||
public List<SalaryAidGroupedByEmployeeViewModelItems> SalaryAidViewModels { get; set; }
|
||||
public string TotalAmount { get; set; }
|
||||
|
||||
}
|
||||
public class SalaryAidGroupedByEmployeeViewModelItems
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public string SalaryAidDateTimeFa { get; set; }
|
||||
public string PersonnelCode { get; set; }
|
||||
public string Amount { get; set; }
|
||||
}
|
||||
@@ -12,4 +12,6 @@ public class SalaryAidSearchViewModel
|
||||
public long EmployeeId { get; set; }
|
||||
public long WorkshopId { get; set; }
|
||||
public int PageIndex { get; set; }
|
||||
public bool ShowAsGrouped { get; set; }
|
||||
|
||||
}
|
||||
@@ -15,4 +15,6 @@ public class SalaryAidViewModel
|
||||
|
||||
public string EmployeeFullName { get; set; }
|
||||
public string PersonnelCode { get; set; }
|
||||
public string MonthFa { get; set; }
|
||||
public string YearFa { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using System.Collections.Generic;
|
||||
using CompanyManagment.App.Contracts.Fine;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.SalaryAid;
|
||||
|
||||
public class SalaryAidsGroupedByEmployeeViewModel
|
||||
{
|
||||
public string EmployeeName { get; set; }
|
||||
public List<SalaryAidViewModel> Aids { get; set; }
|
||||
public long EmployeeId { get; set; }
|
||||
public string PersonnelCode { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Security.Cryptography;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.SalaryAid;
|
||||
|
||||
public class SalaryAidsGroupedViewModel
|
||||
{
|
||||
public List<SalaryAidGroupedByEmployeeViewModel> GroupedByEmployee { get; set; }
|
||||
public List<SalaryAidGroupedByDateViewModel> GroupedByDate { get; set; }
|
||||
public List<SalaryAidViewModel> SalaryAidListViewModels { get; set; }
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
@@ -4,6 +4,7 @@ using System.Linq;
|
||||
using _0_Framework.Application;
|
||||
using Company.Domain.CheckoutAgg;
|
||||
using Company.Domain.CustomizeCheckoutAgg;
|
||||
using Company.Domain.CustomizeCheckoutTempAgg;
|
||||
using Company.Domain.EmployeeAgg;
|
||||
using Company.Domain.File1;
|
||||
using Company.Domain.FineAgg;
|
||||
@@ -15,33 +16,40 @@ namespace CompanyManagment.Application;
|
||||
|
||||
public class FineApplication : IFineApplication
|
||||
{
|
||||
private readonly IFineRepository _fineRepository;
|
||||
private readonly IWorkshopRepository _workshopRepository;
|
||||
private readonly IEmployeeRepository _employeeRepository;
|
||||
private readonly IFineRepository _fineRepository;
|
||||
private readonly IWorkshopRepository _workshopRepository;
|
||||
private readonly IEmployeeRepository _employeeRepository;
|
||||
private readonly ICustomizeCheckoutRepository _customizeCheckoutRepository;
|
||||
public readonly ICustomizeCheckoutTempRepository CustomizeCheckoutTempRepository;
|
||||
private readonly IAuthHelper _authHelper;
|
||||
|
||||
public FineApplication(IFineRepository fineRepository, IEmployeeRepository employeeRepository, IWorkshopRepository workshopRepository, ICustomizeCheckoutRepository customizeCheckoutRepository)
|
||||
{
|
||||
_fineRepository = fineRepository;
|
||||
_employeeRepository = employeeRepository;
|
||||
_workshopRepository = workshopRepository;
|
||||
public FineApplication(IFineRepository fineRepository, IEmployeeRepository employeeRepository,
|
||||
IWorkshopRepository workshopRepository, ICustomizeCheckoutRepository customizeCheckoutRepository,
|
||||
IAuthHelper authHelper,ICustomizeCheckoutTempRepository customizeCheckoutTempRepository)
|
||||
{
|
||||
_fineRepository = fineRepository;
|
||||
_employeeRepository = employeeRepository;
|
||||
_workshopRepository = workshopRepository;
|
||||
_customizeCheckoutRepository = customizeCheckoutRepository;
|
||||
_authHelper = authHelper;
|
||||
|
||||
CustomizeCheckoutTempRepository = customizeCheckoutTempRepository;
|
||||
}
|
||||
|
||||
public List<FineViewModel> GetSearchList(FineSearchViewModel searchModel)
|
||||
{
|
||||
return _fineRepository.GetSearchList(searchModel);
|
||||
}
|
||||
public List<FineViewModel> GetSearchList(FineSearchViewModel searchModel)
|
||||
{
|
||||
return _fineRepository.GetSearchList(searchModel);
|
||||
}
|
||||
|
||||
public EditFineViewModel GetDetails(long id)
|
||||
{
|
||||
return _fineRepository.GetDetails(id);
|
||||
}
|
||||
public EditFineViewModel GetDetails(long id)
|
||||
{
|
||||
return _fineRepository.GetDetails(id);
|
||||
}
|
||||
|
||||
public OperationResult Remove(long id)
|
||||
{
|
||||
OperationResult op = new OperationResult();
|
||||
var entity = _fineRepository.Get(id);
|
||||
public OperationResult Remove(long id)
|
||||
{
|
||||
OperationResult op = new OperationResult();
|
||||
var entity = _fineRepository.Get(id);
|
||||
if (entity == null)
|
||||
return op.Failed("چنین آیتمی وجود ندارد");
|
||||
|
||||
@@ -50,120 +58,174 @@ public class FineApplication : IFineApplication
|
||||
|
||||
|
||||
|
||||
if (_customizeCheckoutRepository.Exists(x => x.WorkshopId == entity.WorkshopId && entity.EmployeeId==x.EmployeeId && x.YearInt == year && x.MonthInt == month))
|
||||
if (_customizeCheckoutRepository.Exists(x =>
|
||||
x.WorkshopId == entity.WorkshopId && entity.EmployeeId == x.EmployeeId && x.YearInt == year &&
|
||||
x.MonthInt == month))
|
||||
{
|
||||
return op.Failed("این پرسنل در این تاریخ دارای فیش حقوقی است");
|
||||
}
|
||||
|
||||
if (CustomizeCheckoutTempRepository.Exists(x =>
|
||||
x.WorkshopId == entity.WorkshopId && entity.EmployeeId == x.EmployeeId && x.YearInt == year &&
|
||||
x.MonthInt == month &&
|
||||
x.ContractStart <= entity.FineDate && x.ContractEnd >= entity.FineDate))
|
||||
{
|
||||
return op.Failed("این پرسنل در این تاریخ دارای فیش حقوقی است");
|
||||
}
|
||||
|
||||
_fineRepository.Remove(entity);
|
||||
_fineRepository.SaveChanges();
|
||||
return op.Succcedded();
|
||||
}
|
||||
_fineRepository.SaveChanges();
|
||||
return op.Succcedded();
|
||||
}
|
||||
|
||||
public OperationResult RemoveRange(List<long> ids)
|
||||
{
|
||||
OperationResult op = new OperationResult();
|
||||
var fines = _fineRepository.GetBy(ids);
|
||||
_fineRepository.RemoveRange(fines);
|
||||
_fineRepository.SaveChanges();
|
||||
return op.Succcedded();
|
||||
}
|
||||
public OperationResult RemoveRange(List<long> ids)
|
||||
{
|
||||
OperationResult op = new OperationResult();
|
||||
var fines = _fineRepository.GetBy(ids);
|
||||
_fineRepository.RemoveRange(fines);
|
||||
_fineRepository.SaveChanges();
|
||||
return op.Succcedded();
|
||||
}
|
||||
|
||||
public OperationResult Create(CreateFineViewModel command)
|
||||
{
|
||||
OperationResult op = new();
|
||||
/// <summary>
|
||||
/// گروهبندی بر اساس ماه هنگام جستجو با انتخاب کارمند
|
||||
/// </summary>
|
||||
public FinesGroupedViewModel GetSearchListAsGrouped(FineSearchViewModel searchModel)
|
||||
{
|
||||
return _fineRepository.GetSearchListAsGrouped(searchModel);
|
||||
}
|
||||
|
||||
#region Validation
|
||||
public OperationResult Create(CreateFineViewModel command)
|
||||
{
|
||||
OperationResult op = new();
|
||||
|
||||
if (!_workshopRepository.Exists(x => x.id == command.WorkshopId))
|
||||
return op.Failed("خطای سیستمی");
|
||||
if (!_employeeRepository.Exists(x => command.EmployeeIds.Any(a => a == x.id)))
|
||||
return op.Failed("خطای سیستمی");
|
||||
#region Validation
|
||||
|
||||
if (!_workshopRepository.Exists(x => x.id == command.WorkshopId))
|
||||
return op.Failed("خطای سیستمی");
|
||||
if (!_employeeRepository.Exists(x => command.EmployeeIds.Any(a => a == x.id)))
|
||||
return op.Failed("خطای سیستمی");
|
||||
|
||||
if (!command.FineDate.TryToGeorgianDateTime(out var fineDate))
|
||||
{
|
||||
return op.Failed("تاریخ وارد شده نامعتبر است");
|
||||
}
|
||||
|
||||
if (fineDate > DateTime.Now)
|
||||
{
|
||||
return op.Failed("تاریخ پرداخت جریمه می بایست تاریخ امروز یا قبل تر باشد");
|
||||
|
||||
}
|
||||
|
||||
if (command.Amount.Length > 15)
|
||||
{
|
||||
return op.Failed("مبلغ وارد شده معتبر نیست");
|
||||
}
|
||||
|
||||
var month = Convert.ToInt32(command.FineDate.Substring(5, 2));
|
||||
var year = Convert.ToInt32(command.FineDate.Substring(0, 4));
|
||||
|
||||
|
||||
|
||||
if (_customizeCheckoutRepository.Exists(x=>x.WorkshopId ==command.WorkshopId && command.EmployeeIds.Contains(x.EmployeeId) && x.YearInt==year && x.MonthInt == month))
|
||||
if (_customizeCheckoutRepository.Exists(x =>
|
||||
x.WorkshopId == command.WorkshopId && command.EmployeeIds.Contains(x.EmployeeId) && x.YearInt == year &&
|
||||
x.MonthInt == month))
|
||||
{
|
||||
return op.Failed("شما نمیتوانید برای پرسنلی در تاریخی که برای فیش حقوقی صادر شده است جریمه ای دهید");
|
||||
|
||||
}
|
||||
|
||||
if (CustomizeCheckoutTempRepository.Exists(x =>
|
||||
x.WorkshopId == command.WorkshopId && command.EmployeeIds.Contains(x.EmployeeId) && x.YearInt == year &&
|
||||
x.MonthInt == month &&
|
||||
x.ContractStart <= fineDate && x.ContractEnd >= fineDate))
|
||||
{
|
||||
return op.Failed("شما نمیتوانید برای پرسنلی در تاریخی که برای فیش حقوقی موقت صادر شده است جریمه ای دهید");
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
DateTime date = command.FineDate.ToGeorgianDateTime();
|
||||
var (userId, userType) = _authHelper.GetUserTypeWithId();
|
||||
foreach (var employeeId in command.EmployeeIds)
|
||||
{
|
||||
Fine entity = new Fine(employeeId, command.WorkshopId, command.Title, command.Amount.MoneyToDouble(), date,
|
||||
userId, userType);
|
||||
_fineRepository.Create(entity);
|
||||
|
||||
foreach (var employeeId in command.EmployeeIds)
|
||||
{
|
||||
Fine entity = new Fine(employeeId, command.WorkshopId, command.Title, command.Amount.MoneyToDouble(), date);
|
||||
_fineRepository.Create(entity);
|
||||
}
|
||||
|
||||
}
|
||||
_fineRepository.SaveChanges();
|
||||
return op.Succcedded();
|
||||
}
|
||||
|
||||
_fineRepository.SaveChanges();
|
||||
return op.Succcedded();
|
||||
}
|
||||
public OperationResult Edit(EditFineViewModel command)
|
||||
{
|
||||
OperationResult op = new();
|
||||
var entity = _fineRepository.Get(command.Id);
|
||||
if (entity == null)
|
||||
return op.Failed("چنین جریمه ای یافت نشد");
|
||||
if (command.EmployeeId <= 0)
|
||||
{
|
||||
return op.Failed("خطای سیستمی!");
|
||||
}
|
||||
|
||||
public OperationResult Edit(EditFineViewModel command)
|
||||
{
|
||||
OperationResult op = new();
|
||||
var entity = _fineRepository.Get(command.Id);
|
||||
if (entity == null)
|
||||
return op.Failed("چنین جریمه ای یافت نشد");
|
||||
if (command.EmployeeId <= 0)
|
||||
{
|
||||
return op.Failed("خطای سیستمی!");
|
||||
}
|
||||
if (!command.FineDate.TryToGeorgianDateTime(out var fineDate))
|
||||
{
|
||||
return op.Failed("تاریخ وارد شده نامعتبر است");
|
||||
}
|
||||
if (fineDate > DateTime.Now)
|
||||
{
|
||||
return op.Failed("تاریخ پرداخت جریمه می بایست تاریخ امروز یا قبل تر باشد");
|
||||
if (!command.FineDate.TryToGeorgianDateTime(out var fineDate))
|
||||
{
|
||||
return op.Failed("تاریخ وارد شده نامعتبر است");
|
||||
}
|
||||
|
||||
if (fineDate > DateTime.Now)
|
||||
{
|
||||
return op.Failed("تاریخ پرداخت جریمه می بایست تاریخ امروز یا قبل تر باشد");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
if (command.Amount.Length > 15)
|
||||
{
|
||||
return op.Failed("مبلغ وارد شده معتبر نیست");
|
||||
}
|
||||
|
||||
var month = Convert.ToInt32(command.FineDate.Substring(5, 2));
|
||||
var year = Convert.ToInt32(command.FineDate.Substring(0, 4));
|
||||
|
||||
if (!_employeeRepository.Exists(x => x.id == command.EmployeeId))
|
||||
{
|
||||
return op.Failed("شخص وارد شده معتبر نمیباشد");
|
||||
}
|
||||
|
||||
|
||||
if (_customizeCheckoutRepository.Exists(x => x.WorkshopId == command.WorkshopId && command.EmployeeId == x.EmployeeId && x.YearInt == year && x.MonthInt == month))
|
||||
if (_customizeCheckoutRepository.Exists(x =>
|
||||
x.WorkshopId == command.WorkshopId && command.EmployeeId == x.EmployeeId && x.YearInt == year &&
|
||||
x.MonthInt == month))
|
||||
{
|
||||
return op.Failed("شما نمیتوانید برای پرسنلی در تاریخی که برای فیش حقوقی صادر شده است جریمه ای دهید");
|
||||
|
||||
}
|
||||
|
||||
if (!_employeeRepository.Exists(x=>x.id == command.EmployeeId))
|
||||
{
|
||||
return op.Failed("شخص وارد شده معتبر نمیباشد");
|
||||
}
|
||||
DateTime date = command.FineDate.ToGeorgianDateTime();
|
||||
if (CustomizeCheckoutTempRepository.Exists(x =>
|
||||
x.WorkshopId == command.WorkshopId && command.EmployeeId == x.EmployeeId && x.YearInt == year &&
|
||||
x.MonthInt == month &&
|
||||
x.ContractStart <= fineDate && x.ContractEnd >= fineDate))
|
||||
{
|
||||
return op.Failed("شما نمیتوانید برای پرسنلی در تاریخی که برای فیش حقوقی موقت صادر شده است جریمه ای دهید");
|
||||
}
|
||||
|
||||
if (!_employeeRepository.Exists(x => x.id == command.EmployeeId))
|
||||
{
|
||||
return op.Failed("شخص وارد شده معتبر نمیباشد");
|
||||
}
|
||||
|
||||
DateTime date = command.FineDate.ToGeorgianDateTime();
|
||||
var (userId, userType) = _authHelper.GetUserTypeWithId();
|
||||
|
||||
|
||||
entity.Edit(command.EmployeeId, command.WorkshopId, command.Title, command.Amount.MoneyToDouble(), date);
|
||||
entity.Edit(command.EmployeeId, command.WorkshopId, command.Title, command.Amount.MoneyToDouble(), date,
|
||||
userId, userType);
|
||||
|
||||
_fineRepository.SaveChanges();
|
||||
return op.Succcedded(entity.id);
|
||||
_fineRepository.SaveChanges();
|
||||
return op.Succcedded(entity.id);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,14 +3,17 @@ using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Reflection.Metadata.Ecma335;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using Company.Domain.CheckoutAgg;
|
||||
using Company.Domain.CustomizeCheckoutAgg;
|
||||
using Company.Domain.CustomizeCheckoutTempAgg;
|
||||
using Company.Domain.LoanAgg;
|
||||
using Company.Domain.LoanAgg.Entities;
|
||||
using CompanyManagment.App.Contracts.Loan;
|
||||
using Hangfire.States;
|
||||
using Microsoft.AspNetCore.Mvc.Infrastructure;
|
||||
using Microsoft.Extensions.Configuration.UserSecrets;
|
||||
|
||||
namespace CompanyManagment.Application;
|
||||
|
||||
@@ -18,11 +21,15 @@ public class LoanApplication : ILoanApplication
|
||||
{
|
||||
private readonly ILoanRepository _loanRepository;
|
||||
private readonly ICustomizeCheckoutRepository _customizeCheckoutRepository;
|
||||
private readonly IAuthHelper _authHelper;
|
||||
private readonly ICustomizeCheckoutTempRepository _customizeCheckoutTempRepository;
|
||||
|
||||
public LoanApplication(ILoanRepository loanRepository, ICustomizeCheckoutRepository customizeCheckoutRepository)
|
||||
public LoanApplication(ILoanRepository loanRepository, ICustomizeCheckoutRepository customizeCheckoutRepository, ICustomizeCheckoutTempRepository customizeCheckoutTempRepository, IAuthHelper authHelper)
|
||||
{
|
||||
_loanRepository = loanRepository;
|
||||
_customizeCheckoutRepository = customizeCheckoutRepository;
|
||||
_authHelper = authHelper;
|
||||
_customizeCheckoutTempRepository = customizeCheckoutTempRepository;
|
||||
}
|
||||
|
||||
public List<LoanViewModel> GetSearchList(LoanSearchViewModel searchModel)
|
||||
@@ -30,9 +37,9 @@ public class LoanApplication : ILoanApplication
|
||||
return _loanRepository.GetSearchList(searchModel);
|
||||
}
|
||||
|
||||
public LoanViewModel GetDetails(long id)
|
||||
public async Task<LoanDetailsViewModel> GetDetails(long id)
|
||||
{
|
||||
return _loanRepository.GetDetails(id);
|
||||
return await _loanRepository.GetDetails(id);
|
||||
}
|
||||
|
||||
public OperationResult Create(CreateLoanViewModel command)
|
||||
@@ -51,15 +58,15 @@ public class LoanApplication : ILoanApplication
|
||||
var lastInstallment = installment.MaxBy(x => x.DateGr).DateGr;
|
||||
#region Validation
|
||||
|
||||
//if (startInstallmentDate.Date < now.Date)
|
||||
//{
|
||||
// return op.Failed("تاریخ شروع وام نمیتواند در گذشته باشد");
|
||||
//}
|
||||
if (startInstallmentDate.Date < now.Date)
|
||||
{
|
||||
return op.Failed("تاریخ شروع وام نمیتواند در گذشته باشد");
|
||||
}
|
||||
|
||||
//if (loanGrantDate>now)
|
||||
//{
|
||||
// return op.Failed("تاریخ پرداخت وام می بایست تاریخ امروز یا قبل تر باشد");
|
||||
//}
|
||||
if (loanGrantDate>now)
|
||||
{
|
||||
return op.Failed("تاریخ پرداخت وام می بایست تاریخ امروز یا قبل تر باشد");
|
||||
}
|
||||
|
||||
if (!command.LoanGrantDate.TryToGeorgianDateTime(out var grantDate))
|
||||
{
|
||||
@@ -68,23 +75,32 @@ public class LoanApplication : ILoanApplication
|
||||
if (amountD < 1000000)
|
||||
return op.Failed("حداقل مبلغ وام 1.000.000 ریال میباشد");
|
||||
|
||||
//if (_customizeCheckoutRepository.Exists(x =>
|
||||
// command.EmployeeIds.Contains(x.EmployeeId) && x.WorkshopId == command.WorkshopId &&
|
||||
// (x.ContractStart > startInstallmentDate && x.ContractStart < lastInstallment)))
|
||||
//{
|
||||
// return op.Failed("شما نمیتوانید برای پرسنلی در تاریخی که برای فیش حقوقی صادر شده است وام دهید");
|
||||
//}
|
||||
if (_customizeCheckoutRepository.Exists(x =>
|
||||
command.EmployeeIds.Contains(x.EmployeeId) && x.WorkshopId == command.WorkshopId &&
|
||||
(x.ContractStart > startInstallmentDate && x.ContractStart < lastInstallment)))
|
||||
{
|
||||
return op.Failed("شما نمیتوانید برای پرسنلی در تاریخی که برای فیش حقوقی صادر شده است وام دهید");
|
||||
}
|
||||
|
||||
if (_customizeCheckoutTempRepository.Exists(x =>
|
||||
command.EmployeeIds.Contains(x.EmployeeId) && x.WorkshopId == command.WorkshopId &&
|
||||
(x.ContractStart >= startInstallmentDate && x.ContractStart <= lastInstallment)))
|
||||
{
|
||||
return op.Failed("پرسنل در بازه اقساط خود دارای فیش غیررسمی است");
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
foreach (var employeeId in command.EmployeeIds)
|
||||
var (userId, userType) = _authHelper.GetUserTypeWithId();
|
||||
|
||||
foreach (var employeeId in command.EmployeeIds)
|
||||
{
|
||||
var entity = new Loan(employeeId, command.WorkshopId, startInstallmentDate, command.Count.ToString(),
|
||||
command.Amount.MoneyToDouble(),
|
||||
installment.First().Amount.MoneyToDouble(),
|
||||
installment.Select(x =>
|
||||
new LoanInstallment(x.Amount.MoneyToDouble(), x.Month, x.Year, x.DateGr)).ToList()
|
||||
, command.GetRounded, grantDate);
|
||||
, command.GetRounded, grantDate,userId,userType);
|
||||
_loanRepository.Create(entity);
|
||||
|
||||
}
|
||||
@@ -93,7 +109,6 @@ public class LoanApplication : ILoanApplication
|
||||
return op.Succcedded();
|
||||
}
|
||||
|
||||
|
||||
public List<LoanInstallmentViewModel> CalculateLoanInstallment(string amount, int installmentCount, string loanStartDate, bool getRounded)
|
||||
{
|
||||
int day = Convert.ToInt32(loanStartDate.Substring(8, 2));
|
||||
@@ -227,11 +242,19 @@ public class LoanApplication : ILoanApplication
|
||||
|
||||
if (_customizeCheckoutRepository.Exists(x =>
|
||||
entity.EmployeeId == x.EmployeeId && x.WorkshopId == entity.WorkshopId &&
|
||||
(x.ContractStart > entity.StartInstallmentPayment && x.ContractStart < lastInstallment)))
|
||||
(x.ContractStart >= entity.StartInstallmentPayment && x.ContractStart <= lastInstallment)))
|
||||
{
|
||||
return op.Failed("این پرسنل در این تاریخ دارای فیش حقوقی است");
|
||||
}
|
||||
|
||||
if (_customizeCheckoutTempRepository.Exists(x =>
|
||||
entity.EmployeeId == x.EmployeeId && x.WorkshopId == entity.WorkshopId &&
|
||||
(x.ContractStart >= entity.StartInstallmentPayment && x.ContractStart <= lastInstallment)))
|
||||
{
|
||||
return op.Failed("پرسنل در بازه اقساط خود دارای فیش غیررسمی است");
|
||||
}
|
||||
|
||||
|
||||
|
||||
_loanRepository.Remove(entity);
|
||||
_loanRepository.SaveChanges();
|
||||
@@ -247,4 +270,9 @@ public class LoanApplication : ILoanApplication
|
||||
_loanRepository.SaveChanges();
|
||||
return op.Succcedded();
|
||||
}
|
||||
|
||||
public LoanGroupedViewModel GetSearchListAsGrouped(LoanSearchViewModel searchModel)
|
||||
{
|
||||
return _loanRepository.GetSearchListAsGrouped(searchModel);
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@ using System.Linq;
|
||||
using _0_Framework.Application;
|
||||
using Company.Domain.CheckoutAgg;
|
||||
using Company.Domain.CustomizeCheckoutAgg;
|
||||
using Company.Domain.CustomizeCheckoutTempAgg;
|
||||
using Company.Domain.RewardAgg;
|
||||
using CompanyManagment.App.Contracts.Reward;
|
||||
using Microsoft.AspNetCore.Components.Forms;
|
||||
@@ -17,17 +18,19 @@ public class RewardApplication : IRewardApplication
|
||||
private readonly IRewardRepository _rewardRepository;
|
||||
private readonly IAuthHelper _authHelper;
|
||||
private readonly ICustomizeCheckoutRepository _customizeCheckoutRepository;
|
||||
private readonly ICustomizeCheckoutTempRepository _customizeCheckoutTempRepository;
|
||||
|
||||
public RewardApplication(IRewardRepository rewardRepository, IAuthHelper authHelper, ICustomizeCheckoutRepository customizeCheckoutRepository)
|
||||
public RewardApplication(IRewardRepository rewardRepository, IAuthHelper authHelper, ICustomizeCheckoutRepository customizeCheckoutRepository, ICustomizeCheckoutTempRepository customizeCheckoutTempRepository)
|
||||
{
|
||||
_rewardRepository = rewardRepository;
|
||||
_authHelper = authHelper;
|
||||
_customizeCheckoutRepository = customizeCheckoutRepository;
|
||||
_customizeCheckoutTempRepository = customizeCheckoutTempRepository;
|
||||
}
|
||||
|
||||
public List<RewardViewModel> GetSearchList(RewardSearchModel searchModel)
|
||||
{
|
||||
return _rewardRepository.GetSearchList(searchModel);
|
||||
return _rewardRepository.GetSearchList(searchModel);
|
||||
}
|
||||
|
||||
|
||||
@@ -37,23 +40,31 @@ public class RewardApplication : IRewardApplication
|
||||
|
||||
public EditRewardViewModel GetDetails(long id)
|
||||
{
|
||||
return _rewardRepository.GetDetails(id);
|
||||
return _rewardRepository.GetDetails(id);
|
||||
}
|
||||
|
||||
public OperationResult Remove(long id)
|
||||
{
|
||||
OperationResult op = new OperationResult();
|
||||
var entity =_rewardRepository.Get(id);
|
||||
var entity = _rewardRepository.Get(id);
|
||||
if (entity == null)
|
||||
return op.Failed("این آیتم وجود ندارد");
|
||||
return op.Failed("این آیتم وجود ندارد");
|
||||
|
||||
var month = Convert.ToInt32(entity.GrantDate.ToFarsi().Substring(5, 2));
|
||||
var year= Convert.ToInt32(entity.GrantDate.ToFarsi().Substring(0, 4));
|
||||
var year = Convert.ToInt32(entity.GrantDate.ToFarsi().Substring(0, 4));
|
||||
|
||||
if (_customizeCheckoutRepository.Exists(x => x.WorkshopId == entity.WorkshopId && entity.EmployeeId==x.EmployeeId && x.YearInt == year && x.MonthInt == month))
|
||||
if (_customizeCheckoutRepository.Exists(x => x.WorkshopId == entity.WorkshopId && entity.EmployeeId == x.EmployeeId && x.YearInt == year && x.MonthInt == month))
|
||||
{
|
||||
return op.Failed("این پرسنل در این تاریخ دارای فیش حقوقی است");
|
||||
}
|
||||
|
||||
if (_customizeCheckoutTempRepository.Exists(x => x.WorkshopId == entity.WorkshopId && entity.EmployeeId == x.EmployeeId &&
|
||||
x.YearInt == year && x.MonthInt == month && x.ContractStart <= entity.GrantDate && x.ContractEnd >= entity.GrantDate))
|
||||
{
|
||||
return op.Failed("این پرسنل در این تاریخ دارای فیش حقوقی موقت است");
|
||||
|
||||
}
|
||||
|
||||
_rewardRepository.Remove(entity);
|
||||
_rewardRepository.SaveChanges();
|
||||
return op.Succcedded();
|
||||
@@ -61,24 +72,24 @@ public class RewardApplication : IRewardApplication
|
||||
|
||||
public OperationResult RemoveRange(IEnumerable<long> ids)
|
||||
{
|
||||
OperationResult op = new OperationResult();
|
||||
var rewards = _rewardRepository.GetBy(ids);
|
||||
_rewardRepository.RemoveRange(rewards);
|
||||
_rewardRepository.SaveChanges();
|
||||
return op.Succcedded();
|
||||
OperationResult op = new OperationResult();
|
||||
var rewards = _rewardRepository.GetBy(ids);
|
||||
_rewardRepository.RemoveRange(rewards);
|
||||
_rewardRepository.SaveChanges();
|
||||
return op.Succcedded();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public OperationResult Create(CreateRewardViewModel command)
|
||||
{
|
||||
var op = new OperationResult();
|
||||
|
||||
#region Validation
|
||||
#region Validation
|
||||
|
||||
if (!command.GrantDate.TryToGeorgianDateTime(out var grantDate))
|
||||
{
|
||||
return op.Failed("تاریخ وارد شده نامعتبر است");
|
||||
}
|
||||
if (!command.GrantDate.TryToGeorgianDateTime(out var grantDate))
|
||||
{
|
||||
return op.Failed("تاریخ وارد شده نامعتبر است");
|
||||
}
|
||||
|
||||
if (grantDate > DateTime.Now)
|
||||
{
|
||||
@@ -86,7 +97,7 @@ public class RewardApplication : IRewardApplication
|
||||
|
||||
}
|
||||
|
||||
if (command.Amount.Length>15)
|
||||
if (command.Amount.Length > 15)
|
||||
{
|
||||
return op.Failed("مبلغ وارد شده معتبر نیست");
|
||||
}
|
||||
@@ -97,19 +108,28 @@ public class RewardApplication : IRewardApplication
|
||||
if (_customizeCheckoutRepository.Exists(x => x.WorkshopId == command.WorkshopId && command.EmployeeIds.Contains(x.EmployeeId) && x.YearInt == year && x.MonthInt == month))
|
||||
{
|
||||
return op.Failed("شما نمیتوانید برای پرسنلی در تاریخی که برای فیش حقوقی صادر شده است پاداشی دهید");
|
||||
}
|
||||
}
|
||||
|
||||
if (_customizeCheckoutTempRepository.Exists(x => x.WorkshopId == command.WorkshopId && command.EmployeeIds.Contains(x.EmployeeId) &&
|
||||
x.YearInt == year && x.MonthInt == month && x.ContractStart <= grantDate && x.ContractEnd >= grantDate))
|
||||
{
|
||||
return op.Failed("شما نمیتوانید برای پرسنلی در تاریخی که برای فیش حقوقی موقت صادر شده است پاداشی دهید");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
var (userId, userType) = _authHelper.GetUserTypeWithId();
|
||||
|
||||
foreach (var employeeId in command.EmployeeIds)
|
||||
foreach (var employeeId in command.EmployeeIds)
|
||||
{
|
||||
var entity = new Reward(employeeId, command.WorkshopId, command.Amount.MoneyToDouble(), command.Description,
|
||||
command.RewardedByAccountId, grantDate,command.Title);
|
||||
userId, userType,grantDate,command.Title);
|
||||
|
||||
_rewardRepository.Create(entity);
|
||||
}
|
||||
|
||||
_rewardRepository.Create(entity);
|
||||
}
|
||||
|
||||
_rewardRepository.SaveChanges();
|
||||
return op.Succcedded();
|
||||
}
|
||||
@@ -140,24 +160,33 @@ public class RewardApplication : IRewardApplication
|
||||
var month = Convert.ToInt32(command.GrantDate.Substring(5, 2));
|
||||
var year = Convert.ToInt32(command.GrantDate.Substring(0, 4));
|
||||
|
||||
if (_customizeCheckoutRepository.Exists(x => x.WorkshopId == command.WorkshopId && command.EmployeeId==x.EmployeeId && x.YearInt == year && x.MonthInt == month))
|
||||
if (_customizeCheckoutRepository.Exists(x => x.WorkshopId == command.WorkshopId && command.EmployeeId == x.EmployeeId && x.YearInt == year && x.MonthInt == month))
|
||||
{
|
||||
return op.Failed("شما نمیتوانید برای پرسنلی در تاریخی که برای فیش حقوقی صادر شده است پاداشی دهید");
|
||||
}
|
||||
var (userId, userType) = _authHelper.GetUserTypeWithId();
|
||||
|
||||
entity.Edit(command.Amount.MoneyToDouble(),command.Description,command.RewardedByAccountId, grantDate,command.Title);
|
||||
if (_customizeCheckoutTempRepository.Exists(x => x.WorkshopId == command.WorkshopId && entity.EmployeeId == x.EmployeeId &&
|
||||
x.YearInt == year && x.MonthInt == month && x.ContractStart <= grantDate && x.ContractEnd >= grantDate))
|
||||
{
|
||||
return op.Failed("شما نمیتوانید برای پرسنلی در تاریخی که برای فیش حقوقی موقت صادر شده است پاداشی دهید");
|
||||
}
|
||||
|
||||
|
||||
entity.Edit(command.Amount.MoneyToDouble(),command.Description,userId,userType, grantDate,command.Title);
|
||||
_rewardRepository.SaveChanges();
|
||||
return op.Succcedded(entity.id);
|
||||
}
|
||||
|
||||
#region Pooya
|
||||
#region Pooya
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// گروهبندی بر اساس ماه هنگام جستجو با انتخاب کارمند
|
||||
/// </summary>
|
||||
public List<MonthlyGroupedEmployeeRewardsViewModel> GetSearchListByEmployee(RewardSearchModel searchModel)
|
||||
public RewardsGroupedViewModel GetSearchListAsGrouped(RewardSearchModel searchModel)
|
||||
{
|
||||
return _rewardRepository.GetSearchListByEmployee(searchModel);
|
||||
return _rewardRepository.GetSearchListAsGrouped(searchModel);
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -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();
|
||||
@@ -164,9 +169,5 @@ namespace CompanyManagment.Application
|
||||
{
|
||||
return _employeeRollCallStatusRepository.GetAll();
|
||||
}
|
||||
public bool IsActiveInPeriod(long employeeId, long workshopId, DateTime startDate, DateTime endDate)
|
||||
{
|
||||
return _employeeRollCallStatusRepository.IsActiveInPeriod(employeeId, workshopId, startDate, endDate);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,10 @@ using CompanyManagment.App.Contracts.Checkout;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Company.Domain.CustomizeCheckoutAgg;
|
||||
using Company.Domain.CustomizeCheckoutTempAgg;
|
||||
using Company.Domain.EmployeeAgg;
|
||||
using CompanyManagment.App.Contracts.Reward;
|
||||
using OfficeOpenXml.Drawing.Chart;
|
||||
|
||||
namespace CompanyManagment.Application;
|
||||
|
||||
@@ -17,14 +20,21 @@ public class SalaryAidApplication : ISalaryAidApplication
|
||||
private readonly ISalaryAidRepository _salaryAidRepository;
|
||||
private readonly ICustomizeCheckoutRepository _customizeCheckoutRepository;
|
||||
private readonly IEmployeeRepository _employeeRepository;
|
||||
private readonly ICustomizeCheckoutTempRepository _customizeCheckoutTempRepository;
|
||||
private readonly IAuthHelper _authHelper;
|
||||
|
||||
|
||||
public SalaryAidApplication(ISalaryAidRepository salaryAidRepository, ICustomizeCheckoutRepository customizeCheckoutRepository, IEmployeeRepository employeeRepository)
|
||||
public SalaryAidApplication(ISalaryAidRepository salaryAidRepository, ICustomizeCheckoutRepository customizeCheckoutRepository,
|
||||
IEmployeeRepository employeeRepository, ICustomizeCheckoutTempRepository customizeCheckoutTempRepository, IAuthHelper authHelper)
|
||||
{
|
||||
_salaryAidRepository = salaryAidRepository;
|
||||
_customizeCheckoutRepository = customizeCheckoutRepository;
|
||||
_authHelper = authHelper;
|
||||
_employeeRepository = employeeRepository;
|
||||
_customizeCheckoutTempRepository = customizeCheckoutTempRepository;
|
||||
}
|
||||
|
||||
|
||||
public List<SalaryAidViewModel> GetSearchList(SalaryAidSearchViewModel searchViewModel)
|
||||
{
|
||||
return _salaryAidRepository.GetSearchList(searchViewModel);
|
||||
@@ -61,11 +71,17 @@ public class SalaryAidApplication : ISalaryAidApplication
|
||||
{
|
||||
return op.Failed("شما نمیتوانید برای پرسنلی در تاریخی که برای فیش حقوقی صادر شده است مساعده ای دهید");
|
||||
}
|
||||
if (_customizeCheckoutTempRepository.Exists(x => x.WorkshopId == command.WorkshopId && command.EmployeeIds.Contains(x.EmployeeId) &&
|
||||
x.YearInt == year && x.MonthInt == month && x.ContractStart <= startDate && x.ContractEnd >= startDate))
|
||||
{
|
||||
return op.Failed("شما نمیتوانید برای پرسنلی در تاریخی که برای فیش حقوقی موقت صادر شده است مساعده ای دهید");
|
||||
}
|
||||
var (userId, userType) = _authHelper.GetUserTypeWithId();
|
||||
|
||||
foreach (var employeeId in command.EmployeeIds)
|
||||
foreach (var employeeId in command.EmployeeIds)
|
||||
{
|
||||
|
||||
var entity = new SalaryAid(employeeId, command.WorkshopId, command.Amount.MoneyToDouble(), startDate);
|
||||
var entity = new SalaryAid(employeeId, command.WorkshopId, command.Amount.MoneyToDouble(), startDate,userId,userType);
|
||||
_salaryAidRepository.Create(entity);
|
||||
|
||||
}
|
||||
@@ -101,8 +117,14 @@ public class SalaryAidApplication : ISalaryAidApplication
|
||||
if (_customizeCheckoutRepository.Exists(x => x.WorkshopId == entity.WorkshopId && entity.EmployeeId == x.EmployeeId && x.YearInt == year && x.MonthInt == month))
|
||||
return op.Failed("شما نمیتوانید برای پرسنلی در تاریخی که برای فیش حقوقی صادر شده است مساعده ای دهید");
|
||||
|
||||
if (_customizeCheckoutTempRepository.Exists(x => x.WorkshopId == command.WorkshopId && command.EmployeeIds.Contains(x.EmployeeId) &&
|
||||
x.YearInt == year && x.MonthInt == month && x.ContractStart <= startDate && x.ContractEnd >= startDate))
|
||||
{
|
||||
return op.Failed("شما نمیتوانید برای پرسنلی در تاریخی که برای فیش حقوقی موقت صادر شده است مساعده ای دهید");
|
||||
}
|
||||
var (userId, userType) = _authHelper.GetUserTypeWithId();
|
||||
|
||||
entity.Edit(Tools.MoneyToDouble(command.Amount),startDate);
|
||||
entity.Edit(Tools.MoneyToDouble(command.Amount),startDate,userId,userType);
|
||||
_salaryAidRepository.SaveChanges();
|
||||
return op.Succcedded();
|
||||
}
|
||||
@@ -121,6 +143,12 @@ public class SalaryAidApplication : ISalaryAidApplication
|
||||
return op.Failed("این پرسنل در این تاریخ دارای فیش حقوقی است");
|
||||
|
||||
|
||||
if (_customizeCheckoutTempRepository.Exists(x => x.WorkshopId == entity.WorkshopId && entity.EmployeeId == x.EmployeeId &&
|
||||
x.YearInt == year && x.MonthInt == month && x.ContractStart <= entity.SalaryAidDateTime && x.ContractEnd >= entity.SalaryAidDateTime))
|
||||
{
|
||||
return op.Failed("این پرسنل در این تاریخ دارای فیش حقوقی موقت است");
|
||||
}
|
||||
|
||||
_salaryAidRepository.Remove(entity);
|
||||
_salaryAidRepository.SaveChanges();
|
||||
return op.Succcedded();
|
||||
@@ -135,6 +163,7 @@ public class SalaryAidApplication : ISalaryAidApplication
|
||||
return op.Succcedded();
|
||||
}
|
||||
|
||||
|
||||
public async Task<OperationResult> CreateRange(List<CreateSalaryAidViewModel> commands)
|
||||
{
|
||||
var op = new OperationResult();
|
||||
@@ -164,8 +193,8 @@ public class SalaryAidApplication : ISalaryAidApplication
|
||||
{
|
||||
return op.Failed("شما نمیتوانید برای پرسنلی در تاریخی که برای فیش حقوقی صادر شده است مساعده ای دهید");
|
||||
}
|
||||
|
||||
foreach (var employeeId in command.EmployeeIds)
|
||||
var (userId, userType) = _authHelper.GetUserTypeWithId();
|
||||
foreach (var employeeId in command.EmployeeIds)
|
||||
{
|
||||
var id = employeeId;
|
||||
if (employeeId == 0)
|
||||
@@ -174,11 +203,22 @@ public class SalaryAidApplication : ISalaryAidApplication
|
||||
id = employee.id;
|
||||
}
|
||||
|
||||
var entity = new SalaryAid(id, command.WorkshopId, command.Amount.MoneyToDouble(), startDate);
|
||||
var entity = new SalaryAid(id, command.WorkshopId, command.Amount.MoneyToDouble(), startDate, userId, userType);
|
||||
await _salaryAidRepository.CreateAsync(entity);
|
||||
}
|
||||
}
|
||||
await _salaryAidRepository.SaveChangesAsync();
|
||||
return op.Succcedded();
|
||||
}
|
||||
#region Pooya
|
||||
/// <summary>
|
||||
/// گروهبندی بر اساس ماه هنگام جستجو با انتخاب کارمند
|
||||
/// </summary>
|
||||
public SalaryAidsGroupedViewModel GetSearchListAsGrouped(SalaryAidSearchViewModel searchModel)
|
||||
{
|
||||
return _salaryAidRepository.GetSearchListAsGrouped(searchModel);
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -17,5 +17,8 @@ public class FineMapping:IEntityTypeConfiguration<Fine>
|
||||
v => v.ToString(),
|
||||
v => (IsActive)Enum.Parse(typeof(IsActive), v)).HasMaxLength(5);
|
||||
builder.Property(x => x.Title).HasMaxLength(255);
|
||||
}
|
||||
|
||||
builder.Property(x => x.CreatedByUserType).HasConversion<string>().HasMaxLength(50);
|
||||
builder.Property(x => x.LastModifiedByUserType).HasConversion<string>().HasMaxLength(50);
|
||||
}
|
||||
}
|
||||
@@ -31,5 +31,7 @@ public class LoanMapping : IEntityTypeConfiguration<Loan>
|
||||
|
||||
builder.Ignore(x => x.StartDateYear);
|
||||
builder.Ignore(x => x.StartDateMonth);
|
||||
}
|
||||
|
||||
builder.Property(x => x.CreatedByUserType).HasConversion<string>().HasMaxLength(50);
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
using System;
|
||||
using _0_Framework.Application;
|
||||
using CompanyManagment.App.Contracts.Reward.Enums;
|
||||
|
||||
namespace CompanyManagment.EFCore.Mapping;
|
||||
|
||||
@@ -19,5 +20,9 @@ public class RewardMapping:IEntityTypeConfiguration<Reward>
|
||||
builder.Property(x => x.Title).HasMaxLength(255);
|
||||
|
||||
builder.Property(x => x.RewardType).HasConversion<string>().HasMaxLength(50);
|
||||
|
||||
builder.Property(x => x.CreatedByUserType).HasConversion<string>().HasMaxLength(50);
|
||||
builder.Property(x => x.LastModifiedByUserType).HasConversion<string>().HasMaxLength(50);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,10 @@ public class SalaryAidMapping:IEntityTypeConfiguration<SalaryAid>
|
||||
{
|
||||
builder.ToTable("SalaryAids");
|
||||
builder.HasKey(x => x.id);
|
||||
|
||||
}
|
||||
|
||||
builder.Property(x => x.CreatedByUserType).HasConversion<string>().HasMaxLength(50);
|
||||
builder.Property(x => x.LastModifiedByUserType).HasConversion<string>().HasMaxLength(50);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
9346
CompanyManagment.EFCore/Migrations/20250413184901_add grouping loan reward SA fine.Designer.cs
generated
Normal file
9346
CompanyManagment.EFCore/Migrations/20250413184901_add grouping loan reward SA fine.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,178 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class addgroupingloanrewardSAfine : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "RewardedByAccountId",
|
||||
table: "Rewards",
|
||||
newName: "LastModifiedByAccountId");
|
||||
|
||||
migrationBuilder.AddColumn<long>(
|
||||
name: "CreatedByAccountId",
|
||||
table: "SalaryAids",
|
||||
type: "bigint",
|
||||
nullable: false,
|
||||
defaultValue: 0L);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "CreatedByUserType",
|
||||
table: "SalaryAids",
|
||||
type: "nvarchar(50)",
|
||||
maxLength: 50,
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
|
||||
migrationBuilder.AddColumn<long>(
|
||||
name: "LastModifiedByAccountId",
|
||||
table: "SalaryAids",
|
||||
type: "bigint",
|
||||
nullable: false,
|
||||
defaultValue: 0L);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "LastModifiedByUserType",
|
||||
table: "SalaryAids",
|
||||
type: "nvarchar(50)",
|
||||
maxLength: 50,
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
|
||||
migrationBuilder.AddColumn<long>(
|
||||
name: "CreatedByAccountId",
|
||||
table: "Rewards",
|
||||
type: "bigint",
|
||||
nullable: false,
|
||||
defaultValue: 0L);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "CreatedByUserType",
|
||||
table: "Rewards",
|
||||
type: "nvarchar(50)",
|
||||
maxLength: 50,
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "LastModifiedByUserType",
|
||||
table: "Rewards",
|
||||
type: "nvarchar(50)",
|
||||
maxLength: 50,
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
|
||||
migrationBuilder.AddColumn<long>(
|
||||
name: "CreatedByAccountId",
|
||||
table: "Loan",
|
||||
type: "bigint",
|
||||
nullable: false,
|
||||
defaultValue: 0L);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "CreatedByUserType",
|
||||
table: "Loan",
|
||||
type: "nvarchar(50)",
|
||||
maxLength: 50,
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
|
||||
migrationBuilder.AddColumn<long>(
|
||||
name: "CreatedByAccountId",
|
||||
table: "Fines",
|
||||
type: "bigint",
|
||||
nullable: false,
|
||||
defaultValue: 0L);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "CreatedByUserType",
|
||||
table: "Fines",
|
||||
type: "nvarchar(50)",
|
||||
maxLength: 50,
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
|
||||
migrationBuilder.AddColumn<long>(
|
||||
name: "LastModifiedByAccountId",
|
||||
table: "Fines",
|
||||
type: "bigint",
|
||||
nullable: false,
|
||||
defaultValue: 0L);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "LastModifiedByUserType",
|
||||
table: "Fines",
|
||||
type: "nvarchar(50)",
|
||||
maxLength: 50,
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CreatedByAccountId",
|
||||
table: "SalaryAids");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CreatedByUserType",
|
||||
table: "SalaryAids");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "LastModifiedByAccountId",
|
||||
table: "SalaryAids");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "LastModifiedByUserType",
|
||||
table: "SalaryAids");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CreatedByAccountId",
|
||||
table: "Rewards");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CreatedByUserType",
|
||||
table: "Rewards");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "LastModifiedByUserType",
|
||||
table: "Rewards");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CreatedByAccountId",
|
||||
table: "Loan");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CreatedByUserType",
|
||||
table: "Loan");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CreatedByAccountId",
|
||||
table: "Fines");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CreatedByUserType",
|
||||
table: "Fines");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "LastModifiedByAccountId",
|
||||
table: "Fines");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "LastModifiedByUserType",
|
||||
table: "Fines");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "LastModifiedByAccountId",
|
||||
table: "Rewards",
|
||||
newName: "RewardedByAccountId");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2536,6 +2536,14 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Property<double>("Amount")
|
||||
.HasColumnType("float");
|
||||
|
||||
b.Property<long>("CreatedByAccountId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<string>("CreatedByUserType")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<DateTime>("CreationDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
@@ -2550,6 +2558,14 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.HasMaxLength(5)
|
||||
.HasColumnType("nvarchar(5)");
|
||||
|
||||
b.Property<long>("LastModifiedByAccountId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<string>("LastModifiedByUserType")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)");
|
||||
@@ -3619,6 +3635,14 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.HasMaxLength(3)
|
||||
.HasColumnType("nvarchar(3)");
|
||||
|
||||
b.Property<long>("CreatedByAccountId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<string>("CreatedByUserType")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<DateTime>("CreationDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
@@ -4324,6 +4348,14 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Property<double>("Amount")
|
||||
.HasColumnType("float");
|
||||
|
||||
b.Property<long>("CreatedByAccountId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<string>("CreatedByUserType")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<DateTime>("CreationDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
@@ -4341,13 +4373,18 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.HasMaxLength(5)
|
||||
.HasColumnType("nvarchar(5)");
|
||||
|
||||
b.Property<string>("RewardType")
|
||||
b.Property<long>("LastModifiedByAccountId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<string>("LastModifiedByUserType")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<long>("RewardedByAccountId")
|
||||
.HasColumnType("bigint");
|
||||
b.Property<string>("RewardType")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.HasMaxLength(255)
|
||||
@@ -4615,12 +4652,28 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Property<double>("Amount")
|
||||
.HasColumnType("float");
|
||||
|
||||
b.Property<long>("CreatedByAccountId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<string>("CreatedByUserType")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<DateTime>("CreationDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<long>("EmployeeId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<long>("LastModifiedByAccountId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<string>("LastModifiedByUserType")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<DateTime>("SalaryAidDateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,27 +1,31 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.InfraStructure;
|
||||
using Company.Domain.FineAgg;
|
||||
using CompanyManagment.App.Contracts.Fine;
|
||||
using CompanyManagment.App.Contracts.Reward;
|
||||
using CompanyManagment.App.Contracts.SalaryAid;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace CompanyManagment.EFCore.Repository;
|
||||
|
||||
public class FineRepository : RepositoryBase<long, Fine>, IFineRepository
|
||||
{
|
||||
private readonly CompanyContext _companyContext;
|
||||
private readonly CompanyContext _companyContext;
|
||||
|
||||
public FineRepository(CompanyContext companyContext) : base(companyContext)
|
||||
{
|
||||
_companyContext = companyContext;
|
||||
}
|
||||
public FineRepository(CompanyContext companyContext) : base(companyContext)
|
||||
{
|
||||
_companyContext = companyContext;
|
||||
}
|
||||
|
||||
public List<FineViewModel> GetSearchList(FineSearchViewModel searchModel)
|
||||
{
|
||||
var query = _companyContext.Fines.Where(x => x.WorkshopId == searchModel.WorkshopId);
|
||||
public List<FineViewModel> GetSearchList(FineSearchViewModel searchModel)
|
||||
{
|
||||
var query = _companyContext.Fines.Where(x => x.WorkshopId == searchModel.WorkshopId);
|
||||
|
||||
if (searchModel.EmployeeId != 0)
|
||||
query = query.Where(x => x.EmployeeId == searchModel.EmployeeId);
|
||||
if (searchModel.EmployeeId != 0)
|
||||
query = query.Where(x => x.EmployeeId == searchModel.EmployeeId);
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.StartDate) && !string.IsNullOrWhiteSpace(searchModel.EndDate))
|
||||
{
|
||||
@@ -29,57 +33,191 @@ public class FineRepository : RepositoryBase<long, Fine>, IFineRepository
|
||||
var endDate = searchModel.EndDate.ToGeorgianDateTime();
|
||||
query = query.Where(x => x.FineDate >= startDate && x.FineDate <= endDate);
|
||||
}
|
||||
var result = query.OrderByDescending(x => x.CreationDate).Skip(searchModel.PageIndex).Take(30).Select(x => new FineViewModel()
|
||||
{
|
||||
Id = x.id,
|
||||
WorkshopId = x.WorkshopId,
|
||||
EmployeeId = x.EmployeeId,
|
||||
Title = x.Title,
|
||||
Amount = x.Amount.ToMoney(),
|
||||
FineDate = x.FineDate.ToFarsi(),
|
||||
IsActive = x.IsActive,
|
||||
CreationDate = x.CreationDate.ToFarsi()
|
||||
}).AsEnumerable();
|
||||
var employees = _companyContext.Employees.Where(x => result.Any(a => a.EmployeeId == x.id)).ToList();
|
||||
var personnelCodes = _companyContext.PersonnelCodeSet
|
||||
.Where(x => result.Any(a => a.EmployeeId == x.EmployeeId && x.WorkshopId == a.WorkshopId)).ToList();
|
||||
return result.Select(x => new FineViewModel()
|
||||
{
|
||||
Id = x.Id,
|
||||
WorkshopId = x.WorkshopId,
|
||||
EmployeeId = x.EmployeeId,
|
||||
EmployeeFullName = employees.FirstOrDefault(a => a.id == x.EmployeeId)?.FullName,
|
||||
PersonnelCode = personnelCodes.FirstOrDefault(a => x.WorkshopId == a.WorkshopId && a.EmployeeId == x.EmployeeId)?.PersonnelCode.ToString(),
|
||||
Title = x.Title,
|
||||
Amount = x.Amount,
|
||||
FineDate = x.FineDate,
|
||||
IsActive = x.IsActive,
|
||||
CreationDate = x.CreationDate
|
||||
}).ToList();
|
||||
}
|
||||
|
||||
public List<Fine> GetBy(IEnumerable<long> ids)
|
||||
{
|
||||
return _companyContext.Fines.Where(x => ids.Contains(x.id)).ToList();
|
||||
var result = query.OrderByDescending(x => x.CreationDate).Skip(searchModel.PageIndex).Take(30).Select(x =>
|
||||
new FineViewModel()
|
||||
{
|
||||
Id = x.id,
|
||||
WorkshopId = x.WorkshopId,
|
||||
EmployeeId = x.EmployeeId,
|
||||
Title = x.Title,
|
||||
Amount = x.Amount.ToMoney(),
|
||||
FineDate = x.FineDate.ToFarsi(),
|
||||
IsActive = x.IsActive,
|
||||
CreationDate = x.CreationDate.ToFarsi()
|
||||
}).AsEnumerable();
|
||||
var employees = _companyContext.Employees.Where(x => result.Any(a => a.EmployeeId == x.id)).ToList();
|
||||
var personnelCodes = _companyContext.PersonnelCodeSet
|
||||
.Where(x => result.Any(a => a.EmployeeId == x.EmployeeId && x.WorkshopId == a.WorkshopId)).ToList();
|
||||
return result.Select(x => new FineViewModel()
|
||||
{
|
||||
Id = x.Id,
|
||||
WorkshopId = x.WorkshopId,
|
||||
EmployeeId = x.EmployeeId,
|
||||
EmployeeFullName = employees.FirstOrDefault(a => a.id == x.EmployeeId)?.FullName,
|
||||
PersonnelCode = personnelCodes
|
||||
.FirstOrDefault(a => x.WorkshopId == a.WorkshopId && a.EmployeeId == x.EmployeeId)?.PersonnelCode
|
||||
.ToString(),
|
||||
Title = x.Title,
|
||||
Amount = x.Amount,
|
||||
FineDate = x.FineDate,
|
||||
IsActive = x.IsActive,
|
||||
CreationDate = x.CreationDate
|
||||
}).ToList();
|
||||
}
|
||||
|
||||
}
|
||||
public List<Fine> GetBy(IEnumerable<long> ids)
|
||||
{
|
||||
return _companyContext.Fines.Where(x => ids.Contains(x.id)).ToList();
|
||||
|
||||
public EditFineViewModel GetDetails(long id)
|
||||
{
|
||||
var entity = _companyContext.Fines.FirstOrDefault(x => x.id == id);
|
||||
if (entity == null)
|
||||
return new();
|
||||
}
|
||||
|
||||
return new EditFineViewModel()
|
||||
{
|
||||
Id = entity.id,
|
||||
WorkshopId = entity.WorkshopId,
|
||||
EmployeeId = entity.EmployeeId,
|
||||
EmployeeFullname = _companyContext.Employees.FirstOrDefault(x => x.id == entity.EmployeeId)?.FullName ?? "",
|
||||
Title = entity.Title,
|
||||
Amount = entity.Amount.ToMoney(),
|
||||
IsActive = entity.IsActive,
|
||||
FineDate = entity.FineDate.ToFarsi(),
|
||||
};
|
||||
}
|
||||
public EditFineViewModel GetDetails(long id)
|
||||
{
|
||||
var entity = _companyContext.Fines.FirstOrDefault(x => x.id == id);
|
||||
if (entity == null)
|
||||
return new();
|
||||
|
||||
return new EditFineViewModel()
|
||||
{
|
||||
Id = entity.id,
|
||||
WorkshopId = entity.WorkshopId,
|
||||
EmployeeId = entity.EmployeeId,
|
||||
EmployeeFullname = _companyContext.Employees.FirstOrDefault(x => x.id == entity.EmployeeId)?.FullName ?? "",
|
||||
Title = entity.Title,
|
||||
Amount = entity.Amount.ToMoney(),
|
||||
IsActive = entity.IsActive,
|
||||
FineDate = entity.FineDate.ToFarsi(),
|
||||
};
|
||||
}
|
||||
|
||||
#region Pooya
|
||||
|
||||
/// <summary>
|
||||
/// گروهبندی بر اساس ماه هنگام جستجو با انتخاب کارمند
|
||||
/// </summary>
|
||||
public FinesGroupedViewModel GetSearchListAsGrouped(FineSearchViewModel searchModel)
|
||||
{
|
||||
var result = new FinesGroupedViewModel();
|
||||
var query = _companyContext.Fines.Where(x => x.WorkshopId == searchModel.WorkshopId);
|
||||
|
||||
var personnelCodes = _companyContext.PersonnelCodeSet
|
||||
.Where(x => x.WorkshopId == searchModel.WorkshopId).ToList();
|
||||
|
||||
var employees = _companyContext.LeftWorkList.Where(x => x.WorkshopId == searchModel.WorkshopId)
|
||||
.Include(x => x.Employee).Select(x => x.Employee).ToList();
|
||||
|
||||
|
||||
var pc = new PersianCalendar();
|
||||
|
||||
if (searchModel.ShowAsGrouped)
|
||||
{
|
||||
|
||||
if (searchModel.EmployeeId > 0)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.StartDate) &&
|
||||
!string.IsNullOrWhiteSpace(searchModel.EndDate))
|
||||
{
|
||||
var startDate = searchModel.StartDate.ToGeorgianDateTime();
|
||||
var endDate = searchModel.EndDate.ToGeorgianDateTime();
|
||||
query = query.Where(x => x.FineDate >= startDate && x.FineDate <= endDate);
|
||||
}
|
||||
query = query.Where(x => x.EmployeeId == searchModel.EmployeeId);
|
||||
|
||||
var list = query.ToList().Select(x => new FineViewModel()
|
||||
{
|
||||
Amount = x.Amount.ToMoney(),
|
||||
AmountDouble = x.Amount,
|
||||
EmployeeFullName = employees.FirstOrDefault(e => e.id == x.EmployeeId).FullName,
|
||||
EmployeeId = x.EmployeeId,
|
||||
CreationDate = x.CreationDate.ToFarsi(),
|
||||
Id = x.id,
|
||||
MonthFa = pc.GetMonth(x.FineDate).ToFarsiMonthByIntNumber(),
|
||||
YearFa = pc.GetYear(x.FineDate).ToString(),
|
||||
PersonnelCode = personnelCodes.FirstOrDefault(p => p.EmployeeId == x.EmployeeId).PersonnelCode.ToString(),
|
||||
FineDate = x.FineDate.ToFarsi(),
|
||||
WorkshopId = x.WorkshopId
|
||||
}).ToList();
|
||||
|
||||
result.GroupedByDate = list.GroupBy(x => new { x.YearFa, x.MonthFa }).Select(x =>
|
||||
new FinesGroupedByDateViewModel()
|
||||
{
|
||||
YearFa = x.Key.YearFa,
|
||||
MonthFa = x.Key.MonthFa,
|
||||
Fines = x.Select(s => new FinesGroupedByDateViewModelItems()
|
||||
{
|
||||
Amount = s.Amount,
|
||||
EmployeeName = s.EmployeeFullName,
|
||||
Id = s.Id,
|
||||
PersonnelCode = s.PersonnelCode,
|
||||
FineDateTimeFa = s.FineDate,
|
||||
Title = s.Title
|
||||
}).ToList(),
|
||||
TotalAmount = x.Sum(s => s.AmountDouble).ToMoney(),
|
||||
|
||||
}).ToList();
|
||||
return result;
|
||||
}
|
||||
else if (!string.IsNullOrWhiteSpace(searchModel.StartDate) &&
|
||||
!string.IsNullOrWhiteSpace(searchModel.EndDate))
|
||||
{
|
||||
var startDate = searchModel.StartDate.ToGeorgianDateTime();
|
||||
|
||||
var endDate = searchModel.EndDate.ToGeorgianDateTime();
|
||||
|
||||
query = query.Where(x => x.FineDate >= startDate && x.FineDate <= endDate);
|
||||
|
||||
result.GroupedByEmployee = query.GroupBy(x => x.EmployeeId).ToList()
|
||||
.Select(x => new FinesGroupedByEmployeeViewModel()
|
||||
{
|
||||
EmployeeId = x.Key,
|
||||
TotalAmount = x.Sum(s => s.Amount).ToMoney(),
|
||||
EmployeeName = employees.FirstOrDefault(e => e.id == x.Key).FullName,
|
||||
Fines = x.Select(s => new FinesGroupedByEmployeeViewModelItems()
|
||||
{
|
||||
Amount = s.Amount.ToMoney(),
|
||||
Id = s.id,
|
||||
FineDateTimeFa = s.FineDate.ToFarsi(),
|
||||
PersonnelCode = personnelCodes.FirstOrDefault(p => p.EmployeeId == s.EmployeeId).PersonnelCode.ToString(),
|
||||
Title = s.Title
|
||||
}).ToList()
|
||||
}).ToList();
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (searchModel.EmployeeId > 0)
|
||||
query = query.Where(x => x.EmployeeId == searchModel.EmployeeId);
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.StartDate) && !string.IsNullOrWhiteSpace(searchModel.EndDate))
|
||||
{
|
||||
var startDate = searchModel.StartDate.ToGeorgianDateTime();
|
||||
var endDate = searchModel.EndDate.ToGeorgianDateTime();
|
||||
query = query.Where(x => x.FineDate >= startDate && x.FineDate <= endDate);
|
||||
}
|
||||
|
||||
|
||||
result.FineListViewModels = query.Skip(searchModel.PageIndex).Take(30).ToList().Select(x => new FineViewModel()
|
||||
{
|
||||
Id = x.id,
|
||||
WorkshopId = x.WorkshopId,
|
||||
EmployeeId = x.EmployeeId,
|
||||
Title = x.Title,
|
||||
Amount = x.Amount.ToMoney(),
|
||||
FineDate = x.FineDate.ToFarsi(),
|
||||
IsActive = x.IsActive,
|
||||
CreationDate = x.CreationDate.ToFarsi(),
|
||||
PersonnelCode = personnelCodes.FirstOrDefault(p => p.EmployeeId == x.EmployeeId).PersonnelCode.ToString(),
|
||||
AmountDouble = x.Amount,
|
||||
EmployeeFullName = employees.FirstOrDefault(e => e.id == x.EmployeeId).FullName,
|
||||
YearFa = x.FineDate.ToFarsi().Substring(0, 4),
|
||||
MonthFa = x.FineDate.ToFarsi().Substring(5, 2),
|
||||
}).ToList();
|
||||
|
||||
|
||||
return result;
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,77 +1,228 @@
|
||||
using _0_Framework.InfraStructure;
|
||||
using System;
|
||||
using _0_Framework.InfraStructure;
|
||||
using Company.Domain.LoanAgg;
|
||||
using Company.Domain.LoanAgg.Entities;
|
||||
using CompanyManagment.App.Contracts.Loan;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System.Globalization;
|
||||
using System.Collections;
|
||||
|
||||
namespace CompanyManagment.EFCore.Repository;
|
||||
|
||||
public class LoanRepository:RepositoryBase<long,Loan>,ILoanRepository
|
||||
public class LoanRepository : RepositoryBase<long, Loan>, ILoanRepository
|
||||
{
|
||||
private readonly CompanyContext _companyContext;
|
||||
|
||||
public LoanRepository(CompanyContext companyContext):base(companyContext)
|
||||
public LoanRepository(CompanyContext companyContext) : base(companyContext)
|
||||
{
|
||||
_companyContext = companyContext;
|
||||
}
|
||||
|
||||
public LoanViewModel GetDetails(long id)
|
||||
public async Task<LoanDetailsViewModel> GetDetails(long id)
|
||||
{
|
||||
return _companyContext.Loans.Select(x => new LoanViewModel()
|
||||
{
|
||||
Id = x.id,
|
||||
WorkshopId = x.WorkshopId,
|
||||
EmployeeId = x.EmployeeId,
|
||||
EmployeeFullName = _companyContext.Employees.FirstOrDefault(e => e.id == x.EmployeeId).FullName,
|
||||
StartDateTime = x.StartDateMonth,
|
||||
Count = x.Count,
|
||||
Amount = x.Amount.ToMoney(),
|
||||
}).FirstOrDefault(x => x.Id == id);
|
||||
var loan = await _companyContext.Loans.FirstOrDefaultAsync(x => x.id == id);
|
||||
if (loan == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var employeeName = await _companyContext.Employees.Where(x => x.id == loan.EmployeeId)
|
||||
.Select(x => x.FName + " " + x.LName).FirstOrDefaultAsync();
|
||||
|
||||
var startDate = loan.LoanInstallments.MinBy(x => x.InstallmentDate).InstallmentDate;
|
||||
var endDate = loan.LoanInstallments.MaxBy(x => x.InstallmentDate).InstallmentDate;
|
||||
|
||||
var customizeCheckouts =await _companyContext.CustomizeCheckouts.Where(x => x.WorkshopId == loan.WorkshopId && x.EmployeeId == loan.EmployeeId &&
|
||||
x.ContractStart <= endDate && x.ContractEnd >= startDate).Select(x=> new {x.MonthInt, x.YearInt}).ToListAsync();
|
||||
|
||||
var result = new LoanDetailsViewModel()
|
||||
{
|
||||
TotalLoanAmount = loan.Amount.ToMoney(),
|
||||
InstallmentCount = loan.LoanInstallments.Count.ToString(),
|
||||
EmployeeFullName = employeeName,
|
||||
Id = loan.id,
|
||||
LoanGrantDate = loan.LoanGrantDate.ToFarsi(),
|
||||
Installments = loan.LoanInstallments.Select(x => new LoanInstallmentDetailsViewModel()
|
||||
{
|
||||
Id = x.Id,
|
||||
InstallmentAmount = x.AmountForMonth.ToMoney(),
|
||||
InstallmentDate = x.InstallmentDate.ToFarsi(),
|
||||
IsPaid = customizeCheckouts.Any(c => c.MonthInt.ToString() == x.Month && c.YearInt.ToString() == x.Year)
|
||||
}).ToList()
|
||||
|
||||
};
|
||||
var totalPaidAmountD = result.Installments.Where(x => x.IsPaid).Sum(x => x.InstallmentAmount.MoneyToDouble());
|
||||
var remainingD = result.Installments.Where(x => !x.IsPaid).Sum(x => x.InstallmentAmount.MoneyToDouble());
|
||||
result.TotalPaidAmount = totalPaidAmountD.ToMoney();
|
||||
result.TotalRemainingAmount= remainingD.ToMoney();
|
||||
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
public List<Loan> GetBy(IEnumerable<long> ids)
|
||||
{
|
||||
return _companyContext.Loans.Where(x => ids.Contains(x.id)).ToList();
|
||||
return _companyContext.Loans.Where(x => ids.Contains(x.id)).ToList();
|
||||
}
|
||||
|
||||
public LoanGroupedViewModel GetSearchListAsGrouped(LoanSearchViewModel searchModel)
|
||||
{
|
||||
var result = new LoanGroupedViewModel();
|
||||
|
||||
var query = _companyContext.Loans.Where(x => x.WorkshopId == searchModel.WorkshopId);
|
||||
|
||||
var personnelCodes = _companyContext.PersonnelCodeSet
|
||||
.Where(x => x.WorkshopId == searchModel.WorkshopId).ToList();
|
||||
|
||||
var employees = _companyContext.LeftWorkList.Where(x => x.WorkshopId == searchModel.WorkshopId)
|
||||
.Include(x => x.Employee).Select(x => x.Employee).ToList();
|
||||
|
||||
var pc = new PersianCalendar();
|
||||
|
||||
if (searchModel.ShowAsGrouped)
|
||||
{
|
||||
if (searchModel.EmployeeId > 0)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.StartDate) &&
|
||||
!string.IsNullOrWhiteSpace(searchModel.EndDate))
|
||||
{
|
||||
var startDate = searchModel.StartDate.ToGeorgianDateTime();
|
||||
var endDate = searchModel.EndDate.ToGeorgianDateTime();
|
||||
query = query.Where(x => x.StartInstallmentPayment >= startDate && x.StartInstallmentPayment <= endDate);
|
||||
}
|
||||
query = query.Where(x => x.EmployeeId == searchModel.EmployeeId);
|
||||
var list = query.ToList().Select(x => new LoanViewModel()
|
||||
{
|
||||
Amount = x.Amount.ToMoney(),
|
||||
AmountDouble = x.Amount,
|
||||
EmployeeFullName = employees.FirstOrDefault(e => e.id == x.EmployeeId).FullName,
|
||||
EmployeeId = x.EmployeeId,
|
||||
CreationDate = x.CreationDate,
|
||||
Id = x.id,
|
||||
MonthFa = pc.GetMonth(x.StartInstallmentPayment).ToFarsiMonthByIntNumber(),
|
||||
YearFa = pc.GetYear(x.StartInstallmentPayment).ToString(),
|
||||
PersonnelCode = personnelCodes.FirstOrDefault(p => p.EmployeeId == x.EmployeeId).PersonnelCode.ToString(),
|
||||
StartDateTime = x.StartInstallmentPayment.ToFarsi(),
|
||||
Count = x.Count,
|
||||
AmountPerMonth = x.AmountPerMonth.ToMoney(),
|
||||
WorkshopId = x.WorkshopId,
|
||||
}).ToList();
|
||||
result.GroupedByDate = list.GroupBy(x => new { x.YearFa, x.MonthFa }).Select(x =>
|
||||
new LoanGroupedByDateViewModel()
|
||||
{
|
||||
MonthFa = x.Key.MonthFa,
|
||||
YearFa = x.Key.YearFa,
|
||||
TotalAmount = x.Sum(l => l.AmountDouble).ToMoney(),
|
||||
LoanItems = x.Select(l => new LoanGroupedByDateViewModelItems()
|
||||
{
|
||||
AmountPerMonth = l.AmountPerMonth,
|
||||
EmployeeName = l.EmployeeFullName,
|
||||
Id = l.Id,
|
||||
InstallmentCount = l.Count,
|
||||
LoanStartDate = l.StartDateTime,
|
||||
PersonnelCode = l.PersonnelCode,
|
||||
TotalAmountFa = l.Amount
|
||||
}).ToList()
|
||||
}).ToList();
|
||||
return result;
|
||||
|
||||
|
||||
}
|
||||
else if (!string.IsNullOrWhiteSpace(searchModel.StartDate) &&
|
||||
!string.IsNullOrWhiteSpace(searchModel.EndDate))
|
||||
{
|
||||
var startDate = searchModel.StartDate.ToGeorgianDateTime();
|
||||
|
||||
var endDate = searchModel.EndDate.ToGeorgianDateTime();
|
||||
|
||||
query = query.Where(x => x.StartInstallmentPayment >= startDate && x.StartInstallmentPayment <= endDate);
|
||||
result.GroupedByEmployee = query.GroupBy(x => x.EmployeeId).ToList()
|
||||
.Select(x => new LoanGroupedByEmployeeViewModel()
|
||||
{
|
||||
EmployeeName = employees.FirstOrDefault(e => e.id == x.Key).FullName,
|
||||
LoanItems = x.Select(l => new LoanGroupedByEmployeeViewModelItems()
|
||||
{
|
||||
TotalAmountFa = l.Amount.ToMoney(),
|
||||
AmountPerMonth = l.AmountPerMonth.ToMoney(),
|
||||
Id = l.id,
|
||||
InstallmentCount = l.Count,
|
||||
LoanDateTimeFa = l.StartInstallmentPayment.ToFarsi(),
|
||||
PersonnelCode = personnelCodes.FirstOrDefault(p => p.EmployeeId == l.EmployeeId).PersonnelCode.ToString(),
|
||||
|
||||
}).ToList(),
|
||||
TotalAmount = x.Sum(l => l.Amount).ToMoney()
|
||||
}).ToList();
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
if (searchModel.EmployeeId > 0)
|
||||
query = query.Where(x => x.EmployeeId == searchModel.EmployeeId);
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.StartDate) && !string.IsNullOrWhiteSpace(searchModel.EndDate))
|
||||
{
|
||||
var startDate = searchModel.StartDate.ToGeorgianDateTime();
|
||||
var endDate = searchModel.EndDate.ToGeorgianDateTime();
|
||||
query = query.Where(x => x.StartInstallmentPayment >= startDate && x.StartInstallmentPayment <= endDate);
|
||||
}
|
||||
|
||||
result.LoanListViewModel = query.OrderByDescending(x => x.StartInstallmentPayment).Skip(searchModel.PageIndex)
|
||||
.Take(30).ToList()
|
||||
.Select(x => new LoanViewModel()
|
||||
{
|
||||
EmployeeFullName = employees.FirstOrDefault(e => e.id == x.EmployeeId).FullName,
|
||||
PersonnelCode = personnelCodes.FirstOrDefault(p => p.EmployeeId == x.EmployeeId).PersonnelCode.ToString(),
|
||||
Amount = x.Amount.ToMoney(),
|
||||
AmountPerMonth = x.AmountPerMonth.ToMoney(),
|
||||
StartDateTime = x.StartInstallmentPayment.ToFarsi(),
|
||||
Count = x.Count,
|
||||
Id = x.id,
|
||||
WorkshopId = x.WorkshopId,
|
||||
EmployeeId = x.EmployeeId,
|
||||
YearFa = pc.GetYear(x.StartInstallmentPayment).ToString(),
|
||||
|
||||
}).ToList();
|
||||
return result;
|
||||
}
|
||||
|
||||
public List<LoanViewModel> GetSearchList(LoanSearchViewModel searchViewModel)
|
||||
{
|
||||
var query = _companyContext.Loans.Where(x => x.WorkshopId == searchViewModel.WorkshopId);
|
||||
{
|
||||
var query = _companyContext.Loans.Where(x => x.WorkshopId == searchViewModel.WorkshopId);
|
||||
|
||||
if (searchViewModel.EmployeeId != 0)
|
||||
query = query.Where(x => x.EmployeeId == searchViewModel.EmployeeId);
|
||||
if (searchViewModel.EmployeeId != 0)
|
||||
query = query.Where(x => x.EmployeeId == searchViewModel.EmployeeId);
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(searchViewModel.StartDate) && !string.IsNullOrWhiteSpace(searchViewModel.EndDate))
|
||||
{
|
||||
var startDate = searchViewModel.StartDate.ToGeorgianDateTime();
|
||||
var endDate = searchViewModel.EndDate.ToGeorgianDateTime();
|
||||
|
||||
var endDate = searchViewModel.EndDate.ToGeorgianDateTime();
|
||||
|
||||
query = query.Where(x => x.LoanGrantDate <= endDate && x.LoanGrantDate >= startDate);
|
||||
}
|
||||
|
||||
|
||||
var employeeIds = query.Select(x => x.EmployeeId);
|
||||
|
||||
var personnelCodes = _companyContext.PersonnelCodeSet.Where(x => x.WorkshopId == searchViewModel.WorkshopId && employeeIds.Contains(x.EmployeeId));
|
||||
|
||||
|
||||
var employees = _companyContext.Employees.Where(x => employeeIds.Contains(x.id)).AsSplitQuery();
|
||||
var employeeIds = query.Select(x => x.EmployeeId);
|
||||
|
||||
return query.Select(x => new LoanViewModel()
|
||||
{
|
||||
Id = x.id,
|
||||
WorkshopId = x.WorkshopId,
|
||||
EmployeeId = x.EmployeeId,
|
||||
EmployeeFullName =employees.FirstOrDefault(e => e.id == x.EmployeeId).FullName,
|
||||
PersonnelCode = personnelCodes.FirstOrDefault(e => e.EmployeeId == x.EmployeeId && e.WorkshopId == searchViewModel.WorkshopId).PersonnelCode.ToString(),
|
||||
StartDateTime = x.StartInstallmentPayment.ToFarsi(),
|
||||
Count = x.Count,
|
||||
Amount = x.Amount.ToMoney(),
|
||||
AmountPerMonth = x.AmountPerMonth.ToMoney(),
|
||||
CreationDate = x.CreationDate
|
||||
}).OrderByDescending(x => x.CreationDate).Skip(searchViewModel.PageIndex).AsSplitQuery().Take(30).ToList();
|
||||
}
|
||||
var personnelCodes = _companyContext.PersonnelCodeSet.Where(x => x.WorkshopId == searchViewModel.WorkshopId && employeeIds.Contains(x.EmployeeId));
|
||||
|
||||
|
||||
var employees = _companyContext.Employees.Where(x => employeeIds.Contains(x.id)).AsSplitQuery();
|
||||
|
||||
return query.Select(x => new LoanViewModel()
|
||||
{
|
||||
Id = x.id,
|
||||
WorkshopId = x.WorkshopId,
|
||||
EmployeeId = x.EmployeeId,
|
||||
EmployeeFullName = employees.FirstOrDefault(e => e.id == x.EmployeeId).FullName,
|
||||
PersonnelCode = personnelCodes.FirstOrDefault(e => e.EmployeeId == x.EmployeeId && e.WorkshopId == searchViewModel.WorkshopId).PersonnelCode.ToString(),
|
||||
StartDateTime = x.StartInstallmentPayment.ToFarsi(),
|
||||
Count = x.Count,
|
||||
Amount = x.Amount.ToMoney(),
|
||||
AmountPerMonth = x.AmountPerMonth.ToMoney(),
|
||||
CreationDate = x.CreationDate
|
||||
}).OrderByDescending(x => x.CreationDate).Skip(searchViewModel.PageIndex).AsSplitQuery().Take(30).ToList();
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.InfraStructure;
|
||||
@@ -22,14 +23,14 @@ public class RewardRepository : RepositoryBase<long, Reward>, IRewardRepository
|
||||
|
||||
if (searchViewModel.EmployeeId != 0)
|
||||
query = query.Where(x => x.EmployeeId == searchViewModel.EmployeeId);
|
||||
if (!string.IsNullOrWhiteSpace(searchViewModel.StartDate) && !string.IsNullOrWhiteSpace(searchViewModel.EndDate))
|
||||
{
|
||||
var startDate = searchViewModel.StartDate.ToGeorgianDateTime();
|
||||
var endDate = searchViewModel.EndDate.ToGeorgianDateTime();
|
||||
query = query.Where(x => x.GrantDate >= startDate && x.GrantDate <= endDate);
|
||||
}
|
||||
if (!string.IsNullOrWhiteSpace(searchViewModel.StartDate) && !string.IsNullOrWhiteSpace(searchViewModel.EndDate))
|
||||
{
|
||||
var startDate = searchViewModel.StartDate.ToGeorgianDateTime();
|
||||
var endDate = searchViewModel.EndDate.ToGeorgianDateTime();
|
||||
query = query.Where(x => x.GrantDate >= startDate && x.GrantDate <= endDate);
|
||||
}
|
||||
|
||||
var result = query.OrderByDescending(x=>x.CreationDate).Select(x => new RewardViewModel()
|
||||
var result = query.OrderByDescending(x => x.CreationDate).Select(x => new RewardViewModel()
|
||||
{
|
||||
Id = x.id,
|
||||
Title = x.Title,
|
||||
@@ -49,16 +50,16 @@ public class RewardRepository : RepositoryBase<long, Reward>, IRewardRepository
|
||||
Title = x.Title,
|
||||
Amount = x.Amount,
|
||||
CreationDate = x.CreationDate,
|
||||
Description = x.Description ?? "-",
|
||||
Description = x.Description??"",
|
||||
GrantDateFa = x.GrantDateFa,
|
||||
EmployeeFullName = employees.FirstOrDefault(e => e.id == x.EmployeeId).FullName ,
|
||||
EmployeeFullName = employees.FirstOrDefault(e => e.id == x.EmployeeId).FullName,
|
||||
Id = x.Id,
|
||||
PersonnelCode = personnelCodes
|
||||
.FirstOrDefault(a => a.WorkshopId == x.WorkshopId && a.EmployeeId == x.EmployeeId).PersonnelCode
|
||||
.ToString(),
|
||||
WorkshopId = x.WorkshopId,
|
||||
EmployeeId = x.EmployeeId
|
||||
}).ToList();
|
||||
}).ToList();
|
||||
}
|
||||
|
||||
public EditRewardViewModel GetDetails(long id)
|
||||
@@ -74,7 +75,6 @@ public class RewardRepository : RepositoryBase<long, Reward>, IRewardRepository
|
||||
EmployeeId = entity.EmployeeId,
|
||||
Amount = entity.Amount.ToMoney(),
|
||||
Description = entity.Description,
|
||||
RewardedByAccountId = entity.RewardedByAccountId,
|
||||
GrantDate = entity.GrantDate.ToFarsi()
|
||||
};
|
||||
|
||||
@@ -92,50 +92,144 @@ public class RewardRepository : RepositoryBase<long, Reward>, IRewardRepository
|
||||
/// <summary>
|
||||
/// گروهبندی بر اساس ماه هنگام جستجو با انتخاب کارمند
|
||||
/// </summary>
|
||||
public List<MonthlyGroupedEmployeeRewardsViewModel> GetSearchListByEmployee(RewardSearchModel searchModel)
|
||||
public RewardsGroupedViewModel GetSearchListAsGrouped(RewardSearchModel searchModel)
|
||||
{
|
||||
var query = _companyContext.Rewards.Where(x => x.EmployeeId == searchModel.EmployeeId && x.WorkshopId == searchModel.WorkshopId && x.IsActive == IsActive.True);
|
||||
var result = new RewardsGroupedViewModel();
|
||||
var query = _companyContext.Rewards.Where(x => x.WorkshopId == searchModel.WorkshopId && x.IsActive == IsActive.True);
|
||||
|
||||
var personnelCodes = _companyContext.PersonnelCodeSet
|
||||
.Where(x => x.WorkshopId == searchModel.WorkshopId).ToList();
|
||||
|
||||
|
||||
var pc = new PersianCalendar();
|
||||
|
||||
var employees = _companyContext.LeftWorkList.Where(x => x.WorkshopId == searchModel.WorkshopId).Include(x => x.Employee).Select(x => x.Employee).ToList();
|
||||
if (searchModel.ShowAsGrouped)
|
||||
{
|
||||
if (searchModel.EmployeeId > 0)
|
||||
{
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.StartDate) && !string.IsNullOrWhiteSpace(searchModel.EndDate))
|
||||
{
|
||||
var startDate = searchModel.StartDate.ToGeorgianDateTime();
|
||||
var endDate = searchModel.EndDate.ToGeorgianDateTime();
|
||||
query = query.Where(x => x.GrantDate >= startDate && x.GrantDate <= endDate);
|
||||
}
|
||||
|
||||
|
||||
query = query.Where(x => x.EmployeeId == searchModel.EmployeeId);
|
||||
|
||||
var list = query.ToList().Select(x => new RewardViewModel
|
||||
{
|
||||
WorkshopId = x.WorkshopId,
|
||||
Amount = x.Amount.ToMoney(),
|
||||
AmountDouble = x.Amount,
|
||||
Description = x.Description,
|
||||
EmployeeFullName = employees.FirstOrDefault(e => e.id == x.EmployeeId).FullName,
|
||||
EmployeeId = x.EmployeeId,
|
||||
GrantDateFa = x.GrantDate.ToFarsi(),
|
||||
GrantDateGr = x.GrantDate,
|
||||
Id = x.id,
|
||||
Title = x.Title,
|
||||
IsActive = x.IsActive,
|
||||
MonthFa = pc.GetMonth(x.GrantDate).ToFarsiMonthByIntNumber(),
|
||||
YearFa = pc.GetYear(x.GrantDate).ToString(),
|
||||
PersonnelCode = personnelCodes.FirstOrDefault(p => p.EmployeeId == x.EmployeeId).PersonnelCode.ToString(),
|
||||
}).ToList();
|
||||
|
||||
result.RewardsGroupedByDate = list.GroupBy(x => new { x.YearFa, x.MonthFa }).Select(x => new RewardsGroupedByDate()
|
||||
{
|
||||
Month = x.Key.MonthFa,
|
||||
Year = x.Key.YearFa,
|
||||
Rewards = x.Select(r => new RewardsGroupedByDateItems()
|
||||
{
|
||||
PersonnelCode = r.PersonnelCode,
|
||||
Amount = r.Amount,
|
||||
Description = r.Description,
|
||||
GrantDateFa = r.GrantDateFa,
|
||||
Title = r.Title,
|
||||
EmployeeName = r.EmployeeFullName,
|
||||
Id = r.Id
|
||||
}).ToList(),
|
||||
TotalAmount = x.Sum(r => r.AmountDouble).ToMoney()
|
||||
}).ToList();
|
||||
|
||||
return result;
|
||||
}
|
||||
else if (!string.IsNullOrWhiteSpace(searchModel.StartDate) && !string.IsNullOrWhiteSpace(searchModel.EndDate))
|
||||
{
|
||||
var startDate = searchModel.StartDate.ToGeorgianDateTime();
|
||||
|
||||
var endDate = searchModel.EndDate.ToGeorgianDateTime();
|
||||
|
||||
query = query.Where(x => x.GrantDate >= startDate && x.GrantDate <= endDate);
|
||||
|
||||
var resList = query.GroupBy(x => x.EmployeeId).ToList();
|
||||
result.RewardsGroupedByEmployee = resList.Select(x => new RewardsGroupedByEmployeeViewModel()
|
||||
{
|
||||
EmployeeId = x.Key,
|
||||
EmployeeName = employees.FirstOrDefault(e => e.id == x.Key).FullName,
|
||||
Rewards = x.Select(r => new RewardsGroupedByEmployeeViewModelItems
|
||||
{
|
||||
PersonnelCode = personnelCodes.FirstOrDefault(p => p.EmployeeId == r.EmployeeId).PersonnelCode.ToString(),
|
||||
Amount = r.Amount.ToMoney(),
|
||||
Description = r.Description,
|
||||
GrantDate = r.GrantDate.ToFarsi(),
|
||||
Title = r.Title,
|
||||
Id = r.id
|
||||
}).ToList(),
|
||||
|
||||
TotalAmount = x.Sum(r => r.Amount).ToMoney()
|
||||
}).ToList();
|
||||
return result;
|
||||
}
|
||||
}
|
||||
if (searchModel.EmployeeId > 0)
|
||||
{
|
||||
query = query.Where(x => x.EmployeeId == searchModel.EmployeeId);
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.StartDate) && !string.IsNullOrWhiteSpace(searchModel.EndDate))
|
||||
{
|
||||
var startDate = searchModel.StartDate.ToGeorgianDateTime();
|
||||
|
||||
var endDate = searchModel.EndDate.ToGeorgianDateTime();
|
||||
|
||||
query = query.Where(x => x.GrantDate >= startDate && x.GrantDate <= endDate);
|
||||
}
|
||||
|
||||
var personnelCode = _companyContext.PersonnelCodeSet
|
||||
.FirstOrDefault(x => x.EmployeeId == searchModel.EmployeeId && x.WorkshopId == searchModel.WorkshopId);
|
||||
var employee = _companyContext.Employees.FirstOrDefault(x => x.id == searchModel.EmployeeId);
|
||||
if (employee == null)
|
||||
return new();
|
||||
var result = query.Select(x => new RewardViewModel()
|
||||
result.RewardListViewModels = query.Skip(searchModel.PageIndex).Take(30).ToList().Select(x => new RewardViewModel()
|
||||
{
|
||||
Id = x.id,
|
||||
EmployeeId = x.EmployeeId,
|
||||
Description = x.Description,
|
||||
Amount = x.Amount.ToMoney(),
|
||||
WorkshopId = x.WorkshopId,
|
||||
CreationDate = x.CreationDate.ToFarsi(),
|
||||
Amount = x.Amount.ToMoney(),
|
||||
AmountDouble = x.Amount,
|
||||
Description = x.Description??"",
|
||||
EmployeeFullName = employees.FirstOrDefault(e => e.id == x.EmployeeId).FullName,
|
||||
EmployeeId = x.EmployeeId,
|
||||
GrantDateFa = x.GrantDate.ToFarsi(),
|
||||
PersonnelCode = personnelCode.PersonnelCode.ToString(),
|
||||
EmployeeFullName = employee.FullName,
|
||||
}).Skip(searchModel.PageIndex).Take(30).ToList();
|
||||
GrantDateGr = x.GrantDate,
|
||||
Id = x.id,
|
||||
Title = x.Title,
|
||||
IsActive = x.IsActive,
|
||||
MonthFa = pc.GetMonth(x.GrantDate).ToFarsiMonthByIntNumber(),
|
||||
YearFa = pc.GetYear(x.GrantDate).ToString(),
|
||||
PersonnelCode = personnelCodes.FirstOrDefault(p => p.EmployeeId == x.EmployeeId).PersonnelCode.ToString(),
|
||||
}).ToList();
|
||||
return result;
|
||||
|
||||
//var result = query.Skip(searchModel.PageIndex).Select(x => new RewardViewModel()
|
||||
//{
|
||||
// Id = x.id,
|
||||
// EmployeeId = x.EmployeeId,
|
||||
// Description = x.Description,
|
||||
// Amount = x.Amount.ToMoney(),
|
||||
// WorkshopId = x.WorkshopId,
|
||||
// CreationDate = x.CreationDate.ToFarsi(),
|
||||
// GrantDateFa = x.GrantDate.ToFarsi(),
|
||||
|
||||
//}).ToList();
|
||||
}
|
||||
|
||||
result.ForEach(x =>
|
||||
{
|
||||
x.YearFa = x.GrantDateFa.Substring(0, 4);
|
||||
x.MonthFa = x.GrantDateFa.Substring(5, 2);
|
||||
});
|
||||
|
||||
return result.GroupBy(x => new { x.YearFa, x.MonthFa }).Select(x => new MonthlyGroupedEmployeeRewardsViewModel()
|
||||
{
|
||||
YearFa = x.Key.YearFa,
|
||||
MonthFa = x.Key.MonthFa,
|
||||
MonthFaName = x.Key.MonthFa.ToFarsiMonthByNumber(),
|
||||
Rewards = x.ToList(),
|
||||
EmployeeId = searchModel.EmployeeId,
|
||||
PersonnelCode = personnelCode.PersonnelCode.ToString()
|
||||
}).OrderByDescending(x => x.YearFa).ThenByDescending(x=>x.MonthFa).ToList();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
@@ -72,7 +72,12 @@ public class RollCallEmployeeRepository : RepositoryBase<long, RollCallEmployee>
|
||||
EmployeeLName = x.LName,
|
||||
EmployeeFullName = x.EmployeeFullName,
|
||||
IsActiveString = x.IsActiveString,
|
||||
HasUploadedImage = x.HasUploadedImage
|
||||
HasUploadedImage = x.HasUploadedImage,
|
||||
Statuses = x.EmployeesStatus.Select(x => new RollCallEmployeeStatusViewModel()
|
||||
{
|
||||
StartDateGr = x.StartDate,
|
||||
EndDateGr = x.EndDate
|
||||
})
|
||||
}).FirstOrDefault();
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -2659,7 +2659,7 @@ CreateWorkingHoursTemp command, bool holidayWorking)
|
||||
&& x.GrantDate >= start && x.GrantDate <= end
|
||||
&& x.RewardType == RewardType.CreatedByCheckoutForBirthDay) == false)
|
||||
{
|
||||
var reward = new Reward(employeeId, workshopId, amount, "", 0, contractStart, "هدیه تولد",
|
||||
var reward = new Reward(employeeId, workshopId, amount, "", 0,UserType.System, contractStart, "هدیه تولد",
|
||||
RewardType.CreatedByCheckoutForBirthDay);
|
||||
_context.Rewards.Add(reward);
|
||||
_context.SaveChanges();
|
||||
@@ -2675,7 +2675,7 @@ CreateWorkingHoursTemp command, bool holidayWorking)
|
||||
&& x.GrantDate >= start && x.GrantDate <= end
|
||||
&& x.RewardType == type) == false)
|
||||
{
|
||||
var reward = new Reward(employeeId, workshopId, amount, "", 0, contractStart, title, type);
|
||||
var reward = new Reward(employeeId, workshopId, amount, "", 0,UserType.System, contractStart, title, type);
|
||||
_context.Rewards.Add(reward);
|
||||
_context.SaveChanges();
|
||||
}
|
||||
|
||||
@@ -528,9 +528,9 @@ public class RollCallRepository : RepositoryBase<long, RollCall>, IRollCallRepos
|
||||
if (employeeRollCallStatuses == null || employeeRollCallStatuses.EmployeesStatus == null || !employeeRollCallStatuses.EmployeesStatus.Any())
|
||||
return new();
|
||||
|
||||
//this list will have all the months which employee was active in, remember this doesn't have statuses,
|
||||
//just the list of months which user had activity in
|
||||
var activeMonths = new List<PersianDateTime>();
|
||||
//this list will have all the months which employee was active in, remember this doesn't have statuses,
|
||||
//just the list of months which user had activity in
|
||||
var activeMonths = new List<PersianDateTime>();
|
||||
|
||||
//filling the list
|
||||
foreach (var status in employeeRollCallStatuses.EmployeesStatus)
|
||||
@@ -562,10 +562,10 @@ public class RollCallRepository : RepositoryBase<long, RollCall>, IRollCallRepos
|
||||
//get the months that include these dates
|
||||
activeMonthsList = activeMonthsList.Where(x => x.Year >= startSearch.Year && x.Month >= startSearch.Month && x.Year <= endSearch.Year && x.Month <= endSearch.Month).ToList();
|
||||
}
|
||||
//if exact datetime is given start and end will be the same date
|
||||
//if exact datetime is given start and end will be the same date
|
||||
if (exactDateTime.HasValue)
|
||||
{
|
||||
startSearch = new PersianDateTime(exactDateTime.Value);
|
||||
startSearch = new PersianDateTime(exactDateTime.Value);
|
||||
endSearch = startSearch;
|
||||
activeMonthsList = activeMonthsList.Where(x => x.Year >= startSearch.Year && x.Month >= startSearch.Month && x.Year <= endSearch.Year && x.Month <= endSearch.Month).ToList();
|
||||
}
|
||||
@@ -575,8 +575,8 @@ public class RollCallRepository : RepositoryBase<long, RollCall>, IRollCallRepos
|
||||
{
|
||||
var persianDateIndex = new PersianDateTime(dateIndex.Value);
|
||||
|
||||
//gets first of month, if the day is 21st of month, first of month is 21-21 +1 = 1 or 21 + (-(21-1)) = 1
|
||||
var dateIndexFirstOfMonth = persianDateIndex.AddDays(-(persianDateIndex.Day - 1));
|
||||
//gets first of month, if the day is 21st of month, first of month is 21-21 +1 = 1 or 21 + (-(21-1)) = 1
|
||||
var dateIndexFirstOfMonth = persianDateIndex.AddDays(-(persianDateIndex.Day - 1));
|
||||
|
||||
activeMonthsList = activeMonthsList.Where(x => dateIndexFirstOfMonth >= x).ToList();
|
||||
}
|
||||
@@ -594,7 +594,7 @@ public class RollCallRepository : RepositoryBase<long, RollCall>, IRollCallRepos
|
||||
x.StartDate < nextMonthFirstDay);
|
||||
|
||||
|
||||
//get leaves in the specified month
|
||||
//get leaves in the specified month
|
||||
var leavesQuery =
|
||||
_context.LeaveList.Where(x => (x.LeaveType == "استعلاجی" || (x.LeaveType == "استحقاقی" && x.PaidLeaveType == "روزانه")) &&
|
||||
x.IsAccepted &&
|
||||
@@ -653,7 +653,9 @@ public class RollCallRepository : RepositoryBase<long, RollCall>, IRollCallRepos
|
||||
StartDate = y.StartDate.Value.ToString("HH:mm"),
|
||||
EndDate = y.EndDate!.Value.ToString("HH:mm"),
|
||||
StartDateGr = y.StartDate.Value,
|
||||
EndDateGr = y.EndDate.Value
|
||||
EndDateGr = y.EndDate.Value,
|
||||
EntryTimeDifferences = CalculateEntryTimeDifferences(y.EarlyEntryDuration, y.LateEntryDuration),
|
||||
ExitTimeDifferences = CalculateExitTimeDifferences(y.EarlyExitDuration, y.LateExitDuration)
|
||||
}),
|
||||
TotalWorkingHoursSpan = new TimeSpan(rollCallsList.Where(y => x.Date == y.ShiftDate.Date)
|
||||
.Sum(y => (y.EndDate!.Value - y.StartDate.Value).Ticks)),
|
||||
@@ -662,26 +664,26 @@ public class RollCallRepository : RepositoryBase<long, RollCall>, IRollCallRepos
|
||||
};
|
||||
});
|
||||
|
||||
//filling TotalWorkingHours string from TimeSpans we filled in the last step and other info
|
||||
result = result.Select(x => new RollCallViewModel()
|
||||
//filling TotalWorkingHours string from TimeSpans we filled in the last step and other info
|
||||
result = result.Select(x => new RollCallViewModel()
|
||||
{
|
||||
EmployeeFullName = employeeName.EmployeeFullName,
|
||||
EmployeeId = employeeId,
|
||||
PersonnelCode = personnelCode.ToString(),
|
||||
DateGr = x.DateGr,
|
||||
DateFa = x.DateFa,
|
||||
|
||||
|
||||
DayOfWeekFa = x.DateGr.DayOfWeek.DayOfWeeKToPersian(),
|
||||
IsHoliday = _holidayItemApplication.IsHoliday(x.DateGr),
|
||||
IsAbsent = !x.RollCallTimesList.Any(),
|
||||
RollCallTimesList = x.RollCallTimesList.OrderBy(r=>r.StartDateGr),
|
||||
RollCallTimesList = x.RollCallTimesList.OrderBy(r => r.StartDateGr),
|
||||
HasLeave = x.HasLeave,
|
||||
TotalWorkingHoursSpan = x.TotalWorkingHoursSpan,
|
||||
TotalWorkingHours = $"{(int)x.TotalWorkingHoursSpan.TotalHours}:{x.TotalWorkingHoursSpan.Minutes.ToString("00")}"
|
||||
}).ToList();
|
||||
|
||||
//total working hours in the whole month or duration
|
||||
var totalWorkingHours = new TimeSpan(result.Sum(x => x.TotalWorkingHoursSpan.Ticks));
|
||||
var totalWorkingHours = new TimeSpan(result.Sum(x => x.TotalWorkingHoursSpan.Ticks));
|
||||
|
||||
//if there are any other months available that the selector
|
||||
return new EmployeeRollCallsByMonthViewModel()
|
||||
@@ -847,10 +849,12 @@ public class RollCallRepository : RepositoryBase<long, RollCall>, IRollCallRepos
|
||||
EmployeeFullName = x.EmployeeFullName,
|
||||
EmployeeId = x.EmployeeId,
|
||||
Reason = leave == null ? "" : $"{leave.LeaveType}-{leave.PaidLeaveType}",
|
||||
RollCallTimesList = employeeRollCallsForDate.OrderBy(r=>r.StartDate).Select(y => new RollCallTimeViewModel()
|
||||
RollCallTimesList = employeeRollCallsForDate.OrderBy(r => r.StartDate).Select(y => new RollCallTimeViewModel()
|
||||
{
|
||||
EndDate = y.EndDate!.Value.ToString("HH:mm"),
|
||||
StartDate = y.StartDate!.Value.ToString("HH:mm"),
|
||||
EntryTimeDifferences = CalculateEntryTimeDifferences(y.EarlyEntryDuration, y.LateEntryDuration),
|
||||
ExitTimeDifferences = CalculateExitTimeDifferences(y.EarlyExitDuration, y.LateExitDuration)
|
||||
}),
|
||||
HasLeave = leave != null,
|
||||
IsAbsent = !employeeRollCallsForDate.Any(),
|
||||
@@ -1081,10 +1085,13 @@ public class RollCallRepository : RepositoryBase<long, RollCall>, IRollCallRepos
|
||||
EmployeeFullName = nameReferences.FirstOrDefault(y => x.Key == y.EmployeeId).EmployeeFullName,
|
||||
EmployeeId = x.FirstOrDefault()!.EmployeeId,
|
||||
TotalWorkingHoursSpan = new TimeSpan(x.Where(y => y.EndDate != null).Sum(y => (y.EndDate!.Value - y.StartDate!.Value).Ticks)),
|
||||
RollCallTimesList = x.Select(y => new RollCallTimeViewModel()
|
||||
RollCallTimesList = x.OrderBy(r => r.StartDate).Select(y => new RollCallTimeViewModel()
|
||||
{
|
||||
StartDate = y.StartDate!.Value.ToString("HH:mm"),
|
||||
EndDate = y.EndDate?.ToString("HH:mm")
|
||||
EndDate = y.EndDate?.ToString("HH:mm"),
|
||||
EntryTimeDifferences = CalculateEntryTimeDifferences(y.EarlyEntryDuration, y.LateEntryDuration),
|
||||
ExitTimeDifferences = CalculateExitTimeDifferences(y.EarlyExitDuration, y.LateExitDuration)
|
||||
|
||||
}).ToList()
|
||||
|
||||
|
||||
|
||||
@@ -1,27 +1,32 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.InfraStructure;
|
||||
using Company.Domain.SalaryAidAgg;
|
||||
using CompanyManagment.App.Contracts.Employee;
|
||||
using CompanyManagment.App.Contracts.Fine;
|
||||
using CompanyManagment.App.Contracts.Reward;
|
||||
using CompanyManagment.App.Contracts.SalaryAid;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace CompanyManagment.EFCore.Repository;
|
||||
|
||||
public class SalaryAidRepository:RepositoryBase<long,SalaryAid>,ISalaryAidRepository
|
||||
public class SalaryAidRepository : RepositoryBase<long, SalaryAid>, ISalaryAidRepository
|
||||
{
|
||||
private readonly CompanyContext _companyContext;
|
||||
|
||||
public SalaryAidRepository(CompanyContext context):base(context)
|
||||
public SalaryAidRepository(CompanyContext context) : base(context)
|
||||
{
|
||||
_companyContext = context;
|
||||
}
|
||||
|
||||
public List<SalaryAidViewModel> GetSearchList(SalaryAidSearchViewModel searchViewModel)
|
||||
{
|
||||
var query = _companyContext.SalaryAids.Where(x => x.WorkshopId == searchViewModel.WorkshopId);
|
||||
var query = _companyContext.SalaryAids.Where(x => x.WorkshopId == searchViewModel.WorkshopId);
|
||||
|
||||
if (searchViewModel.EmployeeId != 0)
|
||||
query = query.Where(x => x.EmployeeId == searchViewModel.EmployeeId);
|
||||
if (searchViewModel.EmployeeId != 0)
|
||||
query = query.Where(x => x.EmployeeId == searchViewModel.EmployeeId);
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(searchViewModel.StartDate) && !string.IsNullOrWhiteSpace(searchViewModel.EndDate))
|
||||
{
|
||||
@@ -34,48 +39,171 @@ public class SalaryAidRepository:RepositoryBase<long,SalaryAid>,ISalaryAidReposi
|
||||
|
||||
var result = query.OrderByDescending(x => x.CreationDate).Skip(searchViewModel.PageIndex).Take(30).AsEnumerable();
|
||||
|
||||
var employees = _companyContext.Employees.Where(x => result.Any(a => a.EmployeeId == x.id)).ToList();
|
||||
var employees = _companyContext.Employees.Where(x => result.Any(a => a.EmployeeId == x.id)).ToList();
|
||||
|
||||
var personnelCodes = _companyContext.PersonnelCodeSet
|
||||
.Where(x => result.Any(a => a.EmployeeId == x.EmployeeId && x.WorkshopId == a.WorkshopId)).ToList();
|
||||
var personnelCodes = _companyContext.PersonnelCodeSet
|
||||
.Where(x => result.Any(a => a.EmployeeId == x.EmployeeId && x.WorkshopId == a.WorkshopId)).ToList();
|
||||
|
||||
return result.Select(x => new SalaryAidViewModel()
|
||||
{
|
||||
Amount = x.Amount.ToMoney(),
|
||||
CreationDate = x.CreationDate.ToFarsi(),
|
||||
EmployeeFullName = employees.FirstOrDefault(e => e.id == x.EmployeeId)?.FullName,
|
||||
Id = x.id,
|
||||
PersonnelCode = personnelCodes
|
||||
.FirstOrDefault(a => a.WorkshopId == x.WorkshopId && a.EmployeeId == x.EmployeeId)?.PersonnelCode
|
||||
.ToString(),
|
||||
EmployeeId = x.EmployeeId,
|
||||
SalaryAidDateTimeFa = x.SalaryAidDateTime.ToFarsi(),
|
||||
SalaryAidDateTimeGe = x.SalaryAidDateTime,
|
||||
WorkshopId = x.WorkshopId
|
||||
}).ToList();
|
||||
return result.Select(x => new SalaryAidViewModel()
|
||||
{
|
||||
Amount = x.Amount.ToMoney(),
|
||||
CreationDate = x.CreationDate.ToFarsi(),
|
||||
EmployeeFullName = employees.FirstOrDefault(e => e.id == x.EmployeeId)?.FullName,
|
||||
Id = x.id,
|
||||
PersonnelCode = personnelCodes
|
||||
.FirstOrDefault(a => a.WorkshopId == x.WorkshopId && a.EmployeeId == x.EmployeeId)?.PersonnelCode
|
||||
.ToString(),
|
||||
EmployeeId = x.EmployeeId,
|
||||
SalaryAidDateTimeFa = x.SalaryAidDateTime.ToFarsi(),
|
||||
SalaryAidDateTimeGe = x.SalaryAidDateTime,
|
||||
WorkshopId = x.WorkshopId
|
||||
}).ToList();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public EditSalaryAidViewModel GetDetails(long id)
|
||||
{
|
||||
var entity = _companyContext.SalaryAids.FirstOrDefault(x => x.id == id);
|
||||
if (entity == null)
|
||||
return new();
|
||||
var res = new EditSalaryAidViewModel()
|
||||
{
|
||||
Id = entity.id,
|
||||
WorkshopId = entity.WorkshopId,
|
||||
EmployeeId = entity.EmployeeId,
|
||||
Amount = entity.Amount.ToMoney(),
|
||||
SalaryDateTime = entity.SalaryAidDateTime.ToFarsi()
|
||||
};
|
||||
var entity = _companyContext.SalaryAids.FirstOrDefault(x => x.id == id);
|
||||
if (entity == null)
|
||||
return new();
|
||||
var res = new EditSalaryAidViewModel()
|
||||
{
|
||||
Id = entity.id,
|
||||
WorkshopId = entity.WorkshopId,
|
||||
EmployeeId = entity.EmployeeId,
|
||||
Amount = entity.Amount.ToMoney(),
|
||||
SalaryDateTime = entity.SalaryAidDateTime.ToFarsi()
|
||||
};
|
||||
|
||||
res.EmployeeFullName = _companyContext.Employees.Find(entity.EmployeeId)?.FullName;
|
||||
return res;
|
||||
}
|
||||
res.EmployeeFullName = _companyContext.Employees.Find(entity.EmployeeId)?.FullName;
|
||||
return res;
|
||||
}
|
||||
|
||||
public List<SalaryAid> GetBy(IEnumerable<long> ids)
|
||||
{
|
||||
return _companyContext.SalaryAids.Where(x => ids.Contains(x.id)).ToList();
|
||||
return _companyContext.SalaryAids.Where(x => ids.Contains(x.id)).ToList();
|
||||
}
|
||||
|
||||
#region Pooya
|
||||
|
||||
/// <summary>
|
||||
/// گروهبندی بر اساس ماه هنگام جستجو با انتخاب کارمند
|
||||
/// </summary>
|
||||
public SalaryAidsGroupedViewModel GetSearchListAsGrouped(SalaryAidSearchViewModel searchModel)
|
||||
{
|
||||
var result = new SalaryAidsGroupedViewModel();
|
||||
var query = _companyContext.SalaryAids.Where(x => x.WorkshopId == searchModel.WorkshopId);
|
||||
|
||||
var personnelCodes = _companyContext.PersonnelCodeSet
|
||||
.Where(x => x.WorkshopId == searchModel.WorkshopId).ToList();
|
||||
|
||||
var employees = _companyContext.LeftWorkList.Where(x => x.WorkshopId == searchModel.WorkshopId)
|
||||
.Include(x => x.Employee).Select(x => x.Employee).ToList();
|
||||
|
||||
var pc = new PersianCalendar();
|
||||
|
||||
if (searchModel.ShowAsGrouped)
|
||||
{
|
||||
if (searchModel.EmployeeId > 0)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.StartDate) &&
|
||||
!string.IsNullOrWhiteSpace(searchModel.EndDate))
|
||||
{
|
||||
var startDate = searchModel.StartDate.ToGeorgianDateTime();
|
||||
var endDate = searchModel.EndDate.ToGeorgianDateTime();
|
||||
query = query.Where(x => x.SalaryAidDateTime >= startDate && x.SalaryAidDateTime <= endDate);
|
||||
}
|
||||
query = query.Where(x => x.EmployeeId == searchModel.EmployeeId);
|
||||
|
||||
var list = query.ToList().Select(x => new SalaryAidViewModel
|
||||
{
|
||||
Amount = x.Amount.ToMoney(),
|
||||
AmountDouble = x.Amount,
|
||||
EmployeeFullName = employees.FirstOrDefault(e => e.id == x.EmployeeId).FullName,
|
||||
EmployeeId = x.EmployeeId,
|
||||
CreationDate = x.CreationDate.ToFarsi(),
|
||||
Id = x.id,
|
||||
MonthFa = pc.GetMonth(x.SalaryAidDateTime).ToFarsiMonthByIntNumber(),
|
||||
YearFa = pc.GetYear(x.SalaryAidDateTime).ToString(),
|
||||
PersonnelCode = personnelCodes.FirstOrDefault(p => p.EmployeeId == x.EmployeeId).PersonnelCode.ToString(),
|
||||
SalaryAidDateTimeFa = x.SalaryAidDateTime.ToFarsi(),
|
||||
SalaryAidDateTimeGe = x.SalaryAidDateTime,
|
||||
WorkshopId = x.WorkshopId
|
||||
|
||||
}).ToList();
|
||||
result.GroupedByDate = list.GroupBy(x => new { x.YearFa, x.MonthFa }).Select(x =>
|
||||
new SalaryAidGroupedByDateViewModel()
|
||||
{
|
||||
YearFa = x.Key.YearFa,
|
||||
MonthFa = x.Key.MonthFa,
|
||||
SalaryAidViewModels = x.Select(s => new SalaryAidGroupedByDateViewModelItems()
|
||||
{
|
||||
Amount = s.Amount,
|
||||
EmployeeName = s.EmployeeFullName,
|
||||
Id = s.Id,
|
||||
PersonnelCode = s.PersonnelCode,
|
||||
SalaryAidDateTimeFa = s.SalaryAidDateTimeFa
|
||||
}).ToList(),
|
||||
TotalAmount = x.Sum(s => s.AmountDouble).ToMoney()
|
||||
}).ToList();
|
||||
return result;
|
||||
}
|
||||
else if (!string.IsNullOrWhiteSpace(searchModel.StartDate) &&
|
||||
!string.IsNullOrWhiteSpace(searchModel.EndDate))
|
||||
{
|
||||
var startDate = searchModel.StartDate.ToGeorgianDateTime();
|
||||
|
||||
var endDate = searchModel.EndDate.ToGeorgianDateTime();
|
||||
|
||||
query = query.Where(x => x.SalaryAidDateTime >= startDate && x.SalaryAidDateTime <= endDate);
|
||||
|
||||
result.GroupedByEmployee = query.GroupBy(x => x.EmployeeId).ToList()
|
||||
.Select(x => new SalaryAidGroupedByEmployeeViewModel()
|
||||
{
|
||||
EmployeeId = x.Key,
|
||||
TotalAmount = x.Sum(s => s.Amount).ToMoney(),
|
||||
EmployeeName = employees.FirstOrDefault(e => e.id == x.Key).FullName,
|
||||
SalaryAidViewModels = x.Select(s => new SalaryAidGroupedByEmployeeViewModelItems()
|
||||
{
|
||||
Amount = s.Amount.ToMoney(),
|
||||
Id = s.id,
|
||||
SalaryAidDateTimeFa = s.SalaryAidDateTime.ToFarsi(),
|
||||
PersonnelCode = personnelCodes.FirstOrDefault(p => p.EmployeeId == s.EmployeeId).PersonnelCode.ToString(),
|
||||
}).ToList()
|
||||
}).ToList();
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
if (searchModel.EmployeeId > 0)
|
||||
query = query.Where(x => x.EmployeeId == searchModel.EmployeeId);
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.StartDate) && !string.IsNullOrWhiteSpace(searchModel.EndDate))
|
||||
{
|
||||
var startDate = searchModel.StartDate.ToGeorgianDateTime();
|
||||
var endDate = searchModel.EndDate.ToGeorgianDateTime();
|
||||
query = query.Where(x => x.SalaryAidDateTime >= startDate && x.SalaryAidDateTime <= endDate);
|
||||
}
|
||||
|
||||
result.SalaryAidListViewModels = query.OrderByDescending(x => x.CreationDate).Skip(searchModel.PageIndex).Take(30).ToList().Select(
|
||||
x => new SalaryAidViewModel()
|
||||
{
|
||||
Amount = x.Amount.ToMoney(),
|
||||
CreationDate = x.CreationDate.ToFarsi(),
|
||||
Id = x.id,
|
||||
EmployeeId = x.EmployeeId,
|
||||
SalaryAidDateTimeFa = x.SalaryAidDateTime.ToFarsi(),
|
||||
SalaryAidDateTimeGe = x.SalaryAidDateTime,
|
||||
WorkshopId = x.WorkshopId,
|
||||
YearFa = x.SalaryAidDateTime.ToFarsi().Substring(0, 4),
|
||||
MonthFa = x.SalaryAidDateTime.ToFarsi().Substring(5, 2),
|
||||
PersonnelCode = personnelCodes.FirstOrDefault(p => p.EmployeeId == x.EmployeeId).PersonnelCode.ToString(),
|
||||
EmployeeFullName = employees.FirstOrDefault(e => e.id == x.EmployeeId).FullName,
|
||||
AmountDouble = x.Amount,
|
||||
}).ToList();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -94,52 +94,52 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk
|
||||
//var esfandCustomizeCheckouts = _context.CustomizeCheckouts
|
||||
// .Where(x => x.WorkshopId == 170 && x.MonthInt == 12 && x.YearInt == 1403);
|
||||
|
||||
var sinzdahBedarDate = new DateTime(2025, 04, 2);
|
||||
var chahardah = sinzdahBedarDate.AddDays(1);
|
||||
//var sinzdahBedarDate = new DateTime(2025, 04, 2);
|
||||
//var chahardah = sinzdahBedarDate.AddDays(1);
|
||||
|
||||
|
||||
var workingEmp = _context.LeftWorkList.Where(x => x.WorkshopId == 170 && x.StartWorkDate <= sinzdahBedarDate && x.LeftWorkDate >= sinzdahBedarDate)
|
||||
.GroupBy(x => x.EmployeeId).Select(x=>x.Key);
|
||||
//var workingEmp = _context.LeftWorkList.Where(x => x.WorkshopId == 170 && x.StartWorkDate <= sinzdahBedarDate && x.LeftWorkDate >= sinzdahBedarDate)
|
||||
// .GroupBy(x => x.EmployeeId).Select(x=>x.Key);
|
||||
|
||||
|
||||
var employeesHaveRollCall = _context.RollCallEmployees
|
||||
.Where(x => workingEmp.Contains(x.EmployeeId) && x.WorkshopId == 170)
|
||||
.Include(x => x.EmployeesStatus)
|
||||
.Where(x => x.EmployeesStatus.Any(s => s.StartDate <= sinzdahBedarDate && s.EndDate >= sinzdahBedarDate)).Select(x=>x.EmployeeId);
|
||||
//var employeesHaveRollCall = _context.RollCallEmployees
|
||||
// .Where(x => workingEmp.Contains(x.EmployeeId) && x.WorkshopId == 170)
|
||||
// .Include(x => x.EmployeesStatus)
|
||||
// .Where(x => x.EmployeesStatus.Any(s => s.StartDate <= sinzdahBedarDate && s.EndDate >= sinzdahBedarDate)).Select(x=>x.EmployeeId);
|
||||
|
||||
|
||||
|
||||
|
||||
var employeeSettings = _context.CustomizeWorkshopEmployeeSettings
|
||||
.Where(x => x.WorkshopId == 170 &&
|
||||
employeesHaveRollCall.Any(c => c == x.EmployeeId));
|
||||
//var employeeSettings = _context.CustomizeWorkshopEmployeeSettings
|
||||
// .Where(x => x.WorkshopId == 170 &&
|
||||
// employeesHaveRollCall.Any(c => c == x.EmployeeId));
|
||||
|
||||
|
||||
var absentEmployeesInSinzdah = employeeSettings.Where(x => !_context.RollCalls
|
||||
.Any(a => a.EmployeeId == x.EmployeeId && a.ShiftDate == sinzdahBedarDate))
|
||||
.ToList();
|
||||
//var absentEmployeesInSinzdah = employeeSettings.Where(x => !_context.RollCalls
|
||||
// .Any(a => a.EmployeeId == x.EmployeeId && a.ShiftDate == sinzdahBedarDate))
|
||||
// .ToList();
|
||||
|
||||
var absentEmployeesInChahardah = employeeSettings.Where(x => !_context.RollCalls
|
||||
.Any(a => a.EmployeeId == x.EmployeeId && a.ShiftDate == chahardah))
|
||||
.ToList();
|
||||
//var absentEmployeesInChahardah = employeeSettings.Where(x => !_context.RollCalls
|
||||
// .Any(a => a.EmployeeId == x.EmployeeId && a.ShiftDate == chahardah))
|
||||
// .ToList();
|
||||
|
||||
foreach (var employeeSetting in absentEmployeesInSinzdah)
|
||||
{
|
||||
var amount = (int)employeeSetting.Salary / 30;
|
||||
var reward = new Reward(employeeSetting.EmployeeId, 170, amount, "", 0, sinzdahBedarDate,
|
||||
"بابت تعطیلی روز 13 فروردین");
|
||||
_context.Rewards.Add(reward);
|
||||
}
|
||||
//foreach (var employeeSetting in absentEmployeesInSinzdah)
|
||||
//{
|
||||
// var amount = (int)employeeSetting.Salary / 30;
|
||||
// var reward = new Reward(employeeSetting.EmployeeId, 170, amount, "", 0, sinzdahBedarDate,
|
||||
// "بابت تعطیلی روز 13 فروردین");
|
||||
// _context.Rewards.Add(reward);
|
||||
//}
|
||||
|
||||
foreach (var employeeSetting in absentEmployeesInChahardah)
|
||||
{
|
||||
var amount = (int)employeeSetting.Salary / 30;
|
||||
var reward = new Reward(employeeSetting.EmployeeId, 170, amount, "", 0, sinzdahBedarDate.AddDays(1),
|
||||
"بابت تعطیلی روز 14 فروردین");
|
||||
_context.Rewards.Add(reward);
|
||||
}
|
||||
//foreach (var employeeSetting in absentEmployeesInChahardah)
|
||||
//{
|
||||
// var amount = (int)employeeSetting.Salary / 30;
|
||||
// var reward = new Reward(employeeSetting.EmployeeId, 170, amount, "", 0, sinzdahBedarDate.AddDays(1),
|
||||
// "بابت تعطیلی روز 14 فروردین");
|
||||
// _context.Rewards.Add(reward);
|
||||
//}
|
||||
|
||||
await _context.SaveChangesAsync();
|
||||
//await _context.SaveChangesAsync();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -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>
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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 () {
|
||||
|
||||
@@ -442,6 +442,16 @@
|
||||
top: -3px;
|
||||
z-index: 4;
|
||||
}
|
||||
|
||||
.modal-dialog {
|
||||
max-width: 1140px;
|
||||
margin: 2rem auto;
|
||||
}
|
||||
|
||||
.modal-xxl {
|
||||
max-width: 1140px;
|
||||
--bs-modal-width: 1140px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="modal-body p-0 d-flex justify-content-center">
|
||||
@@ -697,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();
|
||||
@@ -708,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);
|
||||
},
|
||||
|
||||
@@ -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" />
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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);
|
||||
},
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -13,7 +13,8 @@
|
||||
|
||||
@section Styles {
|
||||
<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/table-responsive.css?ver=@clientVersion" rel="stylesheet" />
|
||||
<link href="~/assetsclient/css/table-grid.css?ver=@clientVersion" rel="stylesheet" />
|
||||
<link href="~/assetsclient/css/operation-button.css?ver=@clientVersion" rel="stylesheet" />
|
||||
<link href="~/AssetsClient/css/filter-search.css?ver=@clientVersion" rel="stylesheet" />
|
||||
<link href="~/AssetsClient/css/card.css?ver=@clientVersion" rel="stylesheet" />
|
||||
@@ -36,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>
|
||||
@@ -59,30 +60,63 @@
|
||||
<div class="search-box card">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="row search-personal-section">
|
||||
<div class="d-flex search-personal-section gap-2">
|
||||
|
||||
<div class="col-3 col-xxl-2">
|
||||
<div class="personnel-selector-navFilter">
|
||||
<select class="form-select employeeName select2OptionIndex" id="employeeSelectIndex" aria-label="انتخاب پرسنل ...">
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-2 col-xxl-1 p-0">
|
||||
|
||||
<div class="start-date-navbarFilter">
|
||||
<input type="text" class="form-control text-center form-control-date date start-date" id="start-date" placeholder="تاریخ شروع" style="direction: ltr">
|
||||
</div>
|
||||
|
||||
<div class="col-2 col-xxl-1">
|
||||
<div class="end-date-navbarFilter">
|
||||
<input type="text" class="form-control text-center form-control-date date end-date" id="end-date" placeholder="تاریخ پایان" style="direction: ltr">
|
||||
</div>
|
||||
|
||||
<button class="btn-search btn-w-size btn-search-click text-nowrap d-flex align-items-center justify-content-center me-2" 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" />
|
||||
</svg>
|
||||
</button>
|
||||
<div class="list-navbarFilter type">
|
||||
<div class="form-check form-checked selectRadioBox">
|
||||
<input type="checkbox" class="tm-selection-rad dataType" value="" id="list" autocomplete="off">
|
||||
<label class="btn btn-outline-primary d-flex gap-1 justify-content-center radio-btn" for="list">
|
||||
|
||||
<div class="btn-clear-filter btn-w-size text-nowrap d-flex align-items-center justify-content-center disable">
|
||||
<svg class="" width="24" height="24" viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
|
||||
<g clip-path="url(#clip0_4983_43834)">
|
||||
<path class="svg" d="M4 17.5C3.1716 17.5 2.5 18.1716 2.5 19C2.5 19.8284 3.1716 20.5 4 20.5H15C15.8284 20.5 16.5 19.8284 16.5 19C16.5 18.1716 15.8284 17.5 15 17.5H4ZM19.5 17.5C18.6716 17.5 18 18.1716 18 19C18 19.8284 18.6716 20.5 19.5 20.5C20.3284 20.5 21 19.8284 21 19C21 18.1716 20.3284 17.5 19.5 17.5ZM4 10.5C3.1716 10.5 2.5 11.1716 2.5 12C2.5 12.7797 3.09491 13.4204 3.85555 13.4931L4 13.5H15C15.8284 13.5 16.5 12.8284 16.5 12C16.5 11.2203 15.9051 10.5796 15.1445 10.5069L15 10.5H4ZM19.5 10.5C18.6716 10.5 18 11.1716 18 12C18 12.8284 18.6716 13.5 19.5 13.5C20.3284 13.5 21 12.8284 21 12C21 11.1716 20.3284 10.5 19.5 10.5ZM19.5 3.5C18.6716 3.5 18 4.17157 18 5C18 5.82843 18.6716 6.5 19.5 6.5C20.3284 6.5 21 5.82843 21 5C21 4.17157 20.3284 3.5 19.5 3.5ZM4 3.5C3.1716 3.5 2.5 4.17157 2.5 5C2.5 5.7797 3.09491 6.42045 3.85555 6.49313L4 6.5H15C15.8284 6.5 16.5 5.82843 16.5 5C16.5 4.2203 15.9051 3.57955 15.1445 3.50687L15 3.5H4Z" />
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_4983_43834">
|
||||
<rect width="24" height="24" fill="white" transform="matrix(-1 0 0 1 24 0)" />
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
<span>لیستی</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="group-navbarFilter type">
|
||||
<div class="form-check form-checked selectRadioBox">
|
||||
<input type="checkbox" class="tm-selection-rad dataType" value="" id="group" autocomplete="off">
|
||||
<label class="btn btn-outline-primary d-flex gap-1 justify-content-center radio-btn" for="group">
|
||||
<svg class="svg" width="24" height="24" fill="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path class="svg" d="M17 13C15.9456 13 15.0818 13.8159 15.0055 14.8507L15 15V18C15 19.0544 15.8159 19.9182 16.8507 19.9945L17 20H20C21.0544 20 21.9182 19.1841 21.9945 18.1493L22 18V15C22 13.9456 21.1841 13.0818 20.1493 13.0055L20 13H17ZM8 17C7.4477 17 7 17.4477 7 18C7 18.5128 7.38603 18.9355 7.88338 18.9933L8 19H12C12.5523 19 13 18.5523 13 18C13 17.4872 12.614 17.0645 12.1166 17.0067L12 17H8ZM4 13C3.4477 13 3 13.4477 3 14C3 14.5523 3.4477 15 4 15H12C12.5523 15 13 14.5523 13 14C13 13.4477 12.5523 13 12 13H4ZM17 3C15.8954 3 15 3.89543 15 5V8C15 9.10457 15.8954 10 17 10H20C21.1046 10 22 9.10457 22 8V5C22 3.89543 21.1046 3 20 3H17ZM8 7C7.4477 7 7 7.44772 7 8C7 8.51283 7.38603 8.93551 7.88338 8.99327L8 9H12C12.5523 9 13 8.55228 13 8C13 7.48717 12.614 7.06449 12.1166 7.00673L12 7H8ZM4 3C3.4477 3 3 3.44772 3 4C3 4.51283 3.38603 4.93551 3.88338 4.99327L4 5H12C12.5523 5 13 4.55228 13 4C13 3.48717 12.614 3.06449 12.1166 3.00673L12 3H4Z" />
|
||||
</svg>
|
||||
<span>گروهی</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-navbarFilter">
|
||||
<button class="btn-search btn-w-size btn-search-click text-nowrap d-flex align-items-center justify-content-center me-2" 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" />
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="clearSearch-navbarFilter btn-clear-filter btn-w-size text-nowrap d-flex align-items-center justify-content-center disable">
|
||||
<span>حذف جستجو</span>
|
||||
</div>
|
||||
|
||||
@@ -114,7 +148,7 @@
|
||||
</div>
|
||||
<!-- End Advance Search Box -->
|
||||
|
||||
<div class="row p-lg-2">
|
||||
<div class="row p-1 p-lg-2">
|
||||
<div class="card p-2">
|
||||
|
||||
<div class="row align-items-center">
|
||||
@@ -162,30 +196,65 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wrapper">
|
||||
<div class="fineList Rtable Rtable--collapse">
|
||||
<div class="wrapper LoadFineList" id="LoadFineList">
|
||||
<div class="fineList Rtable Rtable--collapse">
|
||||
|
||||
<div class="Rtable-row Rtable-row--head align-items-center sticky-div">
|
||||
<div class="Rtable-cell column-heading width1 d-flex align-items-center">
|
||||
@* <div class="select-all d-none d-md-flex align-items-center">
|
||||
<input type="checkbox" class="form-check-input checkAll" name="" id="checkAll2">
|
||||
</div> *@
|
||||
<label for="checkAll2">ردیف</label>
|
||||
</div>
|
||||
<div class="Rtable-cell column-heading width2">نام پرسنل</div>
|
||||
<div class="Rtable-cell column-heading width3 text-center">شماره پرسنلی</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 text-end pe-2 width7">عملیات</div>
|
||||
</div>
|
||||
<div class="Rtable-row Rtable-row--head align-items-center sticky-div">
|
||||
<div class="Rtable-cell column-heading width1 d-flex align-items-center">
|
||||
<span class="d-flex text-white align-items-center gap-1">
|
||||
<input type="checkbox" class="form-check-input checkAll" name="" id="checkAll2List">
|
||||
<label for="checkAll2List" class="prevent-select">ردیف</label>
|
||||
</span>
|
||||
</div>
|
||||
<div class="Rtable-cell column-heading width6">تاریخ</div>
|
||||
<div class="Rtable-cell column-heading width2">نام پرسنل</div>
|
||||
<div class="Rtable-cell column-heading width3 text-center">شماره پرسنلی</div>
|
||||
<div class="Rtable-cell column-heading width4">عنوان</div>
|
||||
<div class="Rtable-cell column-heading width5">مبلغ</div>
|
||||
<div class="Rtable-cell column-heading text-end pe-2 width7">عملیات</div>
|
||||
</div>
|
||||
|
||||
<div class="w-100" id="fineListAjax">
|
||||
</div>
|
||||
<div class="w-100" id="fineListAjax">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="fine-grid LoadRewardListWithEmployee d-none" id="LoadFineListWithEmployee">
|
||||
<div class="Rtable Rtable--5cols Rtable--collapse fine-grid-list">
|
||||
|
||||
<div class="Rtable-row Rtable-row--head align-items-center d-grid gap-2 grid-cols-12 sticky-div">
|
||||
<div class="d-flex col-span-2">
|
||||
<div class="Rtable-cell column-heading width1 text-center searchByBoth">سال</div>
|
||||
<div class="Rtable-cell column-heading width2 text-center searchByBoth">ماه</div>
|
||||
<div class="Rtable-cell column-heading width1 text-center" id="searchJustNameFirstTab">نام پرسنل</div>
|
||||
</div>
|
||||
<div class="d-flex col-span-8">
|
||||
<div class="Rtable-cell column-heading width3">
|
||||
<span class="d-flex justify-content-start text-white align-items-center gap-1">
|
||||
<input type="checkbox" class="form-check-input checkAll" name="" id="checkAll2Group">
|
||||
<label for="checkAll2" class="prevent-select">ردیف</label>
|
||||
</span>
|
||||
</div>
|
||||
<div class="Rtable-cell column-heading width4 groupByName" id="searchJustNameMiddleTab">نام پرسنل</div>
|
||||
<div class="Rtable-cell column-heading width3 text-center">شماره پرسنلی</div>
|
||||
<div class="Rtable-cell column-heading width4">تاریخ</div>
|
||||
<div class="Rtable-cell column-heading width4">عنوان</div>
|
||||
<div class="Rtable-cell column-heading width6">مبلغ</div>
|
||||
<div class="Rtable-cell column-heading width7 text-end pe-2">عملیات</div>
|
||||
</div>
|
||||
<div class="d-flex col-span-2">
|
||||
<div class="Rtable-cell column-heading width1 text-center">مجموع مبالغ</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="w-100 personal-paid-leave-scroll" id="fineEmployeesList">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -218,11 +287,41 @@
|
||||
<input type="text" class="form-control text-center form-control-date date start-date" id="start-date-mobile" placeholder="تاریخ شروع" style="direction: ltr">
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<input type="text" class="form-control text-center form-control-date date end-date" id="end-date-mobile" placeholder="تاریخ پایان" style="direction: ltr">
|
||||
<div class="col-12">
|
||||
<input type="text" class="form-control text-center form-control-date date end-date" id="end-date-mobile" placeholder="تاریخ پایان" style="direction: ltr">
|
||||
</div>
|
||||
|
||||
<div class="col-12 d-flex justify-content-between gap-1">
|
||||
<div class="list-navbarFilter type w-50">
|
||||
<div class="form-check form-checked selectRadioBox">
|
||||
<input type="checkbox" class="tm-selection-rad" value="true" id="listMobile" autocomplete="off">
|
||||
<label class="btn btn-outline-primary d-flex gap-1 justify-content-center radio-btn" for="listMobile">
|
||||
<svg class="" width="24" height="24" viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
|
||||
<g clip-path="url(#clip0_4983_43834)">
|
||||
<path class="svg" d="M4 17.5C3.1716 17.5 2.5 18.1716 2.5 19C2.5 19.8284 3.1716 20.5 4 20.5H15C15.8284 20.5 16.5 19.8284 16.5 19C16.5 18.1716 15.8284 17.5 15 17.5H4ZM19.5 17.5C18.6716 17.5 18 18.1716 18 19C18 19.8284 18.6716 20.5 19.5 20.5C20.3284 20.5 21 19.8284 21 19C21 18.1716 20.3284 17.5 19.5 17.5ZM4 10.5C3.1716 10.5 2.5 11.1716 2.5 12C2.5 12.7797 3.09491 13.4204 3.85555 13.4931L4 13.5H15C15.8284 13.5 16.5 12.8284 16.5 12C16.5 11.2203 15.9051 10.5796 15.1445 10.5069L15 10.5H4ZM19.5 10.5C18.6716 10.5 18 11.1716 18 12C18 12.8284 18.6716 13.5 19.5 13.5C20.3284 13.5 21 12.8284 21 12C21 11.1716 20.3284 10.5 19.5 10.5ZM19.5 3.5C18.6716 3.5 18 4.17157 18 5C18 5.82843 18.6716 6.5 19.5 6.5C20.3284 6.5 21 5.82843 21 5C21 4.17157 20.3284 3.5 19.5 3.5ZM4 3.5C3.1716 3.5 2.5 4.17157 2.5 5C2.5 5.7797 3.09491 6.42045 3.85555 6.49313L4 6.5H15C15.8284 6.5 16.5 5.82843 16.5 5C16.5 4.2203 15.9051 3.57955 15.1445 3.50687L15 3.5H4Z" />
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_4983_43834">
|
||||
<rect width="24" height="24" fill="white" transform="matrix(-1 0 0 1 24 0)" />
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
<span>لیستی</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-check form-checked selectRadioBox w-50">
|
||||
<input type="checkbox" class="tm-selection-rad" name="Command.isGroup" value="true" id="groupMobile" autocomplete="off">
|
||||
<label class="btn btn-outline-primary d-flex gap-1 justify-content-center radio-btn" for="groupMobile">
|
||||
<svg class="svg" width="24" height="24" fill="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path class="svg" d="M17 13C15.9456 13 15.0818 13.8159 15.0055 14.8507L15 15V18C15 19.0544 15.8159 19.9182 16.8507 19.9945L17 20H20C21.0544 20 21.9182 19.1841 21.9945 18.1493L22 18V15C22 13.9456 21.1841 13.0818 20.1493 13.0055L20 13H17ZM8 17C7.4477 17 7 17.4477 7 18C7 18.5128 7.38603 18.9355 7.88338 18.9933L8 19H12C12.5523 19 13 18.5523 13 18C13 17.4872 12.614 17.0645 12.1166 17.0067L12 17H8ZM4 13C3.4477 13 3 13.4477 3 14C3 14.5523 3.4477 15 4 15H12C12.5523 15 13 14.5523 13 14C13 13.4477 12.5523 13 12 13H4ZM17 3C15.8954 3 15 3.89543 15 5V8C15 9.10457 15.8954 10 17 10H20C21.1046 10 22 9.10457 22 8V5C22 3.89543 21.1046 3 20 3H17ZM8 7C7.4477 7 7 7.44772 7 8C7 8.51283 7.38603 8.93551 7.88338 8.99327L8 9H12C12.5523 9 13 8.55228 13 8C13 7.48717 12.614 7.06449 12.1166 7.00673L12 7H8ZM4 3C3.4477 3 3 3.44772 3 4C3 4.51283 3.38603 4.93551 3.88338 4.99327L4 5H12C12.5523 5 13 4.55228 13 4C13 3.48717 12.614 3.06449 12.1166 3.00673L12 3H4Z" />
|
||||
</svg>
|
||||
<span>گروهی</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<div class="col-12">
|
||||
<div class="btn-clear-filter disable py-2 text-center d-block w-100 mt-2">
|
||||
<span class="w-100">حذف جستجو</span>
|
||||
</div>
|
||||
@@ -266,10 +365,10 @@
|
||||
<script src="~/assetsclient/libs/cleave/cleave.min.js"></script>
|
||||
<script>
|
||||
var antiForgeryToken = $(`@Html.AntiForgeryToken()`).val();
|
||||
var fineListLoadDataAjax = `@Url.Page("./Index", "LoadDataAjax")`;
|
||||
// var fineListLoadDataAjax = `@Url.Page("./Index", "LoadDataAjax")`;
|
||||
var fineGroupLoadDataAjax = `@Url.Page("./Index", "Search")`;
|
||||
var employeeListAjax = `@Url.Page("./Index", "EmployeeList")`;
|
||||
var removeFineAjax = `@Url.Page("./Index", "Remove")`;
|
||||
|
||||
var editPermission = @(AuthHelper.GetPermissions().Contains(SubAccountPermissionHelper.EditFinePermissionCode) ? "true" : "false");
|
||||
var deletePermission = @(AuthHelper.GetPermissions().Contains(SubAccountPermissionHelper.DeleteFinePermissionCode) ? "true" : "false");
|
||||
</script>
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
using System.Security.Claims;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Infrastructure;
|
||||
using AccountManagement.Application.Contracts.SubAccount;
|
||||
using CompanyManagment.App.Contracts.Employee;
|
||||
using CompanyManagment.App.Contracts.Error;
|
||||
using CompanyManagment.App.Contracts.Fine;
|
||||
using CompanyManagment.App.Contracts.FineSubject;
|
||||
using CompanyManagment.App.Contracts.Reward;
|
||||
using CompanyManagment.App.Contracts.Workshop;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
@@ -24,59 +22,38 @@ namespace ServiceHost.Areas.Client.Pages.Company.Fine
|
||||
private readonly IFineSubjectApplication _fineSubjectApplication;
|
||||
private readonly IEmployeeApplication _employeeApplication;
|
||||
private readonly IAuthHelper _authHelper;
|
||||
private readonly ISubAccountApplication _subAccountApplication;
|
||||
|
||||
private readonly long _workshopId;
|
||||
public string WorkshopFullName;
|
||||
public int PageIndex = 0;
|
||||
|
||||
public IndexModel(IFineApplication fineApplication, IWorkshopApplication workshopApplication, IPasswordHasher passwordHasher, IFineSubjectApplication fineSubjectApplication, IEmployeeApplication employeeApplication, IAuthHelper authHelper, ISubAccountApplication subAccountApplication)
|
||||
public IndexModel(IFineApplication fineApplication, IWorkshopApplication workshopApplication,
|
||||
IPasswordHasher passwordHasher, IFineSubjectApplication fineSubjectApplication,
|
||||
IEmployeeApplication employeeApplication, IAuthHelper authHelper)
|
||||
{
|
||||
_fineApplication = fineApplication;
|
||||
_workshopApplication = workshopApplication;
|
||||
_passwordHasher = passwordHasher;
|
||||
_fineSubjectApplication = fineSubjectApplication;
|
||||
_employeeApplication = employeeApplication;
|
||||
_authHelper = authHelper;
|
||||
_subAccountApplication = subAccountApplication;
|
||||
_authHelper = authHelper;
|
||||
|
||||
var workshopHash = _authHelper.GetWorkshopSlug();
|
||||
_workshopId = _passwordHasher.SlugDecrypt(workshopHash);
|
||||
|
||||
if (_workshopId < 1)
|
||||
throw new InvalidDataException("اختلال در کارگاه");
|
||||
}
|
||||
|
||||
public IActionResult OnGet()
|
||||
{
|
||||
var workshopHash = User.FindFirstValue("WorkshopSlug");
|
||||
var workshopId = _passwordHasher.SlugDecrypt(workshopHash);
|
||||
|
||||
if (workshopId <= 0)
|
||||
return BadRequest();
|
||||
|
||||
WorkshopFullName = _authHelper.GetWorkshopName();
|
||||
WorkshopFullName = _authHelper.GetWorkshopName();
|
||||
|
||||
return Page();
|
||||
}
|
||||
|
||||
public IActionResult OnGetLoadDataAjax(FineSearchViewModel searchViewModel)
|
||||
{
|
||||
var subAccId = _authHelper.CurrentSubAccountId();
|
||||
if (subAccId > 0)
|
||||
{
|
||||
var subAccountViewModel = _subAccountApplication.GetDetails(subAccId);
|
||||
if (subAccountViewModel.SubAccountRoleId == 2)
|
||||
{
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = true,
|
||||
data = new List<FineViewModel>(),
|
||||
pageIndex = 0,
|
||||
});
|
||||
}
|
||||
}
|
||||
var workshopHash = User.FindFirstValue("WorkshopSlug");
|
||||
var workshopId = _passwordHasher.SlugDecrypt(workshopHash);
|
||||
|
||||
if (workshopId <= 0)
|
||||
return BadRequest();
|
||||
|
||||
searchViewModel.WorkshopId = workshopId;
|
||||
|
||||
searchViewModel.WorkshopId = _workshopId;
|
||||
var result = _fineApplication.GetSearchList(searchViewModel);
|
||||
return new JsonResult(new
|
||||
{
|
||||
@@ -86,21 +63,21 @@ namespace ServiceHost.Areas.Client.Pages.Company.Fine
|
||||
});
|
||||
}
|
||||
|
||||
public IActionResult OnGetEmployeeList()
|
||||
public IActionResult OnGetLoadDataByEmployeeAjax(FineSearchViewModel searchViewModel)
|
||||
{
|
||||
var workshopHash = User.FindFirstValue("WorkshopSlug");
|
||||
var workshopId = _passwordHasher.SlugDecrypt(workshopHash);
|
||||
if (workshopId <= 0)
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = false,
|
||||
message = "کارگاه ای یافت نشد",
|
||||
});
|
||||
|
||||
|
||||
var employees = _employeeApplication.GetWorkingEmployeesByWorkshopId(workshopId);
|
||||
searchViewModel.WorkshopId = _workshopId;
|
||||
|
||||
var result = _fineApplication.GetSearchListAsGrouped(searchViewModel);
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = true,
|
||||
data = result,
|
||||
});
|
||||
}
|
||||
|
||||
public async Task<IActionResult> OnGetEmployeeList()
|
||||
{
|
||||
var employees = await _employeeApplication.WorkedEmployeesInWorkshopSelectList(_workshopId);
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
@@ -111,33 +88,13 @@ namespace ServiceHost.Areas.Client.Pages.Company.Fine
|
||||
|
||||
public IActionResult OnGetCreate()
|
||||
{
|
||||
var workshopHash = User.FindFirstValue("WorkshopSlug");
|
||||
var workshopId = _passwordHasher.SlugDecrypt(workshopHash);
|
||||
if (workshopId <= 0)
|
||||
{
|
||||
var resultError = new ErrorViewModel()
|
||||
{
|
||||
Message = "کارگاه شما یافت نشد"
|
||||
};
|
||||
return Partial("../Error/_ErrorModal", resultError);
|
||||
}
|
||||
|
||||
var command = new CreateFineViewModel();
|
||||
return Partial("ModalCreateNewFine", command);
|
||||
}
|
||||
|
||||
public IActionResult OnPostCreate(CreateFineViewModel command)
|
||||
{
|
||||
var workshopHash = User.FindFirstValue("WorkshopSlug");
|
||||
var workshopId = _passwordHasher.SlugDecrypt(workshopHash);
|
||||
if (workshopId <= 0)
|
||||
return new JsonResult(new
|
||||
{
|
||||
IsSuccedded = false,
|
||||
message = "کارگاه ای یافت نشد",
|
||||
});
|
||||
|
||||
command.WorkshopId = workshopId;
|
||||
command.WorkshopId = _workshopId;
|
||||
var result = _fineApplication.Create(command);
|
||||
|
||||
return new JsonResult(new
|
||||
@@ -149,34 +106,13 @@ namespace ServiceHost.Areas.Client.Pages.Company.Fine
|
||||
|
||||
public IActionResult OnGetEdit(long id)
|
||||
{
|
||||
var workshopHash = User.FindFirstValue("WorkshopSlug");
|
||||
var workshopId = _passwordHasher.SlugDecrypt(workshopHash);
|
||||
if (workshopId <= 0)
|
||||
{
|
||||
var resultError = new ErrorViewModel()
|
||||
{
|
||||
Message = "کارگاه شما یافت نشد"
|
||||
};
|
||||
return Partial("../Error/_ErrorModal", resultError);
|
||||
}
|
||||
|
||||
var command = _fineApplication.GetDetails(id);
|
||||
|
||||
return Partial("ModalEditFine", command);
|
||||
}
|
||||
|
||||
public IActionResult OnPostEdit(EditFineViewModel command)
|
||||
{
|
||||
var workshopHash = User.FindFirstValue("WorkshopSlug");
|
||||
var workshopId = _passwordHasher.SlugDecrypt(workshopHash);
|
||||
if (workshopId <= 0)
|
||||
return new JsonResult(new
|
||||
{
|
||||
IsSuccedded = false,
|
||||
message = "کارگاه ای یافت نشد",
|
||||
});
|
||||
|
||||
command.WorkshopId = workshopId;
|
||||
command.WorkshopId = _workshopId;
|
||||
var result = _fineApplication.Edit(command);
|
||||
|
||||
return new JsonResult(new
|
||||
@@ -200,12 +136,7 @@ namespace ServiceHost.Areas.Client.Pages.Company.Fine
|
||||
|
||||
public IActionResult OnPostCreateFineSubject(CreateFineSubjectViewModel command)
|
||||
{
|
||||
var workshopHash = User.FindFirstValue("WorkshopSlug");
|
||||
var workshopId = _passwordHasher.SlugDecrypt(workshopHash);
|
||||
if (workshopId <= 0)
|
||||
return BadRequest();
|
||||
|
||||
command.WorkshopId = workshopId;
|
||||
command.WorkshopId = _workshopId;
|
||||
|
||||
var result = _fineSubjectApplication.Create(command);
|
||||
return new JsonResult(new
|
||||
@@ -218,12 +149,7 @@ namespace ServiceHost.Areas.Client.Pages.Company.Fine
|
||||
//برای ویرایش عنوان دلبخواه
|
||||
public IActionResult OnPostEditFineSubject(EditFineSubjectViewModel command)
|
||||
{
|
||||
var workshopHash = User.FindFirstValue("WorkshopSlug");
|
||||
var workshopId = _passwordHasher.SlugDecrypt(workshopHash);
|
||||
if (workshopId <= 0)
|
||||
return BadRequest();
|
||||
|
||||
command.WorkshopId = workshopId;
|
||||
command.WorkshopId = _workshopId;
|
||||
|
||||
var result = _fineSubjectApplication.Edit(command);
|
||||
return new JsonResult(new
|
||||
@@ -247,13 +173,7 @@ namespace ServiceHost.Areas.Client.Pages.Company.Fine
|
||||
|
||||
public IActionResult OnGetSearchFineSubject()
|
||||
{
|
||||
var workshopHash = User.FindFirstValue("WorkshopSlug");
|
||||
var workshopId = _passwordHasher.SlugDecrypt(workshopHash);
|
||||
|
||||
if (workshopId <= 0)
|
||||
return BadRequest();
|
||||
|
||||
var list = _fineSubjectApplication.GetAll(workshopId);
|
||||
var list = _fineSubjectApplication.GetAll(_workshopId);
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
@@ -263,5 +183,15 @@ namespace ServiceHost.Areas.Client.Pages.Company.Fine
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public IActionResult OnGetSearch(FineSearchViewModel searchModel)
|
||||
{
|
||||
searchModel.WorkshopId = _workshopId;
|
||||
var result = _fineApplication.GetSearchListAsGrouped(searchModel);
|
||||
return new JsonResult(new
|
||||
{
|
||||
data = result
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -13,7 +13,8 @@
|
||||
|
||||
@section Styles {
|
||||
<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/table-responsive.css?ver=@clientVersion" rel="stylesheet" />
|
||||
<link href="~/assetsclient/css/table-grid.css?ver=@clientVersion" rel="stylesheet" />
|
||||
<link href="~/assetsclient/css/operation-button.css?ver=@clientVersion" rel="stylesheet" />
|
||||
<link href="~/AssetsClient/css/filter-search.css?ver=@clientVersion" rel="stylesheet" />
|
||||
<link href="~/AssetsClient/css/card.css?ver=@clientVersion" rel="stylesheet" />
|
||||
@@ -35,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>
|
||||
@@ -56,23 +57,55 @@
|
||||
<div class="container-fluid d-none d-md-block">
|
||||
<div class="row px-2">
|
||||
<div class="search-box card">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="row search-personal-section">
|
||||
<div class="d-flex">
|
||||
<div class="search-personal-section d-flex align-items-center w-100 gap-2">
|
||||
|
||||
<div class="col-3 col-xxl-2">
|
||||
<select class="form-select employeeName select2OptionIndex" id="employeeSelectIndex" aria-label="انتخاب پرسنل ...">
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-2 col-xxl-1 p-0">
|
||||
<input type="text" class="form-control text-center form-control-date date start-date" id="start-date" placeholder="تاریخ شروع" style="direction: ltr">
|
||||
</div>
|
||||
<div class="personnel-selector-navFilter p-0">
|
||||
<select class="form-select employeeName select2OptionIndex" id="employeeSelectIndex" aria-label="انتخاب پرسنل ...">
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-2 col-xxl-1">
|
||||
<input type="text" class="form-control text-center form-control-date date end-date" id="end-date" placeholder="تاریخ پایان" style="direction: ltr">
|
||||
</div>
|
||||
<div class="start-date-navbarFilter p-0">
|
||||
<input type="text" class="form-control text-center form-control-date date start-date" id="start-date" placeholder="تاریخ شروع" style="direction: ltr">
|
||||
</div>
|
||||
|
||||
<div class="end-date-navbarFilter p-0">
|
||||
<input type="text" class="form-control text-center form-control-date date end-date" id="end-date" placeholder="تاریخ پایان" style="direction: ltr">
|
||||
</div>
|
||||
|
||||
<div class="list-navbarFilter type p-0">
|
||||
<div class="form-check form-checked selectRadioBox">
|
||||
<input type="checkbox" class="tm-selection-rad dataType" value="" id="list" autocomplete="off">
|
||||
<label class="btn btn-outline-primary d-flex gap-1 justify-content-center radio-btn" for="list">
|
||||
|
||||
<svg class="" width="24" height="24" viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
|
||||
<g clip-path="url(#clip0_4983_43834)">
|
||||
<path class="svg" d="M4 17.5C3.1716 17.5 2.5 18.1716 2.5 19C2.5 19.8284 3.1716 20.5 4 20.5H15C15.8284 20.5 16.5 19.8284 16.5 19C16.5 18.1716 15.8284 17.5 15 17.5H4ZM19.5 17.5C18.6716 17.5 18 18.1716 18 19C18 19.8284 18.6716 20.5 19.5 20.5C20.3284 20.5 21 19.8284 21 19C21 18.1716 20.3284 17.5 19.5 17.5ZM4 10.5C3.1716 10.5 2.5 11.1716 2.5 12C2.5 12.7797 3.09491 13.4204 3.85555 13.4931L4 13.5H15C15.8284 13.5 16.5 12.8284 16.5 12C16.5 11.2203 15.9051 10.5796 15.1445 10.5069L15 10.5H4ZM19.5 10.5C18.6716 10.5 18 11.1716 18 12C18 12.8284 18.6716 13.5 19.5 13.5C20.3284 13.5 21 12.8284 21 12C21 11.1716 20.3284 10.5 19.5 10.5ZM19.5 3.5C18.6716 3.5 18 4.17157 18 5C18 5.82843 18.6716 6.5 19.5 6.5C20.3284 6.5 21 5.82843 21 5C21 4.17157 20.3284 3.5 19.5 3.5ZM4 3.5C3.1716 3.5 2.5 4.17157 2.5 5C2.5 5.7797 3.09491 6.42045 3.85555 6.49313L4 6.5H15C15.8284 6.5 16.5 5.82843 16.5 5C16.5 4.2203 15.9051 3.57955 15.1445 3.50687L15 3.5H4Z" />
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_4983_43834">
|
||||
<rect width="24" height="24" fill="white" transform="matrix(-1 0 0 1 24 0)" />
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
<span>لیستی</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="group-navbarFilter type p-0">
|
||||
<div class="form-check form-checked selectRadioBox">
|
||||
<input type="checkbox" class="tm-selection-rad dataType" value="" id="group" autocomplete="off">
|
||||
<label class="btn btn-outline-primary d-flex gap-1 justify-content-center radio-btn" for="group">
|
||||
<svg class="svg" width="24" height="24" fill="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path class="svg" d="M17 13C15.9456 13 15.0818 13.8159 15.0055 14.8507L15 15V18C15 19.0544 15.8159 19.9182 16.8507 19.9945L17 20H20C21.0544 20 21.9182 19.1841 21.9945 18.1493L22 18V15C22 13.9456 21.1841 13.0818 20.1493 13.0055L20 13H17ZM8 17C7.4477 17 7 17.4477 7 18C7 18.5128 7.38603 18.9355 7.88338 18.9933L8 19H12C12.5523 19 13 18.5523 13 18C13 17.4872 12.614 17.0645 12.1166 17.0067L12 17H8ZM4 13C3.4477 13 3 13.4477 3 14C3 14.5523 3.4477 15 4 15H12C12.5523 15 13 14.5523 13 14C13 13.4477 12.5523 13 12 13H4ZM17 3C15.8954 3 15 3.89543 15 5V8C15 9.10457 15.8954 10 17 10H20C21.1046 10 22 9.10457 22 8V5C22 3.89543 21.1046 3 20 3H17ZM8 7C7.4477 7 7 7.44772 7 8C7 8.51283 7.38603 8.93551 7.88338 8.99327L8 9H12C12.5523 9 13 8.55228 13 8C13 7.48717 12.614 7.06449 12.1166 7.00673L12 7H8ZM4 3C3.4477 3 3 3.44772 3 4C3 4.51283 3.38603 4.93551 3.88338 4.99327L4 5H12C12.5523 5 13 4.55228 13 4C13 3.48717 12.614 3.06449 12.1166 3.00673L12 3H4Z" />
|
||||
</svg>
|
||||
<span>گروهی</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-navbarFilter p-0">
|
||||
<button class="btn-search btn-w-size btn-search-click text-nowrap d-flex align-items-center justify-content-center me-2" 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">
|
||||
@@ -80,12 +113,12 @@
|
||||
<path d="M20 20L17 17" stroke="white" stroke-linecap="round" />
|
||||
</svg>
|
||||
</button>
|
||||
|
||||
<div class="btn-clear-filter btn-w-size text-nowrap d-flex align-items-center justify-content-center disable">
|
||||
<span>حذف جستجو</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="clearSearch-navbarFilter btn-clear-filter btn-w-size text-nowrap d-flex align-items-center justify-content-center disable">
|
||||
<span>حذف جستجو</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -113,7 +146,7 @@
|
||||
</div>
|
||||
<!-- End Advance Search Box -->
|
||||
|
||||
<div class="row p-lg-2">
|
||||
<div class="row p-1 p-lg-2">
|
||||
<div class="card p-2">
|
||||
|
||||
<div class="row align-items-center">
|
||||
@@ -161,31 +194,69 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wrapper">
|
||||
<div class="loanList Rtable Rtable--collapse">
|
||||
<div class="wrapper LoadLoanList" id="LoadLoanList">
|
||||
<div class="loanList Rtable Rtable--collapse">
|
||||
|
||||
<div class="Rtable-row Rtable-row--head align-items-center sticky-div">
|
||||
<div class="Rtable-cell column-heading width1 d-flex align-items-center">
|
||||
@* <div class="select-all d-none d-md-flex align-items-center">
|
||||
<div class="Rtable-row Rtable-row--head align-items-center sticky-div">
|
||||
<div class="Rtable-cell column-heading width1 d-flex align-items-center">
|
||||
@* <div class="select-all d-none d-md-flex align-items-center">
|
||||
<input type="checkbox" class="form-check-input checkAll" name="" id="checkAll2">
|
||||
</div> *@
|
||||
<label for="checkAll2">ردیف</label>
|
||||
</div>
|
||||
<div class="Rtable-cell column-heading width2">نام پرسنل</div>
|
||||
<div class="Rtable-cell column-heading text-center 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 text-center width7">تعداد قسط</div>
|
||||
<div class="Rtable-cell column-heading text-end pe-2 width8">عملیات</div>
|
||||
</div>
|
||||
<label for="checkAll2">ردیف</label>
|
||||
</div>
|
||||
<div class="Rtable-cell column-heading width6">تاریخ شروع وام</div>
|
||||
<div class="Rtable-cell column-heading width2">نام پرسنل</div>
|
||||
<div class="Rtable-cell column-heading text-center width3">شماره پرسنلی</div>
|
||||
<div class="Rtable-cell column-heading width4">مبلغ</div>
|
||||
<div class="Rtable-cell column-heading width5">مبلغ هر ماه</div>
|
||||
<div class="Rtable-cell column-heading text-center width7">تعداد قسط</div>
|
||||
<div class="Rtable-cell column-heading text-end pe-2 width8">عملیات</div>
|
||||
</div>
|
||||
|
||||
<div class="w-100" id="loanListAjax">
|
||||
</div>
|
||||
<div class="table-list w-100" id="loanListAjax">
|
||||
<div></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="loan-grid LoadloanListWithEmployee d-none" id="LoadloanListWithEmployee">
|
||||
<div class="Rtable Rtable--5cols Rtable--collapse loan-grid-list">
|
||||
|
||||
<div class="Rtable-row Rtable-row--head align-items-center d-grid gap-2 grid-cols-12 sticky-div">
|
||||
<div class="d-flex col-span-2">
|
||||
<div class="Rtable-cell column-heading width1 searchByBoth text-center">سال</div>
|
||||
<div class="Rtable-cell column-heading width2 searchByBoth text-center">ماه</div>
|
||||
<div class="Rtable-cell column-heading width1 text-center" id="searchJustNameFirstTab">نام پرسنل</div>
|
||||
</div>
|
||||
<div class="d-flex col-span-8">
|
||||
<div class="Rtable-cell column-heading width4">
|
||||
<span class="d-flex justify-content-start text-white align-items-center gap-1">
|
||||
<input type="checkbox" class="form-check-input checkAll" name="" id="checkAll2Group">
|
||||
<label for="checkAll2" class="prevent-select">ردیف</label>
|
||||
</span>
|
||||
</div>
|
||||
<div class="Rtable-cell column-heading width3 groupByName" id="searchJustNameMiddleTab">نام پرسنل</div>
|
||||
<div class="Rtable-cell column-heading width4">تاریخ شروع وام</div>
|
||||
<div class="Rtable-cell column-heading width4 text-center">شماره پرسنلی</div>
|
||||
<div class="Rtable-cell column-heading width3 ">مبلغ</div>
|
||||
<div class="Rtable-cell column-heading width4">مبلغ هر ماه</div>
|
||||
<div class="Rtable-cell column-heading width4 text-center">تعداد قسط</div>
|
||||
<div class="Rtable-cell column-heading width7 text-end pe-2">عملیات</div>
|
||||
</div>
|
||||
<div class="d-flex col-span-2">
|
||||
<div class="Rtable-cell column-heading width1 text-center">مجموع مبالغ</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="w-100 personal-paid-leave-scroll" id="loanEmployeesList">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -218,11 +289,41 @@
|
||||
<input type="text" class="form-control text-center form-control-date date start-date" id="start-date-mobile" placeholder="تاریخ شروع" style="direction: ltr">
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<input type="text" class="form-control text-center form-control-date date end-date" id="end-date-mobile" placeholder="تاریخ پایان" style="direction: ltr">
|
||||
<div class="col-12">
|
||||
<input type="text" class="form-control text-center form-control-date date end-date" id="end-date-mobile" placeholder="تاریخ پایان" style="direction: ltr">
|
||||
</div>
|
||||
|
||||
<div class="col-12 d-flex justify-content-between gap-1">
|
||||
<div class="list-navbarFilter type w-50">
|
||||
<div class="form-check form-checked selectRadioBox">
|
||||
<input type="checkbox" class="tm-selection-rad" value="true" id="listMobile" autocomplete="off">
|
||||
<label class="btn btn-outline-primary d-flex gap-1 justify-content-center radio-btn" for="listMobile">
|
||||
<svg class="" width="24" height="24" viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
|
||||
<g clip-path="url(#clip0_4983_43834)">
|
||||
<path class="svg" d="M4 17.5C3.1716 17.5 2.5 18.1716 2.5 19C2.5 19.8284 3.1716 20.5 4 20.5H15C15.8284 20.5 16.5 19.8284 16.5 19C16.5 18.1716 15.8284 17.5 15 17.5H4ZM19.5 17.5C18.6716 17.5 18 18.1716 18 19C18 19.8284 18.6716 20.5 19.5 20.5C20.3284 20.5 21 19.8284 21 19C21 18.1716 20.3284 17.5 19.5 17.5ZM4 10.5C3.1716 10.5 2.5 11.1716 2.5 12C2.5 12.7797 3.09491 13.4204 3.85555 13.4931L4 13.5H15C15.8284 13.5 16.5 12.8284 16.5 12C16.5 11.2203 15.9051 10.5796 15.1445 10.5069L15 10.5H4ZM19.5 10.5C18.6716 10.5 18 11.1716 18 12C18 12.8284 18.6716 13.5 19.5 13.5C20.3284 13.5 21 12.8284 21 12C21 11.1716 20.3284 10.5 19.5 10.5ZM19.5 3.5C18.6716 3.5 18 4.17157 18 5C18 5.82843 18.6716 6.5 19.5 6.5C20.3284 6.5 21 5.82843 21 5C21 4.17157 20.3284 3.5 19.5 3.5ZM4 3.5C3.1716 3.5 2.5 4.17157 2.5 5C2.5 5.7797 3.09491 6.42045 3.85555 6.49313L4 6.5H15C15.8284 6.5 16.5 5.82843 16.5 5C16.5 4.2203 15.9051 3.57955 15.1445 3.50687L15 3.5H4Z" />
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_4983_43834">
|
||||
<rect width="24" height="24" fill="white" transform="matrix(-1 0 0 1 24 0)" />
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
<span>لیستی</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-check form-checked selectRadioBox w-50">
|
||||
<input type="checkbox" class="tm-selection-rad" name="Command.isGroup" value="true" id="groupMobile" autocomplete="off">
|
||||
<label class="btn btn-outline-primary d-flex gap-1 justify-content-center radio-btn" for="groupMobile">
|
||||
<svg class="svg" width="24" height="24" fill="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path class="svg" d="M17 13C15.9456 13 15.0818 13.8159 15.0055 14.8507L15 15V18C15 19.0544 15.8159 19.9182 16.8507 19.9945L17 20H20C21.0544 20 21.9182 19.1841 21.9945 18.1493L22 18V15C22 13.9456 21.1841 13.0818 20.1493 13.0055L20 13H17ZM8 17C7.4477 17 7 17.4477 7 18C7 18.5128 7.38603 18.9355 7.88338 18.9933L8 19H12C12.5523 19 13 18.5523 13 18C13 17.4872 12.614 17.0645 12.1166 17.0067L12 17H8ZM4 13C3.4477 13 3 13.4477 3 14C3 14.5523 3.4477 15 4 15H12C12.5523 15 13 14.5523 13 14C13 13.4477 12.5523 13 12 13H4ZM17 3C15.8954 3 15 3.89543 15 5V8C15 9.10457 15.8954 10 17 10H20C21.1046 10 22 9.10457 22 8V5C22 3.89543 21.1046 3 20 3H17ZM8 7C7.4477 7 7 7.44772 7 8C7 8.51283 7.38603 8.93551 7.88338 8.99327L8 9H12C12.5523 9 13 8.55228 13 8C13 7.48717 12.614 7.06449 12.1166 7.00673L12 7H8ZM4 3C3.4477 3 3 3.44772 3 4C3 4.51283 3.38603 4.93551 3.88338 4.99327L4 5H12C12.5523 5 13 4.55228 13 4C13 3.48717 12.614 3.06449 12.1166 3.00673L12 3H4Z" />
|
||||
</svg>
|
||||
<span>گروهی</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<div class="col-12">
|
||||
<div class="btn-clear-filter disable py-2 text-center d-block w-100 mt-2">
|
||||
<span class="w-100">حذف جستجو</span>
|
||||
</div>
|
||||
@@ -266,11 +367,14 @@
|
||||
<script src="~/assetsclient/libs/cleave/cleave.min.js"></script>
|
||||
<script>
|
||||
var antiForgeryToken = $(`@Html.AntiForgeryToken()`).val();
|
||||
var loanListLoadDataAjax = `@Url.Page("./Index", "LoadDataAjax")`;
|
||||
// var loanListLoadDataAjax = `@Url.Page("./Index", "LoadDataAjax")`;
|
||||
var loanGroupLoadDataAjax = `@Url.Page("./Index", "Search")`;
|
||||
var removeLoanAjax = `@Url.Page("./Index", "Remove")`;
|
||||
var employeeListAjax = `@Url.Page("./Index", "EmployeeList")`;
|
||||
|
||||
var modalDetailLoanAjax = `@Url.Page("./Index", "Detail")`;
|
||||
var deletePermission = @(AuthHelper.GetPermissions().Contains(SubAccountPermissionHelper.DeleteLoanPermissionCode) ? "true" : "false");
|
||||
// TODO: Mr.Farokhi, Please set the permission for loan details.
|
||||
var detailsPermission = true;
|
||||
</script>
|
||||
<script src="~/assetsclient/pages/loan/js/index.js?ver=@clientVersion"></script>
|
||||
}
|
||||
|
||||
@@ -11,8 +11,6 @@ using CompanyManagment.App.Contracts.Error;
|
||||
using CompanyManagment.App.Contracts.Loan;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using static Microsoft.EntityFrameworkCore.DbLoggerCategory.Database;
|
||||
using AccountManagement.Application.Contracts.SubAccount;
|
||||
using CompanyManagment.App.Contracts.Reward;
|
||||
|
||||
namespace ServiceHost.Areas.Client.Pages.Company.Loan
|
||||
{
|
||||
@@ -24,20 +22,26 @@ namespace ServiceHost.Areas.Client.Pages.Company.Loan
|
||||
private readonly IWorkshopApplication _workshopApplication;
|
||||
private readonly ILoanApplication _loanApplication;
|
||||
private readonly IEmployeeApplication _employeeApplication;
|
||||
private readonly IAuthHelper _authHelper;
|
||||
private readonly ISubAccountApplication _subAccountApplication;
|
||||
private readonly IHttpContextAccessor _contextAccessor;
|
||||
private readonly long _workshopId;
|
||||
|
||||
|
||||
|
||||
public string WorkshopFullName;
|
||||
public int PageIndex = 0;
|
||||
private IAuthHelper _authHelper;
|
||||
|
||||
public IndexModel(IWorkshopApplication workshopApplication, IPasswordHasher passwordHasher, ILoanApplication loanApplication, IEmployeeApplication employeeApplication, IAuthHelper authHelper, ISubAccountApplication subAccountApplication)
|
||||
public IndexModel(IHttpContextAccessor contextAccessor,IWorkshopApplication workshopApplication, IPasswordHasher passwordHasher, ILoanApplication loanApplication, IEmployeeApplication employeeApplication, IAuthHelper authHelper)
|
||||
{
|
||||
_workshopApplication = workshopApplication;
|
||||
_passwordHasher = passwordHasher;
|
||||
_loanApplication = loanApplication;
|
||||
_employeeApplication = employeeApplication;
|
||||
_authHelper = authHelper;
|
||||
_subAccountApplication = subAccountApplication;
|
||||
_authHelper = authHelper;
|
||||
_contextAccessor = contextAccessor;
|
||||
|
||||
var workshopHash = _contextAccessor.HttpContext?.User.FindFirstValue("WorkshopSlug");
|
||||
_workshopId = _passwordHasher.SlugDecrypt(workshopHash);
|
||||
}
|
||||
|
||||
public IActionResult OnGet()
|
||||
@@ -55,20 +59,7 @@ namespace ServiceHost.Areas.Client.Pages.Company.Loan
|
||||
|
||||
public IActionResult OnGetLoadDataAjax(LoanSearchViewModel searchViewModel)
|
||||
{
|
||||
var subAccId = _authHelper.CurrentSubAccountId();
|
||||
if (subAccId > 0)
|
||||
{
|
||||
var subAccountViewModel = _subAccountApplication.GetDetails(subAccId);
|
||||
if (subAccountViewModel.SubAccountRoleId == 2)
|
||||
{
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = true,
|
||||
data = new List<LoanViewModel>(),
|
||||
pageIndex = 0,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
var workshopHash = User.FindFirstValue("WorkshopSlug");
|
||||
var workshopId = _passwordHasher.SlugDecrypt(workshopHash);
|
||||
|
||||
@@ -87,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);
|
||||
@@ -98,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
|
||||
{
|
||||
@@ -227,5 +215,38 @@ namespace ServiceHost.Areas.Client.Pages.Company.Loan
|
||||
message = result.Message,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
#region Details
|
||||
|
||||
public async Task<IActionResult> OnGetDetail(long id)
|
||||
{
|
||||
var workshopHash = User.FindFirstValue("WorkshopSlug");
|
||||
var workshopId = _passwordHasher.SlugDecrypt(workshopHash);
|
||||
if (workshopId <= 0)
|
||||
{
|
||||
var resultError = new ErrorViewModel()
|
||||
{
|
||||
Message = "کارگاه شما یافت نشد"
|
||||
};
|
||||
return Partial("../Error/_ErrorModal", resultError);
|
||||
}
|
||||
|
||||
var command = await _loanApplication.GetDetails(id);
|
||||
return Partial("ModalDetailLoan", command);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
public IActionResult OnGetSearch(LoanSearchViewModel searchModel)
|
||||
{
|
||||
searchModel.WorkshopId = _workshopId;
|
||||
var result = _loanApplication.GetSearchListAsGrouped(searchModel);
|
||||
return new JsonResult(new
|
||||
{
|
||||
data = result
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,159 @@
|
||||
@model CompanyManagment.App.Contracts.Loan.LoanDetailsViewModel
|
||||
|
||||
@{
|
||||
string clientVersion = _0_Framework.Application.Version.StyleVersion;
|
||||
<link href="~/assetsclient/pages/loan/css/ModalDetailLoan.css?ver=@clientVersion" rel="stylesheet" />
|
||||
var index = 1;
|
||||
}
|
||||
|
||||
<form role="form" method="post" name="create-form" id="create-form" autocomplete="off">
|
||||
|
||||
<div class="modal-content">
|
||||
<div class="modal-header pb-0 d-flex align-items-center justify-content-center text-center">
|
||||
<button type="button" class="btn-close position-absolute text-start" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
<div>
|
||||
<p class="m-0 pdHeaderTitle1">جزئیات وام</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
|
||||
<div class="row g-2 p-0">
|
||||
|
||||
<div class="col-6 mt-2 position-relative">
|
||||
<div class="d-flex align-items-center justify-content-between infoLoan p-1">
|
||||
<div class="fullname">@Model.EmployeeFullName</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6 mt-2 position-relative">
|
||||
<div class="d-flex align-items-center justify-content-between infoLoan p-1">
|
||||
<div class="">تاریخ اعطا وام:</div>
|
||||
<div class="">@Model.LoanGrantDate</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6 mt-2 position-relative">
|
||||
<div class="d-flex align-items-center justify-content-between infoLoan p-1">
|
||||
<div>تعداد اقساط:</div>
|
||||
<div>@Model.InstallmentCount قسط</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6 mt-2 position-relative">
|
||||
<div class="d-flex align-items-center justify-content-between infoLoan p-1">
|
||||
<div>تاریخ اولین قسط:</div>
|
||||
<div>@Model.Installments.First().InstallmentDate</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12 my-2 p-0">
|
||||
<div class="installmentContainer">
|
||||
<div class="tableLoanDetail">
|
||||
<div class="Rtable Rtable--5cols Rtable--collapse px-1 ">
|
||||
<div class="Rtable-row Rtable-row--head align-items-center d-flex loanDetailTable sticky">
|
||||
<div class="Rtable-cell column-heading width1">
|
||||
<span class="d-flex text-white align-items-center">
|
||||
<label for="checkAllCreate2" class="text-white prevent-select">ردیف</label>
|
||||
</span>
|
||||
</div>
|
||||
<div class="Rtable-cell column-heading width2 text-center">تاریخ هر قسط</div>
|
||||
<div class="Rtable-cell column-heading width3 text-center">مبلغ هر قسط</div>
|
||||
<div class="Rtable-cell column-heading width4 text-end">وضعیت</div>
|
||||
</div>
|
||||
|
||||
@foreach (var item in Model.Installments)
|
||||
{
|
||||
<div class="Rtable-row align-items-center position-relative loanDetailTable openAction employee-row">
|
||||
<div class="Rtable-cell width1">
|
||||
<div class="Rtable-cell--heading d-none">
|
||||
ردیف
|
||||
</div>
|
||||
<label for="Employee_ID" class="Rtable-cell--content prevent-select">
|
||||
<span class="d-flex align-items-center justify-content-between gap-1">
|
||||
<span class="w-100 text-center">@(index++)</span>
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="Rtable-cell width2">
|
||||
<div class="Rtable-cell--heading d-none">تاریخ هر قسط</div>
|
||||
<div class="Rtable-cell--content text-center employee-name">
|
||||
@(item.InstallmentDate)
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="Rtable-cell width3">
|
||||
<div class="Rtable-cell--content text-center">
|
||||
<div class="d-md-none d-none">مبلغ هر قسط</div>
|
||||
<div class="d-flex justify-content-center">
|
||||
@(item.InstallmentAmount) ریال
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="Rtable-cell width4">
|
||||
<div class="Rtable-cell--content text-center">
|
||||
<div class="d-md-none d-none">وضعیت</div>
|
||||
<div class="d-flex justify-content-end">
|
||||
@if (item.IsPaid)
|
||||
{
|
||||
<span class="widthTableBadgeSuccess">پرداخت شد</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span class="widthTableBadgeNone">عدم پرداخت</span>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="totalPaymentLoan">
|
||||
<div class="d-flex align-items-center justify-content-between">
|
||||
<div class="infoInstallment">کل مبلغ وام:</div>
|
||||
<div class="infoInstallment">@Model.TotalLoanAmount ریال</div>
|
||||
</div>
|
||||
<div class="d-flex align-items-center justify-content-between">
|
||||
<div class="infoInstallment">جمع مبلغ بازپرداخت:</div>
|
||||
<div class="infoInstallment totalPay">@Model.TotalPaidAmount ریال</div>
|
||||
</div>
|
||||
<div class="lineSeparete"></div>
|
||||
<div class="d-flex align-items-center justify-content-between">
|
||||
<div class="infoInstallment">باقیمانده مبلغ بدهی:</div>
|
||||
<div class="infoInstallment remainPay">@Model.TotalRemainingAmount ریال</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer d-block">
|
||||
<div class="container p-0 m-0">
|
||||
<div class="row">
|
||||
<div class="col-12 text-end">
|
||||
<button type="button" class="btn-cancel2 justify-content-center w-100" data-bs-dismiss="modal" aria-label="Close">انصراف</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
<script src="~/assetsclient/js/site.js?ver=@clientVersion"></script>
|
||||
<script src="~/assetsclient/libs/jalaali-js/jalaali.js"></script>
|
||||
<script src="~/admintheme/js/jquery.mask_1.14.16.min.js"></script>
|
||||
|
||||
<script>
|
||||
var antiForgeryToken = $(`@Html.AntiForgeryToken()`).val();
|
||||
</script>
|
||||
@* <script src="~/assetsclient/pages/Loan/js/ModalCreateNewLoan.js?ver=@clientVersion"></script> *@
|
||||
@@ -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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
//******************** عملیات مربوط به پرینت ********************
|
||||
|
||||
|
||||
@@ -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 = "داده ای یافت نشد!"
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 () {
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
|
||||
<link href="~/assetsclient/pages/Reward/css/index.css?ver=@clientVersion" rel="stylesheet" />
|
||||
}
|
||||
|
||||
<div class="content-container">
|
||||
<div class="container-fluid">
|
||||
<div class="row p-2">
|
||||
@@ -37,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>
|
||||
@@ -61,30 +60,63 @@
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
|
||||
<div class="row search-personal-section">
|
||||
<div class="d-flex search-personal-section gap-2">
|
||||
|
||||
<div class="col-3 col-xxl-2">
|
||||
<div class="personnel-selector-navFilter">
|
||||
<select class="form-select employeeName select2OptionIndex" id="employeeSelectIndex" aria-label="انتخاب پرسنل ...">
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-2 col-xxl-1 p-0">
|
||||
<div class="start-date-navbarFilter">
|
||||
<input type="text" class="form-control text-center form-control-date date start-date" id="start-date" placeholder="تاریخ شروع" style="direction: ltr">
|
||||
</div>
|
||||
|
||||
<div class="col-2 col-xxl-1">
|
||||
<div class="end-date-navbarFilter">
|
||||
<input type="text" class="form-control text-center form-control-date date end-date" id="end-date" placeholder="تاریخ پایان" style="direction: ltr">
|
||||
</div>
|
||||
|
||||
<button class="btn-search btn-w-size btn-search-click text-nowrap d-flex align-items-center justify-content-center me-2" 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" />
|
||||
</svg>
|
||||
</button>
|
||||
<div class="list-navbarFilter type">
|
||||
<div class="form-check form-checked selectRadioBox">
|
||||
<input type="checkbox" class="tm-selection-rad dataType" value="" id="list" autocomplete="off">
|
||||
<label class="btn btn-outline-primary d-flex gap-1 justify-content-center radio-btn" for="list">
|
||||
|
||||
<div class="btn-clear-filter btn-w-size text-nowrap d-flex align-items-center justify-content-center disable">
|
||||
<svg class="" width="24" height="24" viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
|
||||
<g clip-path="url(#clip0_4983_43834)">
|
||||
<path class="svg" d="M4 17.5C3.1716 17.5 2.5 18.1716 2.5 19C2.5 19.8284 3.1716 20.5 4 20.5H15C15.8284 20.5 16.5 19.8284 16.5 19C16.5 18.1716 15.8284 17.5 15 17.5H4ZM19.5 17.5C18.6716 17.5 18 18.1716 18 19C18 19.8284 18.6716 20.5 19.5 20.5C20.3284 20.5 21 19.8284 21 19C21 18.1716 20.3284 17.5 19.5 17.5ZM4 10.5C3.1716 10.5 2.5 11.1716 2.5 12C2.5 12.7797 3.09491 13.4204 3.85555 13.4931L4 13.5H15C15.8284 13.5 16.5 12.8284 16.5 12C16.5 11.2203 15.9051 10.5796 15.1445 10.5069L15 10.5H4ZM19.5 10.5C18.6716 10.5 18 11.1716 18 12C18 12.8284 18.6716 13.5 19.5 13.5C20.3284 13.5 21 12.8284 21 12C21 11.1716 20.3284 10.5 19.5 10.5ZM19.5 3.5C18.6716 3.5 18 4.17157 18 5C18 5.82843 18.6716 6.5 19.5 6.5C20.3284 6.5 21 5.82843 21 5C21 4.17157 20.3284 3.5 19.5 3.5ZM4 3.5C3.1716 3.5 2.5 4.17157 2.5 5C2.5 5.7797 3.09491 6.42045 3.85555 6.49313L4 6.5H15C15.8284 6.5 16.5 5.82843 16.5 5C16.5 4.2203 15.9051 3.57955 15.1445 3.50687L15 3.5H4Z"/>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_4983_43834">
|
||||
<rect width="24" height="24" fill="white" transform="matrix(-1 0 0 1 24 0)"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
<span>لیستی</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="group-navbarFilter type">
|
||||
<div class="form-check form-checked selectRadioBox">
|
||||
<input type="checkbox" class="tm-selection-rad dataType" value="" id="group" autocomplete="off">
|
||||
<label class="btn btn-outline-primary d-flex gap-1 justify-content-center radio-btn" for="group">
|
||||
<svg class="svg" width="24" height="24" fill="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path class="svg" d="M17 13C15.9456 13 15.0818 13.8159 15.0055 14.8507L15 15V18C15 19.0544 15.8159 19.9182 16.8507 19.9945L17 20H20C21.0544 20 21.9182 19.1841 21.9945 18.1493L22 18V15C22 13.9456 21.1841 13.0818 20.1493 13.0055L20 13H17ZM8 17C7.4477 17 7 17.4477 7 18C7 18.5128 7.38603 18.9355 7.88338 18.9933L8 19H12C12.5523 19 13 18.5523 13 18C13 17.4872 12.614 17.0645 12.1166 17.0067L12 17H8ZM4 13C3.4477 13 3 13.4477 3 14C3 14.5523 3.4477 15 4 15H12C12.5523 15 13 14.5523 13 14C13 13.4477 12.5523 13 12 13H4ZM17 3C15.8954 3 15 3.89543 15 5V8C15 9.10457 15.8954 10 17 10H20C21.1046 10 22 9.10457 22 8V5C22 3.89543 21.1046 3 20 3H17ZM8 7C7.4477 7 7 7.44772 7 8C7 8.51283 7.38603 8.93551 7.88338 8.99327L8 9H12C12.5523 9 13 8.55228 13 8C13 7.48717 12.614 7.06449 12.1166 7.00673L12 7H8ZM4 3C3.4477 3 3 3.44772 3 4C3 4.51283 3.38603 4.93551 3.88338 4.99327L4 5H12C12.5523 5 13 4.55228 13 4C13 3.48717 12.614 3.06449 12.1166 3.00673L12 3H4Z" />
|
||||
</svg>
|
||||
<span>گروهی</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-navbarFilter">
|
||||
<button class="btn-search btn-w-size btn-search-click text-nowrap d-flex align-items-center justify-content-center me-2" 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" />
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="clearSearch-navbarFilter btn-clear-filter btn-w-size text-nowrap d-flex align-items-center justify-content-center disable">
|
||||
<span>حذف جستجو</span>
|
||||
</div>
|
||||
|
||||
@@ -116,7 +148,7 @@
|
||||
</div>
|
||||
<!-- End Advance Search Box -->
|
||||
|
||||
<div class="row p-lg-2">
|
||||
<div class="row p-1 p-lg-2">
|
||||
<div class="card p-2">
|
||||
|
||||
<div class="row align-items-center">
|
||||
@@ -164,22 +196,22 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wrapper" id="LoadRewardList">
|
||||
<div class="rewardList Rtable Rtable--collapse">
|
||||
<div class="wrapper LoadRewardList" id="LoadRewardList">
|
||||
<div class="rewardList contract-list Rtable Rtable--5cols Rtable--collapse">
|
||||
|
||||
<div class="Rtable-row Rtable-row--head align-items-center sticky-div">
|
||||
<div class="Rtable-cell column-heading width1 d-flex align-items-center">
|
||||
@* <div class="select-all d-none d-md-flex align-items-center">
|
||||
<input type="checkbox" class="form-check-input checkAll" name="" id="checkAll2">
|
||||
</div> *@
|
||||
<label for="checkAll2">ردیف</label>
|
||||
<div class="Rtable-cell column-heading width1">
|
||||
<span class="d-flex text-white align-items-center gap-1">
|
||||
<input type="checkbox" class="form-check-input checkAll" name="" id="checkAll2List">
|
||||
<label for="checkAll2List" class="prevent-select">ردیف</label>
|
||||
</span>
|
||||
</div>
|
||||
<div class="Rtable-cell column-heading width2">نام پرسنل</div>
|
||||
<div class="Rtable-cell column-heading text-center 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 class="Rtable-cell column-heading width2">نام پرسنل</div>
|
||||
<div class="Rtable-cell column-heading width3">شماره پرسنلی</div>
|
||||
<div class="Rtable-cell column-heading width4">عنوان</div>
|
||||
<div class="Rtable-cell column-heading width6">توضیحات</div>
|
||||
<div class="Rtable-cell column-heading width5">مبلغ</div>
|
||||
<div class="Rtable-cell column-heading width8 text-end pe-2">عملیات</div>
|
||||
</div>
|
||||
|
||||
@@ -189,32 +221,40 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="reward-grid" id="LoadRewardListWithEmployee" style="display: none">
|
||||
<div class="Rtable Rtable--5cols Rtable--collapse reward-grid-list">
|
||||
<div class="reward-grid LoadRewardListWithEmployee d-none" id="LoadRewardListWithEmployee">
|
||||
<div class="Rtable Rtable--5cols Rtable--collapse reward-grid-list">
|
||||
|
||||
<div class="Rtable-row Rtable-row--head align-items-center d-grid gap-2 grid-cols-12 sticky-div">
|
||||
<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-10">
|
||||
<div class="Rtable-cell column-heading width3">
|
||||
ردیف
|
||||
</div>
|
||||
<div class="Rtable-cell column-heading width4 text-center">نام پرسنل</div>
|
||||
<div class="Rtable-cell column-heading width5 text-center">شماره پرسنلی</div>
|
||||
<div class="Rtable-cell column-heading width6">مبلغ</div>
|
||||
<div class="Rtable-cell column-heading width7">توضیحات</div>
|
||||
<div class="Rtable-cell column-heading width8">تاریخ</div>
|
||||
<div class="Rtable-cell column-heading width9 text-end pe-2">عملیات</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="Rtable-row Rtable-row--head align-items-center d-grid gap-2 grid-cols-12 sticky-div">
|
||||
<div class="d-flex col-span-2">
|
||||
<div class="Rtable-cell column-heading width1 searchByBoth">سال</div>
|
||||
<div class="Rtable-cell column-heading width2 searchByBoth">ماه</div>
|
||||
<div class="Rtable-cell column-heading width1 " id="searchJustNameFirstTab">نام پرسنل</div>
|
||||
</div>
|
||||
<div class="d-flex col-span-8">
|
||||
<div class="Rtable-cell column-heading width5">
|
||||
<span class="d-flex justify-content-start text-white align-items-center gap-1">
|
||||
<input type="checkbox" class="form-check-input checkAll" name="" id="checkAll2Group">
|
||||
<label for="checkAll2" class="prevent-select">ردیف</label>
|
||||
</span>
|
||||
</div>
|
||||
<div class="Rtable-cell column-heading width3 groupByName" id="searchJustNameMiddleTab">نام پرسنل</div>
|
||||
<div class="Rtable-cell column-heading width3 text-center">شماره پرسنلی</div>
|
||||
<div class="Rtable-cell column-heading width4">عنوان</div>
|
||||
<div class="Rtable-cell column-heading width4">توضیحات</div>
|
||||
<div class="Rtable-cell column-heading width4">تاریخ</div>
|
||||
<div class="Rtable-cell column-heading width6">مبلغ</div>
|
||||
<div class="Rtable-cell column-heading width7 text-end pe-2">عملیات</div>
|
||||
</div>
|
||||
<div class="d-flex col-span-2">
|
||||
<div class="Rtable-cell column-heading width1 text-center">مجموع مبالغ</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="w-100 personal-paid-leave-scroll" id="rewardEmployeesList">
|
||||
<div class="w-100 personal-paid-leave-scroll" id="rewardEmployeesList">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -249,11 +289,41 @@
|
||||
<input type="text" class="form-control text-center form-control-date date start-date" id="start-date-mobile" placeholder="تاریخ شروع" style="direction: ltr">
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<input type="text" class="form-control text-center form-control-date date end-date" id="end-date-mobile" placeholder="تاریخ پایان" style="direction: ltr">
|
||||
<div class="col-12">
|
||||
<input type="text" class="form-control text-center form-control-date date end-date" id="end-date-mobile" placeholder="تاریخ پایان" style="direction: ltr">
|
||||
</div>
|
||||
|
||||
<div class="col-12 d-flex justify-content-between gap-1">
|
||||
<div class="list-navbarFilter type w-50">
|
||||
<div class="form-check form-checked selectRadioBox">
|
||||
<input type="checkbox" class="tm-selection-rad" value="true" id="listMobile" autocomplete="off">
|
||||
<label class="btn btn-outline-primary d-flex gap-1 justify-content-center radio-btn" for="listMobile">
|
||||
<svg class="" width="24" height="24" viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
|
||||
<g clip-path="url(#clip0_4983_43834)">
|
||||
<path class="svg" d="M4 17.5C3.1716 17.5 2.5 18.1716 2.5 19C2.5 19.8284 3.1716 20.5 4 20.5H15C15.8284 20.5 16.5 19.8284 16.5 19C16.5 18.1716 15.8284 17.5 15 17.5H4ZM19.5 17.5C18.6716 17.5 18 18.1716 18 19C18 19.8284 18.6716 20.5 19.5 20.5C20.3284 20.5 21 19.8284 21 19C21 18.1716 20.3284 17.5 19.5 17.5ZM4 10.5C3.1716 10.5 2.5 11.1716 2.5 12C2.5 12.7797 3.09491 13.4204 3.85555 13.4931L4 13.5H15C15.8284 13.5 16.5 12.8284 16.5 12C16.5 11.2203 15.9051 10.5796 15.1445 10.5069L15 10.5H4ZM19.5 10.5C18.6716 10.5 18 11.1716 18 12C18 12.8284 18.6716 13.5 19.5 13.5C20.3284 13.5 21 12.8284 21 12C21 11.1716 20.3284 10.5 19.5 10.5ZM19.5 3.5C18.6716 3.5 18 4.17157 18 5C18 5.82843 18.6716 6.5 19.5 6.5C20.3284 6.5 21 5.82843 21 5C21 4.17157 20.3284 3.5 19.5 3.5ZM4 3.5C3.1716 3.5 2.5 4.17157 2.5 5C2.5 5.7797 3.09491 6.42045 3.85555 6.49313L4 6.5H15C15.8284 6.5 16.5 5.82843 16.5 5C16.5 4.2203 15.9051 3.57955 15.1445 3.50687L15 3.5H4Z" />
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_4983_43834">
|
||||
<rect width="24" height="24" fill="white" transform="matrix(-1 0 0 1 24 0)" />
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
<span>لیستی</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-check form-checked selectRadioBox w-50">
|
||||
<input type="checkbox" class="tm-selection-rad" name="Command.isGroup" value="true" id="groupMobile" autocomplete="off">
|
||||
<label class="btn btn-outline-primary d-flex gap-1 justify-content-center radio-btn" for="groupMobile">
|
||||
<svg class="svg" width="24" height="24" fill="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path class="svg" d="M17 13C15.9456 13 15.0818 13.8159 15.0055 14.8507L15 15V18C15 19.0544 15.8159 19.9182 16.8507 19.9945L17 20H20C21.0544 20 21.9182 19.1841 21.9945 18.1493L22 18V15C22 13.9456 21.1841 13.0818 20.1493 13.0055L20 13H17ZM8 17C7.4477 17 7 17.4477 7 18C7 18.5128 7.38603 18.9355 7.88338 18.9933L8 19H12C12.5523 19 13 18.5523 13 18C13 17.4872 12.614 17.0645 12.1166 17.0067L12 17H8ZM4 13C3.4477 13 3 13.4477 3 14C3 14.5523 3.4477 15 4 15H12C12.5523 15 13 14.5523 13 14C13 13.4477 12.5523 13 12 13H4ZM17 3C15.8954 3 15 3.89543 15 5V8C15 9.10457 15.8954 10 17 10H20C21.1046 10 22 9.10457 22 8V5C22 3.89543 21.1046 3 20 3H17ZM8 7C7.4477 7 7 7.44772 7 8C7 8.51283 7.38603 8.93551 7.88338 8.99327L8 9H12C12.5523 9 13 8.55228 13 8C13 7.48717 12.614 7.06449 12.1166 7.00673L12 7H8ZM4 3C3.4477 3 3 3.44772 3 4C3 4.51283 3.38603 4.93551 3.88338 4.99327L4 5H12C12.5523 5 13 4.55228 13 4C13 3.48717 12.614 3.06449 12.1166 3.00673L12 3H4Z" />
|
||||
</svg>
|
||||
<span>گروهی</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<div class="col-12">
|
||||
<div class="btn-clear-filter disable py-2 text-center d-block w-100 mt-2">
|
||||
<span class="w-100">حذف جستجو</span>
|
||||
</div>
|
||||
@@ -297,7 +367,8 @@
|
||||
<script src="~/assetsclient/libs/cleave/cleave.min.js"></script>
|
||||
<script>
|
||||
var antiForgeryToken = $(`@Html.AntiForgeryToken()`).val();
|
||||
var rewardListLoadDataAjax = `@Url.Page("./Index", "LoadDataAjax")`;
|
||||
// var rewardListLoadDataAjax = `@Url.Page("./Index", "LoadDataAjax")`;
|
||||
var rewardGroupLoadDataAjax = `@Url.Page("./Index", "SearchReward")`;
|
||||
var rewardListLoadDataByEmployeeAjax = `@Url.Page("./Index", "LoadDataByEmployeeAjax")`;
|
||||
var employeeListAjax = `@Url.Page("./Index", "EmployeeList")`;
|
||||
var removeRewardAjax = `@Url.Page("./Index", "Remove")`;
|
||||
|
||||
@@ -8,7 +8,6 @@ using CompanyManagment.App.Contracts.Employee;
|
||||
using CompanyManagment.App.Contracts.Error;
|
||||
using CompanyManagment.App.Contracts.Reward;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using AccountManagement.Application.Contracts.SubAccount;
|
||||
|
||||
namespace ServiceHost.Areas.Client.Pages.Company.Reward
|
||||
{
|
||||
@@ -25,9 +24,8 @@ namespace ServiceHost.Areas.Client.Pages.Company.Reward
|
||||
private readonly long _workshopId;
|
||||
public string WorkshopFullName;
|
||||
public int PageIndex = 0;
|
||||
private readonly ISubAccountApplication _subAccountApplication;
|
||||
|
||||
public IndexModel(IWorkshopApplication workshopApplication, IPasswordHasher passwordHasher, IRewardApplication rewardApplication, IAuthHelper authHelper, IEmployeeApplication employeeApplication, IHttpContextAccessor contextAccessor, ISubAccountApplication subAccountApplication)
|
||||
public IndexModel(IWorkshopApplication workshopApplication, IPasswordHasher passwordHasher, IRewardApplication rewardApplication, IAuthHelper authHelper, IEmployeeApplication employeeApplication, IHttpContextAccessor contextAccessor)
|
||||
{
|
||||
_workshopApplication = workshopApplication;
|
||||
_passwordHasher = passwordHasher;
|
||||
@@ -35,9 +33,8 @@ namespace ServiceHost.Areas.Client.Pages.Company.Reward
|
||||
_authHelper = authHelper;
|
||||
_employeeApplication = employeeApplication;
|
||||
_contextAccessor = contextAccessor;
|
||||
_subAccountApplication = subAccountApplication;
|
||||
|
||||
var workshopHash = _contextAccessor.HttpContext?.User.FindFirstValue("WorkshopSlug");
|
||||
var workshopHash = _contextAccessor.HttpContext?.User.FindFirstValue("WorkshopSlug");
|
||||
_workshopId = _passwordHasher.SlugDecrypt(workshopHash);
|
||||
|
||||
if (_workshopId < 1)
|
||||
@@ -47,6 +44,7 @@ namespace ServiceHost.Areas.Client.Pages.Company.Reward
|
||||
public IActionResult OnGet()
|
||||
{
|
||||
WorkshopFullName = _authHelper.GetWorkshopName();
|
||||
|
||||
return Page();
|
||||
}
|
||||
|
||||
@@ -54,22 +52,7 @@ namespace ServiceHost.Areas.Client.Pages.Company.Reward
|
||||
{
|
||||
searchViewModel.WorkshopId = _workshopId;
|
||||
|
||||
var subAccId = _authHelper.CurrentSubAccountId();
|
||||
if (subAccId > 0)
|
||||
{
|
||||
var subAccountViewModel = _subAccountApplication.GetDetails(subAccId);
|
||||
if (subAccountViewModel.SubAccountRoleId == 2)
|
||||
{
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = true,
|
||||
data = new List<RewardViewModel>(),
|
||||
pageIndex = 0,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
var result = _rewardApplication.GetSearchList(searchViewModel);
|
||||
var result = _rewardApplication.GetSearchList(searchViewModel);
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = true,
|
||||
@@ -82,18 +65,17 @@ namespace ServiceHost.Areas.Client.Pages.Company.Reward
|
||||
{
|
||||
searchViewModel.WorkshopId = _workshopId;
|
||||
|
||||
var result = _rewardApplication.GetSearchListByEmployee(searchViewModel);
|
||||
var result = _rewardApplication.GetSearchListAsGrouped(searchViewModel);
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = true,
|
||||
data = result,
|
||||
pageIndex = result.Count()
|
||||
});
|
||||
}
|
||||
|
||||
public IActionResult OnGetEmployeeList()
|
||||
public async Task<IActionResult> OnGetEmployeeList()
|
||||
{
|
||||
var employees = _employeeApplication.GetWorkingEmployeesByWorkshopId(_workshopId);
|
||||
var employees = await _employeeApplication.WorkedEmployeesInWorkshopSelectList(_workshopId);
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
@@ -109,9 +91,10 @@ namespace ServiceHost.Areas.Client.Pages.Company.Reward
|
||||
}
|
||||
|
||||
public IActionResult OnPostCreate(CreateRewardViewModel command)
|
||||
{
|
||||
command.WorkshopId = _workshopId;
|
||||
command.RewardedByAccountId = _authHelper.CurrentAccountId();
|
||||
{
|
||||
command.WorkshopId = _workshopId;
|
||||
|
||||
|
||||
var result = _rewardApplication.Create(command);
|
||||
|
||||
return new JsonResult(new
|
||||
@@ -148,5 +131,16 @@ namespace ServiceHost.Areas.Client.Pages.Company.Reward
|
||||
message = result.Message,
|
||||
});
|
||||
}
|
||||
|
||||
public IActionResult OnGetSearchReward(RewardSearchModel searchModel)
|
||||
{
|
||||
searchModel.WorkshopId = _workshopId;
|
||||
var result = _rewardApplication.GetSearchListAsGrouped(searchModel);
|
||||
return new JsonResult(new
|
||||
{
|
||||
data = result
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
@@ -203,6 +203,10 @@
|
||||
var antiForgeryToken = $('@Html.AntiForgeryToken()').val();
|
||||
var loadCameraAccountsAjax = `@Url.Page("CameraAccounts", "CameraAccounts")`;
|
||||
var changeCameraAccountStatusAjax = `@Url.Page("./CameraAccounts", "CameraAccountChangeStatus")`;
|
||||
|
||||
// check and show modal Camera Account And Workshop Setting
|
||||
var statusCameraAccountAndWorkshopSettingUrl = `@Url.Page("./Index", "StatusCameraAccountAndWorkshopSetting")`;
|
||||
var saveCameraAccountUrl = `@Url.Page("./Index", "SaveCameraAccountAndWorkshopSetting")`;
|
||||
</script>
|
||||
<script src="~/assetsclient/pages/RollCall/js/CameraAccounts.js?ver=@clientVersion"></script>
|
||||
}
|
||||
@@ -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>
|
||||
@@ -169,8 +169,8 @@
|
||||
<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-normal dropdown-days boxes">
|
||||
<li class="item active" value-data-normal="OneDay">تاریخ براساس یک روز</li>
|
||||
<li class="item" value-data-normal="RangeDays">تاریخ براساس بازه ی زمانی</li>
|
||||
<li class="item active" data-value-normal="one-day">تاریخ براساس یک روز</li>
|
||||
<li class="item" data-value-normal="range-days">تاریخ براساس بازه ی زمانی</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
@@ -328,8 +328,8 @@
|
||||
<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-normal dropdown-days boxes">
|
||||
<li class="item active" value-data-normal="OneDay">تاریخ براساس یک روز</li>
|
||||
<li class="item" value-data-normal="RangeDays">تاریخ براساس بازه ی زمانی</li>
|
||||
<li class="item active" data-value-normal="one-day">تاریخ براساس یک روز</li>
|
||||
<li class="item" data-value-normal="range-days">تاریخ براساس بازه ی زمانی</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -407,6 +407,10 @@
|
||||
// var dateIndex = 0;
|
||||
|
||||
var deleteRollCallData = `@Url.Page("./CaseHistory", "RemoveEmployeeRollCallsInDate")`;
|
||||
|
||||
// check and show modal Camera Account And Workshop Setting
|
||||
var statusCameraAccountAndWorkshopSettingUrl = `@Url.Page("./Index", "StatusCameraAccountAndWorkshopSetting")`;
|
||||
var saveCameraAccountUrl = `@Url.Page("./Index", "SaveCameraAccountAndWorkshopSetting")`;
|
||||
</script>
|
||||
<script src="~/assetsclient/pages/rollcall/js/casehistory.js?ver=@clientVersion"></script>
|
||||
}
|
||||
@@ -4,6 +4,8 @@
|
||||
|
||||
@{
|
||||
ViewData["Title"] = " - " + "لیست حضور و غیاب جاری";
|
||||
|
||||
string clientVersion = _0_Framework.Application.Version.StyleVersion;
|
||||
int index = 1;
|
||||
int indexAbsent = 1;
|
||||
int indexLeave = 1;
|
||||
@@ -11,15 +13,15 @@
|
||||
}
|
||||
|
||||
@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/rollcall-list-table.css?ver=@Version.StyleVersion" rel="stylesheet" />
|
||||
<link href="~/assetsclient/css/operation-button.css?ver=@Version.StyleVersion" rel="stylesheet" />
|
||||
<link href="~/AssetsClient/css/dropdown.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/rollcall-list-table.css?ver=@clientVersion" rel="stylesheet" />
|
||||
<link href="~/assetsclient/css/operation-button.css?ver=@clientVersion" rel="stylesheet" />
|
||||
<link href="~/AssetsClient/css/dropdown.css?ver=@clientVersion" rel="stylesheet" />
|
||||
|
||||
<link href="~/AssetsClient/css/filter-search.css?ver=@Version.StyleVersion" rel="stylesheet" />
|
||||
<link href="~/AssetsClient/css/filter-search.css?ver=@clientVersion" rel="stylesheet" />
|
||||
|
||||
<link href="~/assetsclient/pages/rollcall/css/currentday.css" rel="stylesheet" />
|
||||
<link href="~/assetsclient/pages/rollcall/css/currentday.css?ver=@clientVersion" rel="stylesheet" />
|
||||
}
|
||||
|
||||
|
||||
@@ -36,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>
|
||||
@@ -45,22 +47,22 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="row px-2">
|
||||
<div class="col-12 p-0 mb-2 d-none d-md-block">
|
||||
<div class="search-box card border-0">
|
||||
<div class="d-flex align-items-center gap-2">
|
||||
<div class="container-fluid">
|
||||
<div class="row px-2">
|
||||
<div class="col-12 p-0 mb-2 d-none d-md-block">
|
||||
<div class="search-box card border-0">
|
||||
<div class="d-flex align-items-center gap-2">
|
||||
|
||||
<div class="col-2 position-relative">
|
||||
<input type="text" class="form-control" id="search" placeholder="جستجو ...">
|
||||
<button type="button" id="clear-search" class="close-btn-search d-none">
|
||||
<svg width="20" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M6 18 18 6M6 6l12 12" />
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
<div class="col-2 position-relative">
|
||||
<input type="text" class="form-control" id="search" placeholder="جستجو ...">
|
||||
<button type="button" id="clear-search" class="close-btn-search d-none">
|
||||
<svg width="20" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M6 18 18 6M6 6l12 12" />
|
||||
</svg>
|
||||
</button>
|
||||
</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" />
|
||||
@@ -70,281 +72,6 @@
|
||||
<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;">
|
||||
<span>حذف جستجو</span>
|
||||
</a> *@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- List Items -->
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="widthRightCurrentDay ps-0 d-none d-md-block">
|
||||
<div class="card heightRightCurrentDay">
|
||||
<div class="wrapper table-rollcall">
|
||||
<div class="rollcall-list Rtable Rtable--5cols Rtable--collapse px-1">
|
||||
|
||||
<div class="Rtable-row Rtable-row--head align-items-center d-flex sticky" style="outline: 6px solid white !important;">
|
||||
<div class="Rtable-cell column-heading width1">ردیف</div>
|
||||
<div class="Rtable-cell column-heading width2">نام پرسنل</div>
|
||||
<div class="Rtable-cell column-heading width3">شماره پرسنلی</div>
|
||||
<div class="Rtable-cell column-heading width4 text-end">تاخیر در ورود</div>
|
||||
<div class="Rtable-cell column-heading width5 text-center">ورود</div>
|
||||
<div class="Rtable-cell column-heading width6 text-center">خروج</div>
|
||||
<div class="Rtable-cell column-heading width7 text-start">تجمیع در خروج</div>
|
||||
<div class="Rtable-cell column-heading width8 text-center">مجموع ساعات کاری</div>
|
||||
</div>
|
||||
|
||||
@if (@Model.RollCallViewModels.PresentEmployees.Any())
|
||||
{
|
||||
@foreach (var item in Model.RollCallViewModels.PresentEmployees)
|
||||
{
|
||||
<div class="Rtable-row align-items-center position-relative openAction employee-row @(Model.RollCallViewModels.PresentEmployees.Count() == 1 ? "radius" : "") @(index == 1 ? "firstRadius" : "") @(index == Model.RollCallViewModels.PresentEmployees.Count() ? "lastRadius" : "" ) @(item.RollCallTimesList.Last().EndDate != null ? "existTimeRollCall" : "")">
|
||||
<div class="Rtable-cell width1">
|
||||
<div class="Rtable-cell--heading d-none">
|
||||
ردیف
|
||||
</div>
|
||||
<div class="Rtable-cell--content">
|
||||
<div class="d-flex justify-content-center align-items-center table-number">
|
||||
@(index++)
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="Rtable-cell width2">
|
||||
<div class="Rtable-cell--heading d-none">نام پرسنل</div>
|
||||
<div class="Rtable-cell--content employee-name">
|
||||
@item.EmployeeFullName
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="Rtable-cell width3">
|
||||
<div class="Rtable-cell--content text-center">
|
||||
<div class="d-md-none d-none">شماره پرسنلی: </div>
|
||||
<div class="d-flex ms-1">@item.PersonnelCode</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="Rtable-cell width4 position-relative bg-filter">
|
||||
<div class="Rtable-cell--content text-center">
|
||||
<div class="d-md-none d-none">تاخیر در ورود: </div>
|
||||
<div class="d-flex ms-1">-</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="Rtable-cell width5 position-relative text-center">
|
||||
@foreach (var itemTime in item.RollCallTimesList)
|
||||
{
|
||||
<div class="Rtable-cell--heading">ساعت ورود</div>
|
||||
<div style="direction: ltr; z-index: 6; position: relative" class="Rtable-cell--content text-center">
|
||||
<div>@(itemTime.StartDate ?? "-")</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="Rtable-cell width6 position-relative text-center">
|
||||
@foreach (var itemTime in item.RollCallTimesList)
|
||||
{
|
||||
<div class="Rtable-cell--heading">ساعت خروج</div>
|
||||
<div style="direction: ltr; z-index: 6; position: relative" class="Rtable-cell--content text-center">
|
||||
<div>@(itemTime.EndDate ?? "-")</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="Rtable-cell position-relative width7 bg-filter">
|
||||
<div class="Rtable-cell--content text-center">
|
||||
<div class="d-md-none d-none">تجمیع در خروج: </div>
|
||||
<div class="d-flex ms-1">-</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="Rtable-cell position-relative width8 h-100 bg-filter">
|
||||
<div class="Rtable-cell--content text-center">
|
||||
<div class="d-md-none d-none">مجموع ساعات کاری: </div>
|
||||
<div class="d-flex ms-1">
|
||||
@if (item.RollCallTimesList.Last().EndDate == null)
|
||||
{
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M12 12L18.1254 16.1694C18.6725 16.5418 19 17.1608 19 17.8227V20.5C19 20.7761 18.7761 21 18.5 21H5.5C5.22386 21 5 20.7761 5 20.5V17.8227C5 17.1608 5.32746 16.5418 5.87462 16.1694L12 12ZM12 12L18.1254 7.83062C18.6725 7.45819 19 6.83917 19 6.17729V3.5C19 3.22386 18.7761 3 18.5 3H5.5C5.22386 3 5 3.22386 5 3.5V6.17729C5 6.83917 5.32746 7.45819 5.87462 7.83062L12 12Z" stroke="#13AEAE" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
|
||||
<path d="M15 20.2071V20.85C15 20.9328 14.9328 21 14.85 21H9.15C9.06716 21 9 20.9328 9 20.85V20.2071C9 20.0745 9.05268 19.9473 9.14645 19.8536L11.4343 17.5657C11.7467 17.2533 12.2533 17.2533 12.5657 17.5657L14.8536 19.8536C14.9473 19.9473 15 20.0745 15 20.2071Z" fill="#13AEAE" />
|
||||
<path d="M12 11L17 8H7L12 11Z" fill="#13AEAE" />
|
||||
<path d="M12 18V12" stroke="#13AEAE" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
|
||||
</svg>
|
||||
}
|
||||
else
|
||||
{
|
||||
@item.TotalWorkingHours
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<partial name="Company/Partial/_EmptySection"></partial>
|
||||
}
|
||||
@* <div class="w-100" style="height: 731px; overflow-y: scroll">
|
||||
<div></div>
|
||||
|
||||
</div> *@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="widthLeftCurrentDay ps-0 d-none d-md-block">
|
||||
<div class="row p-0 g-3">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="wrapper">
|
||||
<div class="rollcall-list Rtable Rtable--5cols Rtable--collapse px-1">
|
||||
|
||||
<div class="w-100 my-1">
|
||||
<div class="absenceHeadColorTop" style="border-radius: 10px 10px 0 0;">غیبت</div>
|
||||
<div class="Rtable-row Rtable-row--head align-items-center d-flex table-rollcall-absent absenceHeadColor">
|
||||
<div class="Rtable-cell column-heading width1">ردیف</div>
|
||||
<div class="Rtable-cell column-heading width2">نام پرسنل</div>
|
||||
<div class="Rtable-cell column-heading width3">شماره پرسنلی</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="w-100 heightLeftCurrentDay">
|
||||
<div></div>
|
||||
@if (@Model.RollCallViewModels.AbsentEmployees.Any(x => !x.HasLeave))
|
||||
{
|
||||
@foreach (var item in Model.RollCallViewModels.AbsentEmployees)
|
||||
{
|
||||
if (!item.HasLeave)
|
||||
{
|
||||
<div class="Rtable-row align-items-center position-relative table-rollcall-absent absenceItem absenceItem-row">
|
||||
<div class="Rtable-cell width1">
|
||||
<div class="Rtable-cell--heading d-none">
|
||||
ردیف
|
||||
</div>
|
||||
<div class="Rtable-cell--content">
|
||||
<div class="d-flex justify-content-center align-items-center table-number">
|
||||
@(indexAbsent++)
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="Rtable-cell width2">
|
||||
<div class="Rtable-cell--heading d-none">نام پرسنل</div>
|
||||
<div class="Rtable-cell--content employee-name">
|
||||
@item.EmployeeFullName
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="Rtable-cell width3">
|
||||
<div class="Rtable-cell--content text-center">
|
||||
<div class="d-md-none d-none">شماره پرسنلی: </div>
|
||||
<div class="d-flex ms-1">@item.PersonnelCode</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<partial name="Company/Partial/_EmptySection"></partial>
|
||||
}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="wrapper">
|
||||
<div class="rollcall-list Rtable Rtable--5cols Rtable--collapse px-1">
|
||||
|
||||
<div class="w-100 my-1">
|
||||
<div class="leaveHeadColorTop" style="border-radius: 10px 10px 0 0;">مرخصی</div>
|
||||
<div class="Rtable-row Rtable-row--head align-items-center d-flex table-rollcall-leave leaveHeadColor">
|
||||
<div class="Rtable-cell column-heading width1">ردیف</div>
|
||||
<div class="Rtable-cell column-heading width2">نام پرسنل</div>
|
||||
<div class="Rtable-cell column-heading width3">شماره پرسنلی</div>
|
||||
<div class="Rtable-cell column-heading width4 text-center">نوع مرخصی</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="w-100 heightLeftCurrentDay">
|
||||
<div></div>
|
||||
@if (@Model.RollCallViewModels.AbsentEmployees.Any(x => x.HasLeave))
|
||||
{
|
||||
@foreach (var item in Model.RollCallViewModels.AbsentEmployees)
|
||||
{
|
||||
if (item.HasLeave)
|
||||
{
|
||||
<div class="Rtable-row align-items-center position-relative table-rollcall-leave leaveItem leaveItem-row">
|
||||
<div class="Rtable-cell width1">
|
||||
<div class="Rtable-cell--heading d-none">
|
||||
ردیف
|
||||
</div>
|
||||
<div class="Rtable-cell--content">
|
||||
<div class="d-flex justify-content-center align-items-center table-number">
|
||||
@(indexLeave++)
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="Rtable-cell width2">
|
||||
<div class="Rtable-cell--heading d-none">نام پرسنل</div>
|
||||
<div class="Rtable-cell--content employee-name">
|
||||
@item.EmployeeFullName
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="Rtable-cell width3">
|
||||
<div class="Rtable-cell--content text-center">
|
||||
<div class="d-md-none d-none">شماره پرسنلی: </div>
|
||||
<div class="d-flex ms-1">@item.PersonnelCode</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="Rtable-cell width4">
|
||||
<div class="Rtable-cell--content text-center">
|
||||
<div class="d-md-none d-none"></div>
|
||||
<div class="d-flex ms-1">@item.Reason</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<partial name="Company/Partial/_EmptySection"></partial>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row p-lg-2 d-block d-md-none">
|
||||
<div class="card pt-2">
|
||||
<div class="col-12">
|
||||
<div class="btnsRollCallOnlline">
|
||||
<button class="btnRollCallStatus active" onclick="loadRollCallStatus('all')">آنلاین</button>
|
||||
<button class="btnRollCallStatus" onclick="loadRollCallStatus('leave')">مرخصی <span id="leaveCount"></span></button>
|
||||
<button class="btnRollCallStatus" onclick="loadRollCallStatus('absent')">غیبت <span id="absentCount"></span></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wrapper">
|
||||
<div class="rollcall-list-mobile Rtable Rtable--5cols Rtable--collapse px-1">
|
||||
<div class="w-100" id="loadRollCallTypeAjax">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -352,12 +79,328 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- List Items -->
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="widthRightCurrentDay ps-0 d-none d-md-block">
|
||||
<div class="card heightRightCurrentDay">
|
||||
<div class="wrapper table-rollcall">
|
||||
<div class="rollcall-list Rtable Rtable--5cols Rtable--collapse px-1">
|
||||
|
||||
<div class="Rtable-row Rtable-row--head align-items-center d-flex sticky" style="outline: 6px solid white !important;">
|
||||
<div class="Rtable-cell column-heading width1">ردیف</div>
|
||||
<div class="Rtable-cell column-heading width2">نام پرسنل</div>
|
||||
<div class="Rtable-cell column-heading width3">شماره پرسنلی</div>
|
||||
<div class="Rtable-cell column-heading width4 text-end">تاخیر در ورود</div>
|
||||
<div class="Rtable-cell column-heading width5 text-center">ورود</div>
|
||||
<div class="Rtable-cell column-heading width6 text-center">خروج</div>
|
||||
<div class="Rtable-cell column-heading width7 text-start">تعجیل در خروج</div>
|
||||
<div class="Rtable-cell column-heading width8 text-center">مجموع ساعات کاری</div>
|
||||
</div>
|
||||
|
||||
@if (@Model.RollCallViewModels.PresentEmployees.Any())
|
||||
{
|
||||
@foreach (var item in Model.RollCallViewModels.PresentEmployees)
|
||||
{
|
||||
<div class="Rtable-row align-items-center position-relative openAction employee-row @(Model.RollCallViewModels.PresentEmployees.Count() == 1 ? "radius" : "") @(index == 1 ? "firstRadius" : "") @(index == Model.RollCallViewModels.PresentEmployees.Count() ? "lastRadius" : "" ) @(item.RollCallTimesList.Last().EndDate != null ? "existTimeRollCall" : "")">
|
||||
<div class="Rtable-cell width1">
|
||||
<div class="Rtable-cell--heading d-none">
|
||||
ردیف
|
||||
</div>
|
||||
<div class="Rtable-cell--content">
|
||||
<div class="d-flex justify-content-center align-items-center table-number">
|
||||
@(index++)
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="Rtable-cell width2">
|
||||
<div class="Rtable-cell--heading d-none">نام پرسنل</div>
|
||||
<div class="Rtable-cell--content employee-name">
|
||||
@item.EmployeeFullName
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="Rtable-cell width3">
|
||||
<div class="Rtable-cell--content text-center">
|
||||
<div class="d-md-none d-none">شماره پرسنلی: </div>
|
||||
<div class="d-flex ms-1">@item.PersonnelCode</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="Rtable-cell width4 position-relative bg-filter">
|
||||
<div class="Rtable-cell--content text-center">
|
||||
<div class="d-md-none d-none">تاخیر در ورود: </div>
|
||||
<div class="d-block ms-1">
|
||||
@foreach (var itemTime in item.RollCallTimesList)
|
||||
{
|
||||
string entryTimeDiff = string.IsNullOrEmpty(itemTime.EntryTimeDifferences) ? "-" : itemTime.EntryTimeDifferences;
|
||||
string entryCssClass = entryTimeDiff != "-" && entryTimeDiff.Contains("-") ? "negative-time" :
|
||||
entryTimeDiff != "-" && entryTimeDiff.Contains("+") ? "positive-time" : "";
|
||||
|
||||
if (entryTimeDiff != "-")
|
||||
{
|
||||
entryTimeDiff = entryTimeDiff.TrimEnd('+', '-');
|
||||
}
|
||||
|
||||
<div class="Rtable-cell--content text-center @entryCssClass">@entryTimeDiff</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="Rtable-cell width5 position-relative text-center">
|
||||
@foreach (var itemTime in item.RollCallTimesList)
|
||||
{
|
||||
<div class="Rtable-cell--heading">ساعت ورود</div>
|
||||
<div style="direction: ltr; z-index: 6; position: relative" class="Rtable-cell--content text-center">
|
||||
<div>@(itemTime.StartDate ?? "-")</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="Rtable-cell width6 position-relative text-center">
|
||||
@foreach (var itemTime in item.RollCallTimesList)
|
||||
{
|
||||
<div class="Rtable-cell--heading">ساعت خروج</div>
|
||||
<div style="direction: ltr; z-index: 6; position: relative" class="Rtable-cell--content text-center">
|
||||
<div>@(itemTime.EndDate ?? "-")</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="Rtable-cell position-relative width7 bg-filter">
|
||||
<div class="Rtable-cell--content text-center">
|
||||
<div class="d-md-none d-none">تعجیل در خروج: </div>
|
||||
<div class="d-block ms-1">
|
||||
@foreach (var itemTime in item.RollCallTimesList)
|
||||
{
|
||||
string exitTimeDiff = string.IsNullOrEmpty(itemTime.ExitTimeDifferences) ? "-" : itemTime.ExitTimeDifferences;
|
||||
string exitCssClass = exitTimeDiff != "-" && exitTimeDiff.Contains("-") ? "negative-time" :
|
||||
exitTimeDiff != "-" && exitTimeDiff.Contains("+") ? "positive-time" : "";
|
||||
|
||||
if (exitTimeDiff != "-")
|
||||
{
|
||||
exitTimeDiff = exitTimeDiff.TrimEnd('+', '-');
|
||||
}
|
||||
|
||||
<div class="Rtable-cell--content text-center @exitCssClass">@exitTimeDiff</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="Rtable-cell position-relative width8 h-100 bg-filter">
|
||||
<div class="Rtable-cell--content text-center">
|
||||
<div class="d-md-none d-none">مجموع ساعات کاری: </div>
|
||||
<div class="d-flex ms-1">
|
||||
@if (item.RollCallTimesList.Last().EndDate == null)
|
||||
{
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M12 12L18.1254 16.1694C18.6725 16.5418 19 17.1608 19 17.8227V20.5C19 20.7761 18.7761 21 18.5 21H5.5C5.22386 21 5 20.7761 5 20.5V17.8227C5 17.1608 5.32746 16.5418 5.87462 16.1694L12 12ZM12 12L18.1254 7.83062C18.6725 7.45819 19 6.83917 19 6.17729V3.5C19 3.22386 18.7761 3 18.5 3H5.5C5.22386 3 5 3.22386 5 3.5V6.17729C5 6.83917 5.32746 7.45819 5.87462 7.83062L12 12Z" stroke="#13AEAE" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
|
||||
<path d="M15 20.2071V20.85C15 20.9328 14.9328 21 14.85 21H9.15C9.06716 21 9 20.9328 9 20.85V20.2071C9 20.0745 9.05268 19.9473 9.14645 19.8536L11.4343 17.5657C11.7467 17.2533 12.2533 17.2533 12.5657 17.5657L14.8536 19.8536C14.9473 19.9473 15 20.0745 15 20.2071Z" fill="#13AEAE" />
|
||||
<path d="M12 11L17 8H7L12 11Z" fill="#13AEAE" />
|
||||
<path d="M12 18V12" stroke="#13AEAE" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
|
||||
</svg>
|
||||
}
|
||||
else
|
||||
{
|
||||
@item.TotalWorkingHours
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<partial name="Company/Partial/_EmptySection"></partial>
|
||||
}
|
||||
@* <div class="w-100" style="height: 731px; overflow-y: scroll">
|
||||
<div></div>
|
||||
|
||||
</div> *@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="widthLeftCurrentDay ps-0 d-none d-md-block">
|
||||
<div class="row p-0 g-3">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="wrapper">
|
||||
<div class="rollcall-list Rtable Rtable--5cols Rtable--collapse px-1">
|
||||
|
||||
<div class="w-100 my-1">
|
||||
<div class="absenceHeadColorTop" style="border-radius: 10px 10px 0 0;">غیبت</div>
|
||||
<div class="Rtable-row Rtable-row--head align-items-center d-flex table-rollcall-absent absenceHeadColor">
|
||||
<div class="Rtable-cell column-heading width1">ردیف</div>
|
||||
<div class="Rtable-cell column-heading width2">نام پرسنل</div>
|
||||
<div class="Rtable-cell column-heading width3">شماره پرسنلی</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="w-100 heightLeftCurrentDay">
|
||||
<div></div>
|
||||
@if (@Model.RollCallViewModels.AbsentEmployees.Any(x => !x.HasLeave))
|
||||
{
|
||||
@foreach (var item in Model.RollCallViewModels.AbsentEmployees)
|
||||
{
|
||||
if (!item.HasLeave)
|
||||
{
|
||||
<div class="Rtable-row align-items-center position-relative table-rollcall-absent absenceItem absenceItem-row">
|
||||
<div class="Rtable-cell width1">
|
||||
<div class="Rtable-cell--heading d-none">
|
||||
ردیف
|
||||
</div>
|
||||
<div class="Rtable-cell--content">
|
||||
<div class="d-flex justify-content-center align-items-center table-number">
|
||||
@(indexAbsent++)
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="Rtable-cell width2">
|
||||
<div class="Rtable-cell--heading d-none">نام پرسنل</div>
|
||||
<div class="Rtable-cell--content employee-name">
|
||||
@item.EmployeeFullName
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="Rtable-cell width3">
|
||||
<div class="Rtable-cell--content text-center">
|
||||
<div class="d-md-none d-none">شماره پرسنلی: </div>
|
||||
<div class="d-flex ms-1">@item.PersonnelCode</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<partial name="Company/Partial/_EmptySection"></partial>
|
||||
}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="wrapper">
|
||||
<div class="rollcall-list Rtable Rtable--5cols Rtable--collapse px-1">
|
||||
|
||||
<div class="w-100 my-1">
|
||||
<div class="leaveHeadColorTop" style="border-radius: 10px 10px 0 0;">مرخصی</div>
|
||||
<div class="Rtable-row Rtable-row--head align-items-center d-flex table-rollcall-leave leaveHeadColor">
|
||||
<div class="Rtable-cell column-heading width1">ردیف</div>
|
||||
<div class="Rtable-cell column-heading width2">نام پرسنل</div>
|
||||
<div class="Rtable-cell column-heading width3">شماره پرسنلی</div>
|
||||
<div class="Rtable-cell column-heading width4 text-center">نوع مرخصی</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="w-100 heightLeftCurrentDay">
|
||||
<div></div>
|
||||
@if (@Model.RollCallViewModels.AbsentEmployees.Any(x => x.HasLeave))
|
||||
{
|
||||
@foreach (var item in Model.RollCallViewModels.AbsentEmployees)
|
||||
{
|
||||
if (item.HasLeave)
|
||||
{
|
||||
<div class="Rtable-row align-items-center position-relative table-rollcall-leave leaveItem leaveItem-row">
|
||||
<div class="Rtable-cell width1">
|
||||
<div class="Rtable-cell--heading d-none">
|
||||
ردیف
|
||||
</div>
|
||||
<div class="Rtable-cell--content">
|
||||
<div class="d-flex justify-content-center align-items-center table-number">
|
||||
@(indexLeave++)
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="Rtable-cell width2">
|
||||
<div class="Rtable-cell--heading d-none">نام پرسنل</div>
|
||||
<div class="Rtable-cell--content employee-name">
|
||||
@item.EmployeeFullName
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="Rtable-cell width3">
|
||||
<div class="Rtable-cell--content text-center">
|
||||
<div class="d-md-none d-none">شماره پرسنلی: </div>
|
||||
<div class="d-flex ms-1">@item.PersonnelCode</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="Rtable-cell width4">
|
||||
<div class="Rtable-cell--content text-center">
|
||||
<div class="d-md-none d-none"></div>
|
||||
<div class="d-flex ms-1">@item.Reason</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<partial name="Company/Partial/_EmptySection"></partial>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row p-lg-2 d-block d-md-none">
|
||||
<div class="card pt-2">
|
||||
<div class="col-12">
|
||||
<div class="btnsRollCallOnlline">
|
||||
<button class="btnRollCallStatus active" onclick="loadRollCallStatus('all')">آنلاین</button>
|
||||
<button class="btnRollCallStatus" onclick="loadRollCallStatus('leave')">مرخصی <span id="leaveCount"></span></button>
|
||||
<button class="btnRollCallStatus" onclick="loadRollCallStatus('absent')">غیبت <span id="absentCount"></span></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wrapper">
|
||||
<div class="rollcall-list-mobile Rtable Rtable--5cols Rtable--collapse px-1">
|
||||
<div class="w-100" id="loadRollCallTypeAjax">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="MainModal" class="modal fade" aria-labelledby="myModalLabel" aria-hidden="true" tabindex="-1" data-bs-backdrop="static" style="display: none;">
|
||||
<div class="modal-dialog modal-md modalRollCallWidth modal-dialog-centered">
|
||||
<div class="modal-content" id="ModalContent">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@section Script {
|
||||
<script src="~/AssetsClient/js/dropdown.js?ver=@Version.StyleVersion"></script>
|
||||
<script src="~/assetsclient/js/site.js?ver=@clientVersion"></script>
|
||||
<script src="~/AssetsClient/js/dropdown.js?ver=@clientVersion"></script>
|
||||
<script>
|
||||
var antiForgeryToken = $(`@Html.AntiForgeryToken()`).val();
|
||||
var loadRollCallMoreAjax = "@Url.Page("./CurrentDay", "CurrentDayAjax")";
|
||||
var loadRollCallAbsentLeaveCountAjax = "@Url.Page("./CurrentDay", "CurrentAjaxCount")";
|
||||
|
||||
// check and show modal Camera Account And Workshop Setting
|
||||
var statusCameraAccountAndWorkshopSettingUrl = `@Url.Page("./Index", "StatusCameraAccountAndWorkshopSetting")`;
|
||||
var saveCameraAccountUrl = `@Url.Page("./Index", "SaveCameraAccountAndWorkshopSetting")`;
|
||||
</script>
|
||||
<script src="~/assetsclient/pages/rollcall/js/currentday.js?ver=1235456"></script>
|
||||
<script src="~/assetsclient/pages/rollcall/js/currentday.js?ver=@clientVersion"></script>
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
@@ -200,6 +200,9 @@
|
||||
var deActivePersonnelAjax = `@Url.Page("./EmployeeUploadPicture", "DeActivePersonnel")`;
|
||||
var activePersonnelAjax = `@Url.Page("./EmployeeUploadPicture", "ActivePersonnel")`;
|
||||
|
||||
// check and show modal Camera Account And Workshop Setting
|
||||
var statusCameraAccountAndWorkshopSettingUrl = `@Url.Page("./Index", "StatusCameraAccountAndWorkshopSetting")`;
|
||||
var saveCameraAccountUrl = `@Url.Page("./Index", "SaveCameraAccountAndWorkshopSetting")`;
|
||||
</script>
|
||||
<script src="~/assetsclient/pages/rollcall/js/employeeuploadpicture.js?ver=@clientVersion"></script>
|
||||
}
|
||||
@@ -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>
|
||||
|
||||
@@ -161,6 +161,10 @@
|
||||
var workshopSettingId = Number((@Model.RollCallWorkshopSettings.Id));
|
||||
var isShiftChangedGlobal = false;
|
||||
var titleOfGroup = "";
|
||||
|
||||
// check and show modal Camera Account And Workshop Setting
|
||||
var statusCameraAccountAndWorkshopSettingUrl = `@Url.Page("./Index", "StatusCameraAccountAndWorkshopSetting")`;
|
||||
var saveCameraAccountUrl = `@Url.Page("./Index", "SaveCameraAccountAndWorkshopSetting")`;
|
||||
</script>
|
||||
<script src="~/assetsclient/pages/rollcall/js/grouping.js?ver=@clientVersion"></script>
|
||||
}
|
||||
@@ -307,16 +307,16 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var hasRollCallService = @(Model.CheckRollCallService == true ? "true" : "false");
|
||||
var hasCameraAccount = @Model.HasCameraAccount;
|
||||
var hasRollCallWorkshopSetting = @Model.HasRollCallWorkshopSetting;
|
||||
var saveCameraAccountUrl = `#showmodal=@Url.Page("./Index", "SaveCameraAccountAndWorkshopSetting")`;
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
@section Script {
|
||||
<script src="~/assetsclient/js/site.js?ver=@clientVersion"></script>
|
||||
<script src="~/assetsclient/pages/rollcall/js/index.js"></script>
|
||||
<script>
|
||||
var antiForgeryToken = $(`@Html.AntiForgeryToken()`).val();
|
||||
var hasRollCallService = @(Model.CheckRollCallService == true ? "true" : "false");
|
||||
var hasCameraAccount = @Model.HasCameraAccount;
|
||||
var hasRollCallWorkshopSetting = @Model.HasRollCallWorkshopSetting;
|
||||
var statusCameraAccountAndWorkshopSettingUrl = `@Url.Page("./Index", "StatusCameraAccountAndWorkshopSetting")`;
|
||||
var saveCameraAccountUrl = `@Url.Page("./Index", "SaveCameraAccountAndWorkshopSetting")`;
|
||||
</script>
|
||||
|
||||
<script src="~/assetsclient/js/site.js?ver=@clientVersion"></script>
|
||||
<script src="~/assetsclient/pages/rollcall/js/index.js?ver=@clientVersion"></script>
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user