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);
|
||||
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 totalDayOfLeaveCompute, string totalDayOfYearsCompute, string totalDayOfBunosesCompute,
|
||||
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;
|
||||
FathersName = fathersName;
|
||||
@@ -71,7 +71,7 @@ public class Checkout : EntityBase
|
||||
TotalClaims = totalClaims;
|
||||
TotalDeductions = totalDeductions;
|
||||
TotalPayment = totalPayment;
|
||||
RewardPay = 0;
|
||||
RewardPay = rewardPay;
|
||||
IsActiveString = "true";
|
||||
Signature = signature;
|
||||
MarriedAllowance = marriedAllowance;
|
||||
@@ -93,6 +93,7 @@ public class Checkout : EntityBase
|
||||
CheckoutRollCall = checkoutRollCall;
|
||||
EmployeeMandatoryHours = employeeMandatoryHours;
|
||||
HasInsuranceShareTheSameAsList = hasInsuranceShareTheSameAsList;
|
||||
Rewards = rewards;
|
||||
}
|
||||
|
||||
|
||||
@@ -130,7 +131,7 @@ public class Checkout : EntityBase
|
||||
public double BonusesPay { get; private set; }
|
||||
public double YearsPay { 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 TaxDeducation { 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<CheckoutSalaryAid> SalaryAids { get; set; } = [];
|
||||
|
||||
public ICollection<CheckoutReward> Rewards { get; set; } = [];
|
||||
public CheckoutRollCall CheckoutRollCall { get; private set; }
|
||||
#endregion
|
||||
|
||||
@@ -239,7 +242,7 @@ public class Checkout : EntityBase
|
||||
double insuranceDeduction, double taxDeducation, double installmentDeduction,
|
||||
double salaryAidDeduction, double absenceDeduction, string sumOfWorkingDays
|
||||
, string archiveCode, string personnelCode,
|
||||
string totalClaims, string totalDeductions, double totalPayment, double? rewardPay)
|
||||
string totalClaims, string totalDeductions, double totalPayment, double rewardPay)
|
||||
{
|
||||
EmployeeFullName = employeeFullName;
|
||||
FathersName = fathersName;
|
||||
@@ -337,6 +340,11 @@ public class Checkout : EntityBase
|
||||
InstallmentDeduction = installmentsAmount;
|
||||
}
|
||||
|
||||
public void SetReward(ICollection<CheckoutReward> rewards, double rewardAmount)
|
||||
{
|
||||
RewardPay = rewardAmount;
|
||||
Rewards = rewards;
|
||||
}
|
||||
public void SetCheckoutRollCall(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 CompanyManagment.App.Contracts.EmployeeBankInformation;
|
||||
using System.Collections.Generic;
|
||||
using System.Security.AccessControl;
|
||||
using System.Threading.Tasks;
|
||||
using CompanyManagment.App.Contracts.Workshop;
|
||||
|
||||
namespace Company.Domain.EmployeeBankInformationAgg
|
||||
{
|
||||
@@ -15,31 +11,14 @@ namespace Company.Domain.EmployeeBankInformationAgg
|
||||
void Remove(EmployeeBankInformation bankInformation);
|
||||
void RemoveRange(List<EmployeeBankInformation> entities);
|
||||
|
||||
[Obsolete("از متد async استفاده کنید")]
|
||||
List<GroupedEmployeeBankInformationViewModel> Search(long workshopId, EmployeeBankInformationSearchModel searchParams);
|
||||
|
||||
Task<List<GroupedEmployeeBankInformationViewModel>> SearchAsync(long workshopId,
|
||||
EmployeeBankInformationSearchModel searchParams);
|
||||
|
||||
|
||||
GroupedEmployeeBankInformationViewModel GetByEmployeeId(long workshopId, long employeeId);
|
||||
List<EmployeeBankInformation> GetRangeByEmployeeId(long workshopId, long employeeId);
|
||||
EmployeeBankInformationViewModel GetDetails(long id);
|
||||
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 System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Domain;
|
||||
using _0_Framework.Domain;
|
||||
using Company.Domain.CustomizeWorkshopEmployeeSettingsAgg.Entities;
|
||||
using CompanyManagment.App.Contracts.Contract;
|
||||
using CompanyManagment.App.Contracts.CustomizeCheckout;
|
||||
using CompanyManagment.App.Contracts.Leave;
|
||||
using CompanyManagment.App.Contracts.Loan;
|
||||
using CompanyManagment.App.Contracts.Reward;
|
||||
using CompanyManagment.App.Contracts.RollCall;
|
||||
using CompanyManagment.App.Contracts.SalaryAid;
|
||||
using CompanyManagment.App.Contracts.WorkingHoursTemp;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Company.Domain.RollCallAgg;
|
||||
|
||||
@@ -53,6 +54,9 @@ public interface IRollCallMandatoryRepository : IRepository<long, RollCall>
|
||||
List<SalaryAidViewModel> SalaryAidsForCheckout(long employeeId, long workshopId, DateTime checkoutStart,
|
||||
DateTime checkoutEnd);
|
||||
|
||||
List<RewardViewModel> RewardForCheckout(long employeeId, long workshopId, DateTime checkoutEnd,
|
||||
DateTime checkoutStart);
|
||||
|
||||
Task<ComputingViewModel> RotatingShiftReport(long workshopId, long employeeId, DateTime contractStart,
|
||||
DateTime contractEnd, string shiftwork, bool hasRollCall, CreateWorkingHoursTemp command,bool holidayWorking);
|
||||
}
|
||||
@@ -10,12 +10,5 @@ namespace CompanyManagment.App.Contracts.Bank
|
||||
OperationResult Create(CreateBank command);
|
||||
OperationResult Edit(EditBank command);
|
||||
List<BankViewModel> Search(string name);
|
||||
List<BankSelectList> GetBanksForSelectList();
|
||||
|
||||
}
|
||||
|
||||
public class BankSelectList:SelectListViewModel
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -193,4 +193,9 @@ public class CreateCheckout
|
||||
/// پایه سنوات قبل از تاثیر ساعت کار
|
||||
/// </summary>
|
||||
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.Threading.Tasks;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.EmployeeBankInformation
|
||||
{
|
||||
@@ -10,7 +8,6 @@ namespace CompanyManagment.App.Contracts.EmployeeBankInformation
|
||||
OperationResult Create(CreateEmployeeInformation command);
|
||||
OperationResult GroupCreate(long workshopId, List<CreateEmployeeInformation> command);
|
||||
OperationResult Edit(EditEmployeeInformation command);
|
||||
[Obsolete("از متد Async استفاده شود")]
|
||||
List<GroupedEmployeeBankInformationViewModel> Search(long workshopId, EmployeeBankInformationSearchModel searchParams);
|
||||
List<EmployeeBankInformationViewModelForExcel> SearchForExcel(long workshopId,
|
||||
EmployeeBankInformationSearchModel searchParams);
|
||||
@@ -20,22 +17,5 @@ namespace CompanyManagment.App.Contracts.EmployeeBankInformation
|
||||
OperationResult RemoveByEmployeeId(long workshopId, long employeeId);
|
||||
List<GroupedEmployeeBankInformationViewModel> GetAllByWorkshopId(long workshopId);
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,6 +151,9 @@ public class CreateWorkshop
|
||||
/// تصفیه حساب بصورت استاتیک محاصبه شود
|
||||
/// </summary>
|
||||
public bool IsStaticCheckout { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// آیا پاداش در فیش حقوقی محاسبه شود
|
||||
/// </summary>
|
||||
public bool RewardComputeOnCheckout { get; set; }
|
||||
}
|
||||
@@ -104,10 +104,5 @@ namespace CompanyManagment.Application
|
||||
Id = x.Id
|
||||
}).ToList();
|
||||
}
|
||||
|
||||
public List<BankSelectList> GetBanksForSelectList()
|
||||
{
|
||||
return _bankRepository.GetBanksForSelectList();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -240,6 +240,16 @@ public class CheckoutApplication : ICheckoutApplication
|
||||
|
||||
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 +
|
||||
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 totalDeductionDouble = insuranceDeduction + command.AbsenceDeduction + command.InstallmentDeduction + command.SalaryAidDeduction;
|
||||
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.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,
|
||||
loanInstallments, salaryAids,checkoutRollCall,command.EmployeeMandatoryHours, hasInsuranceShareTheSameAsList);
|
||||
loanInstallments, salaryAids,checkoutRollCall,command.EmployeeMandatoryHours, hasInsuranceShareTheSameAsList, rewards, rewardPay);
|
||||
|
||||
_checkoutRepository.CreateCkeckout(checkout).GetAwaiter().GetResult();
|
||||
//_checkoutRepository.SaveChanges();
|
||||
|
||||
@@ -4,7 +4,6 @@ using Company.Domain.EmployeeBankInformationAgg;
|
||||
using CompanyManagment.App.Contracts.EmployeeBankInformation;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CompanyManagment.Application
|
||||
{
|
||||
@@ -102,13 +101,7 @@ namespace CompanyManagment.Application
|
||||
|
||||
}
|
||||
|
||||
public async Task<List<GroupedEmployeeBankInformationViewModel>> SearchAsync(long workshopId,
|
||||
EmployeeBankInformationSearchModel searchParams)
|
||||
{
|
||||
return await _employeeBankInformationRepository.SearchAsync(workshopId, searchParams);
|
||||
}
|
||||
|
||||
|
||||
//todo: add CardNumber, BankAccountNumber, etc validations
|
||||
public OperationResult Edit(EditEmployeeInformation command)
|
||||
{
|
||||
OperationResult op = new();
|
||||
@@ -175,6 +168,9 @@ namespace CompanyManagment.Application
|
||||
{
|
||||
var entity = _employeeBankInformationRepository.GetByEmployeeId(workshopId, employeeId);
|
||||
|
||||
if (entity == null)
|
||||
return new();
|
||||
|
||||
return entity;
|
||||
}
|
||||
|
||||
@@ -215,12 +211,6 @@ namespace CompanyManagment.Application
|
||||
return _employeeBankInformationRepository.GetAllByWorkshopId(workshopId);
|
||||
}
|
||||
|
||||
|
||||
public async Task<GetEmployeeBankInfoDetailsDto> GetDetailsByEmployeeIdAsync(long workshopId, long employeeId)
|
||||
{
|
||||
return await _employeeBankInformationRepository.GetDetailsByEmployeeIdAsync(workshopId, employeeId);
|
||||
}
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private OperationResult ValidateCreateOperation(List<GroupedEmployeeBankInformationViewModel> workshopEmployeeBankInfoList, CreateEmployeeInformation command)
|
||||
@@ -263,7 +253,8 @@ namespace CompanyManagment.Application
|
||||
return !workshopRecords.Exists(x =>
|
||||
x.WorkshopId == workshopId && x.EmployeeId == employeeId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1569,7 +1569,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
var previousInstitutionContract = await _institutionContractRepository
|
||||
.GetPreviousContract(institutionContract.id);
|
||||
previousInstitutionContract?.DeActive();
|
||||
ReActiveAllAfterCreateNew(institutionContract.ContractingPartyId);
|
||||
await _contractingPartyRepository.ActiveAllAsync(institutionContract.ContractingPartyId);
|
||||
await _institutionContractRepository.SaveChangesAsync();
|
||||
return op.Succcedded();
|
||||
}
|
||||
|
||||
@@ -1524,7 +1524,8 @@ public class InsuranceListApplication : IInsuranceListApplication
|
||||
var dateOfBirth = employeeData.DateOfBirthGr.ToFarsi();
|
||||
var dateOfIssue = employeeData.DateOfIssueGr.ToFarsi();
|
||||
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 startWorkFa = employeeData.StartWorkDateGr.ToFarsi();
|
||||
var workshop = _workShopRepository.GetDetails(workshopId);
|
||||
@@ -1606,7 +1607,7 @@ public class InsuranceListApplication : IInsuranceListApplication
|
||||
MaritalStatus = employeeData.MaritalStatus,
|
||||
|
||||
StartMonthCurrent = startMonthFa,
|
||||
WorkingDays = workingDays.countWorkingDays,
|
||||
WorkingDays = employeeData.WorkingDays,
|
||||
StartWorkDate = startWorkFa,
|
||||
StartWorkDateGr = employeeData.StartWorkDateGr,
|
||||
LeftWorkDate = leftWorkFa,
|
||||
|
||||
@@ -34,7 +34,7 @@ class CheckoutMapping : IEntityTypeConfiguration<Checkout>
|
||||
builder.Property(x => x.FamilyAllowance);
|
||||
builder.Property(x => x.HousingAllowance);
|
||||
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.CreditLeaves);
|
||||
@@ -82,6 +82,15 @@ class CheckoutMapping : IEntityTypeConfiguration<Checkout>
|
||||
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 =>
|
||||
{
|
||||
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)
|
||||
.HasColumnType("nvarchar(10)");
|
||||
|
||||
b.Property<double?>("RewardPay")
|
||||
b.Property<double>("RewardPay")
|
||||
.HasColumnType("float");
|
||||
|
||||
b.Property<string>("RotatingShiftValue")
|
||||
@@ -7501,6 +7501,49 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.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 =>
|
||||
{
|
||||
b1.Property<long>("Checkoutid")
|
||||
@@ -7545,6 +7588,8 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
|
||||
b.Navigation("LoanInstallments");
|
||||
|
||||
b.Navigation("Rewards");
|
||||
|
||||
b.Navigation("SalaryAids");
|
||||
|
||||
b.Navigation("Workshop");
|
||||
|
||||
@@ -31,13 +31,4 @@ public class BankRepository:RepositoryBase<long,Bank>,IBankRepository
|
||||
BankLogoPictureMediaId = x.BankLogoMediaId
|
||||
}).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.SetLoanInstallment(command.LoanInstallments, command.InstallmentDeduction);
|
||||
entity.SetReward(command.Rewards,command.RewardPay);
|
||||
entity.SetCheckoutRollCall(command.CheckoutRollCall);
|
||||
entity.SetEmployeeMandatoryHours(command.EmployeeMandatoryHours);
|
||||
if(command.HasInsuranceShareTheSameAsList)
|
||||
@@ -934,7 +935,7 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
||||
TotalClaims = item.TotalClaims,
|
||||
TotalDeductions = item.TotalDeductions,
|
||||
TotalPayment = item.TotalPayment.ToMoney(),
|
||||
RewardPay = item.RewardPay.ToMoneyNullable(),
|
||||
RewardPay = item.RewardPay.ToMoney(),
|
||||
ContractStartGr = item.ContractStart,
|
||||
ContractEndGr = item.ContractEnd,
|
||||
IsLeft = false,
|
||||
@@ -1335,7 +1336,7 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
||||
TotalClaims = x.TotalClaims,
|
||||
TotalDeductions = x.TotalDeductions,
|
||||
TotalPayment = x.TotalPayment.ToMoney(),
|
||||
RewardPay = x.RewardPay.ToMoneyNullable(),
|
||||
RewardPay = x.RewardPay.ToMoney(),
|
||||
ContractStartGr = x.ContractStart,
|
||||
ContractEndGr = x.ContractEnd,
|
||||
IsLeft = false,
|
||||
|
||||
@@ -6,8 +6,6 @@ using CompanyManagment.App.Contracts.EmployeeBankInformation;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Exceptions;
|
||||
|
||||
namespace CompanyManagment.EFCore.Repository;
|
||||
|
||||
@@ -78,76 +76,6 @@ public class EmployeeBankInformationRepository : RepositoryBase<long, EmployeeBa
|
||||
}).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)
|
||||
{
|
||||
@@ -337,55 +265,4 @@ public class EmployeeBankInformationRepository : RepositoryBase<long, EmployeeBa
|
||||
};
|
||||
}).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;
|
||||
}
|
||||
}
|
||||
@@ -124,69 +124,69 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
public EditInstitutionContract GetDetails(long id)
|
||||
{
|
||||
return _context.InstitutionContractSet.Select(x => new EditInstitutionContract()
|
||||
{
|
||||
Id = x.id,
|
||||
ContractNo = x.ContractNo,
|
||||
ContractStartGr = x.ContractStartGr,
|
||||
ContractStartFa = x.ContractStartFa,
|
||||
ContractEndGr = x.ContractEndGr,
|
||||
ContractEndFa = x.ContractEndFa,
|
||||
RepresentativeName = x.RepresentativeName,
|
||||
ContractingPartyName = x.ContractingPartyName,
|
||||
RepresentativeId = x.RepresentativeId,
|
||||
ContractingPartyId = x.ContractingPartyId,
|
||||
ContractDateFa = x.ContractDateFa,
|
||||
State = x.State,
|
||||
City = x.City,
|
||||
Address = x.Address,
|
||||
Description = x.Description,
|
||||
WorkshopManualCount = x.WorkshopManualCount,
|
||||
EmployeeManualCount = x.EmployeeManualCount,
|
||||
ContractAmountString = x.ContractAmount.ToMoney(),
|
||||
ContractAmount = x.ContractAmount,
|
||||
DailyCompenseationString = x.DailyCompenseation.ToMoney(),
|
||||
ObligationString = x.Obligation.ToMoney(),
|
||||
TotalAmountString = x.TotalAmount.ToMoney(),
|
||||
ExtensionNo = x.ExtensionNo,
|
||||
OfficialCompany = x.OfficialCompany,
|
||||
TypeOfContract = x.TypeOfContract,
|
||||
Signature = x.Signature,
|
||||
HasValueAddedTax = x.HasValueAddedTax,
|
||||
ValueAddedTax = x.ValueAddedTax,
|
||||
})
|
||||
{
|
||||
Id = x.id,
|
||||
ContractNo = x.ContractNo,
|
||||
ContractStartGr = x.ContractStartGr,
|
||||
ContractStartFa = x.ContractStartFa,
|
||||
ContractEndGr = x.ContractEndGr,
|
||||
ContractEndFa = x.ContractEndFa,
|
||||
RepresentativeName = x.RepresentativeName,
|
||||
ContractingPartyName = x.ContractingPartyName,
|
||||
RepresentativeId = x.RepresentativeId,
|
||||
ContractingPartyId = x.ContractingPartyId,
|
||||
ContractDateFa = x.ContractDateFa,
|
||||
State = x.State,
|
||||
City = x.City,
|
||||
Address = x.Address,
|
||||
Description = x.Description,
|
||||
WorkshopManualCount = x.WorkshopManualCount,
|
||||
EmployeeManualCount = x.EmployeeManualCount,
|
||||
ContractAmountString = x.ContractAmount.ToMoney(),
|
||||
ContractAmount = x.ContractAmount,
|
||||
DailyCompenseationString = x.DailyCompenseation.ToMoney(),
|
||||
ObligationString = x.Obligation.ToMoney(),
|
||||
TotalAmountString = x.TotalAmount.ToMoney(),
|
||||
ExtensionNo = x.ExtensionNo,
|
||||
OfficialCompany = x.OfficialCompany,
|
||||
TypeOfContract = x.TypeOfContract,
|
||||
Signature = x.Signature,
|
||||
HasValueAddedTax = x.HasValueAddedTax,
|
||||
ValueAddedTax = x.ValueAddedTax,
|
||||
})
|
||||
.FirstOrDefault(x => x.Id == id);
|
||||
}
|
||||
|
||||
public EditInstitutionContract GetFirstContract(long contractingPartyId, string typeOfContract)
|
||||
{
|
||||
return _context.InstitutionContractSet.Select(x => new EditInstitutionContract()
|
||||
{
|
||||
Id = x.id,
|
||||
ContractNo = x.ContractNo,
|
||||
ContractStartGr = x.ContractStartGr,
|
||||
ContractStartFa = x.ContractStartFa,
|
||||
ContractEndGr = x.ContractEndGr,
|
||||
ContractEndFa = x.ContractEndFa,
|
||||
RepresentativeName = x.RepresentativeName,
|
||||
ContractingPartyName = x.ContractingPartyName,
|
||||
RepresentativeId = x.RepresentativeId,
|
||||
ContractingPartyId = x.ContractingPartyId,
|
||||
ContractDateFa = x.ContractDateFa,
|
||||
State = x.State,
|
||||
City = x.City,
|
||||
Address = x.Address,
|
||||
Description = x.Description,
|
||||
WorkshopManualCount = x.WorkshopManualCount,
|
||||
EmployeeManualCount = x.EmployeeManualCount,
|
||||
ContractAmountString = x.ContractAmount.ToMoney(),
|
||||
DailyCompenseationString = x.DailyCompenseation.ToMoney(),
|
||||
ObligationString = x.Obligation.ToMoney(),
|
||||
TotalAmountString = x.TotalAmount.ToMoney(),
|
||||
ExtensionNo = x.ExtensionNo,
|
||||
OfficialCompany = x.OfficialCompany,
|
||||
TypeOfContract = x.TypeOfContract,
|
||||
Signature = x.Signature
|
||||
})
|
||||
{
|
||||
Id = x.id,
|
||||
ContractNo = x.ContractNo,
|
||||
ContractStartGr = x.ContractStartGr,
|
||||
ContractStartFa = x.ContractStartFa,
|
||||
ContractEndGr = x.ContractEndGr,
|
||||
ContractEndFa = x.ContractEndFa,
|
||||
RepresentativeName = x.RepresentativeName,
|
||||
ContractingPartyName = x.ContractingPartyName,
|
||||
RepresentativeId = x.RepresentativeId,
|
||||
ContractingPartyId = x.ContractingPartyId,
|
||||
ContractDateFa = x.ContractDateFa,
|
||||
State = x.State,
|
||||
City = x.City,
|
||||
Address = x.Address,
|
||||
Description = x.Description,
|
||||
WorkshopManualCount = x.WorkshopManualCount,
|
||||
EmployeeManualCount = x.EmployeeManualCount,
|
||||
ContractAmountString = x.ContractAmount.ToMoney(),
|
||||
DailyCompenseationString = x.DailyCompenseation.ToMoney(),
|
||||
ObligationString = x.Obligation.ToMoney(),
|
||||
TotalAmountString = x.TotalAmount.ToMoney(),
|
||||
ExtensionNo = x.ExtensionNo,
|
||||
OfficialCompany = x.OfficialCompany,
|
||||
TypeOfContract = x.TypeOfContract,
|
||||
Signature = x.Signature
|
||||
})
|
||||
.Where(x => x.ContractingPartyId == contractingPartyId && x.TypeOfContract == typeOfContract)
|
||||
.OrderBy(x => x.ExtensionNo).FirstOrDefault();
|
||||
}
|
||||
@@ -604,40 +604,40 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
}).ToList(),
|
||||
}).ToList();
|
||||
listQuery = listQuery.Select(x => new InstitutionContractViewModel()
|
||||
{
|
||||
Id = x.Id,
|
||||
ContractNo = x.ContractNo,
|
||||
ContractStartGr = x.ContractStartGr,
|
||||
ContractStartFa = x.ContractStartFa,
|
||||
ContractEndGr = x.ContractEndGr,
|
||||
ContractEndFa = x.ContractEndFa,
|
||||
RepresentativeId = x.RepresentativeId,
|
||||
RepresentativeName = x.RepresentativeName,
|
||||
ContractingPartyName = x.ContractingPartyName,
|
||||
ContractingPartyId = x.ContractingPartyId,
|
||||
ContractAmount = x.ContractAmount,
|
||||
TotalAmount = x.TotalAmount,
|
||||
SearchAmount = x.SearchAmount,
|
||||
IsActiveString = x.IsActiveString,
|
||||
OfficialCompany = x.OfficialCompany,
|
||||
TypeOfContract = x.TypeOfContract,
|
||||
Signature = x.Signature,
|
||||
ExpireColor = x.ExpireColor,
|
||||
IsExpier = x.IsExpier,
|
||||
BalanceDouble = x.BalanceDouble,
|
||||
BalanceStr = x.BalanceStr,
|
||||
EmployerViewModels = x.EmployerViewModels,
|
||||
EmployerNo = x.EmployerNo,
|
||||
EmployerName = x.EmployerViewModels.Select(n => n.FullName).FirstOrDefault(),
|
||||
WorkshopViewModels = x.WorkshopViewModels,
|
||||
WorkshopCount = x.WorkshopCount,
|
||||
IsContractingPartyBlock = x.IsContractingPartyBlock,
|
||||
BlockTimes = x.BlockTimes,
|
||||
EmployeeCount =
|
||||
{
|
||||
Id = x.Id,
|
||||
ContractNo = x.ContractNo,
|
||||
ContractStartGr = x.ContractStartGr,
|
||||
ContractStartFa = x.ContractStartFa,
|
||||
ContractEndGr = x.ContractEndGr,
|
||||
ContractEndFa = x.ContractEndFa,
|
||||
RepresentativeId = x.RepresentativeId,
|
||||
RepresentativeName = x.RepresentativeName,
|
||||
ContractingPartyName = x.ContractingPartyName,
|
||||
ContractingPartyId = x.ContractingPartyId,
|
||||
ContractAmount = x.ContractAmount,
|
||||
TotalAmount = x.TotalAmount,
|
||||
SearchAmount = x.SearchAmount,
|
||||
IsActiveString = x.IsActiveString,
|
||||
OfficialCompany = x.OfficialCompany,
|
||||
TypeOfContract = x.TypeOfContract,
|
||||
Signature = x.Signature,
|
||||
ExpireColor = x.ExpireColor,
|
||||
IsExpier = x.IsExpier,
|
||||
BalanceDouble = x.BalanceDouble,
|
||||
BalanceStr = x.BalanceStr,
|
||||
EmployerViewModels = x.EmployerViewModels,
|
||||
EmployerNo = x.EmployerNo,
|
||||
EmployerName = x.EmployerViewModels.Select(n => n.FullName).FirstOrDefault(),
|
||||
WorkshopViewModels = x.WorkshopViewModels,
|
||||
WorkshopCount = x.WorkshopCount,
|
||||
IsContractingPartyBlock = x.IsContractingPartyBlock,
|
||||
BlockTimes = x.BlockTimes,
|
||||
EmployeeCount =
|
||||
((x.WorkshopViewModels.Sum(w => w.LeftWorkIds.Count)) + (x.WorkshopViewModels.Sum(w =>
|
||||
w.InsuranceLeftWorkIds.Count(c => !w.LeftWorkIds.Contains(c))))).ToString(),
|
||||
ArchiveCode = x.WorkshopViewModels.Count > 0 ? ArchiveCodeFinder(x.WorkshopViewModels) : 0,
|
||||
}).OrderBy(x => x.WorkshopCount != "0" && string.IsNullOrWhiteSpace(x.ExpireColor))
|
||||
ArchiveCode = x.WorkshopViewModels.Count > 0 ? ArchiveCodeFinder(x.WorkshopViewModels) : 0,
|
||||
}).OrderBy(x => x.WorkshopCount != "0" && string.IsNullOrWhiteSpace(x.ExpireColor))
|
||||
.ThenBy(x => x.WorkshopCount == "0" && string.IsNullOrWhiteSpace(x.ExpireColor))
|
||||
.ThenBy(x => x.IsExpier == "true")
|
||||
.ThenBy(x => x.ExpireColor == "purple")
|
||||
@@ -1474,7 +1474,8 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
IsInPersonContract = workshopGroup?.CurrentWorkshops
|
||||
.Any(y => y.Services.ContractInPerson) ?? true,
|
||||
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()
|
||||
};
|
||||
@@ -3358,9 +3359,17 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
OneMonthPrice = institution.ContractAmountWithTax.ToMoney(),
|
||||
OneMonthWithoutTax = institution.ContractAmount.ToMoney(),
|
||||
OneMonthTax = institution.ContractAmountTax.ToMoney(),
|
||||
VerifierFullName = institution.VerifierFullName,
|
||||
VerifierPhoneNumber = institution.VerifierPhoneNumber,
|
||||
VerifyCode = institution.VerifyCode,
|
||||
VerifierFullName =
|
||||
institution.VerificationStatus == InstitutionContractVerificationStatus.PendingForVerify
|
||||
? null
|
||||
: institution.VerifierFullName,
|
||||
VerifierPhoneNumber =
|
||||
institution.VerificationStatus == InstitutionContractVerificationStatus.PendingForVerify
|
||||
? null
|
||||
: institution.VerifierPhoneNumber,
|
||||
VerifyCode = institution.VerificationStatus == InstitutionContractVerificationStatus.PendingForVerify
|
||||
? null
|
||||
: institution.VerifyCode,
|
||||
VerifyDate = institution.VerifyCodeCreation.ToFarsi(),
|
||||
VerifyTime = institution.VerifyCodeCreation.ToString("HH:mm:ss"),
|
||||
Workshops = institution.WorkshopGroup.InitialWorkshops
|
||||
@@ -3563,10 +3572,6 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#region PrivateMetods
|
||||
|
||||
/// <summary>
|
||||
@@ -3611,11 +3616,8 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//ایجاد سند مالی ماهانه
|
||||
|
||||
#region CreateMontlyTransaction
|
||||
|
||||
/// <summary>
|
||||
@@ -3625,7 +3627,6 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
public async Task CreateTransactionForInstitutionContracts(DateTime endOfMonthGr, string endOfMonthFa,
|
||||
string description)
|
||||
{
|
||||
|
||||
#region FindeNextMonth 1th
|
||||
|
||||
var firstDayOfMonthGr = ($"{endOfMonthFa.Substring(0, 8)}01").ToGeorgianDateTime();
|
||||
@@ -3656,7 +3657,7 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
SigningType = x.SigningType,
|
||||
InstallmentList = x.Installments
|
||||
.Select(ins => new InstitutionContractInstallmentViewModel
|
||||
{ AmountDouble = ins.Amount, InstallmentDateGr = ins.InstallmentDateGr })
|
||||
{ AmountDouble = ins.Amount, InstallmentDateGr = ins.InstallmentDateGr })
|
||||
.OrderBy(ins => ins.InstallmentDateGr).Skip(1).ToList(),
|
||||
}).Where(x =>
|
||||
x.ContractStartGr < endOfMonthGr && x.ContractEndGr >= endOfMonthGr && x.ContractAmountDouble > 0 &&
|
||||
@@ -3703,7 +3704,7 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
SigningType = x.SigningType,
|
||||
InstallmentList = x.Installments
|
||||
.Select(ins => new InstitutionContractInstallmentViewModel
|
||||
{ AmountDouble = ins.Amount, InstallmentDateGr = ins.InstallmentDateGr })
|
||||
{ AmountDouble = ins.Amount, InstallmentDateGr = ins.InstallmentDateGr })
|
||||
.OrderBy(ins => ins.InstallmentDateGr).Skip(1).ToList(),
|
||||
}).ToListAsync();
|
||||
|
||||
@@ -4008,8 +4009,6 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public async Task<long> GetIdByInstallmentId(long installmentId)
|
||||
{
|
||||
return await _context.InstitutionContractSet.Include(x => x.Installments)
|
||||
@@ -4445,7 +4444,6 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
Id = 0,
|
||||
IdNumberSerial = "",
|
||||
IdNumberSeri = "",
|
||||
|
||||
};
|
||||
creationTemp.SetContractingPartyInfo(request.LegalType, real, legal);
|
||||
}
|
||||
@@ -5221,11 +5219,6 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#region CustomViewModels
|
||||
|
||||
public class WorkshopsAndEmployeeViewModel
|
||||
|
||||
@@ -74,7 +74,7 @@ public class ReportClientRepository : IReportClientRepository
|
||||
TotalClaims = x.TotalClaims,
|
||||
TotalDeductions = x.TotalDeductions,
|
||||
TotalPayment = x.TotalPayment.ToMoney(),
|
||||
RewardPay = x.RewardPay.ToMoneyNullable(),
|
||||
RewardPay = x.RewardPay.ToMoney(),
|
||||
MarriedAllowance = x.MarriedAllowance.ToMoney(),
|
||||
}).Where(x => x.WorkshopId == workshopId);
|
||||
|
||||
@@ -448,7 +448,7 @@ public class ReportClientRepository : IReportClientRepository
|
||||
TotalClaims = x.TotalClaims,
|
||||
TotalDeductions = x.TotalDeductions,
|
||||
TotalPayment = x.TotalPayment.ToMoney(),
|
||||
RewardPay = x.RewardPay.ToMoneyNullable(),
|
||||
RewardPay = x.RewardPay.ToMoney(),
|
||||
MarriedAllowance = x.MarriedAllowance.ToMoney(),
|
||||
}).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)
|
||||
{
|
||||
return _context.Rewards.Where(x =>
|
||||
|
||||
@@ -160,7 +160,9 @@ public class WorkshopRepository : RepositoryBase<long, Company.Domain.WorkshopAg
|
||||
public EditWorkshop GetDetails(long 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
|
||||
{
|
||||
Id = x.id,
|
||||
@@ -193,7 +195,7 @@ public class WorkshopRepository : RepositoryBase<long, Company.Domain.WorkshopAg
|
||||
BonusesOptions = string.IsNullOrWhiteSpace(x.BonusesOptions) ? "EndOfContract1402leftWork1403" : x.BonusesOptions,
|
||||
YearsOptions = x.YearsOptions,
|
||||
IsOldContract = x.IsOldContract,
|
||||
EmployerIdList = emp,
|
||||
EmployerIdList = emp.Select(e=>e.id).ToList(),
|
||||
HasRollCallFreeVip = x.HasRollCallFreeVip,
|
||||
WorkshopHolidayWorking = x.WorkshopHolidayWorking,
|
||||
InsuranceCheckoutOvertime = x.InsuranceCheckoutOvertime,
|
||||
@@ -205,6 +207,7 @@ public class WorkshopRepository : RepositoryBase<long, Company.Domain.WorkshopAg
|
||||
SignCheckout = x.SignCheckout,
|
||||
RotatingShiftCompute = x.RotatingShiftCompute,
|
||||
IsStaticCheckout = x.IsStaticCheckout,
|
||||
RewardComputeOnCheckout = rewardCompute
|
||||
|
||||
}).FirstOrDefault(x => x.Id == id);
|
||||
}
|
||||
|
||||
@@ -209,22 +209,38 @@ public class CreateOrEditCheckoutCommandHandler : IBaseCommandHandler<CreateOrEd
|
||||
}
|
||||
|
||||
}
|
||||
//حقوق نهایی
|
||||
var monthlySalaryPay = (totalHoursWorked * monthlySalaryDefined) / mandatoryHours;
|
||||
// اگر اضافه کار داشت حقوق تعین شده به عنوان حقوق نهایی در نظر گرفته میشود
|
||||
monthlySalaryPay = monthlySalaryPay > monthlySalaryDefined ? monthlySalaryDefined : monthlySalaryPay;
|
||||
////حقوق نهایی
|
||||
//var monthlySalaryPay = (totalHoursWorked * monthlySalaryDefined) / mandatoryHours;
|
||||
//// اگر اضافه کار داشت حقوق تعین شده به عنوان حقوق نهایی در نظر گرفته میشود
|
||||
//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;
|
||||
|
||||
|
||||
//تناسب به دقیقه
|
||||
#region MyRegion
|
||||
|
||||
//var monthlySalaryDefinedTest = monthlySalaryDefined * mandatoryHours;
|
||||
//var monthlySalaryPayTest = totalHoursWorked * monthlySalaryDefined;
|
||||
////// اگر اضافه کار داشت حقوق تعین شده به عنوان حقوق نهایی در نظر گرفته میشود
|
||||
//monthlySalaryPayTest = monthlySalaryPayTest > monthlySalaryDefinedTest ? monthlySalaryDefinedTest : monthlySalaryPayTest;
|
||||
//////حقوق کسر شده
|
||||
//var deductionFromSalaryTest = monthlySalaryDefinedTest - monthlySalaryPayTest;
|
||||
|
||||
#endregion
|
||||
|
||||
var computeResult = new ComputeResultDto
|
||||
{
|
||||
MandatoryHours = mandatoryHours,
|
||||
MonthlySalaryPay = monthlySalaryPay,
|
||||
DeductionFromSalary = deductionFromSalary,
|
||||
DeductionFromSalary = 0 /*deductionFromSalary*/,
|
||||
RemainingHours = remainingTime
|
||||
};
|
||||
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.Modules.SalaryPaymentSettings.Queries.GetUserListWhoHaveSettings;
|
||||
using GozareshgirProgramManager.Domain._Common;
|
||||
using GozareshgirProgramManager.Domain.CheckoutAgg.Enums;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using PersianTools.Core;
|
||||
using PersianDateTime = PersianTools.Core.PersianDateTime;
|
||||
|
||||
namespace GozareshgirProgramManager.Application.Modules.Checkouts.Queries.GetUserToGropCreate;
|
||||
|
||||
@@ -45,8 +46,8 @@ public class GetUserToGroupCreatingQueryHandler : IBaseQueryHandler<GetUserToGro
|
||||
"ایجاد فیش فقط برای ماه های گذشته امکان پذیر است");
|
||||
|
||||
|
||||
var lastMonthStart = lastMonth;
|
||||
var lastMonthEnd = lastMonth;
|
||||
//var lastMonthStart = lastMonth;
|
||||
var lastMonthEnd = ((selectedDate.ToFarsi().FindeEndOfMonth())).ToGeorgianDateTime();
|
||||
|
||||
var query =
|
||||
await (from u in _context.Users
|
||||
@@ -60,8 +61,8 @@ public class GetUserToGroupCreatingQueryHandler : IBaseQueryHandler<GetUserToGro
|
||||
// LEFT JOIN
|
||||
//فیش
|
||||
join ch in _context.Checkouts
|
||||
.Where(x => x.CheckoutStartDate < lastMonthStart
|
||||
&& x.CheckoutEndDate >= lastMonthStart)
|
||||
.Where(x => x.CheckoutStartDate < lastMonthEnd
|
||||
&& x.CheckoutEndDate > selectedDate)
|
||||
on u.Id equals ch.UserId into chJoin
|
||||
from ch in chJoin.DefaultIfEmpty()
|
||||
|
||||
|
||||
@@ -62,8 +62,7 @@ public class ProjectSetTimeDetailsQueryHandler
|
||||
var res = new ProjectSetTimeResponse(
|
||||
skills.Select(skill =>
|
||||
{
|
||||
var section = task
|
||||
.Sections
|
||||
var section = task.Sections
|
||||
.FirstOrDefault(x => x.SkillId == skill.Id);
|
||||
var user = users.FirstOrDefault(x => x.Id == section?.OriginalAssignedUserId);
|
||||
return new ProjectSetTimeResponseSkill
|
||||
|
||||
@@ -794,7 +794,8 @@ public class IndexModel : PageModel
|
||||
watch.Stop();
|
||||
#endregion
|
||||
|
||||
|
||||
var firstContract = _contractApplication.GetDetails(ContractsId[0]);
|
||||
var workshop = _workshopApplication.GetDetails(firstContract.WorkshopIds);
|
||||
|
||||
//int i = 0;
|
||||
foreach (var item in ContractsId)
|
||||
@@ -809,7 +810,7 @@ public class IndexModel : PageModel
|
||||
if (separation.checker)
|
||||
{
|
||||
//workshopInfo
|
||||
var workshop = _workshopApplication.GetDetails(contract.WorkshopIds);
|
||||
|
||||
|
||||
var employeeOptions =
|
||||
_employeeComputeOptionsApplication.GetAllByWorkshopId(contract.WorkshopIds);
|
||||
@@ -1212,7 +1213,7 @@ public class IndexModel : PageModel
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
RewardPayCompute = workshop.RewardComputeOnCheckout,
|
||||
|
||||
};
|
||||
_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 System.Security.Claims;
|
||||
using CompanyManagement.Infrastructure.Excel.EmployeeBankInfo;
|
||||
using CompanyManagment.App.Contracts.Bank;
|
||||
using CompanyManagement.Infrastructure.Excel.EmployeeBankInfo;
|
||||
|
||||
namespace ServiceHost.Areas.Client.Pages.Company.EmployeesBankInfo
|
||||
{
|
||||
@@ -30,11 +28,7 @@ namespace ServiceHost.Areas.Client.Pages.Company.EmployeesBankInfo
|
||||
private readonly IWebHostEnvironment _hostEnvironment;
|
||||
|
||||
|
||||
public IndexModel(IPasswordHasher passwordHasher, IWorkshopApplication workshopApplication,
|
||||
IHttpContextAccessor contextAccessor, IAuthHelper authHelper,
|
||||
IEmployeeBankInformationApplication employeeBankInformationApplication,
|
||||
IEmployeeApplication employeeApplication, IBankApplication bankApplication,
|
||||
IWebHostEnvironment hostEnvironment)
|
||||
public IndexModel(IPasswordHasher passwordHasher, IWorkshopApplication workshopApplication, IHttpContextAccessor contextAccessor, IAuthHelper authHelper, IEmployeeBankInformationApplication employeeBankInformationApplication, IEmployeeApplication employeeApplication, IBankApplication bankApplication, IWebHostEnvironment hostEnvironment)
|
||||
{
|
||||
_passwordHasher = passwordHasher;
|
||||
_workshopApplication = workshopApplication;
|
||||
@@ -70,8 +64,7 @@ namespace ServiceHost.Areas.Client.Pages.Company.EmployeesBankInfo
|
||||
|
||||
public IActionResult OnGetEmployeeBankInfoListAjax(EmployeeBankInformationSearchModel searchModel)
|
||||
{
|
||||
var resultData = _employeeBankInformationApplication
|
||||
.Search(_workshopId, searchModel);
|
||||
var resultData = _employeeBankInformationApplication.Search(_workshopId, searchModel);
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = true,
|
||||
@@ -249,4 +242,4 @@ namespace ServiceHost.Areas.Client.Pages.Company.EmployeesBankInfo
|
||||
$"اطلاعات بانکی پرسنل.xlsx");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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