Compare commits
5 Commits
Fix/progra
...
Feature/Ch
| Author | SHA1 | Date | |
|---|---|---|---|
| 69f4819bf6 | |||
|
|
1257e15b62 | ||
|
|
331fb24a99 | ||
| 900b4b3f4d | |||
| bdc6f95af8 |
@@ -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,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);
|
||||||
}
|
}
|
||||||
@@ -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; }
|
||||||
}
|
}
|
||||||
@@ -151,6 +151,9 @@ public class CreateWorkshop
|
|||||||
/// تصفیه حساب بصورت استاتیک محاصبه شود
|
/// تصفیه حساب بصورت استاتیک محاصبه شود
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsStaticCheckout { get; set; }
|
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());
|
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();
|
||||||
|
|||||||
@@ -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();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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");
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
@@ -124,69 +124,69 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
|||||||
public EditInstitutionContract GetDetails(long id)
|
public EditInstitutionContract GetDetails(long id)
|
||||||
{
|
{
|
||||||
return _context.InstitutionContractSet.Select(x => new EditInstitutionContract()
|
return _context.InstitutionContractSet.Select(x => new EditInstitutionContract()
|
||||||
{
|
{
|
||||||
Id = x.id,
|
Id = x.id,
|
||||||
ContractNo = x.ContractNo,
|
ContractNo = x.ContractNo,
|
||||||
ContractStartGr = x.ContractStartGr,
|
ContractStartGr = x.ContractStartGr,
|
||||||
ContractStartFa = x.ContractStartFa,
|
ContractStartFa = x.ContractStartFa,
|
||||||
ContractEndGr = x.ContractEndGr,
|
ContractEndGr = x.ContractEndGr,
|
||||||
ContractEndFa = x.ContractEndFa,
|
ContractEndFa = x.ContractEndFa,
|
||||||
RepresentativeName = x.RepresentativeName,
|
RepresentativeName = x.RepresentativeName,
|
||||||
ContractingPartyName = x.ContractingPartyName,
|
ContractingPartyName = x.ContractingPartyName,
|
||||||
RepresentativeId = x.RepresentativeId,
|
RepresentativeId = x.RepresentativeId,
|
||||||
ContractingPartyId = x.ContractingPartyId,
|
ContractingPartyId = x.ContractingPartyId,
|
||||||
ContractDateFa = x.ContractDateFa,
|
ContractDateFa = x.ContractDateFa,
|
||||||
State = x.State,
|
State = x.State,
|
||||||
City = x.City,
|
City = x.City,
|
||||||
Address = x.Address,
|
Address = x.Address,
|
||||||
Description = x.Description,
|
Description = x.Description,
|
||||||
WorkshopManualCount = x.WorkshopManualCount,
|
WorkshopManualCount = x.WorkshopManualCount,
|
||||||
EmployeeManualCount = x.EmployeeManualCount,
|
EmployeeManualCount = x.EmployeeManualCount,
|
||||||
ContractAmountString = x.ContractAmount.ToMoney(),
|
ContractAmountString = x.ContractAmount.ToMoney(),
|
||||||
ContractAmount = x.ContractAmount,
|
ContractAmount = x.ContractAmount,
|
||||||
DailyCompenseationString = x.DailyCompenseation.ToMoney(),
|
DailyCompenseationString = x.DailyCompenseation.ToMoney(),
|
||||||
ObligationString = x.Obligation.ToMoney(),
|
ObligationString = x.Obligation.ToMoney(),
|
||||||
TotalAmountString = x.TotalAmount.ToMoney(),
|
TotalAmountString = x.TotalAmount.ToMoney(),
|
||||||
ExtensionNo = x.ExtensionNo,
|
ExtensionNo = x.ExtensionNo,
|
||||||
OfficialCompany = x.OfficialCompany,
|
OfficialCompany = x.OfficialCompany,
|
||||||
TypeOfContract = x.TypeOfContract,
|
TypeOfContract = x.TypeOfContract,
|
||||||
Signature = x.Signature,
|
Signature = x.Signature,
|
||||||
HasValueAddedTax = x.HasValueAddedTax,
|
HasValueAddedTax = x.HasValueAddedTax,
|
||||||
ValueAddedTax = x.ValueAddedTax,
|
ValueAddedTax = x.ValueAddedTax,
|
||||||
})
|
})
|
||||||
.FirstOrDefault(x => x.Id == id);
|
.FirstOrDefault(x => x.Id == id);
|
||||||
}
|
}
|
||||||
|
|
||||||
public EditInstitutionContract GetFirstContract(long contractingPartyId, string typeOfContract)
|
public EditInstitutionContract GetFirstContract(long contractingPartyId, string typeOfContract)
|
||||||
{
|
{
|
||||||
return _context.InstitutionContractSet.Select(x => new EditInstitutionContract()
|
return _context.InstitutionContractSet.Select(x => new EditInstitutionContract()
|
||||||
{
|
{
|
||||||
Id = x.id,
|
Id = x.id,
|
||||||
ContractNo = x.ContractNo,
|
ContractNo = x.ContractNo,
|
||||||
ContractStartGr = x.ContractStartGr,
|
ContractStartGr = x.ContractStartGr,
|
||||||
ContractStartFa = x.ContractStartFa,
|
ContractStartFa = x.ContractStartFa,
|
||||||
ContractEndGr = x.ContractEndGr,
|
ContractEndGr = x.ContractEndGr,
|
||||||
ContractEndFa = x.ContractEndFa,
|
ContractEndFa = x.ContractEndFa,
|
||||||
RepresentativeName = x.RepresentativeName,
|
RepresentativeName = x.RepresentativeName,
|
||||||
ContractingPartyName = x.ContractingPartyName,
|
ContractingPartyName = x.ContractingPartyName,
|
||||||
RepresentativeId = x.RepresentativeId,
|
RepresentativeId = x.RepresentativeId,
|
||||||
ContractingPartyId = x.ContractingPartyId,
|
ContractingPartyId = x.ContractingPartyId,
|
||||||
ContractDateFa = x.ContractDateFa,
|
ContractDateFa = x.ContractDateFa,
|
||||||
State = x.State,
|
State = x.State,
|
||||||
City = x.City,
|
City = x.City,
|
||||||
Address = x.Address,
|
Address = x.Address,
|
||||||
Description = x.Description,
|
Description = x.Description,
|
||||||
WorkshopManualCount = x.WorkshopManualCount,
|
WorkshopManualCount = x.WorkshopManualCount,
|
||||||
EmployeeManualCount = x.EmployeeManualCount,
|
EmployeeManualCount = x.EmployeeManualCount,
|
||||||
ContractAmountString = x.ContractAmount.ToMoney(),
|
ContractAmountString = x.ContractAmount.ToMoney(),
|
||||||
DailyCompenseationString = x.DailyCompenseation.ToMoney(),
|
DailyCompenseationString = x.DailyCompenseation.ToMoney(),
|
||||||
ObligationString = x.Obligation.ToMoney(),
|
ObligationString = x.Obligation.ToMoney(),
|
||||||
TotalAmountString = x.TotalAmount.ToMoney(),
|
TotalAmountString = x.TotalAmount.ToMoney(),
|
||||||
ExtensionNo = x.ExtensionNo,
|
ExtensionNo = x.ExtensionNo,
|
||||||
OfficialCompany = x.OfficialCompany,
|
OfficialCompany = x.OfficialCompany,
|
||||||
TypeOfContract = x.TypeOfContract,
|
TypeOfContract = x.TypeOfContract,
|
||||||
Signature = x.Signature
|
Signature = x.Signature
|
||||||
})
|
})
|
||||||
.Where(x => x.ContractingPartyId == contractingPartyId && x.TypeOfContract == typeOfContract)
|
.Where(x => x.ContractingPartyId == contractingPartyId && x.TypeOfContract == typeOfContract)
|
||||||
.OrderBy(x => x.ExtensionNo).FirstOrDefault();
|
.OrderBy(x => x.ExtensionNo).FirstOrDefault();
|
||||||
}
|
}
|
||||||
@@ -604,40 +604,40 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
|||||||
}).ToList(),
|
}).ToList(),
|
||||||
}).ToList();
|
}).ToList();
|
||||||
listQuery = listQuery.Select(x => new InstitutionContractViewModel()
|
listQuery = listQuery.Select(x => new InstitutionContractViewModel()
|
||||||
{
|
{
|
||||||
Id = x.Id,
|
Id = x.Id,
|
||||||
ContractNo = x.ContractNo,
|
ContractNo = x.ContractNo,
|
||||||
ContractStartGr = x.ContractStartGr,
|
ContractStartGr = x.ContractStartGr,
|
||||||
ContractStartFa = x.ContractStartFa,
|
ContractStartFa = x.ContractStartFa,
|
||||||
ContractEndGr = x.ContractEndGr,
|
ContractEndGr = x.ContractEndGr,
|
||||||
ContractEndFa = x.ContractEndFa,
|
ContractEndFa = x.ContractEndFa,
|
||||||
RepresentativeId = x.RepresentativeId,
|
RepresentativeId = x.RepresentativeId,
|
||||||
RepresentativeName = x.RepresentativeName,
|
RepresentativeName = x.RepresentativeName,
|
||||||
ContractingPartyName = x.ContractingPartyName,
|
ContractingPartyName = x.ContractingPartyName,
|
||||||
ContractingPartyId = x.ContractingPartyId,
|
ContractingPartyId = x.ContractingPartyId,
|
||||||
ContractAmount = x.ContractAmount,
|
ContractAmount = x.ContractAmount,
|
||||||
TotalAmount = x.TotalAmount,
|
TotalAmount = x.TotalAmount,
|
||||||
SearchAmount = x.SearchAmount,
|
SearchAmount = x.SearchAmount,
|
||||||
IsActiveString = x.IsActiveString,
|
IsActiveString = x.IsActiveString,
|
||||||
OfficialCompany = x.OfficialCompany,
|
OfficialCompany = x.OfficialCompany,
|
||||||
TypeOfContract = x.TypeOfContract,
|
TypeOfContract = x.TypeOfContract,
|
||||||
Signature = x.Signature,
|
Signature = x.Signature,
|
||||||
ExpireColor = x.ExpireColor,
|
ExpireColor = x.ExpireColor,
|
||||||
IsExpier = x.IsExpier,
|
IsExpier = x.IsExpier,
|
||||||
BalanceDouble = x.BalanceDouble,
|
BalanceDouble = x.BalanceDouble,
|
||||||
BalanceStr = x.BalanceStr,
|
BalanceStr = x.BalanceStr,
|
||||||
EmployerViewModels = x.EmployerViewModels,
|
EmployerViewModels = x.EmployerViewModels,
|
||||||
EmployerNo = x.EmployerNo,
|
EmployerNo = x.EmployerNo,
|
||||||
EmployerName = x.EmployerViewModels.Select(n => n.FullName).FirstOrDefault(),
|
EmployerName = x.EmployerViewModels.Select(n => n.FullName).FirstOrDefault(),
|
||||||
WorkshopViewModels = x.WorkshopViewModels,
|
WorkshopViewModels = x.WorkshopViewModels,
|
||||||
WorkshopCount = x.WorkshopCount,
|
WorkshopCount = x.WorkshopCount,
|
||||||
IsContractingPartyBlock = x.IsContractingPartyBlock,
|
IsContractingPartyBlock = x.IsContractingPartyBlock,
|
||||||
BlockTimes = x.BlockTimes,
|
BlockTimes = x.BlockTimes,
|
||||||
EmployeeCount =
|
EmployeeCount =
|
||||||
((x.WorkshopViewModels.Sum(w => w.LeftWorkIds.Count)) + (x.WorkshopViewModels.Sum(w =>
|
((x.WorkshopViewModels.Sum(w => w.LeftWorkIds.Count)) + (x.WorkshopViewModels.Sum(w =>
|
||||||
w.InsuranceLeftWorkIds.Count(c => !w.LeftWorkIds.Contains(c))))).ToString(),
|
w.InsuranceLeftWorkIds.Count(c => !w.LeftWorkIds.Contains(c))))).ToString(),
|
||||||
ArchiveCode = x.WorkshopViewModels.Count > 0 ? ArchiveCodeFinder(x.WorkshopViewModels) : 0,
|
ArchiveCode = x.WorkshopViewModels.Count > 0 ? ArchiveCodeFinder(x.WorkshopViewModels) : 0,
|
||||||
}).OrderBy(x => x.WorkshopCount != "0" && string.IsNullOrWhiteSpace(x.ExpireColor))
|
}).OrderBy(x => x.WorkshopCount != "0" && string.IsNullOrWhiteSpace(x.ExpireColor))
|
||||||
.ThenBy(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.IsExpier == "true")
|
||||||
.ThenBy(x => x.ExpireColor == "purple")
|
.ThenBy(x => x.ExpireColor == "purple")
|
||||||
@@ -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();
|
||||||
@@ -3656,7 +3657,7 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
|||||||
SigningType = x.SigningType,
|
SigningType = x.SigningType,
|
||||||
InstallmentList = x.Installments
|
InstallmentList = x.Installments
|
||||||
.Select(ins => new InstitutionContractInstallmentViewModel
|
.Select(ins => new InstitutionContractInstallmentViewModel
|
||||||
{ AmountDouble = ins.Amount, InstallmentDateGr = ins.InstallmentDateGr })
|
{ AmountDouble = ins.Amount, InstallmentDateGr = ins.InstallmentDateGr })
|
||||||
.OrderBy(ins => ins.InstallmentDateGr).Skip(1).ToList(),
|
.OrderBy(ins => ins.InstallmentDateGr).Skip(1).ToList(),
|
||||||
}).Where(x =>
|
}).Where(x =>
|
||||||
x.ContractStartGr < endOfMonthGr && x.ContractEndGr >= endOfMonthGr && x.ContractAmountDouble > 0 &&
|
x.ContractStartGr < endOfMonthGr && x.ContractEndGr >= endOfMonthGr && x.ContractAmountDouble > 0 &&
|
||||||
@@ -3703,7 +3704,7 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
|||||||
SigningType = x.SigningType,
|
SigningType = x.SigningType,
|
||||||
InstallmentList = x.Installments
|
InstallmentList = x.Installments
|
||||||
.Select(ins => new InstitutionContractInstallmentViewModel
|
.Select(ins => new InstitutionContractInstallmentViewModel
|
||||||
{ AmountDouble = ins.Amount, InstallmentDateGr = ins.InstallmentDateGr })
|
{ AmountDouble = ins.Amount, InstallmentDateGr = ins.InstallmentDateGr })
|
||||||
.OrderBy(ins => ins.InstallmentDateGr).Skip(1).ToList(),
|
.OrderBy(ins => ins.InstallmentDateGr).Skip(1).ToList(),
|
||||||
}).ToListAsync();
|
}).ToListAsync();
|
||||||
|
|
||||||
@@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user