InsuranceEmployeeShare comput on checkout completed
This commit is contained in:
15
0_Framework/Application/Enums/TypeOfCheckoutWarning.cs
Normal file
15
0_Framework/Application/Enums/TypeOfCheckoutWarning.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
namespace _0_Framework.Application.Enums;
|
||||
|
||||
public enum TypeOfCheckoutWarning
|
||||
{
|
||||
/// <summary>
|
||||
/// هشدار های متفرقه
|
||||
/// </summary>
|
||||
OthersWarning,
|
||||
/// <summary>
|
||||
/// هشدار سهم بیمه کارگر
|
||||
/// </summary>
|
||||
InsuranceEmployeeShare,
|
||||
|
||||
|
||||
}
|
||||
@@ -1,13 +1,15 @@
|
||||
using _0_Framework.Domain;
|
||||
using _0_Framework.Application.Enums;
|
||||
using _0_Framework.Domain;
|
||||
|
||||
namespace Company.Domain.CheckoutAgg;
|
||||
|
||||
public class CheckoutWarningMessage : EntityBaseWithoutCreationDate
|
||||
{
|
||||
public CheckoutWarningMessage(string warningMessage, long checkoutId)
|
||||
public CheckoutWarningMessage(string warningMessage, long checkoutId, TypeOfCheckoutWarning typeOfCheckoutWarning)
|
||||
{
|
||||
WarningMessage = warningMessage;
|
||||
CheckoutId = checkoutId;
|
||||
TypeOfCheckoutWarning = typeOfCheckoutWarning;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -21,6 +23,10 @@ public class CheckoutWarningMessage : EntityBaseWithoutCreationDate
|
||||
/// </summary>
|
||||
public long CheckoutId { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// نوع هشدار فیش حقوقی
|
||||
/// </summary>
|
||||
public TypeOfCheckoutWarning TypeOfCheckoutWarning { get; private set; }
|
||||
|
||||
public Checkout Checkout { get; set; }
|
||||
}
|
||||
@@ -51,6 +51,14 @@ public interface IInsuranceListRepository:IRepository<long, InsuranceList>
|
||||
List<EmployeeInsurancListDataViewModel> GetEmployeeInsuranceDataAmonthAgo(DateTime currentMonthStartDate, long workshopId);
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// دریافت اطلاعات بیمه کارکنان برای استفاده در فیش حقوقی
|
||||
/// </summary>
|
||||
/// <param name="startDate"></param>
|
||||
/// <param name="workshopId"></param>
|
||||
/// <returns></returns>
|
||||
List<EmployeeInsurancListDataViewModel> EmployeeInsuranceDataBy(DateTime startDate, long workshopId);
|
||||
|
||||
/// <summary>
|
||||
/// بدست آوردن اطلاعات محاسباتی ماه پرسنل برای ویرایش
|
||||
/// </summary>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using _0_Framework.Application.Enums;
|
||||
using CompanyManagment.App.Contracts.Employer;
|
||||
using CompanyManagment.App.Contracts.Loan;
|
||||
using CompanyManagment.App.Contracts.RollCall;
|
||||
@@ -133,6 +134,15 @@ public class CheckoutViewModel
|
||||
/// </summary>
|
||||
public string TotalPaidLeave { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آیا فیش نیاز به بروزرسانی دارد
|
||||
/// </summary>
|
||||
public bool IsUpdateNeeded { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// لیست پیام های هشدار فیش حقوقی
|
||||
/// </summary>
|
||||
public List<CheckoutWarningMessageModel> CheckoutWarningMessageList { get; set; }
|
||||
|
||||
public bool HasSignCheckout { get; set; }
|
||||
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
using _0_Framework.Application.Enums;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.Checkout;
|
||||
|
||||
/// <summary>
|
||||
/// مدل هشدار فیش حقوقی
|
||||
/// </summary>
|
||||
public class CheckoutWarningMessageModel
|
||||
{
|
||||
/// <summary>
|
||||
/// پیام هشدار
|
||||
/// </summary>
|
||||
public string WarningMessage { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// آی دی فیش حقوقی
|
||||
/// </summary>
|
||||
public long CheckoutId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نوع هشدار فیش حقوقی
|
||||
/// </summary>
|
||||
public TypeOfCheckoutWarning TypeOfCheckoutWarning { get; set; }
|
||||
}
|
||||
@@ -1,4 +1,6 @@
|
||||
using Company.Domain.CheckoutAgg;
|
||||
using System;
|
||||
using _0_Framework.Application.Enums;
|
||||
using Company.Domain.CheckoutAgg;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
@@ -13,6 +15,10 @@ public class CheckoutWarningMessageMapping : IEntityTypeConfiguration<CheckoutWa
|
||||
|
||||
builder.Property(x => x.WarningMessage).HasMaxLength(150);
|
||||
|
||||
builder.Property(x => x.TypeOfCheckoutWarning).HasConversion(
|
||||
v => v.ToString(),
|
||||
v => (TypeOfCheckoutWarning)Enum.Parse(typeof(TypeOfCheckoutWarning), v)).HasMaxLength(30);
|
||||
|
||||
builder.HasOne(x => x.Checkout)
|
||||
.WithMany(x => x.CheckoutWarningMessageList)
|
||||
.HasForeignKey(x => x.CheckoutId);
|
||||
|
||||
11116
CompanyManagment.EFCore/Migrations/20251028121828_CheckoutWarningMessage.Designer.cs
generated
Normal file
11116
CompanyManagment.EFCore/Migrations/20251028121828_CheckoutWarningMessage.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,58 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class CheckoutWarningMessage : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "IsUpdateNeeded",
|
||||
table: "Checkouts",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "CheckoutWarningMessage",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<long>(type: "bigint", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
WarningMessage = table.Column<string>(type: "nvarchar(150)", maxLength: 150, nullable: true),
|
||||
CheckoutId = table.Column<long>(type: "bigint", nullable: false),
|
||||
TypeOfCheckoutWarning = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_CheckoutWarningMessage", x => x.id);
|
||||
table.ForeignKey(
|
||||
name: "FK_CheckoutWarningMessage_Checkouts_CheckoutId",
|
||||
column: x => x.CheckoutId,
|
||||
principalTable: "Checkouts",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_CheckoutWarningMessage_CheckoutId",
|
||||
table: "CheckoutWarningMessage",
|
||||
column: "CheckoutId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "CheckoutWarningMessage");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IsUpdateNeeded",
|
||||
table: "Checkouts");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -434,6 +434,9 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.HasMaxLength(10)
|
||||
.HasColumnType("nvarchar(10)");
|
||||
|
||||
b.Property<bool>("IsUpdateNeeded")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("LeaveCheckout")
|
||||
.HasColumnType("bit");
|
||||
|
||||
@@ -546,6 +549,33 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.ToTable("Checkouts", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.CheckoutAgg.CheckoutWarningMessage", b =>
|
||||
{
|
||||
b.Property<long>("id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
|
||||
|
||||
b.Property<long>("CheckoutId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<string>("TypeOfCheckoutWarning")
|
||||
.IsRequired()
|
||||
.HasMaxLength(30)
|
||||
.HasColumnType("nvarchar(30)");
|
||||
|
||||
b.Property<string>("WarningMessage")
|
||||
.HasMaxLength(150)
|
||||
.HasColumnType("nvarchar(150)");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.HasIndex("CheckoutId");
|
||||
|
||||
b.ToTable("CheckoutWarningMessage", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.ClassifiedSalaryAgg.ClassifiedSalary", b =>
|
||||
{
|
||||
b.Property<long>("id")
|
||||
@@ -7214,6 +7244,17 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Navigation("Workshop");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.CheckoutAgg.CheckoutWarningMessage", b =>
|
||||
{
|
||||
b.HasOne("Company.Domain.CheckoutAgg.Checkout", "Checkout")
|
||||
.WithMany("CheckoutWarningMessageList")
|
||||
.HasForeignKey("CheckoutId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Checkout");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.ClientEmployeeWorkshopAgg.ClientEmployeeWorkshop", b =>
|
||||
{
|
||||
b.HasOne("Company.Domain.EmployeeAgg.Employee", "Employee")
|
||||
@@ -10733,6 +10774,11 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Navigation("PetitionsList");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.CheckoutAgg.Checkout", b =>
|
||||
{
|
||||
b.Navigation("CheckoutWarningMessageList");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.ContarctingPartyAgg.PersonalContractingParty", b =>
|
||||
{
|
||||
b.Navigation("ContractingPartyBankAccounts");
|
||||
|
||||
@@ -1994,7 +1994,7 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
||||
// );
|
||||
|
||||
var checkouts =
|
||||
_context.CheckoutSet.Where(x => workshopAcounts.Contains(x.WorkshopId))
|
||||
_context.CheckoutSet.Include(w=>w.CheckoutWarningMessageList).Where(x => workshopAcounts.Contains(x.WorkshopId))
|
||||
.Join(_context.Workshops.AsSplitQuery(),
|
||||
ch => ch.WorkshopId,
|
||||
workshop => workshop.id,
|
||||
@@ -2263,7 +2263,14 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
||||
CreationDate = x.ch.CreationDate,
|
||||
EmployerName = $"{x.workshopEmployer.Employer.FName} {x.workshopEmployer.Employer.LName}",
|
||||
IsBlockCantracingParty = x.contractingParty.IsBlock,
|
||||
HasSignCheckout = x.option != null ? x.option.SignCheckout : x.workshop.SignCheckout
|
||||
HasSignCheckout = x.option != null ? x.option.SignCheckout : x.workshop.SignCheckout,
|
||||
IsUpdateNeeded = x.ch.IsUpdateNeeded,
|
||||
CheckoutWarningMessageList = x.ch.CheckoutWarningMessageList.Select(wm=> new CheckoutWarningMessageModel
|
||||
{
|
||||
WarningMessage = wm.WarningMessage,
|
||||
TypeOfCheckoutWarning = wm.TypeOfCheckoutWarning,
|
||||
|
||||
}).ToList()
|
||||
|
||||
|
||||
}).OrderByDescending(x=>x.Id).Take(3000).ToList().DistinctBy(x => x.Id)
|
||||
@@ -2301,7 +2308,14 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
||||
CreationDate = x.ch.CreationDate,
|
||||
EmployerName = $"{x.workshopEmployer.Employer.FName} {x.workshopEmployer.Employer.LName}",
|
||||
IsBlockCantracingParty = x.contractingParty.IsBlock,
|
||||
HasSignCheckout = x.option != null ? x.option.SignCheckout : x.workshop.SignCheckout
|
||||
HasSignCheckout = x.option != null ? x.option.SignCheckout : x.workshop.SignCheckout,
|
||||
IsUpdateNeeded = x.ch.IsUpdateNeeded,
|
||||
CheckoutWarningMessageList = x.ch.CheckoutWarningMessageList.Select(wm => new CheckoutWarningMessageModel
|
||||
{
|
||||
WarningMessage = wm.WarningMessage,
|
||||
TypeOfCheckoutWarning = wm.TypeOfCheckoutWarning,
|
||||
|
||||
}).ToList()
|
||||
|
||||
}).OrderByDescending(x => x.Id)
|
||||
.GroupBy(x => x.Id)
|
||||
@@ -2367,7 +2381,14 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
||||
CreationDate = x.ch.CreationDate,
|
||||
EmployerName = $"{x.workshopEmployer.Employer.FName} {x.workshopEmployer.Employer.LName}",
|
||||
IsBlockCantracingParty = x.contractingParty.IsBlock,
|
||||
HasSignCheckout = x.option != null ? x.option.SignCheckout : x.workshop.SignCheckout
|
||||
HasSignCheckout = x.option != null ? x.option.SignCheckout : x.workshop.SignCheckout,
|
||||
IsUpdateNeeded = x.ch.IsUpdateNeeded,
|
||||
CheckoutWarningMessageList = x.ch.CheckoutWarningMessageList.Select(wm => new CheckoutWarningMessageModel
|
||||
{
|
||||
WarningMessage = wm.WarningMessage,
|
||||
TypeOfCheckoutWarning = wm.TypeOfCheckoutWarning,
|
||||
|
||||
}).ToList()
|
||||
|
||||
}).GroupBy(x => x.Id).Select(x => x.First()).ToList()
|
||||
.OrderByDescending(x => x.ContractStartGr).ToList();
|
||||
@@ -2400,7 +2421,14 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
||||
CreationDate = x.ch.CreationDate,
|
||||
EmployerName = $"{x.workshopEmployer.Employer.FName} {x.workshopEmployer.Employer.LName}",
|
||||
IsBlockCantracingParty = x.contractingParty.IsBlock,
|
||||
HasSignCheckout = x.option != null ? x.option.SignCheckout : x.workshop.SignCheckout
|
||||
HasSignCheckout = x.option != null ? x.option.SignCheckout : x.workshop.SignCheckout,
|
||||
IsUpdateNeeded = x.ch.IsUpdateNeeded,
|
||||
CheckoutWarningMessageList = x.ch.CheckoutWarningMessageList.Select(wm => new CheckoutWarningMessageModel
|
||||
{
|
||||
WarningMessage = wm.WarningMessage,
|
||||
TypeOfCheckoutWarning = wm.TypeOfCheckoutWarning,
|
||||
|
||||
}).ToList()
|
||||
|
||||
}).GroupBy(x => x.Id)
|
||||
.Select(x => x.First()).ToList()
|
||||
|
||||
@@ -7,6 +7,7 @@ using System.Runtime.CompilerServices;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Application.Enums;
|
||||
using _0_Framework.InfraStructure;
|
||||
using AccountMangement.Infrastructure.EFCore;
|
||||
using Company.Domain.CheckoutAgg;
|
||||
@@ -134,6 +135,11 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
var id = insuranceListObj.id;
|
||||
if (command.EmployeeInsurancListDataList != null && command.EmployeeInsurancListDataList.Count > 0)
|
||||
{
|
||||
var farisMonthName = Tools.ToFarsiMonthByNumber(command.Month);
|
||||
|
||||
var checkouts = _context.CheckoutSet.Where(x =>
|
||||
x.WorkshopId == command.WorkshopId && x.Year == command.Year && x.Month == farisMonthName &&
|
||||
x.IsActiveString == "true");
|
||||
foreach (var item in command.EmployeeInsurancListDataList)
|
||||
{
|
||||
if (item.EmployeeInsurancListDataId == 0)
|
||||
@@ -160,6 +166,29 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
item.LeftWorkDate, item.JobId, item.IncludeStatus, item.BaseYears,
|
||||
item.MarriedAllowance, item.OverTimePay, item.FamilyAllowance);
|
||||
}
|
||||
|
||||
|
||||
if (checkouts.Any())
|
||||
{
|
||||
var checkout = checkouts.FirstOrDefault(x => x.EmployeeId == item.EmployeeId);
|
||||
if (checkout != null)
|
||||
{
|
||||
if (item.InsuranceShare.ToMoney() != checkout.InsuranceDeduction.ToMoney())
|
||||
{
|
||||
checkout.SetUpdateNeeded();
|
||||
if (!_context.CheckoutWarningMessages.Any(x => x.CheckoutId == checkout.id && x.TypeOfCheckoutWarning != TypeOfCheckoutWarning.InsuranceEmployeeShare))
|
||||
{
|
||||
var createWarrning =
|
||||
new CheckoutWarningMessage(
|
||||
"مبلغ بیمه سهم کارگر با مبلغ محاسبه شده در لیست بیمه مغایرت دارد", checkout.id, TypeOfCheckoutWarning.InsuranceEmployeeShare);
|
||||
_context.CheckoutWarningMessages.Add(createWarrning);
|
||||
}
|
||||
|
||||
_context.SaveChanges();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
_employeeInsurancListDataRepository.SaveChanges();
|
||||
@@ -726,10 +755,14 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
if (item.InsuranceShare.ToMoney() != checkout.InsuranceDeduction.ToMoney())
|
||||
{
|
||||
checkout.SetUpdateNeeded();
|
||||
var createWarrning =
|
||||
new CheckoutWarningMessage(
|
||||
"مبلغ بیمه سهم کارگر با مبلغ محاسبه شده در لیست بیمه مغایرت دارد", checkout.id);
|
||||
_context.CheckoutWarningMessages.Add(createWarrning);
|
||||
if (!_context.CheckoutWarningMessages.Any(x => x.CheckoutId == checkout.id && x.TypeOfCheckoutWarning != TypeOfCheckoutWarning.InsuranceEmployeeShare))
|
||||
{
|
||||
var createWarrning =
|
||||
new CheckoutWarningMessage(
|
||||
"مبلغ بیمه سهم کارگر با مبلغ محاسبه شده در لیست بیمه مغایرت دارد", checkout.id, TypeOfCheckoutWarning.InsuranceEmployeeShare);
|
||||
_context.CheckoutWarningMessages.Add(createWarrning);
|
||||
}
|
||||
|
||||
_context.SaveChanges();
|
||||
}
|
||||
}
|
||||
@@ -1436,6 +1469,27 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
}
|
||||
|
||||
|
||||
public List<EmployeeInsurancListDataViewModel> EmployeeInsuranceDataBy(DateTime startDate, long workshopId)
|
||||
{
|
||||
var res = _context.InsuranceListSet
|
||||
.Where(x => x.StartDate <= startDate && x.EndDate >= startDate &&
|
||||
x.WorkshopId == workshopId)
|
||||
.Join(_context.EmployeeInsurancListDataSet,
|
||||
insuranceList => insuranceList.id,
|
||||
employeeInsurancListData => employeeInsurancListData.InsuranceListId,
|
||||
(insuranceList, employeeInsurancListData) => new EmployeeInsurancListDataViewModel
|
||||
{
|
||||
InsuranceListId = insuranceList.id,
|
||||
EmployeeId = employeeInsurancListData.EmployeeId,
|
||||
WorkingDays = employeeInsurancListData.WorkingDays,
|
||||
BenefitsIncludedNonContinuous = employeeInsurancListData.BenefitsIncludedNonContinuous,
|
||||
InsuranceShare = employeeInsurancListData.InsuranceShare,
|
||||
});
|
||||
|
||||
return res.ToList();
|
||||
}
|
||||
|
||||
|
||||
public List<EmployeeDetailsForInsuranceListViewModel> GetEmployeeInsuranceDataForEdit(long insuranceListId,
|
||||
DateTime startDate, DateTime endDate)
|
||||
{
|
||||
|
||||
@@ -781,7 +781,10 @@ public class IndexModel : PageModel
|
||||
DateTime startDateGr = startMonthFa.ToGeorgianDateTime();
|
||||
DateTime endDateGr = startMonthFa.FindeEndOfMonth().ToGeorgianDateTime();
|
||||
int endOfMonth = Convert.ToInt32((startMonthFa.FindeEndOfMonth()).Substring(8, 2));
|
||||
//مقادیر سالانه این تاریخ
|
||||
|
||||
|
||||
var insuranceListData =
|
||||
_insuranceListRepository.EmployeeInsuranceDataBy(startDateGr, contractpData.WorkshopIds);
|
||||
var yearlysaleries = _yearlySalaryApplication.GetInsuranceItems(startDateGr, endDateGr, ConvertYear);
|
||||
|
||||
var insuranceEmployeeData =
|
||||
@@ -1030,57 +1033,70 @@ public class IndexModel : PageModel
|
||||
#region Insurance
|
||||
|
||||
double insuranceShare = 0;
|
||||
//اگر پرسنل داری شروع بکار بیمه بود
|
||||
var insuranceEmployeeDataItem =
|
||||
insuranceEmployeeData.FirstOrDefault(x => x.EmployeeId == contract.EmployeeId);
|
||||
if (insuranceEmployeeDataItem != null && insuranceEmployeeDataItem.StartWorkDateGr <= separation.ContractEndGr)
|
||||
|
||||
//اگر لیست بیمه برای پرسنل ساخته شده بود
|
||||
var insuranceListDataWithDetails =
|
||||
insuranceListData.FirstOrDefault(x => x.EmployeeId == contract.EmployeeId);
|
||||
if (insuranceListDataWithDetails != null)
|
||||
{
|
||||
var workingDays = Tools.GetEmployeeInsuranceWorkingDays(insuranceEmployeeDataItem.StartWorkDateGr, separation.LeftWorkDate, startDateGr, endDateGr, insuranceEmployeeDataItem.EmployeeId);
|
||||
var leftWorkFa = workingDays.hasLeftWorkInMonth ? separation.LeftWorkDate.ToFarsi() : "";
|
||||
|
||||
//به دست آوردن دستمزد روزانه با توجه به اینکه کارگاه مشاغل مقطوع است یا خیر
|
||||
|
||||
double dailyWage = 0;
|
||||
if (workshop.FixedSalary)
|
||||
{
|
||||
var res = _insuranceListApplication.GetDailyWageFixedSalary(ConvertYear, workshop.Id, insuranceEmployeeDataItem.EmployeeId, startDateGr,
|
||||
endDateGr, insuranceEmployeeDataItem.JobId, workshop.Population, workshop.InsuranceJobId);
|
||||
dailyWage = res ?? 0;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
var res = _insuranceListApplication.ComputeDailyWage(yearlysaleries.DayliWage, insuranceEmployeeDataItem.EmployeeId, workshop.Id, ConvertYear);
|
||||
dailyWage = res;
|
||||
}
|
||||
|
||||
//بدست آوردن پایه سنوات
|
||||
var baseYears = _insuranceListRepository.GetEmployeeInsuranceBaseYear(insuranceEmployeeDataItem.EmployeeId, workshop.Id,
|
||||
workingDays.countWorkingDays, startDateGr, endDateGr, workingDays.startWork, workingDays.endWork, workingDays.hasLeftWorkInMonth);
|
||||
|
||||
//جمع مزد روزانه و پایه سنوات
|
||||
var dailyWagePlusBaseYears = dailyWage + baseYears.baseYear;
|
||||
|
||||
|
||||
//دستمزد ماهانه با محاسبه پایه سنوات
|
||||
var monthlySalary = _insuranceListApplication.GetRoundValue(dailyWagePlusBaseYears * workingDays.countWorkingDays);
|
||||
|
||||
//حق تاهل
|
||||
var marriedAllowance = employee.MaritalStatus == "متاهل" ? yearlysaleries.MarriedAllowance : 0;
|
||||
|
||||
//محاسبه مزایای ماهانه
|
||||
var monthlyBenefits = _insuranceListApplication.GetMonthlyBenefits(endOfMonth, yearlysaleries.ConsumableItems, yearlysaleries.HousingAllowance, marriedAllowance, workingDays.countWorkingDays, workshop.TypeOfInsuranceSend, insuranceEmployeeDataItem.JobId, insuranceEmployeeDataItem.EmployeeId, insuranceEmployeeDataItem.IncludeStatus);
|
||||
if (workshop.InsuranceCheckoutOvertime)
|
||||
{
|
||||
|
||||
monthlyBenefits = _insuranceListApplication.GetRoundValue(monthlyBenefits += overTimeWorking);
|
||||
}
|
||||
|
||||
//محاسبه جمع مزایای مشمول و دستمزد ماهانه
|
||||
var benefitsIncludedContinuous = monthlyBenefits + monthlySalary;
|
||||
|
||||
//محاسبه حق بیمه سهم بیمه شده
|
||||
insuranceShare = (benefitsIncludedContinuous * 7) / 100;
|
||||
insuranceShare = insuranceListDataWithDetails.InsuranceShare;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (insuranceEmployeeDataItem != null && insuranceEmployeeDataItem.StartWorkDateGr <= separation.ContractEndGr)
|
||||
{
|
||||
var workingDays = Tools.GetEmployeeInsuranceWorkingDays(insuranceEmployeeDataItem.StartWorkDateGr, separation.LeftWorkDate, startDateGr, endDateGr, insuranceEmployeeDataItem.EmployeeId);
|
||||
var leftWorkFa = workingDays.hasLeftWorkInMonth ? separation.LeftWorkDate.ToFarsi() : "";
|
||||
|
||||
//به دست آوردن دستمزد روزانه با توجه به اینکه کارگاه مشاغل مقطوع است یا خیر
|
||||
|
||||
double dailyWage = 0;
|
||||
if (workshop.FixedSalary)
|
||||
{
|
||||
var res = _insuranceListApplication.GetDailyWageFixedSalary(ConvertYear, workshop.Id, insuranceEmployeeDataItem.EmployeeId, startDateGr,
|
||||
endDateGr, insuranceEmployeeDataItem.JobId, workshop.Population, workshop.InsuranceJobId);
|
||||
dailyWage = res ?? 0;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
var res = _insuranceListApplication.ComputeDailyWage(yearlysaleries.DayliWage, insuranceEmployeeDataItem.EmployeeId, workshop.Id, ConvertYear);
|
||||
dailyWage = res;
|
||||
}
|
||||
|
||||
//بدست آوردن پایه سنوات
|
||||
var baseYears = _insuranceListRepository.GetEmployeeInsuranceBaseYear(insuranceEmployeeDataItem.EmployeeId, workshop.Id,
|
||||
workingDays.countWorkingDays, startDateGr, endDateGr, workingDays.startWork, workingDays.endWork, workingDays.hasLeftWorkInMonth);
|
||||
|
||||
//جمع مزد روزانه و پایه سنوات
|
||||
var dailyWagePlusBaseYears = dailyWage + baseYears.baseYear;
|
||||
|
||||
|
||||
//دستمزد ماهانه با محاسبه پایه سنوات
|
||||
var monthlySalary = _insuranceListApplication.GetRoundValue(dailyWagePlusBaseYears * workingDays.countWorkingDays);
|
||||
|
||||
//حق تاهل
|
||||
var marriedAllowance = employee.MaritalStatus == "متاهل" ? yearlysaleries.MarriedAllowance : 0;
|
||||
|
||||
//محاسبه مزایای ماهانه
|
||||
var monthlyBenefits = _insuranceListApplication.GetMonthlyBenefits(endOfMonth, yearlysaleries.ConsumableItems, yearlysaleries.HousingAllowance, marriedAllowance, workingDays.countWorkingDays, workshop.TypeOfInsuranceSend, insuranceEmployeeDataItem.JobId, insuranceEmployeeDataItem.EmployeeId, insuranceEmployeeDataItem.IncludeStatus);
|
||||
if (workshop.InsuranceCheckoutOvertime)
|
||||
{
|
||||
|
||||
monthlyBenefits = _insuranceListApplication.GetRoundValue(monthlyBenefits += overTimeWorking);
|
||||
}
|
||||
|
||||
//محاسبه جمع مزایای مشمول و دستمزد ماهانه
|
||||
var benefitsIncludedContinuous = monthlyBenefits + monthlySalary;
|
||||
|
||||
//محاسبه حق بیمه سهم بیمه شده
|
||||
insuranceShare = (benefitsIncludedContinuous * 7) / 100;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -2,8 +2,135 @@
|
||||
@{
|
||||
<style>
|
||||
.btn-lime {
|
||||
background-color: #84cc16;
|
||||
border: 1px solid #84cc16;
|
||||
background-color: #84cc16;
|
||||
border: 1px solid #84cc16;
|
||||
}
|
||||
|
||||
|
||||
.fulltext {
|
||||
opacity: 0;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.ellipsed {
|
||||
display: block;
|
||||
width: 100%;
|
||||
text-overflow: ellipsis;
|
||||
overflow-x: clip;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.date-box {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.tooltipfull-containerText {
|
||||
cursor: pointer;
|
||||
position: absolute;
|
||||
display: inline-block;
|
||||
right: -2px;
|
||||
top: 13px;
|
||||
}
|
||||
|
||||
|
||||
.tooltip {
|
||||
opacity: 0;
|
||||
z-index: 99;
|
||||
color: #fff;
|
||||
width: 220px;
|
||||
display: block;
|
||||
font-size: 14px;
|
||||
font-family: 'IranSans';
|
||||
padding: 5px 10px;
|
||||
border-radius: 3px;
|
||||
text-align: center;
|
||||
/*text-shadow: 1px 1px 2px #111;*/
|
||||
background: #e67e22;
|
||||
border: 1px solid #e67e22;
|
||||
box-shadow: 0 0 3px rgba(0,0,0,0.5);
|
||||
-webkit-transition: all .2s ease-in-out;
|
||||
-moz-transition: all .2s ease-in-out;
|
||||
-o-transition: all .2s ease-in-out;
|
||||
-ms-transition: all .2s ease-in-out;
|
||||
transition: all .2s ease-in-out;
|
||||
-webkit-transform: scale(0);
|
||||
-moz-transform: scale(0);
|
||||
-o-transform: scale(0);
|
||||
-ms-transform: scale(0);
|
||||
transform: scale(0);
|
||||
position: absolute;
|
||||
right: -50px;
|
||||
bottom: 40px;
|
||||
}
|
||||
|
||||
.tooltip:before, .tooltip:after {
|
||||
content: '';
|
||||
border-left: 10px solid transparent;
|
||||
border-right: 10px solid transparent;
|
||||
border-top: 10px solid #e67e22;
|
||||
position: absolute;
|
||||
bottom: -10px;
|
||||
left: 70%;
|
||||
}
|
||||
|
||||
.tooltip-container:hover .tooltip, a:hover .tooltip {
|
||||
opacity: 1;
|
||||
-webkit-transform: scale(1);
|
||||
-moz-transform: scale(1);
|
||||
-o-transform: scale(1);
|
||||
-ms-transform: scale(1);
|
||||
transform: scale(1);
|
||||
}
|
||||
|
||||
.tooltipfull {
|
||||
opacity: 0;
|
||||
z-index: 99;
|
||||
color: #fff;
|
||||
/* width: 180px;*/
|
||||
display: block;
|
||||
font-size: 12px;
|
||||
font-family: 'IranSans';
|
||||
padding: 5px 10px;
|
||||
border-radius: 15px;
|
||||
text-align: center;
|
||||
/*text-shadow: 1px 1px 2px #111;*/
|
||||
background: #950000;
|
||||
border: 1px solid #950000;
|
||||
box-shadow: 0 0 3px rgba(0,0,0,0.5);
|
||||
-webkit-transition: all .2s ease-in-out;
|
||||
-moz-transition: all .2s ease-in-out;
|
||||
-o-transition: all .2s ease-in-out;
|
||||
/* -ms-transition: all .2s ease-in-out;*/
|
||||
transition: all .2s ease-in-out;
|
||||
-webkit-transform: scale(0);
|
||||
-moz-transform: scale(0);
|
||||
-o-transform: scale(0);
|
||||
-ms-transform: scale(0);
|
||||
transform: scale(0);
|
||||
position: absolute;
|
||||
right: -2px;
|
||||
bottom: 20px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.tooltipfull:before, .tooltipfull:after {
|
||||
content: '';
|
||||
border-left: 10px solid transparent;
|
||||
border-right: 10px solid transparent;
|
||||
border-top: 10px solid #950000;
|
||||
position: absolute;
|
||||
bottom: -10px;
|
||||
left: 50%;
|
||||
}
|
||||
|
||||
.tooltipfull-containerText:hover .tooltipfull, a:hover .tooltipfull {
|
||||
opacity: 1;
|
||||
-webkit-transform: scale(1);
|
||||
-moz-transform: scale(1);
|
||||
-o-transform: scale(1);
|
||||
-ms-transform: scale(1);
|
||||
transform: scale(1);
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -102,14 +229,41 @@
|
||||
<td class="code-td">
|
||||
<span class="ellipsed">
|
||||
@item.Month
|
||||
@{
|
||||
<span> </span>
|
||||
if(item.IsUpdateNeeded){
|
||||
<i style="color: #cb1c1c; font-size:17px !important" class="fa fa-exclamation-triangle" aria-hidden="true"></i>
|
||||
}
|
||||
}
|
||||
|
||||
</span>
|
||||
|
||||
<div class="tooltipfull-containerText">
|
||||
<p class="fulltext">
|
||||
@item.Month
|
||||
</p>
|
||||
<span class="tooltipfull">
|
||||
@item.Month
|
||||
</span>
|
||||
@{
|
||||
if (item.IsUpdateNeeded)
|
||||
{
|
||||
foreach (var warning in item.CheckoutWarningMessageList)
|
||||
{
|
||||
<p class="fulltext">
|
||||
@warning.WarningMessage
|
||||
</p>
|
||||
<span class="tooltipfull" style="right: -103px;bottom: 20px;">
|
||||
@warning.WarningMessage
|
||||
</span>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<p class="fulltext">
|
||||
@item.Month
|
||||
</p>
|
||||
<span class="tooltipfull">
|
||||
@item.Month
|
||||
</span>
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
</div>
|
||||
</td>
|
||||
<td class="name-td">
|
||||
|
||||
Reference in New Issue
Block a user