merge from goverment list calculation

This commit is contained in:
2025-06-09 16:52:10 +03:30
8 changed files with 100 additions and 83 deletions

View File

@@ -298,4 +298,6 @@ public class EmployeeDetailsForInsuranceListViewModel
///// DSK_SPOUSE
///// </summary>
//public double SumOfMarriedAllowance { get; set; }
public string Month { get; set; }
public string Year { get; set; }
}

View File

@@ -25,4 +25,5 @@ public interface IYearlySalaryApplication
InsuranceYearlySalaryModel GetInsuranceItems(DateTime startDate, DateTime endDate, string year);
#endregion
}

View File

@@ -414,7 +414,6 @@ public class InsuranceListApplication : IInsuranceListApplication
//مقادیر سالانه این تاریخ
var yearlysaleries = _yearlySalaryApplication.GetInsuranceItems(startDateGr, endDateGr, searchModel.Year);
// دریافت اطلاعات هویتی و شروع و ترک کار کارکنان
var employeesInfoAndLeftWorks =
_leftWorkInsuranceApplication.GetEmployeeInsuranceLeftWorksAndInformation(workshopId, startDateGr,

View File

@@ -160,7 +160,7 @@ public class YearlySalaryApplication : IYearlySalaryApplication
public InsuranceYearlySalaryModel GetInsuranceItems(DateTime startDate, DateTime endDate, string year)
{
return _yearlySalaryRepository.GetInsuranceItems(startDate, endDate, year);
}
}
#endregion
}

View File

@@ -3876,7 +3876,6 @@ public class YearlySalaryRepository : RepositoryBase<long, YearlySalary>, IYearl
return query;
}
#endregion

View File

@@ -98,7 +98,7 @@
</div>
<!--اطلاعات کارگاه-->
<div class="col-md-12 col-12 col-sm-12 form-box" id="divInsuranceWorkshopInfo">
@* <div class="d-flex">
@* <div class="d-flex">
<span class="form-title">کپی از آخرین لیست ارسالی </span>
<div id="resultExistPersonel" class="alert alert-danger" style="display:none"></div>
</div> *@
@@ -148,87 +148,87 @@
</ul>
<div class="tab-content">
<div class="tab-pane active" id="DSSKAR">
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10"> تعداد نفرات </label>
<input type="text" placeholder="" id="txtSumOfEmployees" asp-for="SumOfEmployees" class="input green col-md-2 col-2 col-sm-2 notEmpty">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10 text-small"> جمع پایه سنواتی </label>
<input type="text" placeholder="" id="txtSumOfBaseYears" asp-for="SumOfBaseYears" class="input green col-md-2 col-2 col-sm-2">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10"> جمع روزهای کارکرد کل پرسنل </label>
<input type="text" placeholder="" id="txtSumOfWorkingDays" asp-for="SumOfWorkingDays" class="input green col-md-2 col-2 col-sm-2 notEmpty">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10"> جمع دستمزد و مزایای ماهانه مشمول </label>
<input type="text" placeholder="" id="txtIncluded" asp-for="Included" class="input green col-md-2 col-2 col-sm-2 notEmpty">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10"> جمع دستمزد روزانه کل پرسنل </label>
<input type="text" placeholder="" id="txtSumOfDailyWage" asp-for="SumOfDailyWage" class="input green col-md-2 col-2 col-sm-2 notEmpty">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10"> جمع مزایای ماهانه غیرمشمول </label>
<input type="text" placeholder="" id="txtSumOfBenefitsIncludedNonContinuous" value="0" name="SumOfBenefitsIncludedNonContinuous" class="input yellow col-md-2 col-2 col-sm-2 notEmpty">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10 text-small"> جمع دستمزد روزانه <br/> (دستمزد روزانه + پایه سنواتی) </label>
<input type="text" placeholder="" id="txtSumOfDailyWagePlusBaseYears" value="0" name="SumOfDailyWagePlusBaseYears" class="input green col-md-2 col-2 col-sm-2">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10"> جمع دستمزد و مزایای ماهانه مشمول و غیرمشمول (ریال) </label>
<input type="text" placeholder="" id="txtIncludedAndNotIncluded" asp-for="IncludedAndNotIncluded" class="input yellow col-md-2 col-2 col-sm-2 notEmpty">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10"> جمع دستمزد ماهانه (حقوق ماهانه) </label>
<input type="text" placeholder="" id="txtSumOfSalaries" asp-for="SumOfSalaries" class="input green col-md-2 col-2 col-sm-2 notEmpty">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10"> حق بیمه سهم بیمه شده (7%) </label>
<input type="text" placeholder="" id="txtInsuredShare" asp-for="InsuredShare" class="input blue col-md-2 col-2 col-sm-2 notEmpty">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10 text-small"> جمع حق تاهل </label>
<input type="text" placeholder="" id="txtSumOfMarriedAllowance" asp-for="SumOfMarriedAllowance" class="input green col-md-2 col-2 col-sm-2">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10"> حق بیمه سهم کارفرما (20%) </label>
<input type="text" placeholder="" id="txtEmployerShare" asp-for="EmployerShare" class="input blue col-md-2 col-2 col-sm-2 notEmpty">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10 text-small"> جمع مزایای ماهیانه مشمول </label>
<input type="text" placeholder="" id="txtSumOfBenefitsIncluded" asp-for="SumOfBenefitsIncluded" class="input green col-md-2 col-2 col-sm-2 notEmpty">
<label class="col-md-10 col-10 col-sm-10"> تعداد نفرات </label>
<input type="text" placeholder="" id="txtSumOfEmployees" asp-for="SumOfEmployees" class="input green col-md-2 col-2 col-sm-2 notEmpty">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10"> حق بیمه بیکاری (3%) </label>
<input type="text" placeholder="" id="txtUnEmploymentInsurance" asp-for="UnEmploymentInsurance" class="input blue col-md-2 col-2 col-sm-2 notEmpty">
<label class="col-md-10 col-10 col-sm-10 text-small"> جمع پایه سنواتی </label>
<input type="text" placeholder="" id="txtSumOfBaseYears" asp-for="SumOfBaseYears" class="input green col-md-2 col-2 col-sm-2">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10"> جمع روزهای کارکرد کل پرسنل </label>
<input type="text" placeholder="" id="txtSumOfWorkingDays" asp-for="SumOfWorkingDays" class="input green col-md-2 col-2 col-sm-2 notEmpty">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10"> جمع دستمزد و مزایای ماهانه مشمول </label>
<input type="text" placeholder="" id="txtIncluded" asp-for="Included" class="input green col-md-2 col-2 col-sm-2 notEmpty">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10"> جمع دستمزد روزانه کل پرسنل </label>
<input type="text" placeholder="" id="txtSumOfDailyWage" asp-for="SumOfDailyWage" class="input green col-md-2 col-2 col-sm-2 notEmpty">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10"> جمع مزایای ماهانه غیرمشمول </label>
<input type="text" placeholder="" id="txtSumOfBenefitsIncludedNonContinuous" value="0" name="SumOfBenefitsIncludedNonContinuous" class="input yellow col-md-2 col-2 col-sm-2 notEmpty">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10 text-small"> جمع دستمزد روزانه <br /> (دستمزد روزانه + پایه سنواتی) </label>
<input type="text" placeholder="" id="txtSumOfDailyWagePlusBaseYears" value="0" name="SumOfDailyWagePlusBaseYears" class="input green col-md-2 col-2 col-sm-2">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10"> جمع دستمزد و مزایای ماهانه مشمول و غیرمشمول (ریال) </label>
<input type="text" placeholder="" id="txtIncludedAndNotIncluded" asp-for="IncludedAndNotIncluded" class="input yellow col-md-2 col-2 col-sm-2 notEmpty">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10"> جمع دستمزد ماهانه (حقوق ماهانه) </label>
<input type="text" placeholder="" id="txtSumOfSalaries" asp-for="SumOfSalaries" class="input green col-md-2 col-2 col-sm-2 notEmpty">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10"> حق بیمه سهم بیمه شده (7%) </label>
<input type="text" placeholder="" id="txtInsuredShare" asp-for="InsuredShare" class="input blue col-md-2 col-2 col-sm-2 notEmpty">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10 text-small"> جمع حق تاهل </label>
<input type="text" placeholder="" id="txtSumOfMarriedAllowance" asp-for="SumOfMarriedAllowance" class="input green col-md-2 col-2 col-sm-2">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10"> حق بیمه سهم کارفرما (20%) </label>
<input type="text" placeholder="" id="txtEmployerShare" asp-for="EmployerShare" class="input blue col-md-2 col-2 col-sm-2 notEmpty">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10 text-small"> جمع مزایای ماهیانه مشمول </label>
<input type="text" placeholder="" id="txtSumOfBenefitsIncluded" asp-for="SumOfBenefitsIncluded" class="input green col-md-2 col-2 col-sm-2 notEmpty">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10"> حق بیمه بیکاری (3%) </label>
<input type="text" placeholder="" id="txtUnEmploymentInsurance" asp-for="UnEmploymentInsurance" class="input blue col-md-2 col-2 col-sm-2 notEmpty">
</div>
<div class="col-md-6 col-6 col-sm-6" style="display: none">
</div>
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group" style="display: none">
<label class="col-md-10 col-10 col-sm-10 text-small"> 4% سخت و زیان آور </label>
<input type="text" placeholder="" id="txtDifficultJobsInsuranc" asp-for="DifficultJobsInsuranc" class="input green col-md-2 col-2 col-sm-2">
</div>
</div>
<div class="tab-pane" id="DSKWOR">
<div id="table-container">
@@ -738,12 +738,12 @@
var employeeId = $(this).attr("data-employeeid");
if (employeeId == id) {
$(this).find('td:eq(1)').text($('#LeftWorkDate').val());
$(this).find('td:eq(2)').text($('#StartWorkDate').val());
$(this).find('td:eq(3)').text(jobName);
$(this).find('td:eq(4)').text($('#InsuranceShare').val());
var monthlySalaryPlusBaseyear = getNumberValue($('#hiddenMonthlySalaryPlusBaseYear').val());
var benefitsIncludedContinuous = getNumberValue($('#BenefitsIncludedContinuous').val());
var benefitsIncluded = Number(monthlySalaryPlusBaseyear) + Number(benefitsIncludedContinuous);
@@ -768,10 +768,10 @@
$(this).find('td:eq(7)').attr('data-monthlybenefits', benefitsIncludedContinuous);
$(this).find('td:eq(8)').text($('#hiddenMonthlySalaryPlusBaseYear').val());
$(this).find('td:eq(8)').attr("data-monthlysalary", monthlySalaryPlusBaseyear);
$(this).find('td:eq(8)').attr("data-monthlysalary", monthlySalaryPlusBaseyear);
$(this).find('td:eq(8)').attr("data-MonthlySalaryPlusBaseyear", monthlySalaryPlusBaseyear);
$(this).find('td:eq(11)').text($('#DailyWage').val());
$(this).find('td:eq(11)').text($('#DailyWage').val());
$(this).find('td:eq(11)').attr("data-dailywage", getNumberValue($('#DailyWage').val()));
$(this).find('td:eq(11)').attr("data-DailyWagePlusBaseYears", getNumberValue($('#hiddendaailyWagePlusBaseYear').val()));
@@ -792,7 +792,7 @@
var marriedAllowance = getNumberValue($('#hiddenMarriedAllowance').val());
$(this).find('td:eq(9)').text($('#hiddenMarriedAllowance').val());
$(this).find('td:eq(9)').attr("data-MarriedAllowance", marriedAllowance);
var baseYears = getNumberValue($('#hiddenBaseYearToEditModal').val());
$(this).find('td:eq(10)').text($('#hiddenBaseYearToEditModal').val());
$(this).find('td:eq(10)').attr("data-BaseYears", baseYears);
@@ -1052,12 +1052,15 @@
employeeDetails.IncludedAndNotIncluded = Number($(this).find('td:eq(5)').attr('data-includedandnotincluded'));
employeeDetails.InsuranceShare = Number($(this).find('td:eq(4)').attr('data-insuranceshare'));
employeeDetails.WorkingDays = Number($(this).find('td:eq(12)').text());
employeeDetails.MarriedAllowance = Number($(this).find('td:eq(9)').attr('data-MarriedAllowance'));
employeeDetails.BaseYears = Number($(this).find('td:eq(10)').attr('data-BaseYears'));
employeeDetails.DailyWagePlusBaseYears = Number($(this).find('td:eq(11)').attr('data-DailyWagePlusBaseYears'));
employeeDetails.BenefitsIncludedNonContinuous = Number($(this).find('td:eq(5)').attr('data-BenefitsIncludedNonContinuous'));
employeeDetails.Year = $("#Year").val();
employeeDetails.Month = $("#ddlMonth").val();
employeeDetailsForInsuranceList.push(employeeDetails);
});
@@ -1099,7 +1102,7 @@
$('#txtSumOfMarriedAllowance').val(response.sumOfMarriedAllowance);
$('#txtSumOfDailyWagePlusBaseYears').val(response.sumOfDailyWagePlusBaseYears);
$('#txtSumOfBenefitsIncludedNonContinuous').val(response.sumOfBenefitsIncludedNonContinuous);
console.log(response.sumOfBenefitsIncludedNonContinuous);
},
failure: function (response) {
@@ -1251,7 +1254,7 @@
$("#divEmployeeInsurancListData").append(`<input type="hidden" name="SumOfBaseYears" id="SumOfBaseYears" value="${getNumberValue($("#txtSumOfBaseYears").val())}" />`);
$("#divEmployeeInsurancListData").append(`<input type="hidden" name="SumOfMarriedAllowance" id="SumOfMarriedAllowance" value="${getNumberValue($("#txtSumOfMarriedAllowance").val())}" />`);
//$("#divEmployeeInsurancListData").append('<input type="hidden" name="InsuranceWorkshopInfo.FixedSalary" id="InsuranceWorkshopInfo_FixedSalary" value="'+fixedSalary+'" />');
//$("#divEmployeeInsurancListData").append('<input type="hidden" name="InsuranceWorkshopInfo.Population" id="InsuranceWorkshopInfo_Population" value="'+population+'" />');
@@ -1381,7 +1384,7 @@
$.Notification.autoHideNotify('success', 'top right', response.message);
$("#MainModal").modal('hide');
// $('.btn-search1').click();
// Reload Function
pageIndexJs = 0;
hasMoreData = true;

View File

@@ -776,7 +776,8 @@
employeeDetails.BaseYears = Number($(this).find('td:eq(10)').attr('data-BaseYears'));
employeeDetails.DailyWagePlusBaseYears = Number($(this).find('td:eq(11)').attr('data-DailyWagePlusBaseYears'));
employeeDetails.BenefitsIncludedNonContinuous = Number($(this).find('td:eq(5)').attr('data-BenefitsIncludedNonContinuous'));
employeeDetails.Year = $("#Year").val();
employeeDetails.Month = $("#ddlMonth").val();
employeeDetailsForInsuranceList.push(employeeDetails);
});
//console.log(employeeDetailsForInsuranceList);

View File

@@ -192,6 +192,18 @@ public class IndexModel : PageModel
double countWithoutLeft = 0;
double sumOfBaseYears = 0;
double sumOfMarriedAllowance = 0;
double yearlySalaryDailyWage = 0;
if (employeeDetailsForInsuranceList.Count > 0)
{
var employeeDetail = employeeDetailsForInsuranceList.First();
var startMonthFa = $"{employeeDetail.Year}/{employeeDetail.Month.PadLeft(2, '0')}/01";
DateTime startDateGr = startMonthFa.ToGeorgianDateTime();
DateTime endDateGr = startMonthFa.FindeEndOfMonth()
.ToGeorgianDateTime();
int endOfMonth = Convert.ToInt32((startMonthFa.FindeEndOfMonth()).Substring(8, 2));
yearlySalaryDailyWage = _yearlySalaryApplication.GetInsuranceItems(startDateGr, endDateGr, employeeDetail.Year).DayliWage;
}
double sumOfDailyWagePlusBaseYear = 0;
double sumOfBenefitIncludedAndNotIncluded = 0; //مشمول و غیر مشمول
@@ -255,8 +267,8 @@ public class IndexModel : PageModel
//Mahan Changes
//مجموع حقوق ماهیانه خالص
sumOfMonthlySalaryWithoutBaseYears +=
GetRoundValueWhitGovermentlist(employeeDetailsForInsuranceList[i].DailyWage * employeeDetailsForInsuranceList[i].WorkingDays, typeOfInsuranceSendWorkshop);
sumOfMonthlySalaryWithoutBaseYears +=
GetRoundValueWhitGovermentlist(yearlySalaryDailyWage * employeeDetailsForInsuranceList[i].WorkingDays, typeOfInsuranceSendWorkshop);
if (leftWorkDay != "01") //اگر ترک کار آن یکم ماه نبود
sumOfBenefitIncludedAndNotIncluded += employeeDetailsForInsuranceList[i].IncludedAndNotIncluded;