add grouping search for loan reward SA fine

This commit is contained in:
MahanCh
2025-04-13 22:23:25 +03:30
parent 4f673f22d5
commit ac46886922
71 changed files with 15882 additions and 1534 deletions

View File

@@ -8,7 +8,8 @@ namespace _0_Framework.Application
Client,
SubAccount,
Camera,
Admin
Admin,
System
}
}

View File

@@ -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;
}
}

View File

@@ -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
}

View File

@@ -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);

View File

@@ -12,4 +12,6 @@ public interface ILoanRepository:IRepository<long,Loan>
void Remove(Loan entity);
List<Loan> GetBy(IEnumerable<long> ids);
void RemoveRange(IEnumerable<Loan> loans);
LoanGroupedViewModel GetSearchListAsGrouped(LoanSearchViewModel searchModel);
}

View File

@@ -18,6 +18,6 @@ public interface IRewardRepository : IRepository<long, Reward>
/// <summary>
/// گروهبندی بر اساس ماه هنگام جستجو با انتخاب کارمند
/// </summary>
List<MonthlyGroupedEmployeeRewardsViewModel> GetSearchListByEmployee(RewardSearchModel searchModel);
RewardsGroupedViewModel GetSearchListAsGrouped(RewardSearchModel searchModel);
#endregion
}

View File

@@ -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;
}

View File

@@ -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
}

View File

@@ -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(){}
private SalaryAid()
{
public SalaryAid(long employeeId, long workshopId, double amount, DateTime salaryAidDateTime)
}
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;
}
}

View File

@@ -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; }
}

View File

@@ -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; }
}

View File

@@ -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; }
}

View File

@@ -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; }
}

View 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; }
}

View File

@@ -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
}

View File

@@ -1,5 +1,6 @@
using System.Collections.Generic;
using _0_Framework.Application;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace CompanyManagment.App.Contracts.Loan;
@@ -11,4 +12,14 @@ public interface ILoanApplication
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; }
}

View File

@@ -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; }
}

View File

@@ -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; }
}

View File

@@ -16,4 +16,5 @@ public class LoanSearchViewModel
public string EndDate { get; set; }
public int PageIndex { get; set; }
public bool ShowAsGrouped { get; set; }
}

View File

@@ -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; }
}

View File

@@ -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; }

View File

@@ -17,7 +17,7 @@ public interface IRewardApplication
/// <summary>
/// گروهبندی بر اساس ماه هنگام جستجو با انتخاب کارمند
/// </summary>
List<MonthlyGroupedEmployeeRewardsViewModel> GetSearchListByEmployee(RewardSearchModel searchModel);
RewardsGroupedViewModel GetSearchListAsGrouped(RewardSearchModel searchModel);
#endregion
}

View File

@@ -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; }
}

View File

@@ -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; }
}

View File

@@ -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; }
}

View File

@@ -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; }
}

View File

@@ -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; }
}

View File

@@ -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);
}

View File

@@ -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; }
}

View File

@@ -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; }
}

View File

@@ -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; }
}

View File

@@ -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; }
}

View File

@@ -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; }
}

View File

@@ -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; }
}

View File

@@ -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);
}
}
}

View File

@@ -6,11 +6,13 @@ using System.Reflection.Metadata.Ecma335;
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 +20,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)
@@ -51,15 +57,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 +74,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 +108,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 +241,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 +269,9 @@ public class LoanApplication : ILoanApplication
_loanRepository.SaveChanges();
return op.Succcedded();
}
public LoanGroupedViewModel GetSearchListAsGrouped(LoanSearchViewModel searchModel)
{
return _loanRepository.GetSearchListAsGrouped(searchModel);
}
}

View File

@@ -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,6 +18,7 @@ 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)
{
@@ -27,7 +29,7 @@ public class RewardApplication : IRewardApplication
public List<RewardViewModel> GetSearchList(RewardSearchModel searchModel)
{
return _rewardRepository.GetSearchList(searchModel);
return _rewardRepository.GetSearchList(searchModel);
}
@@ -37,23 +39,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 +71,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 +96,7 @@ public class RewardApplication : IRewardApplication
}
if (command.Amount.Length>15)
if (command.Amount.Length > 15)
{
return op.Failed("مبلغ وارد شده معتبر نیست");
}
@@ -97,18 +107,27 @@ 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 +159,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

View File

@@ -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
}

View File

@@ -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);
}
}

View File

@@ -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);
}
}

View File

@@ -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);
}
}

View File

@@ -11,5 +11,9 @@ 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);
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -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");
}
}
}

View File

@@ -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");

View File

@@ -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
}
}

View File

@@ -1,4 +1,5 @@
using _0_Framework.InfraStructure;
using System;
using _0_Framework.InfraStructure;
using Company.Domain.LoanAgg;
using Company.Domain.LoanAgg.Entities;
using CompanyManagment.App.Contracts.Loan;
@@ -6,72 +7,192 @@ using System.Collections.Generic;
using System.Linq;
using _0_Framework.Application;
using Microsoft.EntityFrameworkCore;
using System.Globalization;
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)
{
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);
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);
}
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 employeeIds = query.Select(x => x.EmployeeId);
var personnelCodes = _companyContext.PersonnelCodeSet.Where(x => x.WorkshopId == searchViewModel.WorkshopId && employeeIds.Contains(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 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();
}
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();
}
}

View File

@@ -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,9 +50,9 @@ 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
@@ -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;
result.ForEach(x =>
{
x.YearFa = x.GrantDateFa.Substring(0, 4);
x.MonthFa = x.GrantDateFa.Substring(5, 2);
});
//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(),
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();
//}).ToList();
}
#endregion
}

View File

@@ -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();
}

View File

@@ -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
}

View File

@@ -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

View File

@@ -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" />
@@ -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>

View File

@@ -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 OnGetLoadDataByEmployeeAjax(FineSearchViewModel searchViewModel)
{
searchViewModel.WorkshopId = _workshopId;
var result = _fineApplication.GetSearchListAsGrouped(searchViewModel);
return new JsonResult(new
{
success = true,
data = result,
});
}
public IActionResult OnGetEmployeeList()
{
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);
var employees = _employeeApplication.GetWorkingEmployeesByWorkshopId(_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
});
}
}
}

View File

@@ -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" />
@@ -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 class="personnel-selector-navFilter p-0">
<select class="form-select employeeName select2OptionIndex" id="employeeSelectIndex" aria-label="انتخاب پرسنل ...">
</select>
</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="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="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 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,7 +367,8 @@
<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")`;

View File

@@ -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);
@@ -227,5 +218,15 @@ namespace ServiceHost.Areas.Client.Pages.Company.Loan
message = result.Message,
});
}
public IActionResult OnGetSearch(LoanSearchViewModel searchModel)
{
searchModel.WorkshopId = _workshopId;
var result = _loanApplication.GetSearchListAsGrouped(searchModel);
return new JsonResult(new
{
data = result
});
}
}
}

View File

@@ -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">
@@ -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")`;

View File

@@ -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,12 +65,11 @@ 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()
});
}
@@ -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
});
}
}
}

View File

@@ -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" />
@@ -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,11 +148,11 @@
</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">
<div class="col-12 col-md-6 col-lg-4 d-flex gap-2">
<div class="col-xl-4 col-lg-4 col-md-5 col-sm-12 d-flex gap-1">
<button class="btn-create mb-1" onclick="openCreateSalaryAidModal()" Permission="@SubAccountPermissionHelper.CreateSalaryAidPermissionCode">
<svg width="22" height="22" 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" />
@@ -145,7 +179,7 @@
لیست مساعده
</span>
</div>
<div class="col-12 col-md-6 col-lg-4 text-end">
<div class="col-6 col-md-6 col-sm-6 d-none d-sm-block text-end">
@* <div class="d-flex align-items-center justify-content-end my-1">
<button class="btn-print-all" type="button" onclick="printAll()">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none">
@@ -170,34 +204,69 @@
</div>
</div>
<div class="wrapper">
<div class="salaryaidList Rtable Rtable--collapse">
<div class="wrapper LoadSalaryAidList" id="LoadSalaryAidList">
<div class="salaryaidList contract-list 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 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 text-end pe-2 width8">عملیات</div>
</div>
<div class="Rtable-row Rtable-row--head align-items-center sticky-div">
<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 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 text-end pe-2 width8">عملیات</div>
</div>
<div class="w-100" id="salaryaidListAjax">
</div>
<div class="w-100" id="salaryAidListAjax">
</div>
</div>
</div>
</div>
</div>
</div>
<div class="salaryAid-grid LoadSalaryAidListWithEmployee d-none" id="LoadSalaryAidListWithEmployee">
<div class="Rtable Rtable--5cols Rtable--collapse salaryAid-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 width1">
<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 " 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 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="salaryaidEmployeeListAjax">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<input type="hidden" asp-for="@Model.PageIndex" />
<input type="hidden" id="PageIndex" asp-for="@Model.PageIndex" />
<!-- Modal From Bottom For Advance Search -->
@@ -225,11 +294,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>
@@ -272,12 +371,13 @@
<script src="~/assetsclient/libs/cleave/cleave.min.js"></script>
<script>
var antiForgeryToken = $(`@Html.AntiForgeryToken()`).val();
var salaryaidListLoadDataAjax = `@Url.Page("./Index", "LoadDataAjax")`;
// var salaryAidListLoadDataAjax = `@Url.Page("./Index", "LoadDataAjax")`;
var employeeListAjax = `@Url.Page("./Index", "EmployeeList")`;
var salaryAidGroupLoadDataAjax = `@Url.Page("./Index", "Search")`;
var removeSalaryAidAjax = `@Url.Page("./Index", "Remove")`;
var editPermission = @(AuthHelper.GetPermissions().Contains(SubAccountPermissionHelper.EditSalaryAidPermissionCode) ? "true" : "false");
var deletePermission = @(AuthHelper.GetPermissions().Contains(SubAccountPermissionHelper.DeleteSalaryAidPermissionCode) ? "true" : "false");
</script>
<script src="~/assetsclient/pages/salaryaid/js/index.js?ver=clientVersion"></script>
<script src="~/assetsclient/pages/salaryaid/js/index.js?ver=@clientVersion"></script>
}

View File

@@ -67,12 +67,11 @@ namespace ServiceHost.Areas.Client.Pages.Company.SalaryAid
{
searchViewModel.WorkshopId = _workshopId;
var result = _salaryAidApplication.GetSearchList(searchViewModel);
var result = _salaryAidApplication.GetSearchListAsGrouped(searchViewModel);
return new JsonResult(new
{
success = true,
data = result,
pageIndex = result.Count()
});
}
@@ -176,5 +175,15 @@ namespace ServiceHost.Areas.Client.Pages.Company.SalaryAid
});
}
public IActionResult OnGetSearch(SalaryAidSearchViewModel searchModel)
{
searchModel.WorkshopId = _workshopId;
var result = _salaryAidApplication.GetSearchListAsGrouped(searchModel);
return new JsonResult(new
{
data = result
});
}
}
}

View File

@@ -5,6 +5,138 @@
.fineListModal-width .modal-content {
/*height: 430px;*/
}
.Rtable .Rtable-row .Rtable-cell.column-heading {
padding: 0.2em 0;
}
.Rtable-row .btn-details {
background-color: #D3F8F8;
color: #4DA9D1;
border-radius: 7px;
border: 0 !important;
padding: 6px 8px;
font-size: 12px;
}
.leaveDiv {
padding: 10px;
margin: 6px;
background-color: #ffffff;
color: #000;
border-radius: 5px;
font-size: 11px;
font-weight: 400;
}
.Rtable .Rtable-row .Rtable-cell .Rtable-cell--content > span {
border-radius: 5px;
background: rgba(87, 227, 227, 0.25);
width: 45px;
height: 32px;
display: inline-block;
padding: 6px;
}
.form-check-input[type="radio"], .form-check-input[type="checkbox"] {
padding: 8px;
}
.table-contracts .Rtable .Rtable-row .column-heading > span input {
margin: 0 0 0 5px;
}
.form-check-input[type="radio"], .form-check-input[type="checkbox"] {
border-radius: 4px !important;
border: 0 !important;
outline: 1px solid #1dc9a0;
margin: 2px 0;
}
.table-contracts .form-check-input {
padding: 8px !important;
border: 0 !important;
outline: 1px solid #1dc9a0;
}
.btn-search {
background: #84CC16;
width: 100%;
height: 36px;
}
.tm-selection-rad:checked + .btn, :not(.tm-selection-rad) + .btn:active, .btn:first-child:active, .btn.active, .btn.show {
color: #ffffff;
background: linear-gradient(94deg, #2EBEBE 1.59%, #1E9D9D 47.86%, #0B7878 101.16%);
border: none;
}
.tm-rad, .tm-selection-rad {
position: absolute;
clip: rect(0, 0, 0, 0);
pointer-events: none;
}
.search-box .radio-btn {
color: #717171;
padding: 0;
border-radius: 8px;
border: 1px solid #DADADA;
background-color: white;
outline: none;
width: 100%;
height: 36px;
font-size: 13px;
display: flex;
align-items: center;
justify-items: center;
text-align: center;
}
.select2-container .select2-selection--single, #start-date, #end-date {
height: 36px;
}
.personnel-selector-navFilter {
width: 15%;
}
.start-date-navbarFilter {
width: 12%;
}
.end-date-navbarFilter {
width: 12%;
}
.list-navbarFilter {
width: 7%;
}
.group-navbarFilter {
width: 7%;
}
.search-navbarFilter {
width: 10%;
}
.clearSearch-navbarFilter {
width: 10%;
}
.personnel-selector-navFilter,
.start-date-navbarFilter,
.end-date-navbarFilter,
.list-navbarFilter,
.group-navbarFilter,
.search-navbarFilter,
.clearSearch-navbarFilter {
height: 36px;
}
.sweet-alert button {
font-family: 'IRANYekanX';
@@ -43,15 +175,15 @@
}
.width2 {
width: 18% !important;
width: 10% !important;
}
.width3 {
width: 15% !important;
width: 10% !important;
}
.width4 {
width: 15% !important;
width: 20% !important;
}
.width5 {
@@ -59,11 +191,11 @@
}
.width6 {
width: 5% !important;
width: 8% !important;
}
.width7 {
width: 10% !important;
width: 15% !important;
text-align: center;
}
@@ -174,7 +306,6 @@
.form-check-input[type="radio"]:checked,
.form-check-input[type="checkbox"]:checked {
background-color: #148989;
border: 1px solid #ffffff !important;
background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="white" stroke-width="3"%3E%3Cpath stroke-linecap="round" stroke-linejoin="round" d="M5 13l4 4L19 7" /%3E%3C/svg%3E');
background-size: 75%;
}
@@ -185,20 +316,23 @@
box-shadow: none;
}
.form-check-input[type="radio"] + label,
.form-check-input[type="checkbox"] + label {
color: #83898C;
}
.form-check-input[type="radio"]:checked + label,
.form-check-input[type="checkbox"]:checked + label {
color: #2B2F32;
}
/************************ Radio Button Input (Like Checkbox appearance) ************************/
/************************* row grid *************************/
#fineEmployeesList .personal-grid-row:nth-of-type(odd) .Rtable-row {
background: #ECFFFF !important;
border: 1px solid #E9E9E9 !important;
}
#fineEmployeesList .personal-grid-row:nth-of-type(even) .Rtable-row {
background: #DDF4F4 !important;
border: 1px solid #E9E9E9 !important;
}
/************************* row grid *************************/
@media (max-width: 1366px) {
.fineListModal-width {
@@ -232,6 +366,17 @@
margin: 0 0 60px 0;
}
.prevent-select > span{
width: 30px !important;
}
input[name="foo"] {
display: none !important;
}
.Rtable--collapse .Rtable-row .Rtable-cell .Rtable-cell--content {
text-align: start;
}
/*
.Rtable .Rtable-row:nth-child(even), .table-workshop .Rtable .Rtable-row:nth-child(4n+2), .table-personals .Rtable .Rtable-row:nth-child(4n+2) {
border-radius: 10px;

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,24 @@
.loanListModal-width {
/*----------------------------------------------------------- group table */
/*.personal-grid-row:nth-child(n+1) .Rtable-row {
border: 1px solid #eee !important;
}*/
.table-list .Rtable-row:nth-child(2n) {
border-radius: 10px;
background-color: #ECFFFF;
transition: all .3s ease;
border: 1px solid #eee;
}
.table-list .Rtable-row:nth-child(4n+2) {
border-radius: 10px;
background-color: #DDF4F4;
transition: all .3s ease;
border: 1px solid #eee;
}
.loanListModal-width {
max-width: 460px;
}
@@ -6,6 +26,141 @@
/*height: 430px;*/
}
.Rtable .Rtable-row .Rtable-cell.column-heading {
padding: 0.2em 0;
}
.Rtable-row .btn-details {
background-color: #D3F8F8;
color: #4DA9D1;
border-radius: 7px;
border: 0 !important;
padding: 6px 8px;
font-size: 12px;
}
.leaveDiv {
padding: 10px;
margin: 6px;
background-color: #ffffff;
color: #000;
border-radius: 5px;
font-size: 11px;
font-weight: 400;
}
.Rtable .Rtable-row .Rtable-cell .Rtable-cell--content > span {
border-radius: 5px;
background: rgba(87, 227, 227, 0.25);
width: 45px;
height: 32px;
display: inline-block;
padding: 6px;
}
.form-check-input[type="radio"], .form-check-input[type="checkbox"] {
padding: 8px;
}
.table-contracts .Rtable .Rtable-row .column-heading > span input {
margin: 0 0 0 5px;
}
.form-check-input[type="radio"], .form-check-input[type="checkbox"] {
border-radius: 4px;
border: 0 !important;
outline: 1px solid #1dc9a0;
margin: 2px 0;
}
.table-contracts .form-check-input {
padding: 8px !important;
border: 0 !important;
outline: 1px solid #1dc9a0;
}
.btn-search {
background: #84CC16;
width: 100%;
height: 36px;
}
.tm-selection-rad:checked + .btn, :not(.tm-selection-rad) + .btn:active, .btn:first-child:active, .btn.active, .btn.show {
color: #ffffff;
background: linear-gradient(94deg, #2EBEBE 1.59%, #1E9D9D 47.86%, #0B7878 101.16%);
border: none;
}
.tm-rad, .tm-selection-rad {
position: absolute;
clip: rect(0, 0, 0, 0);
pointer-events: none;
}
.search-box .radio-btn {
color: #717171;
padding: 0;
border-radius: 8px;
border: 1px solid #DADADA;
background-color: white;
outline: none;
width: 100%;
height: 36px;
font-size: 13px;
display: flex;
align-items: center;
justify-items: center;
text-align: center;
}
.select2-container .select2-selection--single, #start-date, #end-date {
height: 36px;
}
.personnel-selector-navFilter {
width: 15%;
}
.start-date-navbarFilter {
width: 12%;
}
.end-date-navbarFilter {
width: 12%;
}
.list-navbarFilter {
width: 7%;
}
.group-navbarFilter {
width: 7%;
}
.search-navbarFilter {
width: 10%;
}
.clearSearch-navbarFilter {
width: 10%;
}
.personnel-selector-navFilter,
.start-date-navbarFilter,
.end-date-navbarFilter,
.list-navbarFilter,
.group-navbarFilter,
.search-navbarFilter,
.clearSearch-navbarFilter {
height: 36px;
}
.errored {
animation: shake 300ms;
color: #eb3434 !important;
@@ -161,7 +316,7 @@
.form-check-input[type="checkbox"] {
width: 15px;
height: 15px;
border-radius: 6px;
border-radius: 4px;
padding: 8px;
border: 1px solid #CFD3D4;
background-color: white;
@@ -185,19 +340,23 @@
box-shadow: none;
}
.form-check-input[type="radio"] + label,
.form-check-input[type="checkbox"] + label {
color: #83898C;
}
.form-check-input[type="radio"]:checked + label,
.form-check-input[type="checkbox"]:checked + label {
color: #2B2F32;
}
/************************ Radio Button Input (Like Checkbox appearance) ************************/
/************************* row grid *************************/
#rewardEmployeesList .personal-grid-row:nth-of-type(odd) .Rtable-row {
background: #ECFFFF !important;
border: 1px solid #E9E9E9 !important;
}
#rewardEmployeesList .personal-grid-row:nth-of-type(even) .Rtable-row {
background: #DDF4F4 !important;
border: 1px solid #E9E9E9 !important;
}
/************************* row grid *************************/
@media (max-width: 1366px) {
@@ -236,6 +395,10 @@
margin: 0 0 60px 0;
}
input[name="foo"] {
display: none !important;
}
/*
.Rtable .Rtable-row:nth-child(even), .table-workshop .Rtable .Rtable-row:nth-child(4n+2), .table-personals .Rtable .Rtable-row:nth-child(4n+2) {
border-radius: 10px;

File diff suppressed because it is too large Load Diff

View File

@@ -1,14 +1,35 @@
var urlPathname = location.pathname;
//var Scrollbar = window.Scrollbar;
//Scrollbar.init(document.querySelector('#amountRials'), {
// alwaysShowTracks: true
//});
document.querySelectorAll('.scroll-container-amount').forEach(container => {
let isDown = false;
let startX;
let scrollLeft;
//Scrollbar.init(document.querySelector('#amountTomans'), {
// alwaysShowTracks: true
//});
container.addEventListener('mousedown', (e) => {
isDown = true;
startX = e.pageX - container.offsetLeft;
scrollLeft = container.scrollLeft;
container.style.cursor = "grabbing";
});
container.addEventListener('mouseleave', () => {
isDown = false;
container.style.cursor = "grab";
});
container.addEventListener('mouseup', () => {
isDown = false;
container.style.cursor = "grab";
});
container.addEventListener('mousemove', (e) => {
if (!isDown) return;
e.preventDefault();
const x = e.pageX - container.offsetLeft;
const walk = (x - startX) * 2;
container.scrollLeft = scrollLeft - walk;
});
});
$(document).ready(function () {
$('.loading').hide();
@@ -381,7 +402,8 @@ function SaveDataAjax() {
}, 2000);
if (urlPathname.indexOf('/Client/Company/Loan') > -1) {
$('#loanListAjax').html('');
$('#loanListAjax').html('<div></div>');
$('#loanEmployeesList').html('');
$('#PageIndex').val(0);
pageIndexJs = 0;
loadLoanList();

View File

@@ -1,7 +1,193 @@
.rewardListModal-width {
/*tooltip styles*/
.tooltipfull-container {
cursor: pointer;
position: relative;
}
.tooltipfull {
opacity: 0;
z-index: 99;
color: #fff;
display: grid;
font-size: 12px;
padding: 5px 10px;
border-radius: 8px;
background: #23a8a8;
border: 1px solid #23a8a8;
-webkit-transition: all .2s ease-in-out;
-moz-transition: all .2s ease-in-out;
-o-transition: all .2s ease-in-out;
transition: all .2s ease-in-out;
-webkit-transform: scale(0);
-moz-transform: scale(0);
-o-transform: scale(0);
-ms-transform: scale(0);
transform: scale(0);
position: absolute;
right: -2px;
bottom: 30px;
white-space: nowrap;
}
.tooltipfull-container:hover .tooltipfull, a:hover .tooltipfull {
opacity: 1;
-webkit-transform: scale(1);
-moz-transform: scale(1);
-o-transform: scale(1);
-ms-transform: scale(1);
transform: scale(1);
}
.tooltipfull:before, .tooltipfull:after {
content: '';
border-left: 10px solid transparent;
border-right: 10px solid transparent;
border-top: 10px solid #23a8a8;
position: absolute;
bottom: -10px;
right: 15px;
}
/*tooltip styles*/
.rewardListModal-width {
max-width: 460px;
}
.Rtable .Rtable-row .Rtable-cell.column-heading {
padding: 0.2em 0;
}
.Rtable-row .btn-details {
background-color: #D3F8F8;
color: #4DA9D1;
border-radius: 7px;
border: 0 !important;
padding: 6px 8px;
font-size: 12px;
}
.leaveDiv {
padding: 10px;
margin: 6px;
background-color: #ffffff;
color: #000;
border-radius: 5px;
font-size: 11px;
font-weight: 400;
}
.Rtable .Rtable-row .Rtable-cell .Rtable-cell--content > span {
border-radius: 5px;
background: rgba(87, 227, 227, 0.25);
width: 45px;
height: 32px;
display: inline-block;
padding: 6px;
}
.form-check-input[type="radio"], .form-check-input[type="checkbox"] {
padding: 8px;
}
.table-contracts .Rtable .Rtable-row .column-heading > span input {
margin: 0 0 0 5px;
}
.form-check-input[type="radio"], .form-check-input[type="checkbox"] {
border-radius: 4px;
border: 0 !important;
outline: 1px solid #1dc9a0;
margin: 2px 0;
}
.table-contracts .form-check-input {
padding: 8px !important;
border: 0 !important;
outline: 1px solid #1dc9a0;
}
.btn-search {
background: #84CC16;
width: 100%;
height: 36px;
}
.tm-selection-rad:checked + .btn, :not(.tm-selection-rad) + .btn:active, .btn:first-child:active, .btn.active, .btn.show {
color: #ffffff;
background: linear-gradient(94deg, #2EBEBE 1.59%, #1E9D9D 47.86%, #0B7878 101.16%);
border: none;
}
.tm-rad, .tm-selection-rad {
position: absolute;
clip: rect(0, 0, 0, 0);
pointer-events: none;
}
.search-box .radio-btn {
color: #717171;
padding: 0;
border-radius: 8px;
border: 1px solid #DADADA;
background-color: white;
outline: none;
width: 100%;
height: 36px;
font-size: 13px;
display: flex;
align-items: center;
justify-items: center;
text-align: center;
}
.select2-container .select2-selection--single, #start-date, #end-date {
height: 36px;
}
.personnel-selector-navFilter {
width: 15%;
}
.start-date-navbarFilter{
width:12%;
}
.end-date-navbarFilter{
width:12%;
}
.list-navbarFilter{
width:7%;
}
.group-navbarFilter{
width:7%;
}
.search-navbarFilter{
width:10%;
}
.clearSearch-navbarFilter {
width:10%;
}
.personnel-selector-navFilter,
.start-date-navbarFilter,
.end-date-navbarFilter,
.list-navbarFilter,
.group-navbarFilter,
.search-navbarFilter,
.clearSearch-navbarFilter {
height: 36px;
}
.rewardListModal-width .modal-content {
/*height: 430px;*/
}
@@ -16,23 +202,79 @@
background-color: #fef2f2 !important;
border: 1px solid #eb3434 !important;
border-radius: 7px;
overflow: hidden;
}
.goToTop {
position: fixed;
bottom: -10px;
margin-right: 100px;
z-index: 100;
color: #fff;
background-color: #25acacd6;
display: none;
.errored .select2-selection .select2-selection--single {
background-color: #fef2f2 !important;
}
.goToTop:hover {
.goToTop {
position: fixed;
bottom: -10px;
margin-right: 100px;
z-index: 100;
color: #fff;
background-color: #2ca4a4;
background-color: #25acacd6;
display: none;
}
.goToTop:hover {
color: #fff;
background-color: #2ca4a4;
}
.tooltipfull-container {
cursor: pointer;
position: relative;
}
.tooltipfull {
opacity: 0;
z-index: 99;
color: #fff;
display: grid;
font-size: 12px;
padding: 5px 10px;
border-radius: 8px;
background: #23a8a8;
border: 1px solid #23a8a8;
-webkit-transition: all .2s ease-in-out;
-moz-transition: all .2s ease-in-out;
-o-transition: all .2s ease-in-out;
transition: all .2s ease-in-out;
-webkit-transform: scale(0);
-moz-transform: scale(0);
-o-transform: scale(0);
-ms-transform: scale(0);
transform: scale(0);
position: absolute;
right: -2px;
bottom: 30px;
white-space: nowrap;
}
.tooltipfull-container:hover .tooltipfull, a:hover .tooltipfull {
opacity: 1;
-webkit-transform: scale(1);
-moz-transform: scale(1);
-o-transform: scale(1);
-ms-transform: scale(1);
transform: scale(1);
}
.tooltipfull:before, .tooltipfull:after {
content: '';
border-left: 10px solid transparent;
border-right: 10px solid transparent;
border-top: 10px solid #23a8a8;
position: absolute;
bottom: -10px;
right: 20px;
}
.width1 {
width: 5% !important;
}
@@ -200,9 +442,9 @@
padding: 3px;
}
.Rtable--collapse .Rtable-row {
/*.Rtable--collapse .Rtable-row {
padding: 5px;
}
}*/
.personal-paid-leave-mobile.Rtable .Rtable-row,
.personal-payment-mobile.Rtable .Rtable-row {
@@ -314,7 +556,7 @@
/************************ Radio Button Input (Like Checkbox appearance) ************************/
.form-check-input[type="radio"],
/*.form-check-input[type="radio"],
.form-check-input[type="checkbox"] {
width: 15px;
height: 15px;
@@ -340,9 +582,9 @@
.form-check-input[type="checkbox"]:focus {
outline: none;
box-shadow: none;
}
}*/
.form-check-input[type="radio"] + label,
/*.form-check-input[type="radio"] + label,
.form-check-input[type="checkbox"] + label {
color: #83898C;
}
@@ -351,10 +593,25 @@
.form-check-input[type="checkbox"]:checked + label {
color: #2B2F32;
}
*/
/************************ Radio Button Input (Like Checkbox appearance) ************************/
/************************* row grid *************************/
#rewardEmployeesList .personal-grid-row:nth-of-type(odd) .Rtable-row {
background: #ECFFFF !important;
border: 1px solid #E9E9E9 !important;
}
#rewardEmployeesList .personal-grid-row:nth-of-type(even) .Rtable-row {
background: #DDF4F4 !important;
border: 1px solid #E9E9E9 !important;
}
/************************* row grid *************************/
@media (max-width: 1366px) {
.rewardListModal-width {
max-width: 390px;
@@ -373,6 +630,37 @@
}
}
@media(max-width: 992px) {
.personnel-selector-navFilter {
width: 15%;
}
.start-date-navbarFilter {
width: 12%;
}
.end-date-navbarFilter {
width: 12%;
}
.list-navbarFilter {
width: 9%;
}
.group-navbarFilter {
width: 9%;
}
.search-navbarFilter {
width: 10%;
}
.clearSearch-navbarFilter {
width: 10%;
}
}
@media (max-width: 767px) {
.goToTop {
position: fixed;
@@ -387,6 +675,11 @@
margin: 0 0 60px 0;
}
input[name="foo"] {
display: none !important;
}
/*
.Rtable .Rtable-row:nth-child(even), .table-workshop .Rtable .Rtable-row:nth-child(4n+2), .table-personals .Rtable .Rtable-row:nth-child(4n+2) {
border-radius: 10px;
@@ -441,18 +734,6 @@
@media(max-width: 1260px) {

File diff suppressed because it is too large Load Diff

View File

@@ -6,6 +6,139 @@
/*height: 430px;*/
}
.Rtable .Rtable-row .Rtable-cell.column-heading {
padding: 0.2em 0;
}
.Rtable-row .btn-details {
background-color: #D3F8F8;
color: #4DA9D1;
border-radius: 7px;
border: 0 !important;
padding: 6px 8px;
font-size: 12px;
}
.leaveDiv{
padding: 10px;
margin: 6px;
background-color: #ffffff;
color: #000;
border-radius: 5px;
font-size: 11px;
font-weight: 400;
}
.Rtable .Rtable-row .Rtable-cell .Rtable-cell--content > span {
border-radius: 5px;
background: rgba(87, 227, 227, 0.25);
width: 45px;
height: 32px;
display: inline-block;
padding: 6px;
}
.form-check-input[type="radio"], .form-check-input[type="checkbox"] {
padding: 8px;
}
.table-contracts .Rtable .Rtable-row .column-heading > span input {
margin: 0 0 0 5px;
}
.form-check-input[type="radio"], .form-check-input[type="checkbox"] {
border-radius: 4px;
border: 0 !important;
outline: 1px solid #1dc9a0;
margin: 2px 0;
}
.table-contracts .form-check-input {
padding: 8px !important;
border: 0 !important;
outline: 1px solid #1dc9a0;
}
.btn-search {
background: #84CC16;
width: 100%;
height: 36px;
}
.tm-selection-rad:checked + .btn, :not(.tm-selection-rad) + .btn:active, .btn:first-child:active, .btn.active, .btn.show {
color: #ffffff;
background: linear-gradient(94deg, #2EBEBE 1.59%, #1E9D9D 47.86%, #0B7878 101.16%);
border: none;
}
.tm-rad, .tm-selection-rad {
position: absolute;
clip: rect(0, 0, 0, 0);
pointer-events: none;
}
.search-box .radio-btn {
color: #717171;
padding: 0;
border-radius: 8px;
border: 1px solid #DADADA;
background-color: white;
outline: none;
width: 100%;
height: 36px;
font-size: 13px;
display: flex;
align-items: center;
justify-items: center;
text-align: center;
}
.select2-container .select2-selection--single, #start-date, #end-date {
height: 36px;
}
.personnel-selector-navFilter {
width: 15%;
}
.start-date-navbarFilter {
width: 12%;
}
.end-date-navbarFilter {
width: 12%;
}
.list-navbarFilter {
width: 7%;
}
.group-navbarFilter {
width: 7%;
}
.search-navbarFilter {
width: 10%;
}
.clearSearch-navbarFilter {
width: 10%;
}
.personnel-selector-navFilter,
.start-date-navbarFilter,
.end-date-navbarFilter,
.list-navbarFilter,
.group-navbarFilter,
.search-navbarFilter,
.clearSearch-navbarFilter {
height: 36px;
}
.sweet-alert button {
font-family: 'IRANYekanX';
}
@@ -16,6 +149,7 @@
background-color: #fef2f2 !important;
border: 1px solid #eb3434 !important;
border-radius: 7px;
overflow: hidden;
}
.goToTop {
@@ -159,22 +293,14 @@
/************************ Radio Button Input (Like Checkbox appearance) ************************/
.form-check-input[type="radio"],
.form-check-input[type="checkbox"] {
width: 15px;
height: 15px;
border-radius: 6px;
padding: 8px;
border: 1px solid #CFD3D4;
background-color: white;
background-position: center;
background-size: contain;
background-repeat: no-repeat;
appearance: none;
}
.form-check-input[type="radio"]:checked,
.form-check-input[type="checkbox"]:checked {
background-color: #148989;
border: 1px solid #ffffff !important;
background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="white" stroke-width="3"%3E%3Cpath stroke-linecap="round" stroke-linejoin="round" d="M5 13l4 4L19 7" /%3E%3C/svg%3E');
background-size: 75%;
}
@@ -185,21 +311,21 @@
box-shadow: none;
}
.form-check-input[type="radio"] + label,
.form-check-input[type="checkbox"] + label {
color: #83898C;
}
.form-check-input[type="radio"]:checked + label,
.form-check-input[type="checkbox"]:checked + label {
color: #2B2F32;
}
/*rwo grid */
#salaryaidEmployeeListAjax .personal-grid-row:nth-of-type(odd) .Rtable-row {
background: #ECFFFF !important;
border: 1px solid #E9E9E9 !important;
}
#salaryaidEmployeeListAjax .personal-grid-row:nth-of-type(even) .Rtable-row {
background: #DDF4F4 !important;
border: 1px solid #E9E9E9 !important;
}
/*rwo grid */
/************************ Radio Button Input (Like Checkbox appearance) ************************/
@media (max-width: 1366px) {
.salaryaidListModal-width {
max-width: 390px;
@@ -218,6 +344,36 @@
}
}
@media (max-width: 992px) {
.personnel-selector-navFilter {
width: 17%;
}
.start-date-navbarFilter {
width: 15%;
}
.end-date-navbarFilter {
width: 15%;
}
.list-navbarFilter {
width: 10%;
}
.group-navbarFilter {
width: 10%;
}
.search-navbarFilter {
width: 15%;
}
.clearSearch-navbarFilter {
width: 15%;
}
}
@media (max-width: 767px) {
.goToTop {
position: fixed;
@@ -227,6 +383,13 @@
color: #fff;
background-color: #25acac70;
}
.widthNumberCustom1 {
display: none !important;
}
input[name="foo"] {
display: none !important;
}
.wrapper {
margin: 0 0 60px 0;

File diff suppressed because it is too large Load Diff

View File

@@ -204,7 +204,7 @@ function SaveDataAjax() {
}, 1500);
if (urlPathname.indexOf('/Client/Company/SalaryAid') > -1) {
$('#salaryaidListAjax').html('');
$('#salaryAidListAjax').html('');
$('#PageIndex').val(0);
pageIndexJs = 0;
loadSalaryAidList();

View File

@@ -127,7 +127,7 @@ function SaveDataAjax() {
$('.alert-success-msg p').text('');
}, 1500);
$('#salaryaidListAjax').html('');
$('#salaryAidListAjax').html('');
$('#PageIndex').val(0);
pageIndexJs = 0;
loadSalaryAidList();

View File

@@ -746,7 +746,7 @@ $('#createData').click(function () {
}, 2000);
if (urlPathname.indexOf('/Client/Company/SalaryAid') > -1) {
$('#salaryaidListAjax').html('');
$('#salaryAidListAjax').html('');
$('#PageIndex').val(0);
pageIndexJs = 0;
loadSalaryAidList();