Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<NuGetAudit>false</NuGetAudit>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -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;
|
||||
|
||||
57
Company.Domain/CheckoutAgg/ValueObjects/CheckoutReward.cs
Normal file
57
Company.Domain/CheckoutAgg/ValueObjects/CheckoutReward.cs
Normal file
@@ -0,0 +1,57 @@
|
||||
using System;
|
||||
|
||||
namespace Company.Domain.CheckoutAgg.ValueObjects;
|
||||
|
||||
public class CheckoutReward
|
||||
{
|
||||
public CheckoutReward(string amount, double amountDouble, string grantDateFa, DateTime grantDateGr, string description, string title, long entityId)
|
||||
{
|
||||
Amount = amount;
|
||||
AmountDouble = amountDouble;
|
||||
GrantDateFa = grantDateFa;
|
||||
GrantDateGr = grantDateGr;
|
||||
Description = description;
|
||||
Title = title;
|
||||
EntityId = entityId;
|
||||
}
|
||||
|
||||
/// <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,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);
|
||||
}
|
||||
@@ -193,4 +193,9 @@ public class CreateCheckout
|
||||
/// پایه سنوات قبل از تاثیر ساعت کار
|
||||
/// </summary>
|
||||
public double BaseYearUnAffected { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آیا برای محاسبه پاداش مجاز است
|
||||
/// </summary>
|
||||
public bool RewardPayCompute { get; set; }
|
||||
}
|
||||
@@ -4,6 +4,7 @@
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
<NoWarn>$(NoWarn);1591</NoWarn>
|
||||
<NuGetAudit>false</NuGetAudit>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -151,6 +151,9 @@ public class CreateWorkshop
|
||||
/// تصفیه حساب بصورت استاتیک محاصبه شود
|
||||
/// </summary>
|
||||
public bool IsStaticCheckout { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// آیا پاداش در فیش حقوقی محاسبه شود
|
||||
/// </summary>
|
||||
public bool RewardComputeOnCheckout { get; set; }
|
||||
}
|
||||
@@ -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, checkoutEnd.ToGeorgianDateTime(), checkoutStart.ToGeorgianDateTime())
|
||||
.Select(x => new CheckoutReward(x.Amount, x.AmountDouble, x.GrantDateFa, x.GrantDateGr, x.Description, x.Title, x.Id)).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();
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,10 +5199,10 @@ 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 =>
|
||||
var result = _context.Rewards.Where(x =>
|
||||
x.WorkshopId == workshopId && x.EmployeeId == employeeId && x.GrantDate <= checkoutEnd &&
|
||||
x.GrantDate >= checkoutStart).Select(x => new RewardViewModel
|
||||
{
|
||||
@@ -5215,6 +5215,8 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
|
||||
IsActive = x.IsActive,
|
||||
Id = x.id
|
||||
}).ToList();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private List<FineViewModel> FinesForCheckout(long employeeId, long workshopId, DateTime contractStart,
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<NuGetAudit>false</NuGetAudit>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
Reference in New Issue
Block a user