contractTerm And CutEndYear completed on EmployeeOptions
This commit is contained in:
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Domain;
|
||||
|
||||
namespace Company.Domain.EmployeeComputeOptionsAgg
|
||||
@@ -10,13 +11,15 @@ namespace Company.Domain.EmployeeComputeOptionsAgg
|
||||
public class EmployeeComputeOptions : EntityBase
|
||||
{
|
||||
public EmployeeComputeOptions(long workshopId, long employeeId, string computeOptions, string bonusesOptions, string yearsOptions,
|
||||
bool createContract, bool signContract, bool createCheckout, bool signCheckout)
|
||||
bool createContract, bool signContract, bool createCheckout, bool signCheckout, string contractTerm, IsActive cutContractEndOfYear)
|
||||
{
|
||||
WorkshopId = workshopId;
|
||||
EmployeeId = employeeId;
|
||||
ComputeOptions = computeOptions;
|
||||
BonusesOptions = bonusesOptions;
|
||||
YearsOptions = yearsOptions;
|
||||
ContractTerm = contractTerm;
|
||||
CutContractEndOfYear = contractTerm == "1" ? IsActive.None : cutContractEndOfYear;
|
||||
|
||||
SetContractAndCheckoutOptions(createContract, signContract, createCheckout, signCheckout);
|
||||
}
|
||||
@@ -51,12 +54,30 @@ namespace Company.Domain.EmployeeComputeOptionsAgg
|
||||
/// </summary>
|
||||
public bool SignCheckout { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// مدت قرارداد
|
||||
/// </summary>
|
||||
public string ContractTerm { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// اگر قرارداد بیش از یک ماه باشد و گزینه انتخاب شده منتهی به پایان سال باشد
|
||||
/// این آیتم
|
||||
/// True
|
||||
/// است
|
||||
/// </summary>
|
||||
public IsActive CutContractEndOfYear { get; private set; }
|
||||
|
||||
|
||||
|
||||
public void Edit(string computeOptions, string bonusesOptions, string yearsOptions, bool createContract, bool signContract, bool createCheckout,
|
||||
bool signCheckout)
|
||||
bool signCheckout, string contractTerm, IsActive cutContractEndOfYear)
|
||||
{
|
||||
ComputeOptions = computeOptions;
|
||||
BonusesOptions = bonusesOptions;
|
||||
YearsOptions = yearsOptions;
|
||||
|
||||
ContractTerm = contractTerm;
|
||||
CutContractEndOfYear = contractTerm == "1" ? IsActive.None : cutContractEndOfYear;
|
||||
SetContractAndCheckoutOptions(createContract, signContract, createCheckout, signCheckout);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using _0_Framework.Application;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -34,5 +35,18 @@ namespace CompanyManagment.App.Contracts.EmployeeComputeOptions
|
||||
/// امضای تصفیه
|
||||
/// </summary>
|
||||
public bool SignCheckout { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مدت قرارداد
|
||||
/// </summary>
|
||||
public string ContractTerm { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// اگر قرارداد بیش از یک ماه باشد و گزینه انتخاب شده منتهی به پایان سال باشد
|
||||
/// این آیتم
|
||||
/// True
|
||||
/// است
|
||||
/// </summary>
|
||||
public IsActive CutContractEndOfYear { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
namespace CompanyManagment.App.Contracts.EmployeeComputeOptions;
|
||||
using _0_Framework.Application;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.EmployeeComputeOptions;
|
||||
|
||||
public class EmployeeComputeOptionsViewModel
|
||||
{
|
||||
@@ -28,4 +30,18 @@ public class EmployeeComputeOptionsViewModel
|
||||
/// امضای تصفیه
|
||||
/// </summary>
|
||||
public bool SignCheckout { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// مدت قرارداد
|
||||
/// </summary>
|
||||
public string ContractTerm { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// اگر قرارداد بیش از یک ماه باشد و گزینه انتخاب شده منتهی به پایان سال باشد
|
||||
/// این آیتم
|
||||
/// True
|
||||
/// است
|
||||
/// </summary>
|
||||
public IsActive CutContractEndOfYear { get; set; }
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using _0_Framework.Application;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -43,4 +44,17 @@ public class ConnectedPersonnelViewModel
|
||||
/// امضای تصفیه
|
||||
/// </summary>
|
||||
public bool SignCheckout { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مدت قرارداد
|
||||
/// </summary>
|
||||
public string ContractTerm { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// اگر قرارداد بیش از یک ماه باشد و گزینه انتخاب شده منتهی به پایان سال باشد
|
||||
/// این آیتم
|
||||
/// True
|
||||
/// است
|
||||
/// </summary>
|
||||
public IsActive CutContractEndOfYear { get; set; }
|
||||
}
|
||||
@@ -31,7 +31,7 @@ public class EmployeeComputeOptionsApplication : IEmployeeComputeOptionsApplicat
|
||||
var editOptions = _employeeComputeOptionsRepository.Get(query.Id);
|
||||
|
||||
editOptions.Edit(command.ComputeOptions, command.BonusesOptions, command.YearsOptions,
|
||||
command.CreateContract, command.SignContract, command.CreateCheckout, command.SignCheckout);
|
||||
command.CreateContract, command.SignContract, command.CreateCheckout, command.SignCheckout, command.ContractTerm, command.CutContractEndOfYear);
|
||||
|
||||
_employeeComputeOptionsRepository.SaveChanges();
|
||||
return opration.Succcedded();
|
||||
@@ -40,7 +40,7 @@ public class EmployeeComputeOptionsApplication : IEmployeeComputeOptionsApplicat
|
||||
{
|
||||
var createOptions = new EmployeeComputeOptions(command.WorkshopId, command.EmployeeId,
|
||||
command.ComputeOptions, command.BonusesOptions, command.YearsOptions, command.CreateContract,
|
||||
command.SignContract, command.CreateCheckout, command.SignCheckout);
|
||||
command.SignContract, command.CreateCheckout, command.SignCheckout, command.ContractTerm, command.CutContractEndOfYear);
|
||||
|
||||
_employeeComputeOptionsRepository.Create(createOptions);
|
||||
_employeeComputeOptionsRepository.SaveChanges();
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using Company.Domain.EmployeeComputeOptionsAgg;
|
||||
using System;
|
||||
using _0_Framework.Application;
|
||||
using Company.Domain.EmployeeComputeOptionsAgg;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
@@ -16,6 +18,9 @@ public class EmployeeComputeOptionsMapping : IEntityTypeConfiguration<EmployeeCo
|
||||
builder.Property(x => x.ComputeOptions).HasMaxLength(50);
|
||||
builder.Property(x => x.YearsOptions).HasMaxLength(50);
|
||||
builder.Property(x => x.BonusesOptions).HasMaxLength(50);
|
||||
builder.Property(x => x.ContractTerm).HasMaxLength(10);
|
||||
builder.Property(x => x.CutContractEndOfYear).HasConversion(x => x.ToString()
|
||||
, x => ((IsActive)Enum.Parse(typeof(IsActive), x))).HasMaxLength(5);
|
||||
|
||||
}
|
||||
}
|
||||
9870
CompanyManagment.EFCore/Migrations/20250622193551_ContractTermAndCutOptionToEmployeeOptions.Designer.cs
generated
Normal file
9870
CompanyManagment.EFCore/Migrations/20250622193551_ContractTermAndCutOptionToEmployeeOptions.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,41 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class ContractTermAndCutOptionToEmployeeOptions : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "ContractTerm",
|
||||
table: "EmployeeComputeOptions",
|
||||
type: "nvarchar(10)",
|
||||
maxLength: 10,
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "CutContractEndOfYear",
|
||||
table: "EmployeeComputeOptions",
|
||||
type: "nvarchar(5)",
|
||||
maxLength: 5,
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "ContractTerm",
|
||||
table: "EmployeeComputeOptions");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CutContractEndOfYear",
|
||||
table: "EmployeeComputeOptions");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1809,6 +1809,10 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<string>("ContractTerm")
|
||||
.HasMaxLength(10)
|
||||
.HasColumnType("nvarchar(10)");
|
||||
|
||||
b.Property<bool>("CreateCheckout")
|
||||
.HasColumnType("bit");
|
||||
|
||||
@@ -1818,6 +1822,11 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Property<DateTime>("CreationDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("CutContractEndOfYear")
|
||||
.IsRequired()
|
||||
.HasMaxLength(5)
|
||||
.HasColumnType("nvarchar(5)");
|
||||
|
||||
b.Property<long>("EmployeeId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
|
||||
@@ -34,6 +34,8 @@ public class EmployeeComputeOptionsRepository : RepositoryBase<long, EmployeeCom
|
||||
CreateCheckout = x.CreateCheckout,
|
||||
CreateContract = x.CreateContract,
|
||||
SignContract = x.SignContract,
|
||||
ContractTerm = x.ContractTerm,
|
||||
CutContractEndOfYear = x.CutContractEndOfYear
|
||||
|
||||
}).FirstOrDefault(x => x.WorkshopId == workshopId && x.EmployeeId == employeeId);
|
||||
|
||||
@@ -52,7 +54,9 @@ public class EmployeeComputeOptionsRepository : RepositoryBase<long, EmployeeCom
|
||||
CreateCheckout = getFromWorkshop.CreateCheckout,
|
||||
CreateContract = getFromWorkshop.CreateContract,
|
||||
SignCheckout = getFromWorkshop.SignCheckout,
|
||||
SignContract = getFromWorkshop.SignContract
|
||||
SignContract = getFromWorkshop.SignContract,
|
||||
ContractTerm = getFromWorkshop.ContractTerm,
|
||||
CutContractEndOfYear = getFromWorkshop.CutContractEndOfYear
|
||||
};
|
||||
|
||||
result = fromWorkshop;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
@page
|
||||
@using _0_Framework.Application
|
||||
@model ServiceHost.Areas.Admin.Pages.Company.ConnectedPersonnels.IndexModel
|
||||
|
||||
@{
|
||||
@@ -14,6 +15,11 @@
|
||||
<link href="~/admintheme/assets/datatables-new/css/dataTables.bootstrap4.min.css" rel="stylesheet" />
|
||||
<link href="~/admintheme/assets/datatables-new/css/responsive.bootstrap4.min.css" rel="stylesheet" />
|
||||
<link href="~/assetsadmin/page/connectedpersonnels/css/index.css?ver=@adminVersion" rel="stylesheet" />
|
||||
<style>
|
||||
.table > tbody > tr > td{
|
||||
padding: 3px !important;
|
||||
}
|
||||
</style>
|
||||
}
|
||||
<input type="hidden" asp-for="@Model.workshopId" value="@Model.workshopId" id="workshopId" />
|
||||
|
||||
@@ -32,14 +38,14 @@
|
||||
<th>ردیف</th>
|
||||
<th>نام و نام خانوادگی</th>
|
||||
<th>کد پرسنلی</th>
|
||||
<th>دارای قرارداد</th>
|
||||
<th>دارای بیمه</th>
|
||||
<th>انتخاب نوع محاسبه طلب مرخصی</th>
|
||||
<th>انتخاب نوع محاسبه سنوات</th>
|
||||
<th>انتخاب نوع محاسبه عیدی و پاداش</th>
|
||||
<th>مدت قراداد</th>
|
||||
<th> منتهی به پایان سال</th>
|
||||
<th> طلب مرخصی</th>
|
||||
<th> سنوات</th>
|
||||
<th> عیدی و پاداش</th>
|
||||
|
||||
<th>عدم قرارداد</th>
|
||||
<th>عدم تصفیه حساب</th>
|
||||
<th>ایجاد قرارداد</th>
|
||||
<th>ایجاد تصفیه حساب</th>
|
||||
|
||||
|
||||
<th>عملیات</th>
|
||||
@@ -56,12 +62,32 @@
|
||||
i++;
|
||||
}
|
||||
<td>
|
||||
<h6>@item.PersonName</h6>
|
||||
<span style="font-size:10px">@item.PersonName</span>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<h6>@item.PersonelCode</h6>
|
||||
<span style="font-size:10px">@item.PersonelCode</span>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
@if (@item.ContractPerson)
|
||||
{
|
||||
<select class="form-control" data-ContractTerm="@item.EmployeeId" asp-for="@item.ContractTerm" style="width: 75px;font-size: 10px;">
|
||||
<option value="1"> <span>1 ماهه</span> </option>
|
||||
<option value="2"> <span>2 ماهه</span> </option>
|
||||
<option value="3"> <span>3 ماهه</span> </option>
|
||||
<option value="6"> <span>6 ماهه</span> </option>
|
||||
<option value="12"> <span>1 ساله</span> </option>
|
||||
</select>
|
||||
}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<select class="form-control" data-CutContractEndOfYear="@item.EmployeeId" asp-for="@item.CutContractEndOfYear" style="width: 100px;font-size: 10px;">
|
||||
<option value="@IsActive.None"> <span></span> </option>
|
||||
<option value="@IsActive.True"> <span>منتهی باشد</span> </option>
|
||||
<option value="@IsActive.False"> <span>منتهی نباشد</span> </option>
|
||||
|
||||
</select>
|
||||
</td>
|
||||
@* <td class="text-center">
|
||||
@if (@item.ContractPerson && !@item.ContractLeft)
|
||||
{
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
@@ -96,11 +122,11 @@
|
||||
<path d="M8 12H16" stroke="#B91C1C" stroke-width="1.2" stroke-linecap="round" />
|
||||
</svg>
|
||||
}
|
||||
</td>
|
||||
</td> *@
|
||||
<td>
|
||||
@if (@item.ContractPerson)
|
||||
{
|
||||
<select class="form-control" data-ComputeOptions="@item.EmployeeId" id="ComputeOptionsSelect" asp-for="@item.ComputeOptions" style="width: 170px;font-size: 12px;">
|
||||
<select class="form-control" data-ComputeOptions="@item.EmployeeId" id="ComputeOptionsSelect" asp-for="@item.ComputeOptions" style="width: 140px;font-size: 10px;">
|
||||
<option value="OnEndOfContract">محاسبه در پایان قرارداد</option>
|
||||
<option value="OnLeftWork"> محاسبه در پایان همکاری (ترک کار از مجموعه) </option>
|
||||
<option value="OnEndOfYear"> محاسبه در پایان سال به شرطی که قرارداد منتهی به پایان سال باشد </option>
|
||||
@@ -110,7 +136,7 @@
|
||||
<td>
|
||||
@if (@item.ContractPerson)
|
||||
{
|
||||
<select class="form-control" data-YearsOptions="@item.EmployeeId" asp-for="@item.YearsOptions" style="width: 170px;font-size: 12px;">
|
||||
<select class="form-control" data-YearsOptions="@item.EmployeeId" asp-for="@item.YearsOptions" style="width: 140px;font-size: 10px;">
|
||||
<option value="OnCheckoutOfMonth"> محاسبه در فیش حقوقی ماهیانه </option>
|
||||
<option value="OnEndOfContract"> محاسبه در پایان قرارداد </option>
|
||||
<option value="OnLeftWork"> محاسبه در پایان همکاری (ترک کار از مجموعه) </option>
|
||||
@@ -121,7 +147,7 @@
|
||||
<td>
|
||||
@if (@item.ContractPerson)
|
||||
{
|
||||
<select class="form-control" data-BonusesOptions="@item.EmployeeId" asp-for="@item.BonusesOptions" style="width: 170px;font-size: 12px;">
|
||||
<select class="form-control" data-BonusesOptions="@item.EmployeeId" asp-for="@item.BonusesOptions" style="width: 140px;font-size: 10px;">
|
||||
<option value="OnCheckoutOfMonth"> محاسبه در فیش حقوقی ماهیانه </option>
|
||||
<option value="OnEndOfContract"> محاسبه در پایان قرارداد </option>
|
||||
<option value="OnEndOfYear"> محاسبه در پایان سال </option>
|
||||
@@ -168,12 +194,12 @@
|
||||
<td>
|
||||
@if (@item.ContractPerson)
|
||||
{
|
||||
<button onclick="save(@item.EmployeeId)" class="btn btn-success save" data-save="@item.EmployeeId" disabled="disabled">ذخیره</button>
|
||||
<button onclick="save(@item.EmployeeId)" style="font-size:8px" class="btn btn-success save" data-save="@item.EmployeeId" disabled="disabled">ذخیره</button>
|
||||
}
|
||||
<a class="btn btn-success pull-left rad" style="margin-left: 5px"
|
||||
@* <a class="btn btn-success pull-left rad" style="margin-left: 5px"
|
||||
href="#showmodal=@Url.Page("./Index", "TakePicture", new { employeeId = item.EmployeeId, workshopId = item.WorkshopId})">
|
||||
<i class="ion-information-circled ionSize"></i>
|
||||
</a>
|
||||
</a> *@
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
@@ -72,7 +72,8 @@ namespace ServiceHost.Areas.Admin.Pages.Company.ConnectedPersonnels
|
||||
CreateCheckout = option.CreateCheckout,
|
||||
SignContract = option.SignContract,
|
||||
SignCheckout = option.SignCheckout,
|
||||
|
||||
ContractTerm = option.ContractTerm,
|
||||
CutContractEndOfYear = option.CutContractEndOfYear
|
||||
};
|
||||
|
||||
final.Add(finalResult);
|
||||
|
||||
@@ -91,7 +91,13 @@ public class AutoExtensionModel : PageModel
|
||||
_yearlySalaryApplication.GetYears();
|
||||
|
||||
workshopName = res.WorkshopName;
|
||||
WorkshopId = res.WorkshopId;
|
||||
ArchiveCode = res.ArchiveCode;
|
||||
WAddress1 = res.WAddress1;
|
||||
EmployerId = res.EmployerId;
|
||||
EmployerWarning = res.EmployerWarning;
|
||||
if (res.EmployeeList != null)
|
||||
{
|
||||
if (res.EmployeeList.Any(x => x.PersonnelCode > 0))
|
||||
{
|
||||
MaxPersonnelCode = res.EmployeeList.Select(x => x.PersonnelCode).Max();
|
||||
@@ -102,13 +108,20 @@ public class AutoExtensionModel : PageModel
|
||||
MaxPersonnelCode = 1;
|
||||
}
|
||||
|
||||
WorkshopId = res.WorkshopId;
|
||||
ArchiveCode = res.ArchiveCode;
|
||||
WAddress1 = res.WAddress1;
|
||||
EmployerId = res.EmployerId;
|
||||
EmployeeList = res.EmployeeList.Where(x => x.EmployeeHasCreateContract).ToList();
|
||||
EmployeeSelectList = new SelectList(res.EmployeeList, "EmployeeId", "EmployeeName");
|
||||
HavingPersonel = !res.EmployeeList.Any(x => x.EmployeeHasCreateContract) ? false : res.HavingPersonel;
|
||||
}
|
||||
else
|
||||
{
|
||||
MaxPersonnelCode = 1;
|
||||
HavingPersonel = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#region Old
|
||||
|
||||
@@ -410,6 +410,9 @@ function save(EmployeeId) {
|
||||
command.CreateCheckout = $(`#FailureCreateCheckout_${EmployeeId}`).prop("checked");
|
||||
command.SignCheckout = $(`#FailureSignCheckout_${EmployeeId}`).prop("checked");
|
||||
|
||||
command.ContractTerm = $('[data-ContractTerm="' + EmployeeId + '"]').val();
|
||||
command.CutContractEndOfYear = $('[data-CutContractEndOfYear="' + EmployeeId + '"]').val();
|
||||
|
||||
$.ajax({
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
|
||||
Reference in New Issue
Block a user