Insurance Edit Custom modal bug fixed - employee bank info updated
This commit is contained in:
@@ -388,8 +388,8 @@ public class InsuranceListApplication: IInsuranceListApplication
|
||||
x.Year == searchModel.Year && x.Month == searchModel.Month &&
|
||||
searchModel.WorkshopIds.Contains(x.WorkshopId)))
|
||||
{
|
||||
var startMonthFa = $"{searchModel.Year}/{searchModel.Month}/01";
|
||||
DateTime startDateGr = startMonthFa.ToGeorgianDateTime();
|
||||
var startMonthFa = $"{searchModel.Year}/{searchModel.Month.PadLeft(2, '0')}/01";
|
||||
DateTime startDateGr = startMonthFa.ToGeorgianDateTime();
|
||||
DateTime endDateGr = startMonthFa.FindeEndOfMonth()
|
||||
.ToGeorgianDateTime();
|
||||
int endOfMonth = Convert.ToInt32((startMonthFa.FindeEndOfMonth()).Substring(8, 2));
|
||||
@@ -423,7 +423,9 @@ public class InsuranceListApplication: IInsuranceListApplication
|
||||
//بدست آوردن پایه سنوات
|
||||
var baseYears = _insuranceListRepositpry.GetEmployeeInsuranceBaseYear(employee.EmployeeId, workshopId,
|
||||
workingDays.countWorkingDays, startDateGr, endDateGr,workingDays.startWork, workingDays.endWork, workingDays.hasLeftWorkInMonth);
|
||||
baseYears.baseYear = employee.JobId is 10 or 16 or 17 or 18 ? 0 : baseYears.baseYear;
|
||||
//آیا کارفرما یا مدیر عامل است؟
|
||||
bool isManager = employee.JobId is 10 or 16 or 17 or 18 ;
|
||||
baseYears.baseYear = isManager ? 0 : baseYears.baseYear;
|
||||
Console.WriteLine(employee.JobId + " - "+ baseYears.baseYear);
|
||||
//جمع مزد روزانه و پایه سنوات
|
||||
var dailyWagePlusBaseYears = dailyWage + baseYears.baseYear;
|
||||
@@ -433,7 +435,7 @@ public class InsuranceListApplication: IInsuranceListApplication
|
||||
var monthlySalary = GetRoundValue(dailyWagePlusBaseYears * workingDays.countWorkingDays);
|
||||
|
||||
//حق تاهل
|
||||
var marriedAllowance = employee.MaritalStatus == "متاهل" ? yearlysaleries.MarriedAllowance : 0;
|
||||
var marriedAllowance = employee.MaritalStatus == "متاهل" && !isManager ? yearlysaleries.MarriedAllowance : 0;
|
||||
|
||||
//محاسبه مزایای ماهانه
|
||||
var monthlyBenefits = GetMonthlyBenefits(endOfMonth, yearlysaleries.ConsumableItems, yearlysaleries.HousingAllowance, marriedAllowance, workingDays.countWorkingDays, searchModel.TypeOfInsuranceSendWorkshop, employee.JobId, employee.EmployeeId,employee.IncludeStatus);
|
||||
@@ -514,7 +516,7 @@ public class InsuranceListApplication: IInsuranceListApplication
|
||||
DailyWagePlusBaseYears = dailyWagePlusBaseYears,
|
||||
|
||||
//حق تاهل
|
||||
MarriedAllowance = employee.MaritalStatus == "متاهل" ? yearlysaleries.MarriedAllowance : 0,
|
||||
MarriedAllowance = marriedAllowance,
|
||||
|
||||
//دستمزد ماهانه
|
||||
MonthlySalary = monthlySalary,
|
||||
@@ -1370,7 +1372,7 @@ public class InsuranceListApplication: IInsuranceListApplication
|
||||
{
|
||||
var result = new MainEmployeeDetailsViewModel();
|
||||
var workshopId = searchModel.WorkshopIds.FirstOrDefault();
|
||||
var startMonthFa = $"{searchModel.Year}/{searchModel.Month}/01";
|
||||
var startMonthFa = $"{searchModel.Year}/{searchModel.Month.PadLeft(2, '0')}/01";
|
||||
DateTime startDateGr = startMonthFa.ToGeorgianDateTime();
|
||||
DateTime endDateGr = startMonthFa.FindeEndOfMonth()
|
||||
.ToGeorgianDateTime();
|
||||
@@ -1396,6 +1398,9 @@ public class InsuranceListApplication: IInsuranceListApplication
|
||||
var leftWorkFa = workingDays.hasLeftWorkInMonth ? employeeData.LeftWorkDateGr.ToFarsi() : "";
|
||||
var startWorkFa = employeeData.StartWorkDateGr.ToFarsi();
|
||||
|
||||
//آیا کارفرما است
|
||||
bool isManager = employeeData.JobId is 10 or 16 or 17 or 18;
|
||||
|
||||
//محاسبه حق بیمه سهم کارفرما
|
||||
var employerShare = (employeeData.BenefitsIncludedContinuous * 20) / 100;
|
||||
|
||||
@@ -1456,7 +1461,7 @@ public class InsuranceListApplication: IInsuranceListApplication
|
||||
DailyWagePlusBaseYears = employeeData.DailyWagePlusBaseYears,
|
||||
|
||||
//حق تاهل
|
||||
MarriedAllowance = employeeData.MarriedAllowance,
|
||||
MarriedAllowance = isManager ? 0 : employeeData.MarriedAllowance,
|
||||
|
||||
//دستمزد ماهانه
|
||||
MonthlySalary = employeeData.MonthlySalary,
|
||||
|
||||
Reference in New Issue
Block a user