Compare commits
8 Commits
Feature/Em
...
Feature/Ch
| Author | SHA1 | Date | |
|---|---|---|---|
| 69f4819bf6 | |||
|
|
1257e15b62 | ||
|
|
331fb24a99 | ||
| 900b4b3f4d | |||
| bdc6f95af8 | |||
|
|
21302803b6 | ||
|
|
8ec13ffae1 | ||
|
|
5508d4e88f |
@@ -8,6 +8,5 @@ namespace Company.Domain.BankAgg
|
|||||||
{
|
{
|
||||||
public void Remove(Bank entity);
|
public void Remove(Bank entity);
|
||||||
List<BankViewModel> Search(string name);
|
List<BankViewModel> Search(string name);
|
||||||
List<BankSelectList> GetBanksForSelectList();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ public class Checkout : EntityBase
|
|||||||
string overNightWorkValue, string fridayWorkValue, string rotatingShifValue, string absenceValue,
|
string overNightWorkValue, string fridayWorkValue, string rotatingShifValue, string absenceValue,
|
||||||
string totalDayOfLeaveCompute, string totalDayOfYearsCompute, string totalDayOfBunosesCompute,
|
string totalDayOfLeaveCompute, string totalDayOfYearsCompute, string totalDayOfBunosesCompute,
|
||||||
ICollection<CheckoutLoanInstallment> loanInstallments,
|
ICollection<CheckoutLoanInstallment> loanInstallments,
|
||||||
ICollection<CheckoutSalaryAid> salaryAids, CheckoutRollCall checkoutRollCall, TimeSpan employeeMandatoryHours, bool hasInsuranceShareTheSameAsList)
|
ICollection<CheckoutSalaryAid> salaryAids, CheckoutRollCall checkoutRollCall, TimeSpan employeeMandatoryHours, bool hasInsuranceShareTheSameAsList, ICollection<CheckoutReward> rewards,double rewardPay)
|
||||||
{
|
{
|
||||||
EmployeeFullName = employeeFullName;
|
EmployeeFullName = employeeFullName;
|
||||||
FathersName = fathersName;
|
FathersName = fathersName;
|
||||||
@@ -71,7 +71,7 @@ public class Checkout : EntityBase
|
|||||||
TotalClaims = totalClaims;
|
TotalClaims = totalClaims;
|
||||||
TotalDeductions = totalDeductions;
|
TotalDeductions = totalDeductions;
|
||||||
TotalPayment = totalPayment;
|
TotalPayment = totalPayment;
|
||||||
RewardPay = 0;
|
RewardPay = rewardPay;
|
||||||
IsActiveString = "true";
|
IsActiveString = "true";
|
||||||
Signature = signature;
|
Signature = signature;
|
||||||
MarriedAllowance = marriedAllowance;
|
MarriedAllowance = marriedAllowance;
|
||||||
@@ -93,6 +93,7 @@ public class Checkout : EntityBase
|
|||||||
CheckoutRollCall = checkoutRollCall;
|
CheckoutRollCall = checkoutRollCall;
|
||||||
EmployeeMandatoryHours = employeeMandatoryHours;
|
EmployeeMandatoryHours = employeeMandatoryHours;
|
||||||
HasInsuranceShareTheSameAsList = hasInsuranceShareTheSameAsList;
|
HasInsuranceShareTheSameAsList = hasInsuranceShareTheSameAsList;
|
||||||
|
Rewards = rewards;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -130,7 +131,7 @@ public class Checkout : EntityBase
|
|||||||
public double BonusesPay { get; private set; }
|
public double BonusesPay { get; private set; }
|
||||||
public double YearsPay { get; private set; }
|
public double YearsPay { get; private set; }
|
||||||
public double LeavePay { get; private set; }
|
public double LeavePay { get; private set; }
|
||||||
public double? RewardPay { get; private set; }
|
public double RewardPay { get; private set; }
|
||||||
public double InsuranceDeduction { get; private set; }
|
public double InsuranceDeduction { get; private set; }
|
||||||
public double TaxDeducation { get; private set; }
|
public double TaxDeducation { get; private set; }
|
||||||
public double InstallmentDeduction { get; private set; }
|
public double InstallmentDeduction { get; private set; }
|
||||||
@@ -223,6 +224,8 @@ public class Checkout : EntityBase
|
|||||||
|
|
||||||
public ICollection<CheckoutLoanInstallment> LoanInstallments { get; set; } = [];
|
public ICollection<CheckoutLoanInstallment> LoanInstallments { get; set; } = [];
|
||||||
public ICollection<CheckoutSalaryAid> SalaryAids { get; set; } = [];
|
public ICollection<CheckoutSalaryAid> SalaryAids { get; set; } = [];
|
||||||
|
|
||||||
|
public ICollection<CheckoutReward> Rewards { get; set; } = [];
|
||||||
public CheckoutRollCall CheckoutRollCall { get; private set; }
|
public CheckoutRollCall CheckoutRollCall { get; private set; }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@@ -239,7 +242,7 @@ public class Checkout : EntityBase
|
|||||||
double insuranceDeduction, double taxDeducation, double installmentDeduction,
|
double insuranceDeduction, double taxDeducation, double installmentDeduction,
|
||||||
double salaryAidDeduction, double absenceDeduction, string sumOfWorkingDays
|
double salaryAidDeduction, double absenceDeduction, string sumOfWorkingDays
|
||||||
, string archiveCode, string personnelCode,
|
, string archiveCode, string personnelCode,
|
||||||
string totalClaims, string totalDeductions, double totalPayment, double? rewardPay)
|
string totalClaims, string totalDeductions, double totalPayment, double rewardPay)
|
||||||
{
|
{
|
||||||
EmployeeFullName = employeeFullName;
|
EmployeeFullName = employeeFullName;
|
||||||
FathersName = fathersName;
|
FathersName = fathersName;
|
||||||
@@ -337,6 +340,11 @@ public class Checkout : EntityBase
|
|||||||
InstallmentDeduction = installmentsAmount;
|
InstallmentDeduction = installmentsAmount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SetReward(ICollection<CheckoutReward> rewards, double rewardAmount)
|
||||||
|
{
|
||||||
|
RewardPay = rewardAmount;
|
||||||
|
Rewards = rewards;
|
||||||
|
}
|
||||||
public void SetCheckoutRollCall(CheckoutRollCall checkoutRollCall)
|
public void SetCheckoutRollCall(CheckoutRollCall checkoutRollCall)
|
||||||
{
|
{
|
||||||
CheckoutRollCall = checkoutRollCall;
|
CheckoutRollCall = checkoutRollCall;
|
||||||
|
|||||||
56
Company.Domain/CheckoutAgg/ValueObjects/CheckoutReward.cs
Normal file
56
Company.Domain/CheckoutAgg/ValueObjects/CheckoutReward.cs
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Company.Domain.CheckoutAgg.ValueObjects;
|
||||||
|
|
||||||
|
public class CheckoutReward
|
||||||
|
{
|
||||||
|
public CheckoutReward(string amount, double amountDouble, string grantDateFa, DateTime grantDateGr, string description, string title)
|
||||||
|
{
|
||||||
|
Amount = amount;
|
||||||
|
AmountDouble = amountDouble;
|
||||||
|
GrantDateFa = grantDateFa;
|
||||||
|
GrantDateGr = grantDateGr;
|
||||||
|
Description = description;
|
||||||
|
Title = title;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// مبلغ پاداش
|
||||||
|
/// string
|
||||||
|
/// </summary>
|
||||||
|
public string Amount { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// مبلغ پاداش
|
||||||
|
/// double
|
||||||
|
/// </summary>
|
||||||
|
public double AmountDouble { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// تاریخ اعطاء
|
||||||
|
/// شمسی
|
||||||
|
/// </summary>
|
||||||
|
public string GrantDateFa { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// تاریخ اعطاء
|
||||||
|
/// میلادی
|
||||||
|
/// </summary>
|
||||||
|
public DateTime GrantDateGr { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// توضیحات
|
||||||
|
/// </summary>
|
||||||
|
public string Description { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// عنوان
|
||||||
|
/// </summary>
|
||||||
|
public string Title { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// آی دی پاداش
|
||||||
|
/// </summary>
|
||||||
|
public long EntityId { get; set; }
|
||||||
|
}
|
||||||
@@ -1,11 +1,7 @@
|
|||||||
|
|
||||||
using System;
|
|
||||||
using _0_Framework.Domain;
|
using _0_Framework.Domain;
|
||||||
using CompanyManagment.App.Contracts.EmployeeBankInformation;
|
using CompanyManagment.App.Contracts.EmployeeBankInformation;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Security.AccessControl;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using CompanyManagment.App.Contracts.Workshop;
|
|
||||||
|
|
||||||
namespace Company.Domain.EmployeeBankInformationAgg
|
namespace Company.Domain.EmployeeBankInformationAgg
|
||||||
{
|
{
|
||||||
@@ -15,31 +11,14 @@ namespace Company.Domain.EmployeeBankInformationAgg
|
|||||||
void Remove(EmployeeBankInformation bankInformation);
|
void Remove(EmployeeBankInformation bankInformation);
|
||||||
void RemoveRange(List<EmployeeBankInformation> entities);
|
void RemoveRange(List<EmployeeBankInformation> entities);
|
||||||
|
|
||||||
[Obsolete("از متد async استفاده کنید")]
|
|
||||||
List<GroupedEmployeeBankInformationViewModel> Search(long workshopId, EmployeeBankInformationSearchModel searchParams);
|
List<GroupedEmployeeBankInformationViewModel> Search(long workshopId, EmployeeBankInformationSearchModel searchParams);
|
||||||
|
|
||||||
Task<List<GroupedEmployeeBankInformationViewModel>> SearchAsync(long workshopId,
|
|
||||||
EmployeeBankInformationSearchModel searchParams);
|
|
||||||
|
|
||||||
|
|
||||||
GroupedEmployeeBankInformationViewModel GetByEmployeeId(long workshopId, long employeeId);
|
GroupedEmployeeBankInformationViewModel GetByEmployeeId(long workshopId, long employeeId);
|
||||||
List<EmployeeBankInformation> GetRangeByEmployeeId(long workshopId, long employeeId);
|
List<EmployeeBankInformation> GetRangeByEmployeeId(long workshopId, long employeeId);
|
||||||
EmployeeBankInformationViewModel GetDetails(long id);
|
EmployeeBankInformationViewModel GetDetails(long id);
|
||||||
List<GroupedEmployeeBankInformationViewModel> GetAllByWorkshopId(long workshopId);
|
List<GroupedEmployeeBankInformationViewModel> GetAllByWorkshopId(long workshopId);
|
||||||
|
|
||||||
List<EmployeeBankInformationViewModelForExcel> SearchForExcel(long workshopId,
|
|
||||||
EmployeeBankInformationSearchModel searchParams);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// جزئیات اطلاعات بانکی بر اساس پرسنل
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="workshopId"></param>
|
|
||||||
/// <param name="employeeId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<GetEmployeeBankInfoDetailsDto> GetDetailsByEmployeeIdAsync(long workshopId, long employeeId);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
List<EmployeeBankInformationViewModelForExcel> SearchForExcel(long workshopId, EmployeeBankInformationSearchModel searchParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +1,16 @@
|
|||||||
using System;
|
using _0_Framework.Domain;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using _0_Framework.Domain;
|
|
||||||
using Company.Domain.CustomizeWorkshopEmployeeSettingsAgg.Entities;
|
using Company.Domain.CustomizeWorkshopEmployeeSettingsAgg.Entities;
|
||||||
using CompanyManagment.App.Contracts.Contract;
|
using CompanyManagment.App.Contracts.Contract;
|
||||||
using CompanyManagment.App.Contracts.CustomizeCheckout;
|
using CompanyManagment.App.Contracts.CustomizeCheckout;
|
||||||
using CompanyManagment.App.Contracts.Leave;
|
using CompanyManagment.App.Contracts.Leave;
|
||||||
using CompanyManagment.App.Contracts.Loan;
|
using CompanyManagment.App.Contracts.Loan;
|
||||||
|
using CompanyManagment.App.Contracts.Reward;
|
||||||
using CompanyManagment.App.Contracts.RollCall;
|
using CompanyManagment.App.Contracts.RollCall;
|
||||||
using CompanyManagment.App.Contracts.SalaryAid;
|
using CompanyManagment.App.Contracts.SalaryAid;
|
||||||
using CompanyManagment.App.Contracts.WorkingHoursTemp;
|
using CompanyManagment.App.Contracts.WorkingHoursTemp;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Company.Domain.RollCallAgg;
|
namespace Company.Domain.RollCallAgg;
|
||||||
|
|
||||||
@@ -53,6 +54,9 @@ public interface IRollCallMandatoryRepository : IRepository<long, RollCall>
|
|||||||
List<SalaryAidViewModel> SalaryAidsForCheckout(long employeeId, long workshopId, DateTime checkoutStart,
|
List<SalaryAidViewModel> SalaryAidsForCheckout(long employeeId, long workshopId, DateTime checkoutStart,
|
||||||
DateTime checkoutEnd);
|
DateTime checkoutEnd);
|
||||||
|
|
||||||
|
List<RewardViewModel> RewardForCheckout(long employeeId, long workshopId, DateTime checkoutEnd,
|
||||||
|
DateTime checkoutStart);
|
||||||
|
|
||||||
Task<ComputingViewModel> RotatingShiftReport(long workshopId, long employeeId, DateTime contractStart,
|
Task<ComputingViewModel> RotatingShiftReport(long workshopId, long employeeId, DateTime contractStart,
|
||||||
DateTime contractEnd, string shiftwork, bool hasRollCall, CreateWorkingHoursTemp command,bool holidayWorking);
|
DateTime contractEnd, string shiftwork, bool hasRollCall, CreateWorkingHoursTemp command,bool holidayWorking);
|
||||||
}
|
}
|
||||||
@@ -10,12 +10,5 @@ namespace CompanyManagment.App.Contracts.Bank
|
|||||||
OperationResult Create(CreateBank command);
|
OperationResult Create(CreateBank command);
|
||||||
OperationResult Edit(EditBank command);
|
OperationResult Edit(EditBank command);
|
||||||
List<BankViewModel> Search(string name);
|
List<BankViewModel> Search(string name);
|
||||||
List<BankSelectList> GetBanksForSelectList();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public class BankSelectList:SelectListViewModel
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -193,4 +193,9 @@ public class CreateCheckout
|
|||||||
/// پایه سنوات قبل از تاثیر ساعت کار
|
/// پایه سنوات قبل از تاثیر ساعت کار
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public double BaseYearUnAffected { get; set; }
|
public double BaseYearUnAffected { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// آیا برای محاسبه پاداش مجاز است
|
||||||
|
/// </summary>
|
||||||
|
public bool RewardPayCompute { get; set; }
|
||||||
}
|
}
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
namespace CompanyManagment.App.Contracts.EmployeeBankInformation;
|
|
||||||
|
|
||||||
public class GetEmployeeBankInfoDetailsBankItemDto
|
|
||||||
{
|
|
||||||
public long Id { get; set; }
|
|
||||||
public string CardNumber { get; set; }
|
|
||||||
public string ShebaNumber { get; set; }
|
|
||||||
public string BankAccountNumber { get; set; }
|
|
||||||
public string BankName { get; set; }
|
|
||||||
public string BankLogoPath { get; set; }
|
|
||||||
public bool IsDefault { get; set; }
|
|
||||||
public long BankId { get; set; }
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
namespace CompanyManagment.App.Contracts.EmployeeBankInformation;
|
|
||||||
|
|
||||||
public class GetEmployeeBankInfoDetailsDto
|
|
||||||
{
|
|
||||||
public long EmployeeId { get; set; }
|
|
||||||
public string EmployeeFullName { get; set; }
|
|
||||||
public List<GetEmployeeBankInfoDetailsBankItemDto> BankItems { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,7 +1,5 @@
|
|||||||
using System;
|
using _0_Framework.Application;
|
||||||
using _0_Framework.Application;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace CompanyManagment.App.Contracts.EmployeeBankInformation
|
namespace CompanyManagment.App.Contracts.EmployeeBankInformation
|
||||||
{
|
{
|
||||||
@@ -10,7 +8,6 @@ namespace CompanyManagment.App.Contracts.EmployeeBankInformation
|
|||||||
OperationResult Create(CreateEmployeeInformation command);
|
OperationResult Create(CreateEmployeeInformation command);
|
||||||
OperationResult GroupCreate(long workshopId, List<CreateEmployeeInformation> command);
|
OperationResult GroupCreate(long workshopId, List<CreateEmployeeInformation> command);
|
||||||
OperationResult Edit(EditEmployeeInformation command);
|
OperationResult Edit(EditEmployeeInformation command);
|
||||||
[Obsolete("از متد Async استفاده شود")]
|
|
||||||
List<GroupedEmployeeBankInformationViewModel> Search(long workshopId, EmployeeBankInformationSearchModel searchParams);
|
List<GroupedEmployeeBankInformationViewModel> Search(long workshopId, EmployeeBankInformationSearchModel searchParams);
|
||||||
List<EmployeeBankInformationViewModelForExcel> SearchForExcel(long workshopId,
|
List<EmployeeBankInformationViewModelForExcel> SearchForExcel(long workshopId,
|
||||||
EmployeeBankInformationSearchModel searchParams);
|
EmployeeBankInformationSearchModel searchParams);
|
||||||
@@ -20,22 +17,5 @@ namespace CompanyManagment.App.Contracts.EmployeeBankInformation
|
|||||||
OperationResult RemoveByEmployeeId(long workshopId, long employeeId);
|
OperationResult RemoveByEmployeeId(long workshopId, long employeeId);
|
||||||
List<GroupedEmployeeBankInformationViewModel> GetAllByWorkshopId(long workshopId);
|
List<GroupedEmployeeBankInformationViewModel> GetAllByWorkshopId(long workshopId);
|
||||||
OperationResult SetDefault(long workshopId, long bankInfoId);
|
OperationResult SetDefault(long workshopId, long bankInfoId);
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// گرفتن لیست اطلاعات بانکی
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="workshopId"></param>
|
|
||||||
/// <param name="searchParams"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<List<GroupedEmployeeBankInformationViewModel>> SearchAsync
|
|
||||||
(long workshopId, EmployeeBankInformationSearchModel searchParams);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// جزئیات اطلاعات بانکی بر اساس پرسنل
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="workshopId"></param>
|
|
||||||
/// <param name="employeeId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<GetEmployeeBankInfoDetailsDto> GetDetailsByEmployeeIdAsync(long workshopId, long employeeId);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -152,5 +152,8 @@ public class CreateWorkshop
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsStaticCheckout { get; set; }
|
public bool IsStaticCheckout { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// آیا پاداش در فیش حقوقی محاسبه شود
|
||||||
|
/// </summary>
|
||||||
|
public bool RewardComputeOnCheckout { get; set; }
|
||||||
}
|
}
|
||||||
@@ -104,10 +104,5 @@ namespace CompanyManagment.Application
|
|||||||
Id = x.Id
|
Id = x.Id
|
||||||
}).ToList();
|
}).ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<BankSelectList> GetBanksForSelectList()
|
|
||||||
{
|
|
||||||
return _bankRepository.GetBanksForSelectList();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -240,6 +240,16 @@ public class CheckoutApplication : ICheckoutApplication
|
|||||||
|
|
||||||
command.InstallmentDeduction = loanInstallments.Sum(x => x.AmountForMonth.MoneyToDouble());
|
command.InstallmentDeduction = loanInstallments.Sum(x => x.AmountForMonth.MoneyToDouble());
|
||||||
|
|
||||||
|
var rewards = new List<CheckoutReward>();
|
||||||
|
double rewardPay = 0;
|
||||||
|
if (command.RewardPayCompute)
|
||||||
|
{
|
||||||
|
rewards = _rollCallMandatoryRepository.RewardForCheckout(command.EmployeeId, command.WorkshopId, checkoutStart.ToGeorgianDateTime(), checkoutEnd.ToGeorgianDateTime())
|
||||||
|
.Select(x => new CheckoutReward(x.Amount, x.AmountDouble, x.GrantDateFa, x.GrantDateGr, x.Description, x.Title)).ToList();
|
||||||
|
|
||||||
|
rewardPay = rewards.Sum(x => x.AmountDouble);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -361,7 +371,7 @@ public class CheckoutApplication : ICheckoutApplication
|
|||||||
|
|
||||||
|
|
||||||
var totalClaimsDouble = monthlyWage + bacicYears + consumableItem + housingAllowance + marriedAllowance + command.OvertimePay +
|
var totalClaimsDouble = monthlyWage + bacicYears + consumableItem + housingAllowance + marriedAllowance + command.OvertimePay +
|
||||||
command.NightworkPay + familyAllowance + bunos + years + command.LeavePay + command.FridayPay + command.ShiftPay;
|
command.NightworkPay + familyAllowance + bunos + years + command.LeavePay + command.FridayPay + command.ShiftPay + rewardPay;
|
||||||
var totalClaims = totalClaimsDouble.ToMoney();
|
var totalClaims = totalClaimsDouble.ToMoney();
|
||||||
var totalDeductionDouble = insuranceDeduction + command.AbsenceDeduction + command.InstallmentDeduction + command.SalaryAidDeduction;
|
var totalDeductionDouble = insuranceDeduction + command.AbsenceDeduction + command.InstallmentDeduction + command.SalaryAidDeduction;
|
||||||
var totalDeductions = totalDeductionDouble.ToMoney();
|
var totalDeductions = totalDeductionDouble.ToMoney();
|
||||||
@@ -386,7 +396,7 @@ public class CheckoutApplication : ICheckoutApplication
|
|||||||
, command.OvertimePay, command.NightworkPay, command.FridayPay, 0, command.ShiftPay, familyAllowance, bunos, years, command.LeavePay, insuranceDeduction, 0, command.InstallmentDeduction, command.SalaryAidDeduction, command.AbsenceDeduction, sumOfWorkingDays,
|
, command.OvertimePay, command.NightworkPay, command.FridayPay, 0, command.ShiftPay, familyAllowance, bunos, years, command.LeavePay, insuranceDeduction, 0, command.InstallmentDeduction, command.SalaryAidDeduction, command.AbsenceDeduction, sumOfWorkingDays,
|
||||||
command.ArchiveCode, command.PersonnelCode, totalClaims, totalDeductions, totalPayment, command.Signature, marriedAllowance, command.LeaveCheckout, command.CreditLeaves, command.AbsencePeriod, command.AverageHoursPerDay, command.HasRollCall, command.OverTimeWorkValue, command.OverNightWorkValue
|
command.ArchiveCode, command.PersonnelCode, totalClaims, totalDeductions, totalPayment, command.Signature, marriedAllowance, command.LeaveCheckout, command.CreditLeaves, command.AbsencePeriod, command.AverageHoursPerDay, command.HasRollCall, command.OverTimeWorkValue, command.OverNightWorkValue
|
||||||
, command.FridayWorkValue, command.RotatingShiftValue, command.AbsenceValue, command.TotalDayOfLeaveCompute, command.TotalDayOfYearsCompute, command.TotalDayOfBunosesCompute,
|
, command.FridayWorkValue, command.RotatingShiftValue, command.AbsenceValue, command.TotalDayOfLeaveCompute, command.TotalDayOfYearsCompute, command.TotalDayOfBunosesCompute,
|
||||||
loanInstallments, salaryAids,checkoutRollCall,command.EmployeeMandatoryHours, hasInsuranceShareTheSameAsList);
|
loanInstallments, salaryAids,checkoutRollCall,command.EmployeeMandatoryHours, hasInsuranceShareTheSameAsList, rewards, rewardPay);
|
||||||
|
|
||||||
_checkoutRepository.CreateCkeckout(checkout).GetAwaiter().GetResult();
|
_checkoutRepository.CreateCkeckout(checkout).GetAwaiter().GetResult();
|
||||||
//_checkoutRepository.SaveChanges();
|
//_checkoutRepository.SaveChanges();
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ using Company.Domain.EmployeeBankInformationAgg;
|
|||||||
using CompanyManagment.App.Contracts.EmployeeBankInformation;
|
using CompanyManagment.App.Contracts.EmployeeBankInformation;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace CompanyManagment.Application
|
namespace CompanyManagment.Application
|
||||||
{
|
{
|
||||||
@@ -102,13 +101,7 @@ namespace CompanyManagment.Application
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<List<GroupedEmployeeBankInformationViewModel>> SearchAsync(long workshopId,
|
//todo: add CardNumber, BankAccountNumber, etc validations
|
||||||
EmployeeBankInformationSearchModel searchParams)
|
|
||||||
{
|
|
||||||
return await _employeeBankInformationRepository.SearchAsync(workshopId, searchParams);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public OperationResult Edit(EditEmployeeInformation command)
|
public OperationResult Edit(EditEmployeeInformation command)
|
||||||
{
|
{
|
||||||
OperationResult op = new();
|
OperationResult op = new();
|
||||||
@@ -175,6 +168,9 @@ namespace CompanyManagment.Application
|
|||||||
{
|
{
|
||||||
var entity = _employeeBankInformationRepository.GetByEmployeeId(workshopId, employeeId);
|
var entity = _employeeBankInformationRepository.GetByEmployeeId(workshopId, employeeId);
|
||||||
|
|
||||||
|
if (entity == null)
|
||||||
|
return new();
|
||||||
|
|
||||||
return entity;
|
return entity;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -215,12 +211,6 @@ namespace CompanyManagment.Application
|
|||||||
return _employeeBankInformationRepository.GetAllByWorkshopId(workshopId);
|
return _employeeBankInformationRepository.GetAllByWorkshopId(workshopId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public async Task<GetEmployeeBankInfoDetailsDto> GetDetailsByEmployeeIdAsync(long workshopId, long employeeId)
|
|
||||||
{
|
|
||||||
return await _employeeBankInformationRepository.GetDetailsByEmployeeIdAsync(workshopId, employeeId);
|
|
||||||
}
|
|
||||||
|
|
||||||
#region Private Methods
|
#region Private Methods
|
||||||
|
|
||||||
private OperationResult ValidateCreateOperation(List<GroupedEmployeeBankInformationViewModel> workshopEmployeeBankInfoList, CreateEmployeeInformation command)
|
private OperationResult ValidateCreateOperation(List<GroupedEmployeeBankInformationViewModel> workshopEmployeeBankInfoList, CreateEmployeeInformation command)
|
||||||
@@ -264,6 +254,7 @@ namespace CompanyManagment.Application
|
|||||||
x.WorkshopId == workshopId && x.EmployeeId == employeeId);
|
x.WorkshopId == workshopId && x.EmployeeId == employeeId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1569,7 +1569,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
|||||||
var previousInstitutionContract = await _institutionContractRepository
|
var previousInstitutionContract = await _institutionContractRepository
|
||||||
.GetPreviousContract(institutionContract.id);
|
.GetPreviousContract(institutionContract.id);
|
||||||
previousInstitutionContract?.DeActive();
|
previousInstitutionContract?.DeActive();
|
||||||
ReActiveAllAfterCreateNew(institutionContract.ContractingPartyId);
|
await _contractingPartyRepository.ActiveAllAsync(institutionContract.ContractingPartyId);
|
||||||
await _institutionContractRepository.SaveChangesAsync();
|
await _institutionContractRepository.SaveChangesAsync();
|
||||||
return op.Succcedded();
|
return op.Succcedded();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1524,6 +1524,7 @@ public class InsuranceListApplication : IInsuranceListApplication
|
|||||||
var dateOfBirth = employeeData.DateOfBirthGr.ToFarsi();
|
var dateOfBirth = employeeData.DateOfBirthGr.ToFarsi();
|
||||||
var dateOfIssue = employeeData.DateOfIssueGr.ToFarsi();
|
var dateOfIssue = employeeData.DateOfIssueGr.ToFarsi();
|
||||||
var leftDate = employeeData.LeftWorkDateGr != null ? employeeData.LeftWorkDateGr.Value.AddDays(-1) : new DateTime();
|
var leftDate = employeeData.LeftWorkDateGr != null ? employeeData.LeftWorkDateGr.Value.AddDays(-1) : new DateTime();
|
||||||
|
|
||||||
var workingDays = Tools.GetEmployeeInsuranceWorkingDays(employeeData.StartWorkDateGr, leftDate, startDateGr, endDateGr, employeeData.EmployeeId);
|
var workingDays = Tools.GetEmployeeInsuranceWorkingDays(employeeData.StartWorkDateGr, leftDate, startDateGr, endDateGr, employeeData.EmployeeId);
|
||||||
var leftWorkFa = workingDays.hasLeftWorkInMonth ? employeeData.LeftWorkDateGr.ToFarsi() : "";
|
var leftWorkFa = workingDays.hasLeftWorkInMonth ? employeeData.LeftWorkDateGr.ToFarsi() : "";
|
||||||
var startWorkFa = employeeData.StartWorkDateGr.ToFarsi();
|
var startWorkFa = employeeData.StartWorkDateGr.ToFarsi();
|
||||||
@@ -1606,7 +1607,7 @@ public class InsuranceListApplication : IInsuranceListApplication
|
|||||||
MaritalStatus = employeeData.MaritalStatus,
|
MaritalStatus = employeeData.MaritalStatus,
|
||||||
|
|
||||||
StartMonthCurrent = startMonthFa,
|
StartMonthCurrent = startMonthFa,
|
||||||
WorkingDays = workingDays.countWorkingDays,
|
WorkingDays = employeeData.WorkingDays,
|
||||||
StartWorkDate = startWorkFa,
|
StartWorkDate = startWorkFa,
|
||||||
StartWorkDateGr = employeeData.StartWorkDateGr,
|
StartWorkDateGr = employeeData.StartWorkDateGr,
|
||||||
LeftWorkDate = leftWorkFa,
|
LeftWorkDate = leftWorkFa,
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ class CheckoutMapping : IEntityTypeConfiguration<Checkout>
|
|||||||
builder.Property(x => x.FamilyAllowance);
|
builder.Property(x => x.FamilyAllowance);
|
||||||
builder.Property(x => x.HousingAllowance);
|
builder.Property(x => x.HousingAllowance);
|
||||||
builder.Property(x => x.ConsumableItems);
|
builder.Property(x => x.ConsumableItems);
|
||||||
builder.Property(x => x.RewardPay).HasColumnType("float").IsRequired(false);
|
builder.Property(x => x.RewardPay);
|
||||||
|
|
||||||
builder.Property(x => x.LeaveCheckout);
|
builder.Property(x => x.LeaveCheckout);
|
||||||
builder.Property(x => x.CreditLeaves);
|
builder.Property(x => x.CreditLeaves);
|
||||||
@@ -82,6 +82,15 @@ class CheckoutMapping : IEntityTypeConfiguration<Checkout>
|
|||||||
salaryAid.Property(x => x.CalculationDateTimeFa).HasMaxLength(15);
|
salaryAid.Property(x => x.CalculationDateTimeFa).HasMaxLength(15);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
builder.OwnsMany(x => x.Rewards, reward =>
|
||||||
|
{
|
||||||
|
reward.Property(x => x.Description).HasColumnType("ntext");
|
||||||
|
reward.Property(x => x.Title).HasMaxLength(255);
|
||||||
|
reward.Property(x=> x.Amount).HasMaxLength(25);
|
||||||
|
reward.Property(x => x.GrantDateFa).HasMaxLength(10);
|
||||||
|
});
|
||||||
|
|
||||||
builder.OwnsOne(x => x.CheckoutRollCall, rollCall =>
|
builder.OwnsOne(x => x.CheckoutRollCall, rollCall =>
|
||||||
{
|
{
|
||||||
rollCall.Property(x => x.TotalPresentTimeSpan).HasTimeSpanConversion();
|
rollCall.Property(x => x.TotalPresentTimeSpan).HasTimeSpanConversion();
|
||||||
|
|||||||
11566
CompanyManagment.EFCore/Migrations/20260124132444_Add Reward to checkout.Designer.cs
generated
Normal file
11566
CompanyManagment.EFCore/Migrations/20260124132444_Add Reward to checkout.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,66 @@
|
|||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace CompanyManagment.EFCore.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class AddRewardtocheckout : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AlterColumn<double>(
|
||||||
|
name: "RewardPay",
|
||||||
|
table: "Checkouts",
|
||||||
|
type: "float",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: 0.0,
|
||||||
|
oldClrType: typeof(double),
|
||||||
|
oldType: "float",
|
||||||
|
oldNullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "CheckoutReward",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Checkoutid = table.Column<long>(type: "bigint", nullable: false),
|
||||||
|
Id = table.Column<int>(type: "int", nullable: false)
|
||||||
|
.Annotation("SqlServer:Identity", "1, 1"),
|
||||||
|
Amount = table.Column<string>(type: "nvarchar(25)", maxLength: 25, nullable: true),
|
||||||
|
AmountDouble = table.Column<double>(type: "float", nullable: false),
|
||||||
|
GrantDateFa = table.Column<string>(type: "nvarchar(10)", maxLength: 10, nullable: true),
|
||||||
|
GrantDateGr = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||||
|
Description = table.Column<string>(type: "ntext", nullable: true),
|
||||||
|
Title = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true),
|
||||||
|
EntityId = table.Column<long>(type: "bigint", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_CheckoutReward", x => new { x.Checkoutid, x.Id });
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_CheckoutReward_Checkouts_Checkoutid",
|
||||||
|
column: x => x.Checkoutid,
|
||||||
|
principalTable: "Checkouts",
|
||||||
|
principalColumn: "id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "CheckoutReward");
|
||||||
|
|
||||||
|
migrationBuilder.AlterColumn<double>(
|
||||||
|
name: "RewardPay",
|
||||||
|
table: "Checkouts",
|
||||||
|
type: "float",
|
||||||
|
nullable: true,
|
||||||
|
oldClrType: typeof(double),
|
||||||
|
oldType: "float");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -635,7 +635,7 @@ namespace CompanyManagment.EFCore.Migrations
|
|||||||
.HasMaxLength(10)
|
.HasMaxLength(10)
|
||||||
.HasColumnType("nvarchar(10)");
|
.HasColumnType("nvarchar(10)");
|
||||||
|
|
||||||
b.Property<double?>("RewardPay")
|
b.Property<double>("RewardPay")
|
||||||
.HasColumnType("float");
|
.HasColumnType("float");
|
||||||
|
|
||||||
b.Property<string>("RotatingShiftValue")
|
b.Property<string>("RotatingShiftValue")
|
||||||
@@ -7501,6 +7501,49 @@ namespace CompanyManagment.EFCore.Migrations
|
|||||||
.HasForeignKey("Checkoutid");
|
.HasForeignKey("Checkoutid");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
b.OwnsMany("Company.Domain.CheckoutAgg.ValueObjects.CheckoutReward", "Rewards", b1 =>
|
||||||
|
{
|
||||||
|
b1.Property<long>("Checkoutid")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b1.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property<int>("Id"));
|
||||||
|
|
||||||
|
b1.Property<string>("Amount")
|
||||||
|
.HasMaxLength(25)
|
||||||
|
.HasColumnType("nvarchar(25)");
|
||||||
|
|
||||||
|
b1.Property<double>("AmountDouble")
|
||||||
|
.HasColumnType("float");
|
||||||
|
|
||||||
|
b1.Property<string>("Description")
|
||||||
|
.HasColumnType("ntext");
|
||||||
|
|
||||||
|
b1.Property<long>("EntityId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b1.Property<string>("GrantDateFa")
|
||||||
|
.HasMaxLength(10)
|
||||||
|
.HasColumnType("nvarchar(10)");
|
||||||
|
|
||||||
|
b1.Property<DateTime>("GrantDateGr")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b1.Property<string>("Title")
|
||||||
|
.HasMaxLength(255)
|
||||||
|
.HasColumnType("nvarchar(255)");
|
||||||
|
|
||||||
|
b1.HasKey("Checkoutid", "Id");
|
||||||
|
|
||||||
|
b1.ToTable("CheckoutReward");
|
||||||
|
|
||||||
|
b1.WithOwner()
|
||||||
|
.HasForeignKey("Checkoutid");
|
||||||
|
});
|
||||||
|
|
||||||
b.OwnsMany("Company.Domain.CheckoutAgg.ValueObjects.CheckoutSalaryAid", "SalaryAids", b1 =>
|
b.OwnsMany("Company.Domain.CheckoutAgg.ValueObjects.CheckoutSalaryAid", "SalaryAids", b1 =>
|
||||||
{
|
{
|
||||||
b1.Property<long>("Checkoutid")
|
b1.Property<long>("Checkoutid")
|
||||||
@@ -7545,6 +7588,8 @@ namespace CompanyManagment.EFCore.Migrations
|
|||||||
|
|
||||||
b.Navigation("LoanInstallments");
|
b.Navigation("LoanInstallments");
|
||||||
|
|
||||||
|
b.Navigation("Rewards");
|
||||||
|
|
||||||
b.Navigation("SalaryAids");
|
b.Navigation("SalaryAids");
|
||||||
|
|
||||||
b.Navigation("Workshop");
|
b.Navigation("Workshop");
|
||||||
|
|||||||
@@ -31,13 +31,4 @@ public class BankRepository:RepositoryBase<long,Bank>,IBankRepository
|
|||||||
BankLogoPictureMediaId = x.BankLogoMediaId
|
BankLogoPictureMediaId = x.BankLogoMediaId
|
||||||
}).ToList();
|
}).ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<BankSelectList> GetBanksForSelectList()
|
|
||||||
{
|
|
||||||
return context.Banks.Select(x => new BankSelectList()
|
|
||||||
{
|
|
||||||
Id = x.id,
|
|
||||||
Text = x.BankName
|
|
||||||
}).ToList();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -531,6 +531,7 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
|||||||
|
|
||||||
entity.SetSalaryAid(command.SalaryAids, command.SalaryAidDeduction);
|
entity.SetSalaryAid(command.SalaryAids, command.SalaryAidDeduction);
|
||||||
entity.SetLoanInstallment(command.LoanInstallments, command.InstallmentDeduction);
|
entity.SetLoanInstallment(command.LoanInstallments, command.InstallmentDeduction);
|
||||||
|
entity.SetReward(command.Rewards,command.RewardPay);
|
||||||
entity.SetCheckoutRollCall(command.CheckoutRollCall);
|
entity.SetCheckoutRollCall(command.CheckoutRollCall);
|
||||||
entity.SetEmployeeMandatoryHours(command.EmployeeMandatoryHours);
|
entity.SetEmployeeMandatoryHours(command.EmployeeMandatoryHours);
|
||||||
if(command.HasInsuranceShareTheSameAsList)
|
if(command.HasInsuranceShareTheSameAsList)
|
||||||
@@ -934,7 +935,7 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
|||||||
TotalClaims = item.TotalClaims,
|
TotalClaims = item.TotalClaims,
|
||||||
TotalDeductions = item.TotalDeductions,
|
TotalDeductions = item.TotalDeductions,
|
||||||
TotalPayment = item.TotalPayment.ToMoney(),
|
TotalPayment = item.TotalPayment.ToMoney(),
|
||||||
RewardPay = item.RewardPay.ToMoneyNullable(),
|
RewardPay = item.RewardPay.ToMoney(),
|
||||||
ContractStartGr = item.ContractStart,
|
ContractStartGr = item.ContractStart,
|
||||||
ContractEndGr = item.ContractEnd,
|
ContractEndGr = item.ContractEnd,
|
||||||
IsLeft = false,
|
IsLeft = false,
|
||||||
@@ -1335,7 +1336,7 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
|||||||
TotalClaims = x.TotalClaims,
|
TotalClaims = x.TotalClaims,
|
||||||
TotalDeductions = x.TotalDeductions,
|
TotalDeductions = x.TotalDeductions,
|
||||||
TotalPayment = x.TotalPayment.ToMoney(),
|
TotalPayment = x.TotalPayment.ToMoney(),
|
||||||
RewardPay = x.RewardPay.ToMoneyNullable(),
|
RewardPay = x.RewardPay.ToMoney(),
|
||||||
ContractStartGr = x.ContractStart,
|
ContractStartGr = x.ContractStart,
|
||||||
ContractEndGr = x.ContractEnd,
|
ContractEndGr = x.ContractEnd,
|
||||||
IsLeft = false,
|
IsLeft = false,
|
||||||
|
|||||||
@@ -6,8 +6,6 @@ using CompanyManagment.App.Contracts.EmployeeBankInformation;
|
|||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
|
||||||
using _0_Framework.Exceptions;
|
|
||||||
|
|
||||||
namespace CompanyManagment.EFCore.Repository;
|
namespace CompanyManagment.EFCore.Repository;
|
||||||
|
|
||||||
@@ -78,76 +76,6 @@ public class EmployeeBankInformationRepository : RepositoryBase<long, EmployeeBa
|
|||||||
}).ToList();
|
}).ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<List<GroupedEmployeeBankInformationViewModel>> SearchAsync(long workshopId, EmployeeBankInformationSearchModel searchParams)
|
|
||||||
{
|
|
||||||
var bankInfoQuery = _companyContext.EmployeeBankInformationSet
|
|
||||||
.Where(x => x.WorkshopId == workshopId)
|
|
||||||
.Select(x => new
|
|
||||||
{
|
|
||||||
x.BankId,
|
|
||||||
x.EmployeeId,
|
|
||||||
x.WorkshopId,
|
|
||||||
}).AsQueryable();
|
|
||||||
|
|
||||||
if (searchParams.BankId > 0)
|
|
||||||
bankInfoQuery = bankInfoQuery.Where(x => x.BankId == searchParams.BankId);
|
|
||||||
|
|
||||||
if (searchParams.EmployeeId > 0)
|
|
||||||
bankInfoQuery = bankInfoQuery.Where(x => x.EmployeeId == searchParams.EmployeeId);
|
|
||||||
|
|
||||||
var bankInfoList = await bankInfoQuery.ToListAsync();
|
|
||||||
|
|
||||||
var employeeIds = bankInfoList.Select(x => x.EmployeeId).Distinct().ToList();
|
|
||||||
|
|
||||||
var employees = await _companyContext.Employees
|
|
||||||
.Where(x => employeeIds.Contains(x.id)).ToListAsync();
|
|
||||||
|
|
||||||
var personnelCodes = await _companyContext.PersonnelCodeSet
|
|
||||||
.Where(x=>employeeIds.Contains(x.EmployeeId) && x.WorkshopId == workshopId)
|
|
||||||
.ToDictionaryAsync(x=>x.EmployeeId,x=>x.PersonnelCode);
|
|
||||||
|
|
||||||
var bankIds = bankInfoList.Select(x=>x.BankId).Distinct().ToList();
|
|
||||||
|
|
||||||
var banks =await _companyContext.Banks.Where(x => bankIds.Contains(x.id)).ToListAsync();
|
|
||||||
|
|
||||||
|
|
||||||
//Get bank logos from account context
|
|
||||||
var mediaIds = banks.Select(x=>x.BankLogoMediaId).ToList();
|
|
||||||
|
|
||||||
var banksLogos = _accountContext.Medias.Where(y => mediaIds.Contains(y.id))
|
|
||||||
.Select(media => new { media.Path, MediaId = media.id }).ToList();
|
|
||||||
|
|
||||||
var banksWithLogo = banks.Select(x => new
|
|
||||||
{
|
|
||||||
Logo = banksLogos.FirstOrDefault(l => l.MediaId == x.BankLogoMediaId),
|
|
||||||
Bank = x
|
|
||||||
}).ToList();
|
|
||||||
|
|
||||||
return bankInfoList.GroupBy(x => x.EmployeeId).Select(x =>
|
|
||||||
{
|
|
||||||
var employee = employees.FirstOrDefault(e=>e.id == x.Key);
|
|
||||||
|
|
||||||
var selectBankId = x.Select(b => b.BankId);
|
|
||||||
|
|
||||||
var selectBanks = banksWithLogo
|
|
||||||
.Where(b => selectBankId.Contains(b.Bank.id)).ToList();
|
|
||||||
|
|
||||||
return new GroupedEmployeeBankInformationViewModel()
|
|
||||||
{
|
|
||||||
BankPicturesList =
|
|
||||||
selectBanks.Select(y => y.Logo.Path).ToList(),
|
|
||||||
EmployeeId = x.Key,
|
|
||||||
WorkshopId = workshopId,
|
|
||||||
EmployeeName = employee?.FullName ?? "",
|
|
||||||
TotalBankAccountsCount = x.Count(),
|
|
||||||
PersonnelCode = personnelCodes.TryGetValue(x.Key,out var value)?
|
|
||||||
value.ToString() :
|
|
||||||
"",
|
|
||||||
BankNamesList = selectBanks.Select(y => y.Bank.BankName).ToList()
|
|
||||||
};
|
|
||||||
}).ToList();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void RemoveByEmployeeId(IEnumerable<EmployeeBankInformation> entities)
|
public void RemoveByEmployeeId(IEnumerable<EmployeeBankInformation> entities)
|
||||||
{
|
{
|
||||||
@@ -337,55 +265,4 @@ public class EmployeeBankInformationRepository : RepositoryBase<long, EmployeeBa
|
|||||||
};
|
};
|
||||||
}).ToList();
|
}).ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<GetEmployeeBankInfoDetailsDto> GetDetailsByEmployeeIdAsync(long workshopId, long employeeId)
|
|
||||||
{
|
|
||||||
var employeeBankInfos =await _companyContext.EmployeeBankInformationSet
|
|
||||||
.Where(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId).ToListAsync();
|
|
||||||
|
|
||||||
if (employeeBankInfos.Count == 0)
|
|
||||||
{
|
|
||||||
throw new NotFoundException("اطلاعات بانکی یافت نشد");
|
|
||||||
}
|
|
||||||
var employee = await _companyContext.Employees
|
|
||||||
.FirstOrDefaultAsync(x=>x.id == employeeId);
|
|
||||||
|
|
||||||
if (employee == null)
|
|
||||||
{
|
|
||||||
throw new NotFoundException("پرسنل مورد نظر یافت نشد");
|
|
||||||
}
|
|
||||||
|
|
||||||
var employeeFullName = employee.FullName;
|
|
||||||
|
|
||||||
var bankIds = employeeBankInfos.Select(x => x.BankId).Distinct().ToList();
|
|
||||||
|
|
||||||
var banks = await _companyContext.Banks.Where(x => bankIds.Contains(x.id)).ToListAsync();
|
|
||||||
|
|
||||||
var mediaIds = banks.Select(x => x.BankLogoMediaId).ToList();
|
|
||||||
|
|
||||||
var bankLogos = await _accountContext.Medias.Where(x=>mediaIds.Contains(x.id)).ToListAsync();
|
|
||||||
|
|
||||||
var res = new GetEmployeeBankInfoDetailsDto()
|
|
||||||
{
|
|
||||||
EmployeeId = employeeId,
|
|
||||||
EmployeeFullName = employeeFullName,
|
|
||||||
BankItems = employeeBankInfos.Select(x =>
|
|
||||||
{
|
|
||||||
var bank = banks.FirstOrDefault(y => y.id == x.BankId);
|
|
||||||
var bankLogo = bankLogos.FirstOrDefault(l => bank?.BankLogoMediaId == l.id);
|
|
||||||
return new GetEmployeeBankInfoDetailsBankItemDto()
|
|
||||||
{
|
|
||||||
BankId = x.BankId,
|
|
||||||
BankAccountNumber = x.BankAccountNumber,
|
|
||||||
BankLogoPath = bankLogo?.Path ?? "",
|
|
||||||
BankName = bank?.BankName ?? "",
|
|
||||||
CardNumber = x.CardNumber,
|
|
||||||
ShebaNumber = x.ShebaNumber,
|
|
||||||
IsDefault = x.IsDefault,
|
|
||||||
Id = x.id
|
|
||||||
};
|
|
||||||
}).ToList()
|
|
||||||
};
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1474,7 +1474,8 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
|||||||
IsInPersonContract = workshopGroup?.CurrentWorkshops
|
IsInPersonContract = workshopGroup?.CurrentWorkshops
|
||||||
.Any(y => y.Services.ContractInPerson) ?? true,
|
.Any(y => y.Services.ContractInPerson) ?? true,
|
||||||
IsOldContract = x.contract.SigningType == InstitutionContractSigningType.Legacy,
|
IsOldContract = x.contract.SigningType == InstitutionContractSigningType.Legacy,
|
||||||
InstitutionContractIsSentFlag = sendFlags.ContainsKey(x.contract.id) ? sendFlags[x.contract.id] : false
|
InstitutionContractIsSentFlag =
|
||||||
|
sendFlags.ContainsKey(x.contract.id) ? sendFlags[x.contract.id] : false
|
||||||
};
|
};
|
||||||
}).ToList()
|
}).ToList()
|
||||||
};
|
};
|
||||||
@@ -3358,9 +3359,17 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
|||||||
OneMonthPrice = institution.ContractAmountWithTax.ToMoney(),
|
OneMonthPrice = institution.ContractAmountWithTax.ToMoney(),
|
||||||
OneMonthWithoutTax = institution.ContractAmount.ToMoney(),
|
OneMonthWithoutTax = institution.ContractAmount.ToMoney(),
|
||||||
OneMonthTax = institution.ContractAmountTax.ToMoney(),
|
OneMonthTax = institution.ContractAmountTax.ToMoney(),
|
||||||
VerifierFullName = institution.VerifierFullName,
|
VerifierFullName =
|
||||||
VerifierPhoneNumber = institution.VerifierPhoneNumber,
|
institution.VerificationStatus == InstitutionContractVerificationStatus.PendingForVerify
|
||||||
VerifyCode = institution.VerifyCode,
|
? null
|
||||||
|
: institution.VerifierFullName,
|
||||||
|
VerifierPhoneNumber =
|
||||||
|
institution.VerificationStatus == InstitutionContractVerificationStatus.PendingForVerify
|
||||||
|
? null
|
||||||
|
: institution.VerifierPhoneNumber,
|
||||||
|
VerifyCode = institution.VerificationStatus == InstitutionContractVerificationStatus.PendingForVerify
|
||||||
|
? null
|
||||||
|
: institution.VerifyCode,
|
||||||
VerifyDate = institution.VerifyCodeCreation.ToFarsi(),
|
VerifyDate = institution.VerifyCodeCreation.ToFarsi(),
|
||||||
VerifyTime = institution.VerifyCodeCreation.ToString("HH:mm:ss"),
|
VerifyTime = institution.VerifyCodeCreation.ToString("HH:mm:ss"),
|
||||||
Workshops = institution.WorkshopGroup.InitialWorkshops
|
Workshops = institution.WorkshopGroup.InitialWorkshops
|
||||||
@@ -3563,10 +3572,6 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#region PrivateMetods
|
#region PrivateMetods
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -3611,11 +3616,8 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//ایجاد سند مالی ماهانه
|
//ایجاد سند مالی ماهانه
|
||||||
|
|
||||||
#region CreateMontlyTransaction
|
#region CreateMontlyTransaction
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -3625,7 +3627,6 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
|||||||
public async Task CreateTransactionForInstitutionContracts(DateTime endOfMonthGr, string endOfMonthFa,
|
public async Task CreateTransactionForInstitutionContracts(DateTime endOfMonthGr, string endOfMonthFa,
|
||||||
string description)
|
string description)
|
||||||
{
|
{
|
||||||
|
|
||||||
#region FindeNextMonth 1th
|
#region FindeNextMonth 1th
|
||||||
|
|
||||||
var firstDayOfMonthGr = ($"{endOfMonthFa.Substring(0, 8)}01").ToGeorgianDateTime();
|
var firstDayOfMonthGr = ($"{endOfMonthFa.Substring(0, 8)}01").ToGeorgianDateTime();
|
||||||
@@ -4008,8 +4009,6 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public async Task<long> GetIdByInstallmentId(long installmentId)
|
public async Task<long> GetIdByInstallmentId(long installmentId)
|
||||||
{
|
{
|
||||||
return await _context.InstitutionContractSet.Include(x => x.Installments)
|
return await _context.InstitutionContractSet.Include(x => x.Installments)
|
||||||
@@ -4445,7 +4444,6 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
|||||||
Id = 0,
|
Id = 0,
|
||||||
IdNumberSerial = "",
|
IdNumberSerial = "",
|
||||||
IdNumberSeri = "",
|
IdNumberSeri = "",
|
||||||
|
|
||||||
};
|
};
|
||||||
creationTemp.SetContractingPartyInfo(request.LegalType, real, legal);
|
creationTemp.SetContractingPartyInfo(request.LegalType, real, legal);
|
||||||
}
|
}
|
||||||
@@ -5221,11 +5219,6 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#region CustomViewModels
|
#region CustomViewModels
|
||||||
|
|
||||||
public class WorkshopsAndEmployeeViewModel
|
public class WorkshopsAndEmployeeViewModel
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ public class ReportClientRepository : IReportClientRepository
|
|||||||
TotalClaims = x.TotalClaims,
|
TotalClaims = x.TotalClaims,
|
||||||
TotalDeductions = x.TotalDeductions,
|
TotalDeductions = x.TotalDeductions,
|
||||||
TotalPayment = x.TotalPayment.ToMoney(),
|
TotalPayment = x.TotalPayment.ToMoney(),
|
||||||
RewardPay = x.RewardPay.ToMoneyNullable(),
|
RewardPay = x.RewardPay.ToMoney(),
|
||||||
MarriedAllowance = x.MarriedAllowance.ToMoney(),
|
MarriedAllowance = x.MarriedAllowance.ToMoney(),
|
||||||
}).Where(x => x.WorkshopId == workshopId);
|
}).Where(x => x.WorkshopId == workshopId);
|
||||||
|
|
||||||
@@ -448,7 +448,7 @@ public class ReportClientRepository : IReportClientRepository
|
|||||||
TotalClaims = x.TotalClaims,
|
TotalClaims = x.TotalClaims,
|
||||||
TotalDeductions = x.TotalDeductions,
|
TotalDeductions = x.TotalDeductions,
|
||||||
TotalPayment = x.TotalPayment.ToMoney(),
|
TotalPayment = x.TotalPayment.ToMoney(),
|
||||||
RewardPay = x.RewardPay.ToMoneyNullable(),
|
RewardPay = x.RewardPay.ToMoney(),
|
||||||
MarriedAllowance = x.MarriedAllowance.ToMoney(),
|
MarriedAllowance = x.MarriedAllowance.ToMoney(),
|
||||||
}).Where(x => x.WorkshopId == workshopId);
|
}).Where(x => x.WorkshopId == workshopId);
|
||||||
|
|
||||||
|
|||||||
@@ -5199,7 +5199,7 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<RewardViewModel> RewardForCheckout(long employeeId, long workshopId, DateTime checkoutEnd,
|
public List<RewardViewModel> RewardForCheckout(long employeeId, long workshopId, DateTime checkoutEnd,
|
||||||
DateTime checkoutStart)
|
DateTime checkoutStart)
|
||||||
{
|
{
|
||||||
return _context.Rewards.Where(x =>
|
return _context.Rewards.Where(x =>
|
||||||
|
|||||||
@@ -160,7 +160,9 @@ public class WorkshopRepository : RepositoryBase<long, Company.Domain.WorkshopAg
|
|||||||
public EditWorkshop GetDetails(long id)
|
public EditWorkshop GetDetails(long id)
|
||||||
{
|
{
|
||||||
var emp = _context.WorkshopEmployers.Where(x => x.WorkshopId == id)
|
var emp = _context.WorkshopEmployers.Where(x => x.WorkshopId == id)
|
||||||
.Select(x => x.EmployerId).ToList();
|
.Select(x => x.Employer).ToList();
|
||||||
|
var contractingPart = emp.Select(x => x.ContractingPartyId).ToList();
|
||||||
|
bool rewardCompute = contractingPart.Any(x=>x == 30804);
|
||||||
return _context.Workshops.Select(x => new EditWorkshop
|
return _context.Workshops.Select(x => new EditWorkshop
|
||||||
{
|
{
|
||||||
Id = x.id,
|
Id = x.id,
|
||||||
@@ -193,7 +195,7 @@ public class WorkshopRepository : RepositoryBase<long, Company.Domain.WorkshopAg
|
|||||||
BonusesOptions = string.IsNullOrWhiteSpace(x.BonusesOptions) ? "EndOfContract1402leftWork1403" : x.BonusesOptions,
|
BonusesOptions = string.IsNullOrWhiteSpace(x.BonusesOptions) ? "EndOfContract1402leftWork1403" : x.BonusesOptions,
|
||||||
YearsOptions = x.YearsOptions,
|
YearsOptions = x.YearsOptions,
|
||||||
IsOldContract = x.IsOldContract,
|
IsOldContract = x.IsOldContract,
|
||||||
EmployerIdList = emp,
|
EmployerIdList = emp.Select(e=>e.id).ToList(),
|
||||||
HasRollCallFreeVip = x.HasRollCallFreeVip,
|
HasRollCallFreeVip = x.HasRollCallFreeVip,
|
||||||
WorkshopHolidayWorking = x.WorkshopHolidayWorking,
|
WorkshopHolidayWorking = x.WorkshopHolidayWorking,
|
||||||
InsuranceCheckoutOvertime = x.InsuranceCheckoutOvertime,
|
InsuranceCheckoutOvertime = x.InsuranceCheckoutOvertime,
|
||||||
@@ -205,6 +207,7 @@ public class WorkshopRepository : RepositoryBase<long, Company.Domain.WorkshopAg
|
|||||||
SignCheckout = x.SignCheckout,
|
SignCheckout = x.SignCheckout,
|
||||||
RotatingShiftCompute = x.RotatingShiftCompute,
|
RotatingShiftCompute = x.RotatingShiftCompute,
|
||||||
IsStaticCheckout = x.IsStaticCheckout,
|
IsStaticCheckout = x.IsStaticCheckout,
|
||||||
|
RewardComputeOnCheckout = rewardCompute
|
||||||
|
|
||||||
}).FirstOrDefault(x => x.Id == id);
|
}).FirstOrDefault(x => x.Id == id);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -209,22 +209,38 @@ public class CreateOrEditCheckoutCommandHandler : IBaseCommandHandler<CreateOrEd
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
//حقوق نهایی
|
////حقوق نهایی
|
||||||
var monthlySalaryPay = (totalHoursWorked * monthlySalaryDefined) / mandatoryHours;
|
//var monthlySalaryPay = (totalHoursWorked * monthlySalaryDefined) / mandatoryHours;
|
||||||
// اگر اضافه کار داشت حقوق تعین شده به عنوان حقوق نهایی در نظر گرفته میشود
|
//// اگر اضافه کار داشت حقوق تعین شده به عنوان حقوق نهایی در نظر گرفته میشود
|
||||||
monthlySalaryPay = monthlySalaryPay > monthlySalaryDefined ? monthlySalaryDefined : monthlySalaryPay;
|
//monthlySalaryPay = monthlySalaryPay > monthlySalaryDefined ? monthlySalaryDefined : monthlySalaryPay;
|
||||||
|
|
||||||
//حقوق کسر شده
|
////حقوق کسر شده
|
||||||
var deductionFromSalary = monthlySalaryDefined - monthlySalaryPay;
|
//var deductionFromSalary = monthlySalaryDefined - monthlySalaryPay;
|
||||||
|
|
||||||
|
//new chang salary compute
|
||||||
|
var monthlySalaryPay = totalHoursWorked * monthlySalaryDefined;
|
||||||
|
|
||||||
//زمان باقی مانده
|
//زمان باقی مانده
|
||||||
var remainingTime = totalHoursWorked - mandatoryHours;
|
var remainingTime = totalHoursWorked - mandatoryHours;
|
||||||
|
|
||||||
|
|
||||||
|
//تناسب به دقیقه
|
||||||
|
#region MyRegion
|
||||||
|
|
||||||
|
//var monthlySalaryDefinedTest = monthlySalaryDefined * mandatoryHours;
|
||||||
|
//var monthlySalaryPayTest = totalHoursWorked * monthlySalaryDefined;
|
||||||
|
////// اگر اضافه کار داشت حقوق تعین شده به عنوان حقوق نهایی در نظر گرفته میشود
|
||||||
|
//monthlySalaryPayTest = monthlySalaryPayTest > monthlySalaryDefinedTest ? monthlySalaryDefinedTest : monthlySalaryPayTest;
|
||||||
|
//////حقوق کسر شده
|
||||||
|
//var deductionFromSalaryTest = monthlySalaryDefinedTest - monthlySalaryPayTest;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
var computeResult = new ComputeResultDto
|
var computeResult = new ComputeResultDto
|
||||||
{
|
{
|
||||||
MandatoryHours = mandatoryHours,
|
MandatoryHours = mandatoryHours,
|
||||||
MonthlySalaryPay = monthlySalaryPay,
|
MonthlySalaryPay = monthlySalaryPay,
|
||||||
DeductionFromSalary = deductionFromSalary,
|
DeductionFromSalary = 0 /*deductionFromSalary*/,
|
||||||
RemainingHours = remainingTime
|
RemainingHours = remainingTime
|
||||||
};
|
};
|
||||||
Console.WriteLine(mandatoryHours);
|
Console.WriteLine(mandatoryHours);
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
using GozareshgirProgramManager.Application._Common.Interfaces;
|
using DNTPersianUtils.Core;
|
||||||
|
using GozareshgirProgramManager.Application._Common.Interfaces;
|
||||||
using GozareshgirProgramManager.Application._Common.Models;
|
using GozareshgirProgramManager.Application._Common.Models;
|
||||||
using GozareshgirProgramManager.Application.Modules.SalaryPaymentSettings.Queries.GetUserListWhoHaveSettings;
|
using GozareshgirProgramManager.Application.Modules.SalaryPaymentSettings.Queries.GetUserListWhoHaveSettings;
|
||||||
using GozareshgirProgramManager.Domain._Common;
|
using GozareshgirProgramManager.Domain._Common;
|
||||||
using GozareshgirProgramManager.Domain.CheckoutAgg.Enums;
|
using GozareshgirProgramManager.Domain.CheckoutAgg.Enums;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using PersianTools.Core;
|
using PersianDateTime = PersianTools.Core.PersianDateTime;
|
||||||
|
|
||||||
namespace GozareshgirProgramManager.Application.Modules.Checkouts.Queries.GetUserToGropCreate;
|
namespace GozareshgirProgramManager.Application.Modules.Checkouts.Queries.GetUserToGropCreate;
|
||||||
|
|
||||||
@@ -45,8 +46,8 @@ public class GetUserToGroupCreatingQueryHandler : IBaseQueryHandler<GetUserToGro
|
|||||||
"ایجاد فیش فقط برای ماه های گذشته امکان پذیر است");
|
"ایجاد فیش فقط برای ماه های گذشته امکان پذیر است");
|
||||||
|
|
||||||
|
|
||||||
var lastMonthStart = lastMonth;
|
//var lastMonthStart = lastMonth;
|
||||||
var lastMonthEnd = lastMonth;
|
var lastMonthEnd = ((selectedDate.ToFarsi().FindeEndOfMonth())).ToGeorgianDateTime();
|
||||||
|
|
||||||
var query =
|
var query =
|
||||||
await (from u in _context.Users
|
await (from u in _context.Users
|
||||||
@@ -60,8 +61,8 @@ public class GetUserToGroupCreatingQueryHandler : IBaseQueryHandler<GetUserToGro
|
|||||||
// LEFT JOIN
|
// LEFT JOIN
|
||||||
//فیش
|
//فیش
|
||||||
join ch in _context.Checkouts
|
join ch in _context.Checkouts
|
||||||
.Where(x => x.CheckoutStartDate < lastMonthStart
|
.Where(x => x.CheckoutStartDate < lastMonthEnd
|
||||||
&& x.CheckoutEndDate >= lastMonthStart)
|
&& x.CheckoutEndDate > selectedDate)
|
||||||
on u.Id equals ch.UserId into chJoin
|
on u.Id equals ch.UserId into chJoin
|
||||||
from ch in chJoin.DefaultIfEmpty()
|
from ch in chJoin.DefaultIfEmpty()
|
||||||
|
|
||||||
|
|||||||
@@ -62,8 +62,7 @@ public class ProjectSetTimeDetailsQueryHandler
|
|||||||
var res = new ProjectSetTimeResponse(
|
var res = new ProjectSetTimeResponse(
|
||||||
skills.Select(skill =>
|
skills.Select(skill =>
|
||||||
{
|
{
|
||||||
var section = task
|
var section = task.Sections
|
||||||
.Sections
|
|
||||||
.FirstOrDefault(x => x.SkillId == skill.Id);
|
.FirstOrDefault(x => x.SkillId == skill.Id);
|
||||||
var user = users.FirstOrDefault(x => x.Id == section?.OriginalAssignedUserId);
|
var user = users.FirstOrDefault(x => x.Id == section?.OriginalAssignedUserId);
|
||||||
return new ProjectSetTimeResponseSkill
|
return new ProjectSetTimeResponseSkill
|
||||||
|
|||||||
@@ -794,7 +794,8 @@ public class IndexModel : PageModel
|
|||||||
watch.Stop();
|
watch.Stop();
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
var firstContract = _contractApplication.GetDetails(ContractsId[0]);
|
||||||
|
var workshop = _workshopApplication.GetDetails(firstContract.WorkshopIds);
|
||||||
|
|
||||||
//int i = 0;
|
//int i = 0;
|
||||||
foreach (var item in ContractsId)
|
foreach (var item in ContractsId)
|
||||||
@@ -809,7 +810,7 @@ public class IndexModel : PageModel
|
|||||||
if (separation.checker)
|
if (separation.checker)
|
||||||
{
|
{
|
||||||
//workshopInfo
|
//workshopInfo
|
||||||
var workshop = _workshopApplication.GetDetails(contract.WorkshopIds);
|
|
||||||
|
|
||||||
var employeeOptions =
|
var employeeOptions =
|
||||||
_employeeComputeOptionsApplication.GetAllByWorkshopId(contract.WorkshopIds);
|
_employeeComputeOptionsApplication.GetAllByWorkshopId(contract.WorkshopIds);
|
||||||
@@ -1212,7 +1213,7 @@ public class IndexModel : PageModel
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
RewardPayCompute = workshop.RewardComputeOnCheckout,
|
||||||
|
|
||||||
};
|
};
|
||||||
_checkoutApplication.Create(command);
|
_checkoutApplication.Create(command);
|
||||||
|
|||||||
@@ -1,106 +0,0 @@
|
|||||||
using _0_Framework.Application;
|
|
||||||
using CompanyManagment.App.Contracts.EmployeeBankInformation;
|
|
||||||
using CompanyManagement.Infrastructure.Excel.EmployeeBankInfo;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
using ServiceHost.BaseControllers;
|
|
||||||
|
|
||||||
namespace ServiceHost.Areas.Client.Controllers;
|
|
||||||
|
|
||||||
public class EmployeeBankInfoController : ClientBaseController
|
|
||||||
{
|
|
||||||
private readonly IEmployeeBankInformationApplication _employeeBankInformationApplication;
|
|
||||||
private readonly long _workshopId;
|
|
||||||
|
|
||||||
public EmployeeBankInfoController(IEmployeeBankInformationApplication employeeBankInformationApplication,
|
|
||||||
IAuthHelper authHelper)
|
|
||||||
{
|
|
||||||
_employeeBankInformationApplication = employeeBankInformationApplication;
|
|
||||||
_workshopId = authHelper.GetWorkshopId();
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpGet]
|
|
||||||
public async Task<ActionResult<List<GroupedEmployeeBankInformationViewModel>>> GetList(
|
|
||||||
EmployeeBankInformationSearchModel searchModel)
|
|
||||||
{
|
|
||||||
return await _employeeBankInformationApplication.SearchAsync(_workshopId, searchModel);
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpGet("{employeeId:long}")]
|
|
||||||
public async Task<ActionResult<GetEmployeeBankInfoDetailsDto>> GetDetails(long employeeId)
|
|
||||||
{
|
|
||||||
return await _employeeBankInformationApplication.GetDetailsByEmployeeIdAsync(_workshopId, employeeId);
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpPost]
|
|
||||||
public ActionResult<OperationResult> Create([FromBody]CreateEmployeeInformation command)
|
|
||||||
{
|
|
||||||
command.WorkshopId = _workshopId;
|
|
||||||
return _employeeBankInformationApplication.Create(command);
|
|
||||||
}
|
|
||||||
[HttpPut]
|
|
||||||
public ActionResult<OperationResult> Edit([FromBody]EditEmployeeInformation command)
|
|
||||||
{
|
|
||||||
command.WorkshopId = _workshopId;
|
|
||||||
return _employeeBankInformationApplication.Edit(command);
|
|
||||||
}
|
|
||||||
[HttpDelete("delete-by-employee/{employeeId:long}")]
|
|
||||||
public ActionResult<OperationResult> Remove(long employeeId)
|
|
||||||
{
|
|
||||||
return _employeeBankInformationApplication.RemoveByEmployeeId(_workshopId, employeeId);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpDelete("delete-one/{id:long}")]
|
|
||||||
public IActionResult OnPostDelete(long id)
|
|
||||||
{
|
|
||||||
var result = _employeeBankInformationApplication.Remove(id);
|
|
||||||
return new JsonResult(new
|
|
||||||
{
|
|
||||||
success = result.IsSuccedded,
|
|
||||||
message = result.Message,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpPost("excel")]
|
|
||||||
public ActionResult DownloadExcel([FromBody]DownloadExcelRequest request)
|
|
||||||
{
|
|
||||||
|
|
||||||
var employeeBankInformationViewModelForExcels = _employeeBankInformationApplication.SearchForExcel(_workshopId,
|
|
||||||
new EmployeeBankInformationSearchModel() { EmployeeBankInfoIds = request.Ids });
|
|
||||||
|
|
||||||
var resultViewModel = employeeBankInformationViewModelForExcels.Select(x => new EmployeeBankInfoExcelViewModel
|
|
||||||
{
|
|
||||||
Name = x.EmployeeName,
|
|
||||||
BankAccounts = x.BankInformationList.Select(b => new BankInfoExcelViewModel()
|
|
||||||
{
|
|
||||||
IsDefault = b.IsDefault,
|
|
||||||
ShebaNumber = b.ShebaNumber,
|
|
||||||
AccountNumber = b.BankAccountNumber,
|
|
||||||
BankName = b.BankName,
|
|
||||||
CardNumber = b.CardNumber
|
|
||||||
}).ToList()
|
|
||||||
}).ToList();
|
|
||||||
|
|
||||||
var bytes = EmployeeBankInfoExcelGenerator.Generate(resultViewModel);
|
|
||||||
return File(bytes,
|
|
||||||
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
||||||
$"اطلاعات بانکی پرسنل.xlsx");
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpPost("set-default/{bankId:long}")]
|
|
||||||
public IActionResult SetDefault(long bankId)
|
|
||||||
{
|
|
||||||
var result = _employeeBankInformationApplication.SetDefault(_workshopId, bankId);
|
|
||||||
return new JsonResult(new
|
|
||||||
{
|
|
||||||
success = result.IsSuccedded,
|
|
||||||
message = result.Message,
|
|
||||||
id = result.SendId
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
public class DownloadExcelRequest
|
|
||||||
{
|
|
||||||
public List<long> Ids { get; set; }
|
|
||||||
}
|
|
||||||
@@ -8,8 +8,6 @@ using Microsoft.AspNetCore.Mvc;
|
|||||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||||
using System.Security.Claims;
|
using System.Security.Claims;
|
||||||
using CompanyManagement.Infrastructure.Excel.EmployeeBankInfo;
|
using CompanyManagement.Infrastructure.Excel.EmployeeBankInfo;
|
||||||
using CompanyManagment.App.Contracts.Bank;
|
|
||||||
using CompanyManagement.Infrastructure.Excel.EmployeeBankInfo;
|
|
||||||
|
|
||||||
namespace ServiceHost.Areas.Client.Pages.Company.EmployeesBankInfo
|
namespace ServiceHost.Areas.Client.Pages.Company.EmployeesBankInfo
|
||||||
{
|
{
|
||||||
@@ -30,11 +28,7 @@ namespace ServiceHost.Areas.Client.Pages.Company.EmployeesBankInfo
|
|||||||
private readonly IWebHostEnvironment _hostEnvironment;
|
private readonly IWebHostEnvironment _hostEnvironment;
|
||||||
|
|
||||||
|
|
||||||
public IndexModel(IPasswordHasher passwordHasher, IWorkshopApplication workshopApplication,
|
public IndexModel(IPasswordHasher passwordHasher, IWorkshopApplication workshopApplication, IHttpContextAccessor contextAccessor, IAuthHelper authHelper, IEmployeeBankInformationApplication employeeBankInformationApplication, IEmployeeApplication employeeApplication, IBankApplication bankApplication, IWebHostEnvironment hostEnvironment)
|
||||||
IHttpContextAccessor contextAccessor, IAuthHelper authHelper,
|
|
||||||
IEmployeeBankInformationApplication employeeBankInformationApplication,
|
|
||||||
IEmployeeApplication employeeApplication, IBankApplication bankApplication,
|
|
||||||
IWebHostEnvironment hostEnvironment)
|
|
||||||
{
|
{
|
||||||
_passwordHasher = passwordHasher;
|
_passwordHasher = passwordHasher;
|
||||||
_workshopApplication = workshopApplication;
|
_workshopApplication = workshopApplication;
|
||||||
@@ -70,8 +64,7 @@ namespace ServiceHost.Areas.Client.Pages.Company.EmployeesBankInfo
|
|||||||
|
|
||||||
public IActionResult OnGetEmployeeBankInfoListAjax(EmployeeBankInformationSearchModel searchModel)
|
public IActionResult OnGetEmployeeBankInfoListAjax(EmployeeBankInformationSearchModel searchModel)
|
||||||
{
|
{
|
||||||
var resultData = _employeeBankInformationApplication
|
var resultData = _employeeBankInformationApplication.Search(_workshopId, searchModel);
|
||||||
.Search(_workshopId, searchModel);
|
|
||||||
return new JsonResult(new
|
return new JsonResult(new
|
||||||
{
|
{
|
||||||
success = true,
|
success = true,
|
||||||
|
|||||||
@@ -1,25 +0,0 @@
|
|||||||
using CompanyManagment.App.Contracts.Bank;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
using ServiceHost.BaseControllers;
|
|
||||||
|
|
||||||
namespace ServiceHost.Controllers;
|
|
||||||
|
|
||||||
public class BankController : GeneralBaseController
|
|
||||||
{
|
|
||||||
private readonly IBankApplication _bankApplication;
|
|
||||||
|
|
||||||
public BankController(IBankApplication bankApplication)
|
|
||||||
{
|
|
||||||
_bankApplication = bankApplication;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// دریافت لیست بانکها برای SelectList
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
[HttpGet]
|
|
||||||
public ActionResult<List<BankSelectList>> GetBankList()
|
|
||||||
{
|
|
||||||
return _bankApplication.GetBanksForSelectList();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user