complete 1

This commit is contained in:
SamSys
2025-02-01 18:14:58 +03:30
parent df6465c35d
commit 4c39ea1d98
9 changed files with 2082 additions and 1822 deletions

View File

@@ -57,8 +57,10 @@ public static class Tools
startWorkInMonth = true;
}
if(leftWork == null)
leftWork = DateTime.MinValue;
//اگر ترک کار پرسنل در ماه مشخص شده لیست بیمه بود
if (leftWork != null && leftWork.Value <= endDate)
if (leftWork != DateTime.MinValue && leftWork.Value <= endDate)
{
end = leftWork.Value;
endWorkInMonth = true;

View File

@@ -39,7 +39,7 @@ public interface IInsuranceListRepository:IRepository<long, InsuranceList>
/// محاسبه پایه سنوات بیمه برای پرسنل
/// </summary>
/// <returns></returns>
(int insuranceHistoryYearsCount, double baseYear) GetEmployeeInsuranceBaseYear(long employeeId, long workshopId, int countWorkingDay, DateTime listStartDate, DateTime endDate);
(int insuranceHistoryYearsCount, double baseYear) GetEmployeeInsuranceBaseYear(long employeeId, long workshopId, int countWorkingDay, DateTime listStartDate, DateTime listEndDate, DateTime startWorkDate, DateTime leftDate, bool hasLeft);
#endregion
#region client

View File

@@ -134,9 +134,13 @@ public class EmployeeDetailsForInsuranceListViewModel
/// DSW_MASH
/// </summary>
public double MonthlyBenefitsIncluded { get; set; }
// مزایای مشمول مستمر
/// <summary>
/// مزایای مشمول مستمر
/// </summary>
public double BenefitsIncludedContinuous { get; set; }
//مزایای مشمول غیر مستمر
/// <summary>
/// مزایای مشمول غیر مستمر
/// </summary>
public double BenefitsIncludedNonContinuous { get; set; }
/// <summary>
@@ -191,9 +195,14 @@ public class EmployeeDetailsForInsuranceListViewModel
public bool IsMaritalStatusSet { get; set; }
public int EndMonthCurrentDay { get; set; }
public double SumOfDailyWage { get; set; }
//بیمه سهم کارفرما
/// <summary>
/// حق بیمه سهم کارفرما
/// </summary>
public double EmployerShare { get; set; }
//بیمه بیکاری
/// <summary>
/// بیمه بیکاری
/// </summary>
public double UnEmploymentInsurance { get; set; }
public string StartMonthCurrent { get; set; }
public bool HasLeftWorkInMonth { get; set; }
@@ -231,13 +240,13 @@ public class EmployeeDetailsForInsuranceListViewModel
/// پایه سنواتی
/// DSW_INC
/// </summary>
public string BaseYears { get; set; }
public double BaseYears { get; set; }
/// <summary>
/// جمع پایه سنوات و دستمزد روزانه
/// DSW_INC
/// </summary>
public string DailyWagePlusBaseYears { get; set; }
public double DailyWagePlusBaseYears { get; set; }
/// <summary>
/// حق تاهل

View File

@@ -12,4 +12,5 @@ public class MainEmployeeDetailsViewModel
public bool IsExist { get; set; }
public bool IsBlock { get; set; }
public double MaritalStatus { get; set; }
}

View File

@@ -4,6 +4,7 @@ using System.Diagnostics;
using System.Linq;
using System.Runtime.InteropServices;
using _0_Framework.Application;
using _0_Framework.Domain.CustomizeCheckoutShared.ValueObjects;
using Company.Domain.DateSalaryAgg;
using Company.Domain.DateSalaryItemAgg;
using Company.Domain.EmployeeAgg;
@@ -384,11 +385,13 @@ public class InsuranceListApplication: IInsuranceListApplication
x.Year == searchModel.Year && x.Month == searchModel.Month &&
searchModel.WorkshopIds.Contains(x.WorkshopId)))
{
DateTime startDateGr = (searchModel.Year + "/" + searchModel.Month + "/01").ToGeorgianDateTime();
DateTime endDateGr = (searchModel.Year + "/" + searchModel.Month + "/01").FindeEndOfMonth()
var startMonthFa = $"{searchModel.Year}/{searchModel.Month}/01";
DateTime startDateGr = startMonthFa.ToGeorgianDateTime();
DateTime endDateGr = startMonthFa.FindeEndOfMonth()
.ToGeorgianDateTime();
int endOfMonth = Convert.ToInt32((startMonthFa.FindeEndOfMonth()).Substring(8, 2));
List<EmployeeDetailsForInsuranceListViewModel> list = new List<EmployeeDetailsForInsuranceListViewModel>();
//مقادیر سالانه این تاریخ
var yearlysaleries = _yearlySalaryApplication.GetInsuranceItems(startDateGr, endDateGr, searchModel.Year);
@@ -403,12 +406,46 @@ public class InsuranceListApplication: IInsuranceListApplication
var dateOfBirth = employee.DateOfBirthGr.ToFarsi();
var dateOfIssue = employee.DateOfIssueGr.ToFarsi();
var leftDate = employee.LeftWorkDateGr != null ? employee.LeftWorkDateGr.Value.AddDays(-1) : new DateTime();
var workingDays = Tools.GetEmployeeInsuranceWorkingDays(employee.StartWorkDateGr, leftDate, startDateGr,endDateGr, employee.EmployeeId);
//به دست آوردن دستمزد روزانه با توجه به اینکه کارگاه مشاغل مقطوع است یا خیر
var dailyWage = searchModel.FixedSalary ?
var workingDays = Tools.GetEmployeeInsuranceWorkingDays(employee.StartWorkDateGr, leftDate, startDateGr,endDateGr, employee.EmployeeId);
var leftWorkFa = workingDays.hasLeftWorkInMonth ? employee.LeftWorkDateGr.ToFarsi(): "";
var startWorkFa = workingDays.startWork.ToFarsi();
//به دست آوردن دستمزد روزانه با توجه به اینکه کارگاه مشاغل مقطوع است یا خیر
var dailyWage = searchModel.FixedSalary ?
Convert.ToDouble(GetDailyWageFixedSalary(searchModel.Year, workshopId, employee.EmployeeId, startDateGr, endDateGr, employee.JobId, searchModel.Population, searchModel.InsuranceJobId))
: ComputeDailyWage(yearlysaleries.DayliWage, employee.EmployeeId, workshopId, searchModel.Year);
return new EmployeeDetailsForInsuranceListViewModel
//بدست آوردن پایه سنوات
var baseYears = _insuranceListRepositpry.GetEmployeeInsuranceBaseYear(employee.EmployeeId, workshopId,
workingDays.countWorkingDays, startDateGr, endDateGr,workingDays.startWork, workingDays.endWork, workingDays.hasLeftWorkInMonth);
//جمع مزد روزانه و پایه سنوات
var dailyWagePlusBaseYears = dailyWage + baseYears.baseYear;
//دستمزد ماهانه با محاسبه پایه سنوات
var monthlySalary = GetRoundValue(dailyWagePlusBaseYears * workingDays.countWorkingDays);
//حق تاهل
var marriedAllowance = employee.MaritalStatus == "متاهل" ? yearlysaleries.MarriedAllowance : 0;
//محاسبه مزایای ماهانه
var monthlyBenefits = GetMonthlyBenefits(endOfMonth, yearlysaleries.ConsumableItems, yearlysaleries.HousingAllowance, marriedAllowance, workingDays.countWorkingDays, searchModel.TypeOfInsuranceSendWorkshop, employee.JobId, employee.EmployeeId);
//محاسبه مزایای مشمول مستمر
var benefitsIncludedContinuous = monthlyBenefits + monthlySalary;
//محاسبه حق بیمه سهم بیمه شده
var insuranceShare = (benefitsIncludedContinuous * 7) / 100;
//محاسبه حق بیمه سهم کارفرما
var employerShare = (benefitsIncludedContinuous * 20) / 100;
// محاسبه بیمه بیکاری
var unEmploymentInsurance = (benefitsIncludedContinuous * 3) / 100;
return new EmployeeDetailsForInsuranceListViewModel
{
#region EmployeeInfo
@@ -427,319 +464,391 @@ public class InsuranceListApplication: IInsuranceListApplication
NationalCode = employee.NationalCode,
Nationality = employee.Nationality,
InsuranceCode = employee.InsuranceCode,
// آیا وضعیت تاهل پرسنل ست شده است
IsMaritalStatusSet = !string.IsNullOrWhiteSpace(employee.MaritalStatus),
MaritalStatus = employee.MaritalStatus,
#endregion
StartMonthCurrent = startMonthFa,
WorkingDays = workingDays.countWorkingDays,
StartWorkDate = startWorkFa,
StartWorkDateGr = workingDays.startWork,
LeftWorkDate = leftWorkFa,
LeftWorkDateGr = workingDays.hasLeftWorkInMonth ? employee.LeftWorkDateGr : null,
JobId = employee.JobId,
JobName = employee.JobName,
JobCode = employee.JobCode,
#region Compute
HasStartWorkInMonth = workingDays.hasStartWorkInMonth,
HasLeftWorkInMonth = workingDays.hasLeftWorkInMonth,
#endregion
IncludeStatus = employee.IncludeStatus,
#region Compute
//مشمول مزایا بودن
IncludeStatus = employee.IncludeStatus,
//دستمزد روزانه
DailyWage = GetRoundValue(dailyWage),
DailyWageStr = dailyWage.ToMoney(),
#endregion
HasConfilictJobs = dailyWage == 0,
//پایه سنوات
BaseYears = baseYears.baseYear,
//مجموع مزد روزانه و پایه سنوات
DailyWagePlusBaseYears = dailyWagePlusBaseYears,
//حق تاهل
MarriedAllowance = employee.MaritalStatus == "متاهل" ? yearlysaleries.MarriedAllowance : 0,
//دستمزد ماهانه
MonthlySalary = monthlySalary,
//مزایای ماهانه
MonthlyBenefits = monthlyBenefits,
//مزایای مشمول مستمر
BenefitsIncludedContinuous = benefitsIncludedContinuous,
//مزیایی مشمول غیر مستمر
BenefitsIncludedNonContinuous = 0,
// جمع کل دستمزد و مزایای ماهانه
IncludedAndNotIncluded = benefitsIncludedContinuous,
//حق بیمه سهم بیمه شده
InsuranceShare = GetRoundValue(insuranceShare),
//حق بیمه سهم کارفرما
EmployerShare = GetRoundValue(employerShare),
//بیمه بیکاری
UnEmploymentInsurance = GetRoundValue(unEmploymentInsurance),
//کمک هزینه مسکن
HousingAllowance = yearlysaleries.HousingAllowance,
//کمک هزینه اقلام
ConsumableItems = yearlysaleries.ConsumableItems,
EndMonthCurrentDay = endOfMonth,
YearlySalaryItem = yearlysaleries.DayliWage,
MonthlyBaseYearsStr = "0",
MonthlyBaseYears = 0,
#endregion
};
};
});
Console.WriteLine("New Compute : " + watch.Elapsed);
watch.Stop();
watch.Start();
var leftWorkInsuranceViewModel = _leftWorkInsuranceApplication.SearchForCreateInsuranceList(searchModel);
//int leftWorkInsuranceCount= leftWorkInsuranceViewModelList.Count();
string startMonthCurrent = searchModel.Year + "/" + searchModel.Month + "/01";
string endMonthCurrent = startMonthCurrent.FindeEndOfMonth();
#region Old_heydari
//List<EmployeeDetailsForInsuranceListViewModel> list = new List<EmployeeDetailsForInsuranceListViewModel>();
//var leftWorkInsuranceViewModel = _leftWorkInsuranceApplication.SearchForCreateInsuranceList(searchModel);
////int leftWorkInsuranceCount= leftWorkInsuranceViewModelList.Count();
var model = new YearlySalarySearchModel();
var startDate = startMonthCurrent.ToGeorgianDateTime();
var endDate = endMonthCurrent.ToGeorgianDateTime();
model.StartDateGr = startDate;
model.EndDateGr = endMonthCurrent.ToGeorgianDateTime();
model.year = searchModel.Year;
//string startMonthCurrent = searchModel.Year + "/" + searchModel.Month + "/01";
//string endMonthCurrent = startMonthCurrent.FindeEndOfMonth();
//var model = new YearlySalarySearchModel();
//var startDate = startMonthCurrent.ToGeorgianDateTime();
//var endDate = endMonthCurrent.ToGeorgianDateTime();
//model.StartDateGr = startDate;
//model.EndDateGr = endMonthCurrent.ToGeorgianDateTime();
//model.year = searchModel.Year;
foreach (var item in leftWorkInsuranceViewModel)
{
var employeeObject = _employeeRepository.GetDetailsByADDate(item.EmployeeId);
var employeeDetailsForInsuranceObj = new EmployeeDetailsForInsuranceListViewModel();
employeeDetailsForInsuranceObj.HasConfilictJobs = false;
// آیا وضعیت تاهل پرسنل ست شده است
employeeDetailsForInsuranceObj.IsMaritalStatusSet =
!string.IsNullOrWhiteSpace(employeeObject.MaritalStatus);
//دزیافت اطلاعات هویتی پرسنل
//در صورت نداشن دیتا از جدول پرسنل پر می شود
#region PersonnelInfo
if (_insuranceEmployeeInfoRepository.Exists(x => x.EmployeeId == item.EmployeeId))
{
var employeeInfoObject = _insuranceEmployeeInfoApplication.GetDetailsByEmployeeId(item.EmployeeId);
employeeDetailsForInsuranceObj.InsuranceEmployeeInformationId = employeeInfoObject.Id;
employeeDetailsForInsuranceObj.EmployeeId = employeeInfoObject.EmployeeId;
employeeDetailsForInsuranceObj.FName = employeeInfoObject.FName;
employeeDetailsForInsuranceObj.LName = employeeInfoObject.LName;
employeeDetailsForInsuranceObj.FatherName = employeeInfoObject.FatherName;
employeeDetailsForInsuranceObj.DateOfBirth = employeeInfoObject.DateOfBirth;
employeeDetailsForInsuranceObj.DateOfIssue = employeeInfoObject.DateOfIssue;
employeeDetailsForInsuranceObj.DateOfBirthGr = employeeInfoObject.DateOfBirthGr;
employeeDetailsForInsuranceObj.DateOfIssueGr = employeeInfoObject.DateOfIssueGr;
employeeDetailsForInsuranceObj.PlaceOfIssue = employeeInfoObject.PlaceOfIssue;
employeeDetailsForInsuranceObj.IdNumber = employeeInfoObject.IdNumber;
employeeDetailsForInsuranceObj.Gender = employeeInfoObject.Gender;
//از جدول پرسنل پر می شود
employeeDetailsForInsuranceObj.NationalCode = employeeObject.NationalCode; //employeeInfoObject.NationalCode;
employeeDetailsForInsuranceObj.Nationality = employeeObject.Nationality;
employeeDetailsForInsuranceObj.InsuranceCode = employeeObject.InsuranceCode; //employeeInfoObject.InsuranceCode;
}
else
{
// var employeeObject = _employeeRepository.GetDetailsByADDate(item.EmployeeId);
employeeDetailsForInsuranceObj.InsuranceEmployeeInformationId = 0;
//employeeDetailsForInsuranceObj.EmployeeInsurancListDataId = 0;
employeeDetailsForInsuranceObj.EmployeeId = employeeObject.Id;
employeeDetailsForInsuranceObj.FName = employeeObject.FName;
employeeDetailsForInsuranceObj.LName = employeeObject.LName;
employeeDetailsForInsuranceObj.FatherName = employeeObject.FatherName;
employeeDetailsForInsuranceObj.DateOfBirth = (employeeObject.DateOfBirth == "1300/10/11" ? "" : employeeObject.DateOfBirth);
employeeDetailsForInsuranceObj.DateOfIssue = employeeObject.DateOfIssue;
employeeDetailsForInsuranceObj.PlaceOfIssue = employeeObject.PlaceOfIssue;
employeeDetailsForInsuranceObj.NationalCode = employeeObject.NationalCode;
employeeDetailsForInsuranceObj.IdNumber = employeeObject.IdNumber;
employeeDetailsForInsuranceObj.Gender = employeeObject.Gender;
employeeDetailsForInsuranceObj.InsuranceCode = employeeObject.InsuranceCode;
employeeDetailsForInsuranceObj.Nationality = employeeObject.Nationality;
}
#endregion
//روزهای کارکرد پرسنل
#region ComputingWorkingDays
int startWork = 0;
int endWork = 0;
var year = Convert.ToInt32(searchModel.Year);
var month = Convert.ToInt32(searchModel.Month);
var day = 1;
var persianCurrentStartDate = new PersianDateTime(year, month, day);
var dayMonthCurrent = Convert.ToInt32(endMonthCurrent.Substring(8, 2));
var persianCurrentEndDate = new PersianDateTime(year, month, dayMonthCurrent);
//آخرین روز ماه جاری
var endMonthCurrentDay = Convert.ToInt32(endMonthCurrent.Substring(8, 2));
var yearStartDateUser = Convert.ToInt32(item.StartWorkDate.Substring(0, 4));
var monthStartDateUser = Convert.ToInt32(item.StartWorkDate.Substring(5, 2));
var dayStartDateUser = Convert.ToInt32(item.StartWorkDate.Substring(8, 2));
var persianStartDateUser = new PersianDateTime(yearStartDateUser, monthStartDateUser, dayStartDateUser);
if (persianStartDateUser < persianCurrentStartDate)
employeeDetailsForInsuranceObj.HasStartWorkInMonth = false;
else
employeeDetailsForInsuranceObj.HasStartWorkInMonth = true;
//اگر شروع به کار کاربر از ابتدای ماه جاری کمتر باشد
if (persianStartDateUser <= persianCurrentStartDate)
{
startWork = 1;
}
else
{
startWork = dayStartDateUser;
}
if (!string.IsNullOrEmpty(item.LeftWorkDate))
{
var yearEndDateUser = Convert.ToInt32(item.LeftWorkDate.Substring(0, 4));
var monthEndDateUser = Convert.ToInt32(item.LeftWorkDate.Substring(5, 2));
var dayEndDateUser = Convert.ToInt32(item.LeftWorkDate.Substring(8, 2));
var persianLeftDateUser = new PersianDateTime(yearEndDateUser, monthEndDateUser, dayEndDateUser);
var persianEndDateUser = persianLeftDateUser.AddDays(-1);
var persianEndDateUserStr = persianLeftDateUser.AddDays(-1).ToString("yyyy/MM/dd");
//if (persianLeftDateUser <= persianCurrentEndDate)
// employeeDetailsForInsuranceObj.HasLeftWorkInMonth = true;
//else
// employeeDetailsForInsuranceObj.HasLeftWorkInMonth = false;
//ترک کارش در ماه و سال جاری بود نمایش داده شود
if (!item.LeftWorkDate.Contains(searchModel.Year + "/" + searchModel.Month))
{
employeeDetailsForInsuranceObj.HasLeftWorkInMonth = false;
item.LeftWorkDate = string.Empty;
item.LeftWorkDateGr = null;
}
else
{
employeeDetailsForInsuranceObj.HasLeftWorkInMonth = true;
}
//اگر پایان به کار کاربر از پایان ماه جاری بیشتر باشد
if (persianEndDateUser >= persianCurrentEndDate)
{
endWork = endMonthCurrentDay;
}
else
{
endWork = Convert.ToInt32(persianEndDateUserStr.Substring(8, 2));
}
}
else
{
employeeDetailsForInsuranceObj.HasLeftWorkInMonth = false;
endWork = endMonthCurrentDay;
}
int countWorkingDays = 0;
for (int i = startWork; i <= endWork; i++)
{
countWorkingDays = countWorkingDays + 1;
}
//farokhiChanges
//روزهای کارکرد پرسنل با آی دی های زیر دستی تعریف شد
switch (item.EmployeeId)
{
//case 3812://ثابت- کسری حاجی پور
// countWorkingDays = 15;
// break;
case 40463://ثابت
countWorkingDays = 10;
break;
case 40469://ثابت
countWorkingDays = 7;
break;
case 9950://ثابت
countWorkingDays = 15;
break;
case 9640://ثابت
countWorkingDays = 15;
break;
case 40998://ثابت
countWorkingDays = 15;
break;
case 6219://ثابت
countWorkingDays = 15;
break;
//case 7897://ثابت
// countWorkingDays = 15;
break;
}
#endregion
employeeDetailsForInsuranceObj.IncludeStatus = item.IncludeStatus;
#region InsuranceJob
double dailyWage = employeeDetailsForInsuranceObj.DailyWage;
if (searchModel.FixedSalary)
{
dailyWage = Convert.ToDouble(GetDailyWageFixedSalary(searchModel.Year, workshopId,item.EmployeeId, model.StartDateGr, model.EndDateGr, item.JobId, searchModel.Population, searchModel.InsuranceJobId));
employeeDetailsForInsuranceObj.HasConfilictJobs = (dailyWage == 0 ? true : false);
}
#endregion
if (yearlysaleries != null)
{
if(!searchModel.FixedSalary )
{
//dailyWage= yearlysalaryItem.ItemValue;
dailyWage = ComputeDailyWage(yearlysaleries.DayliWage, item.EmployeeId,workshopId, searchModel.Year) ;
//(double basic, int totalYears) basicResult = BasicYear(item.EmployeeId, workshopId, startDate);
//var basic = basicResult.basic;
//if (basicResult.totalYears > 0)
//{
// monthlybaseYear = GetMonthlyBaseYear(basicResult.basic, countWorkingDays);
//}
}
employeeDetailsForInsuranceObj.DailyWage = GetRoundValue(dailyWage);
employeeDetailsForInsuranceObj.BaseYears = "0";
employeeDetailsForInsuranceObj.DailyWageStr = employeeDetailsForInsuranceObj.DailyWage.ToMoney();
employeeDetailsForInsuranceObj.DailyWagePlusBaseYears = "0";
employeeDetailsForInsuranceObj.MonthlySalary = GetRoundValue(dailyWage * countWorkingDays);
employeeDetailsForInsuranceObj.HousingAllowance = yearlysaleries.HousingAllowance;
employeeDetailsForInsuranceObj.ConsumableItems = yearlysaleries.ConsumableItems;
employeeDetailsForInsuranceObj.EndMonthCurrentDay = endMonthCurrentDay;
employeeDetailsForInsuranceObj.YearlySalaryItem = yearlysaleries.DayliWage;
employeeDetailsForInsuranceObj.MonthlyBaseYearsStr = monthlybaseYear.ToMoney();
//foreach (var item in leftWorkInsuranceViewModel)
//{
// var employeeObject = _employeeRepository.GetDetailsByADDate(item.EmployeeId);
employeeDetailsForInsuranceObj.MarriedAllowance = 0;
if (item.IncludeStatus)
{
var marital = employeeObject.MaritalStatus == "متاهل" ? yearlysaleries.MarriedAllowance : 0;
employeeDetailsForInsuranceObj.MonthlyBenefits = GetMonthlyBenefits(endMonthCurrentDay, yearlysaleries.ConsumableItems, yearlysaleries.HousingAllowance, marital, countWorkingDays);
}
else
{
employeeDetailsForInsuranceObj.MonthlyBenefits = 0;
}
// var employeeDetailsForInsuranceObj = new EmployeeDetailsForInsuranceListViewModel();
// employeeDetailsForInsuranceObj.HasConfilictJobs = false;
if (searchModel.TypeOfInsuranceSendWorkshop == "Govermentlist" && item.JobId == 10) //کمک دولت
{
employeeDetailsForInsuranceObj.MonthlyBenefits = 0;
}
//farokhiChanges
if (item.EmployeeId == 42783)
employeeDetailsForInsuranceObj.MonthlyBenefits = 53082855;
// // آیا وضعیت تاهل پرسنل ست شده است
// employeeDetailsForInsuranceObj.IsMaritalStatusSet =
// !string.IsNullOrWhiteSpace(employeeObject.MaritalStatus);
// //دزیافت اطلاعات هویتی پرسنل
// //در صورت نداشن دیتا از جدول پرسنل پر می شود
// #region PersonnelInfo
employeeDetailsForInsuranceObj.BenefitsIncludedContinuous =employeeDetailsForInsuranceObj.MonthlyBenefits + employeeDetailsForInsuranceObj.MonthlySalary;
//حق بیمه سهم بیمه شده
var insuranceShare = (employeeDetailsForInsuranceObj.BenefitsIncludedContinuous * 7) / 100;
employeeDetailsForInsuranceObj.InsuranceShare = GetRoundValue(insuranceShare); //Math.Round(insuranceShare, MidpointRounding.ToPositiveInfinity);
//حق بیمه سهم کارفرما
var employerShare = (employeeDetailsForInsuranceObj.BenefitsIncludedContinuous * 20) / 100;
employeeDetailsForInsuranceObj.EmployerShare = GetRoundValue(employerShare); //Math.Round(employerShare, MidpointRounding.ToPositiveInfinity);
// if (_insuranceEmployeeInfoRepository.Exists(x => x.EmployeeId == item.EmployeeId))
// {
// var employeeInfoObject = _insuranceEmployeeInfoApplication.GetDetailsByEmployeeId(item.EmployeeId);
// employeeDetailsForInsuranceObj.InsuranceEmployeeInformationId = employeeInfoObject.Id;
// employeeDetailsForInsuranceObj.EmployeeId = employeeInfoObject.EmployeeId;
// employeeDetailsForInsuranceObj.FName = employeeInfoObject.FName;
// employeeDetailsForInsuranceObj.LName = employeeInfoObject.LName;
// employeeDetailsForInsuranceObj.FatherName = employeeInfoObject.FatherName;
// employeeDetailsForInsuranceObj.DateOfBirth = employeeInfoObject.DateOfBirth;
// employeeDetailsForInsuranceObj.DateOfIssue = employeeInfoObject.DateOfIssue;
// employeeDetailsForInsuranceObj.DateOfBirthGr = employeeInfoObject.DateOfBirthGr;
// employeeDetailsForInsuranceObj.DateOfIssueGr = employeeInfoObject.DateOfIssueGr;
// employeeDetailsForInsuranceObj.PlaceOfIssue = employeeInfoObject.PlaceOfIssue;
// employeeDetailsForInsuranceObj.IdNumber = employeeInfoObject.IdNumber;
// employeeDetailsForInsuranceObj.Gender = employeeInfoObject.Gender;
// //از جدول پرسنل پر می شود
// employeeDetailsForInsuranceObj.NationalCode = employeeObject.NationalCode; //employeeInfoObject.NationalCode;
// employeeDetailsForInsuranceObj.Nationality = employeeObject.Nationality;
// employeeDetailsForInsuranceObj.InsuranceCode = employeeObject.InsuranceCode; //employeeInfoObject.InsuranceCode;
// }
// else
// {
// // var employeeObject = _employeeRepository.GetDetailsByADDate(item.EmployeeId);
// employeeDetailsForInsuranceObj.InsuranceEmployeeInformationId = 0;
// //employeeDetailsForInsuranceObj.EmployeeInsurancListDataId = 0;
// employeeDetailsForInsuranceObj.EmployeeId = employeeObject.Id;
// employeeDetailsForInsuranceObj.FName = employeeObject.FName;
// employeeDetailsForInsuranceObj.LName = employeeObject.LName;
// employeeDetailsForInsuranceObj.FatherName = employeeObject.FatherName;
// employeeDetailsForInsuranceObj.DateOfBirth = (employeeObject.DateOfBirth == "1300/10/11" ? "" : employeeObject.DateOfBirth);
// employeeDetailsForInsuranceObj.DateOfIssue = employeeObject.DateOfIssue;
// employeeDetailsForInsuranceObj.PlaceOfIssue = employeeObject.PlaceOfIssue;
// employeeDetailsForInsuranceObj.NationalCode = employeeObject.NationalCode;
// employeeDetailsForInsuranceObj.IdNumber = employeeObject.IdNumber;
// employeeDetailsForInsuranceObj.Gender = employeeObject.Gender;
// employeeDetailsForInsuranceObj.InsuranceCode = employeeObject.InsuranceCode;
// employeeDetailsForInsuranceObj.Nationality = employeeObject.Nationality;
// }
// #endregion
// //روزهای کارکرد پرسنل
// #region ComputingWorkingDays
// int startWork = 0;
// int endWork = 0;
// var year = Convert.ToInt32(searchModel.Year);
// var month = Convert.ToInt32(searchModel.Month);
// var day = 1;
// var persianCurrentStartDate = new PersianDateTime(year, month, day);
// var dayMonthCurrent = Convert.ToInt32(endMonthCurrent.Substring(8, 2));
// var persianCurrentEndDate = new PersianDateTime(year, month, dayMonthCurrent);
// //آخرین روز ماه جاری
// var endMonthCurrentDay = Convert.ToInt32(endMonthCurrent.Substring(8, 2));
// var yearStartDateUser = Convert.ToInt32(item.StartWorkDate.Substring(0, 4));
// var monthStartDateUser = Convert.ToInt32(item.StartWorkDate.Substring(5, 2));
// var dayStartDateUser = Convert.ToInt32(item.StartWorkDate.Substring(8, 2));
// var persianStartDateUser = new PersianDateTime(yearStartDateUser, monthStartDateUser, dayStartDateUser);
// if (persianStartDateUser < persianCurrentStartDate)
// employeeDetailsForInsuranceObj.HasStartWorkInMonth = false;
// else
// employeeDetailsForInsuranceObj.HasStartWorkInMonth = true;
// //اگر شروع به کار کاربر از ابتدای ماه جاری کمتر باشد
// if (persianStartDateUser <= persianCurrentStartDate)
// {
// startWork = 1;
// }
// else
// {
// startWork = dayStartDateUser;
// }
// if (!string.IsNullOrEmpty(item.LeftWorkDate))
// {
// var yearEndDateUser = Convert.ToInt32(item.LeftWorkDate.Substring(0, 4));
// var monthEndDateUser = Convert.ToInt32(item.LeftWorkDate.Substring(5, 2));
// var dayEndDateUser = Convert.ToInt32(item.LeftWorkDate.Substring(8, 2));
// var persianLeftDateUser = new PersianDateTime(yearEndDateUser, monthEndDateUser, dayEndDateUser);
// var persianEndDateUser = persianLeftDateUser.AddDays(-1);
// var persianEndDateUserStr = persianLeftDateUser.AddDays(-1).ToString("yyyy/MM/dd");
// //if (persianLeftDateUser <= persianCurrentEndDate)
// // employeeDetailsForInsuranceObj.HasLeftWorkInMonth = true;
// //else
// // employeeDetailsForInsuranceObj.HasLeftWorkInMonth = false;
// //ترک کارش در ماه و سال جاری بود نمایش داده شود
// if (!item.LeftWorkDate.Contains(searchModel.Year + "/" + searchModel.Month))
// {
// employeeDetailsForInsuranceObj.HasLeftWorkInMonth = false;
// item.LeftWorkDate = string.Empty;
// item.LeftWorkDateGr = null;
// }
// else
// {
// employeeDetailsForInsuranceObj.HasLeftWorkInMonth = true;
// }
// //اگر پایان به کار کاربر از پایان ماه جاری بیشتر باشد
// if (persianEndDateUser >= persianCurrentEndDate)
// {
// endWork = endMonthCurrentDay;
// }
// else
// {
// endWork = Convert.ToInt32(persianEndDateUserStr.Substring(8, 2));
// }
// }
// else
// {
// employeeDetailsForInsuranceObj.HasLeftWorkInMonth = false;
// endWork = endMonthCurrentDay;
// }
// int countWorkingDays = 0;
// for (int i = startWork; i <= endWork; i++)
// {
// countWorkingDays = countWorkingDays + 1;
// }
// //farokhiChanges
// //روزهای کارکرد پرسنل با آی دی های زیر دستی تعریف شد
// switch (item.EmployeeId)
// {
// //case 3812://ثابت- کسری حاجی پور
// // countWorkingDays = 15;
// // break;
// case 40463://ثابت
// countWorkingDays = 10;
// break;
// case 40469://ثابت
// countWorkingDays = 7;
// break;
// case 9950://ثابت
// countWorkingDays = 15;
// break;
// case 9640://ثابت
// countWorkingDays = 15;
// break;
// case 40998://ثابت
// countWorkingDays = 15;
// break;
// case 6219://ثابت
// countWorkingDays = 15;
// break;
// //case 7897://ثابت
// // countWorkingDays = 15;
// break;
// }
// #endregion
// employeeDetailsForInsuranceObj.IncludeStatus = item.IncludeStatus;
//if (searchModel.TypeOfInsuranceSendWorkshop == "Govermentlist" && item.JobId==10)//کمک دولت
//{employeeDetailsForInsuranceObj.InsuranceShare = 0;}
// #region InsuranceJob
// double dailyWage = employeeDetailsForInsuranceObj.DailyWage;
// if (searchModel.FixedSalary)
// {
// dailyWage = Convert.ToDouble(GetDailyWageFixedSalary(searchModel.Year, workshopId, item.EmployeeId, model.StartDateGr, model.EndDateGr, item.JobId, searchModel.Population, searchModel.InsuranceJobId));
// employeeDetailsForInsuranceObj.HasConfilictJobs = (dailyWage == 0 ? true : false);
// }
// #endregion
// if (yearlysaleries != null)
// {
// if (!searchModel.FixedSalary)
// {
// //dailyWage= yearlysalaryItem.ItemValue;
// dailyWage = ComputeDailyWage(yearlysaleries.DayliWage, item.EmployeeId, workshopId, searchModel.Year);
// //(double basic, int totalYears) basicResult = BasicYear(item.EmployeeId, workshopId, startDate);
// //var basic = basicResult.basic;
// //if (basicResult.totalYears > 0)
// //{
// // monthlybaseYear = GetMonthlyBaseYear(basicResult.basic, countWorkingDays);
// //}
// }
// employeeDetailsForInsuranceObj.DailyWage = GetRoundValue(dailyWage);
// employeeDetailsForInsuranceObj.BaseYears = 0;
// employeeDetailsForInsuranceObj.DailyWageStr = employeeDetailsForInsuranceObj.DailyWage.ToMoney();
// employeeDetailsForInsuranceObj.DailyWagePlusBaseYears = 0;
// employeeDetailsForInsuranceObj.MonthlySalary = GetRoundValue(dailyWage * countWorkingDays);
// employeeDetailsForInsuranceObj.HousingAllowance = yearlysaleries.HousingAllowance;
// employeeDetailsForInsuranceObj.ConsumableItems = yearlysaleries.ConsumableItems;
// employeeDetailsForInsuranceObj.EndMonthCurrentDay = endMonthCurrentDay;
// employeeDetailsForInsuranceObj.YearlySalaryItem = yearlysaleries.DayliWage;
// employeeDetailsForInsuranceObj.MonthlyBaseYearsStr = monthlybaseYear.ToMoney();
var unEmploymentInsurance =(employeeDetailsForInsuranceObj.BenefitsIncludedContinuous * 3) / 100;
employeeDetailsForInsuranceObj.UnEmploymentInsurance = GetRoundValue(unEmploymentInsurance);
employeeDetailsForInsuranceObj.BenefitsIncludedNonContinuous = employeeDetailsForInsuranceObj.BenefitsIncludedNonContinuous;
employeeDetailsForInsuranceObj.IncludedAndNotIncluded = employeeDetailsForInsuranceObj.BenefitsIncludedNonContinuous + employeeDetailsForInsuranceObj.BenefitsIncludedContinuous;
// employeeDetailsForInsuranceObj.MarriedAllowance = 0;
}
// if (item.IncludeStatus)
// {
// var marital = employeeObject.MaritalStatus == "متاهل" ? yearlysaleries.MarriedAllowance : 0;
// employeeDetailsForInsuranceObj.MonthlyBenefits = GetMonthlyBenefits(endMonthCurrentDay, yearlysaleries.ConsumableItems, yearlysaleries.HousingAllowance, marital, countWorkingDays, searchModel.TypeOfInsuranceSendWorkshop, item.JobId, item.EmployeeId);
// }
// else
// {
// employeeDetailsForInsuranceObj.MonthlyBenefits = 0;
// }
employeeDetailsForInsuranceObj.StartMonthCurrent = startMonthCurrent;
employeeDetailsForInsuranceObj.WorkingDays = countWorkingDays;
employeeDetailsForInsuranceObj.StartWorkDate = item.StartWorkDate;
employeeDetailsForInsuranceObj.LeftWorkDate = item.LeftWorkDate;
employeeDetailsForInsuranceObj.JobId = item.JobId;
employeeDetailsForInsuranceObj.JobName = item.JobName;
employeeDetailsForInsuranceObj.JobCode = item.JobCode;
if (!string.IsNullOrWhiteSpace(item.LeftWorkDate))
employeeDetailsForInsuranceObj.LeftWorkDateGr = item.LeftWorkDateGr;
// if (searchModel.TypeOfInsuranceSendWorkshop == "Govermentlist" && item.JobId == 10) //کمک دولت
// {
// employeeDetailsForInsuranceObj.MonthlyBenefits = 0;
// }
// //farokhiChanges
// if (item.EmployeeId == 42783)
// employeeDetailsForInsuranceObj.MonthlyBenefits = 53082855;
employeeDetailsForInsuranceObj.StartWorkDateGr = item.StartWorkDateGr;
//farokhiChanges
if (item.EmployeeId == 42783)
employeeDetailsForInsuranceObj.MonthlyBenefits = 53082855;
// employeeDetailsForInsuranceObj.BenefitsIncludedContinuous = employeeDetailsForInsuranceObj.MonthlyBenefits + employeeDetailsForInsuranceObj.MonthlySalary;
list.Add(employeeDetailsForInsuranceObj);
}
list = list.OrderByDescending(x => x.HasLeftWorkInMonth).ThenByDescending(x => x.HasStartWorkInMonth)
// //حق بیمه سهم بیمه شده
// var insuranceShare = (employeeDetailsForInsuranceObj.BenefitsIncludedContinuous * 7) / 100;
// employeeDetailsForInsuranceObj.InsuranceShare = GetRoundValue(insuranceShare); //Math.Round(insuranceShare, MidpointRounding.ToPositiveInfinity);
// //حق بیمه سهم کارفرما
// var employerShare = (employeeDetailsForInsuranceObj.BenefitsIncludedContinuous * 20) / 100;
// employeeDetailsForInsuranceObj.EmployerShare = GetRoundValue(employerShare); //Math.Round(employerShare, MidpointRounding.ToPositiveInfinity);
// //if (searchModel.TypeOfInsuranceSendWorkshop == "Govermentlist" && item.JobId==10)//کمک دولت
// //{employeeDetailsForInsuranceObj.InsuranceShare = 0;}
// var unEmploymentInsurance = (employeeDetailsForInsuranceObj.BenefitsIncludedContinuous * 3) / 100;
// employeeDetailsForInsuranceObj.UnEmploymentInsurance = GetRoundValue(unEmploymentInsurance);
// employeeDetailsForInsuranceObj.BenefitsIncludedNonContinuous = employeeDetailsForInsuranceObj.BenefitsIncludedNonContinuous;
// employeeDetailsForInsuranceObj.IncludedAndNotIncluded = employeeDetailsForInsuranceObj.BenefitsIncludedNonContinuous + employeeDetailsForInsuranceObj.BenefitsIncludedContinuous;
// }
// employeeDetailsForInsuranceObj.StartMonthCurrent = startMonthCurrent;
// employeeDetailsForInsuranceObj.WorkingDays = countWorkingDays;
// employeeDetailsForInsuranceObj.StartWorkDate = item.StartWorkDate;
// employeeDetailsForInsuranceObj.LeftWorkDate = item.LeftWorkDate;
// employeeDetailsForInsuranceObj.JobId = item.JobId;
// employeeDetailsForInsuranceObj.JobName = item.JobName;
// employeeDetailsForInsuranceObj.JobCode = item.JobCode;
// if (!string.IsNullOrWhiteSpace(item.LeftWorkDate))
// employeeDetailsForInsuranceObj.LeftWorkDateGr = item.LeftWorkDateGr;
// employeeDetailsForInsuranceObj.StartWorkDateGr = item.StartWorkDateGr;
// //farokhiChanges
// if (item.EmployeeId == 42783)
// employeeDetailsForInsuranceObj.MonthlyBenefits = 53082855;
// list.Add(employeeDetailsForInsuranceObj);
//}
//result.EmployeeDetailsForInsuranceList = list.OrderByDescending(x => x.HasLeftWorkInMonth).ThenByDescending(x => x.HasStartWorkInMonth)
// .ThenBy(x => x.LName).ToList();
#endregion
result.EmployeeDetailsForInsuranceList = computeResult.OrderByDescending(x => x.HasLeftWorkInMonth).ThenByDescending(x => x.HasStartWorkInMonth)
.ThenBy(x => x.LName).ToList();
result.EmployeeDetailsForInsuranceList = list;
Console.WriteLine("ToList compute : " + watch.Elapsed);
result.IsExist = false;
result.IsBlock = isBolock;
result.MaritalStatus = yearlysaleries.MarriedAllowance;
Console.WriteLine("old heydari compute : " + watch.Elapsed);
}
}
else
{
result.IsExist = true;
@@ -1195,7 +1304,7 @@ public class InsuranceListApplication: IInsuranceListApplication
if (item.IncludeStatus)
{
var marital = employeeObject.MaritalStatus == "متاهل" ? maritalStatus.ItemValue : 0;
item.MonthlyBenefits = GetMonthlyBenefits(dayMonthCurrent, consumableItems.ItemValue, housingAllowance.ItemValue, marital, countWorkingDays);
item.MonthlyBenefits = GetMonthlyBenefits(dayMonthCurrent, consumableItems.ItemValue, housingAllowance.ItemValue, marital, countWorkingDays, searchModel.TypeOfInsuranceSendWorkshop, item.JobId, item.EmployeeId);
}
else
{
@@ -1349,8 +1458,27 @@ public class InsuranceListApplication: IInsuranceListApplication
return result;
}
private double GetMonthlyBenefits(int endMonthCurrentDay, double consumableItemsItemValue, double housingAllowanceItemValue,double maritalStatus, int countWorkingDays)
/// <summary>
/// محاسبه مزایای ماهانه
/// </summary>
/// <param name="endMonthCurrentDay"></param>
/// <param name="consumableItemsItemValue"></param>
/// <param name="housingAllowanceItemValue"></param>
/// <param name="maritalStatus"></param>
/// <param name="countWorkingDays"></param>
/// <param name="typeOfInsuranceSendWorkshop"></param>
/// <param name="jobId"></param>
/// <param name="employeeId"></param>
/// <returns></returns>
private double GetMonthlyBenefits(int endMonthCurrentDay, double consumableItemsItemValue, double housingAllowanceItemValue,double maritalStatus, int countWorkingDays, string typeOfInsuranceSendWorkshop, long jobId,long employeeId)
{
//اگر پرسنل کارفرما بود و نوع لیست کارگاه کمک دولت بود مزایا محاسبه نشود
if (typeOfInsuranceSendWorkshop == "Govermentlist" && jobId == 10)
return 0;
//پرسنل استثناء
if (employeeId == 42783)
return 53082855;
//مزایای ماهانه با توجه به پایان ماه که 30 یا 31 روزه است، متفاوت می باشد
//برای ماه 29 روزه هم تقسیم بر 30 می شود.
if (countWorkingDays == endMonthCurrentDay)
@@ -1378,6 +1506,8 @@ public class InsuranceListApplication: IInsuranceListApplication
dailyWage=employeeInsurancListData.DailyWage;
}
}
dailyWage = employeeId == 6536 ? 9399512 : dailyWage;
return dailyWage;
}
public MainEmployeeDetailsViewModel GetEmployeeForInsuranceList(List<LeftWorkInsuranceViewModel> leftWorkInsuranceViewModelList, EmployeeForEditInsuranceListSearchModel searchModel)
@@ -1608,7 +1738,7 @@ public class InsuranceListApplication: IInsuranceListApplication
if (item.IncludeStatus)
{
var marital = employeeObject.MaritalStatus == "متاهل" ? maritalStatus.ItemValue : 0;
employeeDetailsForInsuranceObj.MonthlyBenefits = GetMonthlyBenefits(endMonthCurrentDay, consumableItems.ItemValue, housingAllowance.ItemValue, marital, countWorkingDays);
employeeDetailsForInsuranceObj.MonthlyBenefits = GetMonthlyBenefits(endMonthCurrentDay, consumableItems.ItemValue, housingAllowance.ItemValue, marital, countWorkingDays, searchModel.TypeOfInsuranceSendWorkshop, item.JobId, item.EmployeeId);
}
else
{

View File

@@ -2,12 +2,14 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text.RegularExpressions;
using _0_Framework.Application;
using _0_Framework.InfraStructure;
using Company.Domain.EmployeeChildrenAgg;
using Company.Domain.EmployeeInsurancListDataAgg;
using Company.Domain.InsuranceListAgg;
using Company.Domain.InsuranceWorkshopAgg;
using Company.Domain.InsuranceYearlySalaryAgg;
using Company.Domain.InsurancWorkshopInfoAgg;
using CompanyManagment.App.Contracts.EmployeeInsurancListData;
using CompanyManagment.App.Contracts.InsuranceList;
@@ -15,6 +17,7 @@ using CompanyManagment.App.Contracts.InsuranceWorkshopInfo;
using CompanyManagment.App.Contracts.PersonalContractingParty;
using Microsoft.EntityFrameworkCore;
using Microsoft.Identity.Client;
using PersianTools.Core;
namespace CompanyManagment.EFCore.Repository;
@@ -27,7 +30,8 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
private readonly IInsuranceWorkshopInfoRepository _insuranceWorkshopInfoRepository;
private readonly IAuthHelper _authHelper;
private readonly IPersonalContractingPartyApp _contractingPartyApp;
public InsuranceListRepository(CompanyContext context, IEmployeeInsurancListDataRepository employeeInsurancListDataRepository, IInsuranceListWorkshopRepository insuranceListWorkshopRepository , IInsuranceWorkshopInfoRepository insuranceWorkshopInfoRepository, IAuthHelper authHelper, IPersonalContractingPartyApp contractingPartyApp) : base(context)
private readonly IInsuranceYearlySalaryRepository _insuranceYearlySalaryRepository;
public InsuranceListRepository(CompanyContext context, IEmployeeInsurancListDataRepository employeeInsurancListDataRepository, IInsuranceListWorkshopRepository insuranceListWorkshopRepository , IInsuranceWorkshopInfoRepository insuranceWorkshopInfoRepository, IAuthHelper authHelper, IPersonalContractingPartyApp contractingPartyApp, IInsuranceYearlySalaryRepository insuranceYearlySalaryRepository) : base(context)
{
_context = context;
_employeeInsurancListDataRepository = employeeInsurancListDataRepository;
@@ -35,6 +39,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
_insuranceWorkshopInfoRepository = insuranceWorkshopInfoRepository;
_authHelper = authHelper;
_contractingPartyApp = contractingPartyApp;
_insuranceYearlySalaryRepository = insuranceYearlySalaryRepository;
}
public OperationResult CreateInsuranceListworkshop(long id, List<long> workshopIds)
{
@@ -1178,13 +1183,53 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
#endregion
public (int insuranceHistoryYearsCount, double baseYear) GetEmployeeInsuranceBaseYear(long employeeId, long workshopId, int countWorkingDay,DateTime listStartDate, DateTime endDate)
public (int insuranceHistoryYearsCount, double baseYear) GetEmployeeInsuranceBaseYear(long employeeId, long workshopId, int countWorkingDay,DateTime listStartDate, DateTime listEndDate, DateTime startWorkDate, DateTime leftDate, bool hasLeft)
{
var lefts = _context.LeftWorkInsuranceList
.Where(x => x.EmployeeId == employeeId);
.Where(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId).Select(x=> new
{
startWork = x.StartWorkDate,
leftWork = x.LeftWorkDate == null ? listEndDate : x.LeftWorkDate.Value,
}).OrderBy(x=>x.startWork).ToList();
int countDay = 0;
foreach (var left in lefts)
{
var start = left.startWork.ToPersianDateTime();
var end = left.leftWork.ToPersianDateTime();
var count = (int)(end - start).TotalDays +1;
countDay += count;
}
return (0, 0);
if (countDay < 365)
return (0, 0);
//تعداد سال های سابقه بیمه
int yearsCount = countDay / 365;
//بدست آوردن مزد سنوات بر اساس سابقه به سال
var baseYear = _insuranceYearlySalaryRepository.GetBaseYearByDate(listStartDate, yearsCount);
if(baseYear == 0)
return (0, 0);
//اگر ترک کار کرده بود
//یا
//شروع به کارش بعد از یکم ماه بود
if (hasLeft || listStartDate < startWorkDate)
{
//تعداد روزهای ماه در این لیست بیمه
var monthDayCont = (int)(listEndDate - listStartDate).TotalDays + 1;
//پایه سنوات به ازای هر روز
var baseyarPerDay = baseYear / monthDayCont;
// پایه سنوات یک روز ضرب در روزهای کارکرد در ماه
baseYear = baseyarPerDay * countWorkingDay;
}
return (yearsCount, baseYear);
}
}

View File

@@ -1,7 +1,7 @@
@using _0_Framework.Application
@model CompanyManagment.App.Contracts.InsuranceList.MainEmployeeDetailsViewModel
@{
<style>
<style>
.firstCheckAlert {
background-color: #f06b31;
animation: color-change 800ms linear infinite;
@@ -25,198 +25,206 @@
}
}
</style>
}
<input type="hidden" id="maritalStatusErr" name="maritalStatusErr"/>
<input type="hidden" id="maritalStatusVal" value="@Model.MaritalStatus" asp-for="@Model.MaritalStatus"/>
@if (Model.EmployeeDetailsForInsuranceList != null)
{
var index = 1;
var index = 1;
if (Model.EmployeeDetailsForInsuranceList.Any(x => !x.IsMaritalStatusSet))
{
<script>
if (Model.EmployeeDetailsForInsuranceList.Any(x => !x.IsMaritalStatusSet))
{
<script>
$('#maritalStatusErr').val(true);
</script>
<table id="DSKWOR" class="table table-bordered table-striped dataTable" style="min-width: 473px;">
<colgroup>
$('#maritalStatusErr').val(true);
</script>
<table id="DSKWOR" class="table table-bordered table-striped dataTable" style="min-width: 473px;">
<colgroup>
<col class="colgp-4">
<col class="colgp-3">
<col class="colgp-2">
<col class="colgp-1">
</colgroup>
<thead>
<tr>
<th colspan="4">
<col class="colgp-4">
<col class="colgp-3">
<col class="colgp-2">
<col class="colgp-1">
</colgroup>
<thead>
<tr>
<th colspan="4">
<p style="color: red">
ابتدا وضعیت تاهل پرسنل در لیست زیر را مشخص نمایید
</p>
</th>
</tr>
<tr>
<p style="color: red">
ابتدا وضعیت تاهل پرسنل در لیست زیر را مشخص نمایید
</p>
</th>
</tr>
<tr>
<th class="header-style sorting_asc_disabled sorting_desc_disabled"> کدملی </th>
<th class="header-styledit-btn sorting_asc_disabled sorting_desc_disabled"> نام خانوادگی </th>
<th class="header-style sorting_asc_disabled sorting_desc_disabled"> نام </th>
<th class="header-style sorting_asc_disabled sorting_desc_disabled">#</th>
<th class="header-style sorting_asc_disabled sorting_desc_disabled"> کدملی </th>
<th class="header-styledit-btn sorting_asc_disabled sorting_desc_disabled"> نام خانوادگی </th>
<th class="header-style sorting_asc_disabled sorting_desc_disabled"> نام </th>
<th class="header-style sorting_asc_disabled sorting_desc_disabled">#</th>
</tr>
</tr>
</thead>
</thead>
<tbody>
@foreach (var item in Model.EmployeeDetailsForInsuranceList)
{
if (!item.IsMaritalStatusSet)
{
<tr>
<tbody>
@foreach (var item in Model.EmployeeDetailsForInsuranceList)
{
if (!item.IsMaritalStatusSet)
{
<tr>
<td class="td-ellipsis @(item.Nationality == "ایرانی" ? "emptyTR" : "")">@item.NationalCode</td>
<td class="td-ellipsis emptyTR">@item.LName</td>
<td class="td-ellipsis emptyTR">@item.FName</td>
<td class="td-ellipsis ">@index</td>
</tr>
index++;
}
}
<td class="td-ellipsis @(item.Nationality == "ایرانی" ? "emptyTR" : "")">@item.NationalCode</td>
<td class="td-ellipsis emptyTR">@item.LName</td>
<td class="td-ellipsis emptyTR">@item.FName</td>
<td class="td-ellipsis ">@index</td>
</tr>
index++;
}
}
</tbody>
</table>
}
else
{
<script>
</tbody>
</table>
}
else
{
<script>
$('#maritalStatusErr').val(false);
</script>
}
$('#maritalStatusErr').val(false);
</script>
}
<div class="col-md-6 @(Model.EmployeeDetailsForInsuranceList.Any(x => !x.IsMaritalStatusSet) ? "hideDataTable" : "")" style="float: left; ">
<button id="btnPrint" type="button" class="btn btn-success btn-rounded waves-effect waves-light" style="float: left">پرینت </button>
</div>
<table id="DSKWOR-datatable" class="table table-bordered table-striped dataTable @(Model.EmployeeDetailsForInsuranceList.Any(x => !x.IsMaritalStatusSet) ? "hideDataTable" : "")">
<colgroup>
<col class="colgp-21">
<col class="colgp-20">
<col class="colgp-19">
<col class="colgp-18">
<col class="colgp-17">
<col class="colgp-16">
<col class="colgp-15">
<col class="colgp-14">
<col class="colgp-13">
<col class="colgp-12">
<col class="colgp-11">
<col class="colgp-10">
<col class="colgp-9">
<col class="colgp-8">
<col class="colgp-7">
<col class="colgp-6">
<col class="colgp-5">
<col class="colgp-4">
<col class="colgp-3">
<col class="colgp-2">
<col class="colgp-1">
</colgroup>
<thead>
<tr>
<th class="sorting_asc_disabled sorting_desc_disabled"></th>
<th class="header-style small-font sorting_asc_disabled sorting_desc_disabled"> تاریخ ترک کار </th>
<th class="header-style small-font sorting_asc_disabled sorting_desc_disabled">تاریخ آغاز بکار </th>
<th class="header-style small-font sorting_asc_disabled sorting_desc_disabled"> شغل</th>
<th class="header-style small-font sorting_asc_disabled sorting_desc_disabled"> حق بیمه سهم بیمه شده </th>
<th class="header-style small-font sorting_asc_disabled sorting_desc_disabled"> حقوق و مزایای ماهیانه مشمول و غیر مشمول </th>
<th class="header-style small-font sorting_asc_disabled sorting_desc_disabled"> حقوق و مزایای ماهیانه مشمول </th>
<th class="header-style small-font sorting_asc_disabled sorting_desc_disabled"> مزایای ماهیانه مشمول </th>
<th class="header-style small-font sorting_asc_disabled sorting_desc_disabled"> حقوق ماهیانه مشمول </th>
<th class="header-style small-font sorting_asc_disabled sorting_desc_disabled"> دستمزد روزانه </th>
<th class="header-style small-font sorting_asc_disabled sorting_desc_disabled"> روزهای کارکرد </th>
<th class="header-style sorting_asc_disabled sorting_desc_disabled"> ش شناسنامه </th>
<th class="header-style sorting_asc_disabled sorting_desc_disabled"> تاریخ تولد </th>
<th class="header-style sorting_asc_disabled sorting_desc_disabled"> محل صدور </th>
<th class="header-style sorting_asc_disabled sorting_desc_disabled"> کدملی </th>
<th class="header-style sorting_asc_disabled sorting_desc_disabled"> نام پدر </th>
<th class="header-style small-font sorting_asc_disabled sorting_desc_disabled"> جنسیت </th>
<th class="header-styledit-btn sorting_asc_disabled sorting_desc_disabled"> نام خانوادگی </th>
<th class="header-style sorting_asc_disabled sorting_desc_disabled"> نام </th>
<th class="header-style sorting_asc_disabled sorting_desc_disabled"> شماره بیمه </th>
<th class="header-style sorting_asc_disabled sorting_desc_disabled">#</th>
</tr>
</thead>
<tbody>
<div class="col-md-6 @(Model.EmployeeDetailsForInsuranceList.Any(x => !x.IsMaritalStatusSet) ? "hideDataTable" : "")" style="float: left; ">
<button id="btnPrint" type="button" class="btn btn-success btn-rounded waves-effect waves-light" style="float: left">پرینت </button>
</div>
<table id="DSKWOR-datatable" class="table table-bordered table-striped dataTable @(Model.EmployeeDetailsForInsuranceList.Any(x => !x.IsMaritalStatusSet) ? "hideDataTable" : "")">
<colgroup>
<col class="colgp-23">
<col class="colgp-22">
<col class="colgp-21">
<col class="colgp-20">
<col class="colgp-19">
<col class="colgp-18">
<col class="colgp-17">
<col class="colgp-16">
<col class="colgp-15">
<col class="colgp-14">
<col class="colgp-13">
<col class="colgp-12">
<col class="colgp-11">
<col class="colgp-10">
<col class="colgp-9">
<col class="colgp-8">
<col class="colgp-7">
<col class="colgp-6">
<col class="colgp-5">
<col class="colgp-4">
<col class="colgp-3">
<col class="colgp-2">
<col class="colgp-1">
</colgroup>
<thead>
<tr>
<th class="sorting_asc_disabled sorting_desc_disabled"></th>
<th class="header-style small-font sorting_asc_disabled sorting_desc_disabled"> تاریخ ترک کار </th>
<th class="header-style small-font sorting_asc_disabled sorting_desc_disabled">تاریخ آغاز بکار </th>
<th class="header-style small-font sorting_asc_disabled sorting_desc_disabled"> شغل</th>
<th class="header-style small-font sorting_asc_disabled sorting_desc_disabled"> حق بیمه سهم بیمه شده </th>
<th class="header-style small-font sorting_asc_disabled sorting_desc_disabled"> حقوق و مزایای ماهیانه مشمول و غیر مشمول </th>
<th class="header-style small-font sorting_asc_disabled sorting_desc_disabled"> حقوق و مزایای ماهیانه مشمول </th>
<th class="header-style small-font sorting_asc_disabled sorting_desc_disabled"> مزایای ماهیانه مشمول </th>
<th class="header-style small-font sorting_asc_disabled sorting_desc_disabled"> حقوق ماهیانه مشمول </th>
<th class="header-style small-font sorting_asc_disabled sorting_desc_disabled"> حق تاهل </th>
<th class="header-style small-font sorting_asc_disabled sorting_desc_disabled"> پایه سنوات روزانه</th>
<th class="header-style small-font sorting_asc_disabled sorting_desc_disabled"> دستمزد روزانه </th>
<th class="header-style small-font sorting_asc_disabled sorting_desc_disabled"> روزهای کارکرد </th>
<th class="header-style sorting_asc_disabled sorting_desc_disabled"> ش شناسنامه </th>
<th class="header-style sorting_asc_disabled sorting_desc_disabled"> تاریخ تولد </th>
<th class="header-style sorting_asc_disabled sorting_desc_disabled"> محل صدور </th>
<th class="header-style sorting_asc_disabled sorting_desc_disabled"> کدملی </th>
<th class="header-style sorting_asc_disabled sorting_desc_disabled"> نام پدر </th>
<th class="header-style small-font sorting_asc_disabled sorting_desc_disabled"> جنسیت </th>
<th class="header-styledit-btn sorting_asc_disabled sorting_desc_disabled"> نام خانوادگی </th>
<th class="header-style sorting_asc_disabled sorting_desc_disabled"> نام </th>
<th class="header-style sorting_asc_disabled sorting_desc_disabled"> شماره بیمه </th>
<th class="header-style sorting_asc_disabled sorting_desc_disabled">#</th>
</tr>
</thead>
<tbody>
@foreach (var item in Model.EmployeeDetailsForInsuranceList)
{
if (item.LeftWorkDate == item.StartMonthCurrent)
{
<tr data-hasconfilictjobs="@item.HasConfilictJobs" data-nationality="@item.Nationality" data-yearlySalaryItem="@item.YearlySalaryItem" data-IncludeStatus="@Convert.ToInt32(item.IncludeStatus)" class="leftwork" data-employeeId="@item.EmployeeId" data-insuranceEmployeeInformationId="@item.InsuranceEmployeeInformationId" data-DateOfIssue="@item.DateOfIssue">
<td>
<i onclick="editList(this)" class="fa fa-edit edit-btn"></i>
@* <a permission="10418" onclick="OpenLeftWorkInsurance(@item.EmployeeId,'@(item.FName +" "+item.LName)')" >
@foreach (var item in Model.EmployeeDetailsForInsuranceList)
{
if (item.LeftWorkDate == item.StartMonthCurrent)
{
<tr data-hasconfilictjobs="@item.HasConfilictJobs" data-nationality="@item.Nationality" data-yearlySalaryItem="@item.YearlySalaryItem" data-IncludeStatus="@Convert.ToInt32(item.IncludeStatus)" class="leftwork" data-employeeId="@item.EmployeeId" data-insuranceEmployeeInformationId="@item.InsuranceEmployeeInformationId" data-DateOfIssue="@item.DateOfIssue">
<td>
<i onclick="editList(this)" class="fa fa-edit edit-btn"></i>
@* <a permission="10418" onclick="OpenLeftWorkInsurance(@item.EmployeeId,'@(item.FName +" "+item.LName)')" >
<i class="fa faSize fa-sign-out"></i>
</a>*@
</td>
<td data-LeftWorkDate="@item.LeftWorkDateGr" class="small-font td-ellipsis ">@item.LeftWorkDate</td>
<td data-StartWorkDate="@item.StartWorkDateGr" class="small-font td-ellipsis emptyTR">@item.StartWorkDate</td>
<td data-Id="@item.JobId" data-jobcode="@item.JobCode" class="@(item.HasConfilictJobs && item.JobId != 10 ? "blink" : "") small-font td-ellipsis emptyTR" id="JobName">@item.JobName</td>
<td data-InsuranceShare="0" data-EmployerShare="0" data-UnemploymentInsurance="0" class="small-font td-ellipsis emptyTR">0</td>
<td data-IncludedAndNotIncluded="0" data-BenefitsIncludedNonContinuous="0" class="small-font td-ellipsis emptyTR">0 </td>
<td data-BenefitsIncludedContinuous="0" class="small-font td-ellipsis emptyTR">0 </td>
<td data-MonthlyBenefits="0" class="small-font td-ellipsis emptyTR">0 </td>
<td data-MonthlySalary="0" class="small-font td-ellipsis emptyTR">0</td>
<td data-DailyWage="0" class="small-font td-ellipsis emptyTR">0</td>
<td data-EndMonthCurrentDay="@item.EndMonthCurrentDay" data-OldWorkingDays="0" data-HousingAllowance="@item.HousingAllowance" data-ConsumableItems="@item.ConsumableItems" class="small-font td-ellipsis emptyTR">0</td>
<td class="td-ellipsis emptyTR">@item.IdNumber</td>
<td class="td-ellipsis emptyTR">@item.DateOfBirth</td>
<td class="td-ellipsis emptyTR">@item.PlaceOfIssue</td>
<td class="td-ellipsis @(item.Nationality == "ایرانی" ? "emptyTR" : "")">@item.NationalCode</td>
<td class="td-ellipsis emptyTR">@item.FatherName</td>
<td class="small-font td-ellipsis emptyTR">@item.Gender</td>
<td class="td-ellipsis emptyTR">@item.LName</td>
<td class="td-ellipsis emptyTR">@item.FName</td>
<td class="td-ellipsis emptyTR">@item.InsuranceCode</td>
<td class="td-ellipsis ">@index</td>
</tr>
}
else
{
<tr data-hasconfilictjobs="@item.HasConfilictJobs" data-nationality="@item.Nationality" data-yearlySalaryItem="@item.YearlySalaryItem" data-IncludeStatus="@Convert.ToInt32(item.IncludeStatus)" class="@(item.HasLeftWorkInMonth ? "leftwork" : item.HasStartWorkInMonth ? "startwork" : "")" ondblclick="rowdbClick(this)" data-employeeId="@item.EmployeeId" data-insuranceEmployeeInformationId="@item.InsuranceEmployeeInformationId" data-DateOfIssue="@item.DateOfIssue">
<td>
<i onclick="editList(this)" class="fa fa-edit edit-btn"></i>
@* <a permission="10418" onclick="OpenLeftWorkInsurance(@item.EmployeeId,'@(item.FName +" "+item.LName)')" >
</td>
<td data-LeftWorkDate="@item.LeftWorkDateGr" class="small-font td-ellipsis ">@item.LeftWorkDate</td>
<td data-StartWorkDate="@item.StartWorkDateGr" class="small-font td-ellipsis emptyTR">@item.StartWorkDate</td>
<td data-Id="@item.JobId" data-jobcode="@item.JobCode" class="@(item.HasConfilictJobs && item.JobId != 10 ? "blink" : "") small-font td-ellipsis emptyTR" id="JobName">@item.JobName</td>
<td data-InsuranceShare="0" data-EmployerShare="0" data-UnemploymentInsurance="0" class="small-font td-ellipsis emptyTR">0</td>
<td data-IncludedAndNotIncluded="0" data-BenefitsIncludedNonContinuous="0" class="small-font td-ellipsis emptyTR">0 </td>
<td data-BenefitsIncludedContinuous="0" class="small-font td-ellipsis emptyTR">0 </td>
<td data-MonthlyBenefits="0" class="small-font td-ellipsis emptyTR">0 </td>
<td data-MonthlySalary="0" class="small-font td-ellipsis emptyTR">0</td>
<td data-MarriedAllowance="0" class="small-font td-ellipsis emptyTR">0</td>
<td data-BaseYears="0" class="small-font td-ellipsis emptyTR">0</td>
<td data-DailyWage="0" class="small-font td-ellipsis emptyTR">0</td>
<td data-EndMonthCurrentDay="@item.EndMonthCurrentDay" data-OldWorkingDays="0" data-HousingAllowance="@item.HousingAllowance" data-ConsumableItems="@item.ConsumableItems" class="small-font td-ellipsis emptyTR">0</td>
<td class="td-ellipsis emptyTR">@item.IdNumber</td>
<td class="td-ellipsis emptyTR">@item.DateOfBirth</td>
<td class="td-ellipsis emptyTR">@item.PlaceOfIssue</td>
<td class="td-ellipsis @(item.Nationality == "ایرانی" ? "emptyTR" : "")">@item.NationalCode</td>
<td class="td-ellipsis emptyTR">@item.FatherName</td>
<td class="small-font td-ellipsis emptyTR">@item.Gender</td>
<td class="td-ellipsis emptyTR">@item.LName</td>
<td class="td-ellipsis emptyTR">@item.FName</td>
<td class="td-ellipsis emptyTR">@item.InsuranceCode</td>
<td class="td-ellipsis ">@index</td>
</tr>
}
else
{
<tr data-hasconfilictjobs="@item.HasConfilictJobs" data-nationality="@item.Nationality" data-yearlySalaryItem="@item.YearlySalaryItem" data-IncludeStatus="@Convert.ToInt32(item.IncludeStatus)" class="@(item.HasLeftWorkInMonth ? "leftwork" : item.HasStartWorkInMonth ? "startwork" : "")" ondblclick="rowdbClick(this)" data-employeeId="@item.EmployeeId" data-insuranceEmployeeInformationId="@item.InsuranceEmployeeInformationId" data-DateOfIssue="@item.DateOfIssue">
<td>
<i onclick="editList(this)" class="fa fa-edit edit-btn"></i>
@* <a permission="10418" onclick="OpenLeftWorkInsurance(@item.EmployeeId,'@(item.FName +" "+item.LName)')" >
<i class="fa faSize fa-sign-out"></i>
</a>*@
</td>
<td data-LeftWorkDate="@item.LeftWorkDateGr" class="small-font td-ellipsis ">@item.LeftWorkDate</td>
<td data-StartWorkDate="@item.StartWorkDateGr" class="small-font td-ellipsis emptyTR">@item.StartWorkDate</td>
<td data-Id="@item.JobId" data-jobcode="@item.JobCode" class="@(item.HasConfilictJobs && item.JobId != 10 ? "blink" : "") small-font td-ellipsis emptyTR jobName">@item.JobName</td>
<td data-InsuranceShare="@item.InsuranceShare" data-EmployerShare="@item.EmployerShare" data-UnemploymentInsurance="@item.UnEmploymentInsurance" class="small-font td-ellipsis emptyTR">@item.InsuranceShare.ToMoney()</td>
<td data-IncludedAndNotIncluded="@item.IncludedAndNotIncluded" data-BenefitsIncludedNonContinuous="@item.BenefitsIncludedNonContinuous" class="small-font td-ellipsis emptyTR">@item.IncludedAndNotIncluded.ToMoney() </td>
<td data-BenefitsIncludedContinuous="@item.BenefitsIncludedContinuous" class="small-font td-ellipsis emptyTR">@item.BenefitsIncludedContinuous.ToMoney() </td>
<td data-MonthlyBenefits="@item.MonthlyBenefits" class="small-font td-ellipsis emptyTR">@item.MonthlyBenefits.ToMoney() </td>
<td data-MonthlySalary="@(item.HasConfilictJobs ? 0 : item.MonthlySalary)" class="small-font td-ellipsis emptyTR">@(item.HasConfilictJobs ? "" : item.MonthlySalary.ToMoney())</td>
<td data-DailyWage="@(item.HasConfilictJobs ? 0 : item.DailyWage)" class="small-font td-ellipsis emptyTR">@(item.HasConfilictJobs ? "" : item.DailyWageStr)</td>
<td data-EndMonthCurrentDay="@item.EndMonthCurrentDay" data-OldWorkingDays="@item.WorkingDays" data-HousingAllowance="@item.HousingAllowance" data-ConsumableItems="@item.ConsumableItems" class="small-font td-ellipsis emptyTR">@item.WorkingDays</td>
<td class="td-ellipsis emptyTR">@item.IdNumber</td>
<td class="td-ellipsis emptyTR">@item.DateOfBirth</td>
<td class="td-ellipsis emptyTR">@item.PlaceOfIssue</td>
<td class="td-ellipsis @(item.Nationality == "ایرانی" ? "emptyTR" : "")">@item.NationalCode</td>
<td class="td-ellipsis emptyTR">@item.FatherName</td>
<td class="small-font td-ellipsis emptyTR">@item.Gender</td>
<td class="td-ellipsis emptyTR">@item.LName</td>
<td class="td-ellipsis emptyTR">@item.FName</td>
<td class="td-ellipsis emptyTR">@item.InsuranceCode</td>
<td class="td-ellipsis ">@index</td>
</tr>
}
index = index + 1;
}
</td>
<td data-LeftWorkDate="@item.LeftWorkDateGr" class="small-font td-ellipsis ">@item.LeftWorkDate</td>
<td data-StartWorkDate="@item.StartWorkDateGr" class="small-font td-ellipsis emptyTR">@item.StartWorkDate</td>
<td data-Id="@item.JobId" data-jobcode="@item.JobCode" class="@(item.HasConfilictJobs && item.JobId != 10 ? "blink" : "") small-font td-ellipsis emptyTR jobName">@item.JobName</td>
<td data-InsuranceShare="@item.InsuranceShare" data-EmployerShare="@item.EmployerShare" data-UnemploymentInsurance="@item.UnEmploymentInsurance" class="small-font td-ellipsis emptyTR">@item.InsuranceShare.ToMoney()</td>
<td data-IncludedAndNotIncluded="@item.IncludedAndNotIncluded" data-BenefitsIncludedNonContinuous="@item.BenefitsIncludedNonContinuous" class="small-font td-ellipsis emptyTR">@item.IncludedAndNotIncluded.ToMoney() </td>
<td data-BenefitsIncludedContinuous="@item.BenefitsIncludedContinuous" class="small-font td-ellipsis emptyTR">@item.BenefitsIncludedContinuous.ToMoney() </td>
<td data-MonthlyBenefits="@item.MonthlyBenefits" class="small-font td-ellipsis emptyTR">@item.MonthlyBenefits.ToMoney() </td>
<td data-MonthlySalary="@(item.HasConfilictJobs ? 0 : item.MonthlySalary)" class="small-font td-ellipsis emptyTR">@(item.HasConfilictJobs ? "" : item.MonthlySalary.ToMoney())</td>
<td data-MarriedAllowance="@item.MarriedAllowance" class="small-font td-ellipsis emptyTR">@item.MarriedAllowance.ToMoney()</td>
<td data-BaseYears="@item.BaseYears" class="small-font td-ellipsis emptyTR">@item.BaseYears.ToMoney()</td>
<td data-DailyWage="@(item.HasConfilictJobs ? 0 : item.DailyWage)" class="small-font td-ellipsis emptyTR">@(item.HasConfilictJobs ? "" : item.DailyWageStr)</td>
<td data-EndMonthCurrentDay="@item.EndMonthCurrentDay" data-OldWorkingDays="@item.WorkingDays" data-HousingAllowance="@item.HousingAllowance" data-ConsumableItems="@item.ConsumableItems" class="small-font td-ellipsis emptyTR">@item.WorkingDays</td>
<td class="td-ellipsis emptyTR">@item.IdNumber</td>
<td class="td-ellipsis emptyTR">@item.DateOfBirth</td>
<td class="td-ellipsis emptyTR">@item.PlaceOfIssue</td>
<td class="td-ellipsis @(item.Nationality == "ایرانی" ? "emptyTR" : "")">@item.NationalCode</td>
<td class="td-ellipsis emptyTR">@item.FatherName</td>
<td class="small-font td-ellipsis emptyTR">@item.Gender</td>
<td class="td-ellipsis emptyTR">@item.LName</td>
<td class="td-ellipsis emptyTR">@item.FName</td>
<td class="td-ellipsis emptyTR">@item.InsuranceCode</td>
<td class="td-ellipsis ">@index</td>
</tr>
}
</tbody>
</table>
index = index + 1;
}
</tbody>
</table>
}
@@ -226,14 +234,14 @@
$(document).ready(function(){
$(".ring").remove();
$('#DSKWOR-datatable').dataTable({
"lengthMenu": [[25, 10, 50, 100, -1], [25, 10, 50, 100, "All"]],
"pageLength": -1, // set the default page length to "All"
"ordering": false
});
$('#DSKWOR-datatable').dataTable({
"lengthMenu": [[25, 10, 50, 100, -1], [25, 10, 50, 100, "All"]],
"pageLength": -1, // set the default page length to "All"
"ordering": false
});
if($('#maritalStatusErr').val() == "true")
{
@@ -268,79 +276,79 @@
});
});
@if (Model != null && Model.IsBlock)
@if (Model != null && Model.IsBlock)
{
<text>
$("#resultExistPersonel").show();
$("#resultExistPersonel").html(' این کارگاه بلاک شده است ');
<text>
$("#resultExistPersonel").show();
$("#resultExistPersonel").html(' این کارگاه بلاک شده است ');
</text>
}
else if (Model != null && Model.IsExist && Model.IsBlock != true)
else if (Model != null && Model.IsExist && Model.IsBlock != true)
{
<text>
$("#resultExistPersonel").show();
$("#Year").addClass("errored");
$("#ddlMonth").addClass("errored");
$("#resultExistPersonel").html('برای این کارگاه در ماه و سال انتخاب شده لیست بیمه تنظیم گردیده است، در صورت نیاز به ثبت این لیست،لیست قبلی را حذف نمایید.');
<text>
$("#resultExistPersonel").show();
$("#Year").addClass("errored");
$("#ddlMonth").addClass("errored");
$("#resultExistPersonel").html('برای این کارگاه در ماه و سال انتخاب شده لیست بیمه تنظیم گردیده است، در صورت نیاز به ثبت این لیست،لیست قبلی را حذف نمایید.');
</text>
}
else
else
{
<text>
$("#resultExistPersonel").hide();
$("#Year").removeClass("errored");
$("#ddlMonth").removeClass("errored");
$("#resultExistPersonel").html('');
document.getElementById("btnPrint").onclick = function () {
printElement(document.getElementById("DSKWOR-datatable"));
};
<text>
$("#resultExistPersonel").hide();
$("#Year").removeClass("errored");
$("#ddlMonth").removeClass("errored");
$("#resultExistPersonel").html('');
document.getElementById("btnPrint").onclick = function () {
printElement(document.getElementById("DSKWOR-datatable"));
};
function printElement(elem) {
var domClone = elem.cloneNode(true);
function printElement(elem) {
var domClone = elem.cloneNode(true);
// create a new stylesheet to hide everything except the modal
var style = document.createElement("style");
style.innerHTML = `
@@media print {
body * {
visibility: hidden;
}
#printSection, #printSection * {
visibility: visible;
}
#printSection {
position: absolute;
left: 0;
top: 0;
}
// create a new stylesheet to hide everything except the modal
var style = document.createElement("style");
style.innerHTML = `
@@media print {
body * {
visibility: hidden;
}
#printSection, #printSection * {
visibility: visible;
}
#printSection {
position: absolute;
left: 0;
top: 0;
}
}
`;
document.head.appendChild(style);
// create a new section to hold the modal for printing
var $printSection = document.getElementById("printSection");
if (!$printSection) {
$printSection = document.createElement("div");
$printSection.id = "printSection";
document.body.appendChild($printSection);
}
`;
document.head.appendChild(style);
// create a new section to hold the modal for printing
var $printSection = document.getElementById("printSection");
if (!$printSection) {
$printSection = document.createElement("div");
$printSection.id = "printSection";
document.body.appendChild($printSection);
$printSection.innerHTML = "";
$printSection.appendChild(domClone);
window.print();
// remove the new stylesheet after printing
document.head.removeChild(style);
}
$printSection.innerHTML = "";
$printSection.appendChild(domClone);
window.print();
// remove the new stylesheet after printing
document.head.removeChild(style);
}
</text>
}
var jobName = $('#JobId option:selected').text();
// console.log($("#EmployeeId").val(),jobName);
//شروع محاسبه کارگاه
setDataTable($("#EmployeeId").val(),jobName);
//$(function () {

View File

@@ -115,7 +115,9 @@ public class IndexModel : PageModel
//ماه قبل
BeforCurrentMonth = persianBeforeDate.Substring(5, 2),
//سال جاری
CurrentYear = persianBeforeDate.Substring(0, 4)
CurrentYear = persianBeforeDate.Substring(0, 4),
InsuranceWorkshopInfo = new InsuranceWorkshopInfoViewModel(),
};
return Partial("./Create", command);
}
@@ -183,6 +185,8 @@ public class IndexModel : PageModel
double sumOfIncludedKarfarma = 0;
var hasKarfarma = false;
double countWithoutLeft = 0;
double sumOfBaseYears = 0;
double sumOfMarriedAllowance = 0;
for (var i = 0; i < employeeDetailsForInsuranceList.Count; i++)
@@ -201,9 +205,17 @@ public class IndexModel : PageModel
leftWorkDay = "";
}
//بدست آوردن جمع پایه سنواتی
var baseYear = employeeDetailsForInsuranceList[i].BaseYears *
employeeDetailsForInsuranceList[i].WorkingDays;
sumOfBaseYears += baseYear;
// if (employeeDetailsForInsuranceList[i].IncludeStatus && (employeeDetailsForInsuranceList[i].JobId == 10 || employeeDetailsForInsuranceList[i].JobId == 17 || employeeDetailsForInsuranceList[i].JobId == 18 || employeeDetailsForInsuranceList[i].JobId == 16))// 10 --> karfarma
if (!employeeDetailsForInsuranceList[i].IncludeStatus &&
//بدست آوردن جمع حق تاهل
sumOfMarriedAllowance += employeeDetailsForInsuranceList[i].MarriedAllowance;
// if (employeeDetailsForInsuranceList[i].IncludeStatus && (employeeDetailsForInsuranceList[i].JobId == 10 || employeeDetailsForInsuranceList[i].JobId == 17 || employeeDetailsForInsuranceList[i].JobId == 18 || employeeDetailsForInsuranceList[i].JobId == 16))// 10 --> karfarma
if (!employeeDetailsForInsuranceList[i].IncludeStatus &&
(employeeDetailsForInsuranceList[i].JobCode == "027079" ||
employeeDetailsForInsuranceList[i].JobCode == "024398" ||
employeeDetailsForInsuranceList[i].JobCode == "011015" ||
@@ -373,8 +385,12 @@ public class IndexModel : PageModel
//سهم حق کارفرما
EmployerShare = employerShare.ToMoney(),
//بیمه بیکاری
UnEmploymentInsurance = unEmploymentInsurance.ToMoney()
});
UnEmploymentInsurance = unEmploymentInsurance.ToMoney(),
//جمع پایه سنواتی
SumOfBaseYears = sumOfBaseYears.ToMoney(),
//جمع حق تاهل
SumOfMarriedAllowance = sumOfMarriedAllowance.ToMoney(),
});
}
@@ -555,7 +571,12 @@ public class IndexModel : PageModel
odbf.Header.AddColumn(new DbfColumn("DSK_BIMH", DbfColumn.DbfColumnType.Number, 12, 0));
//ردیف پیمان
odbf.Header.AddColumn(new DbfColumn("MON_PYM", DbfColumn.DbfColumnType.Character, 3, 0));
var orec = new DbfRecord(odbf.Header);
//مجموع پایه سنواتی ها
odbf.Header.AddColumn(new DbfColumn("DSK_INC", DbfColumn.DbfColumnType.Character, 12, 0));
//مجموع حق تاهل ها
odbf.Header.AddColumn(new DbfColumn("DSK_SPOUSE", DbfColumn.DbfColumnType.Character, 12, 0));
var orec = new DbfRecord(odbf.Header);
//کد کارگاه
orec[0] = GetSpecifiedCharactes(createInsuranceList.InsuranceWorkshopInfo.InsuranceCode, 10);
@@ -603,7 +624,14 @@ public class IndexModel : PageModel
orec[21] = createInsuranceList.DifficultJobsInsuranc.ToString();
//ردیف پیمان
orec[22] = GetSpecifiedCharactes(createInsuranceList.InsuranceWorkshopInfo.AgreementNumber, 12);
odbf.Write(orec);
//مجموع پایه سنواتی ها
orec[23] = createInsuranceList.SumOfBaseYears.ToString();
//مجموع حق تاهل ها
orec[24] = createInsuranceList.SumOfMarriedAllowance.ToString();
odbf.Write(orec);
//odbf.Header.RecordCount = 50;
odbf.WriteHeader();
odbf.Close();
@@ -670,7 +698,12 @@ public class IndexModel : PageModel
// کد ملی
dsw.Header.AddColumn(new DbfColumn("PER_NATCOD", DbfColumn.DbfColumnType.Character, 10, 0));
foreach (var item in createInsuranceList.EmployeeInsurancListDataList)
// پایه سنوات
dsw.Header.AddColumn(new DbfColumn("DSW_INC", DbfColumn.DbfColumnType.Number, 12, 0));
// حق تاهل
dsw.Header.AddColumn(new DbfColumn("DSW_SPOUSE", DbfColumn.DbfColumnType.Number, 12, 0));
foreach (var item in createInsuranceList.EmployeeInsurancListDataList)
{
var employee = createInsuranceList.EmployeeDetailsForInsuranceList
.Where(p => p.EmployeeId == item.EmployeeId).FirstOrDefault();
@@ -749,7 +782,12 @@ public class IndexModel : PageModel
//کد ملی
dswrec[26] = employee.NationalCode;
dsw.Write(dswrec);
//پایه سنوات
dswrec[27] = item.BaseYears.ToString();
//حق تاهل
dswrec[28] = item.MarriedAllowance.ToString();
dsw.Write(dswrec);
}