insurane nane caspian 1403 esfand

This commit is contained in:
SamSys
2025-05-18 18:57:41 +03:30
parent fc43e97cc4
commit c0e438aa6d
3 changed files with 132 additions and 74 deletions

View File

@@ -415,7 +415,7 @@ 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 leftDate = employee.LeftWorkDateGr?.AddDays(-1) ?? new DateTime();
bool isManager = employee.JobId is 10 or 16 or 17 or 18 or 3498;
@@ -452,9 +452,22 @@ public class InsuranceListApplication: IInsuranceListApplication
var leftWorkFa = workingDays.hasLeftWorkInMonth ? employee.LeftWorkDateGr.ToFarsi(): "";
var startWorkFa = employee.StartWorkDateGr.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);
double dailyWage = 0;
if (searchModel.FixedSalary)
{
var res = GetDailyWageFixedSalary(searchModel.Year, workshopId, employee.EmployeeId, startDateGr,
endDateGr, employee.JobId, searchModel.Population, searchModel.InsuranceJobId);
dailyWage = res ?? 0;
}
else
{
var res = ComputeDailyWage(yearlysaleries.DayliWage, employee.EmployeeId, workshopId, searchModel.Year);
dailyWage = res;
}
//بدست آوردن پایه سنوات
var baseYears = _insuranceListRepositpry.GetEmployeeInsuranceBaseYear(employee.EmployeeId, workshopId,
workingDays.countWorkingDays, startDateGr, endDateGr,workingDays.startWork, workingDays.endWork, workingDays.hasLeftWorkInMonth);
@@ -511,7 +524,7 @@ public class InsuranceListApplication: IInsuranceListApplication
.FirstOrDefault(e => e.EmployeeId == employee.EmployeeId);
//مزیای عیر مشمول لیست قبل
var benefitsIncludedNonContinuous =
employeeListData != null ? employeeListData.BenefitsIncludedNonContinuous : 0;
employeeListData?.BenefitsIncludedNonContinuous ?? 0;
if (workshop.InsuranceCheckoutFamilyAllowance && employeeHasCheckout && !isManager)
{
@@ -619,7 +632,7 @@ public class InsuranceListApplication: IInsuranceListApplication
};
});
}).ToList();
Console.WriteLine("New Compute : " + watch.Elapsed);
watch.Stop();
@@ -1661,9 +1674,46 @@ public class InsuranceListApplication: IInsuranceListApplication
private double? GetDailyWageFixedSalary(string year, long workshopId,long employeeId,DateTime? startDateGr, DateTime? endDateGr, long jobId, string population, long? insuranceJobId)
{
double? result = 0;
//اگر مشاغل مقطوع بود و شغلش کارفرما بود
// در جدول لیست بیمه قبلی چک شود
try
{
if (workshopId == 318 && year == "1403")
{
double percent = 0;
switch (jobId)
{
case 39:
percent = 1.75;
return 4180000;
break;
case 466:
percent = 1.6;
return 3822000;
break;
case 1192 or 398 or 8:
percent = 1.5;
return 3583000;
break;
}
//var dateSaleryviewModel = new DateSalarySearchModel();
//dateSaleryviewModel.StartDateGr = startDateGr;
//dateSaleryviewModel.EndDateGr = endDateGr;
//var _dateSalary = _dateSalaryRepository.GetDateSalaryViewModel(dateSaleryviewModel);
//// && _dateSalary.Id >0
//if (_dateSalary != null)
//{
// var dateSaleryItemviewModel = new DateSalaryItemSearchModel();
// dateSaleryItemviewModel.DateSalaryId = _dateSalary.Id;
// dateSaleryItemviewModel.Percent = percent;
// var dateSalaryItem = _dateSalaryItemRepository.Search(dateSaleryItemviewModel);
// if (dateSalaryItem != null)
// result = dateSalaryItem[0].Salary;
//}
}
if (jobId == 10) //کارفرما
{
InsuranceListSearchModel searchModel = new InsuranceListSearchModel();
@@ -1748,6 +1798,14 @@ public class InsuranceListApplication: IInsuranceListApplication
result = dateSalaryItem[0].Salary;
}
}
}
}
catch (Exception)
{
result = 0;
}
return result;
}

Binary file not shown.

Binary file not shown.