diff --git a/Company.Domain/CheckoutAgg/ICheckoutRepository.cs b/Company.Domain/CheckoutAgg/ICheckoutRepository.cs index 90d2f576..3a71ea7c 100644 --- a/Company.Domain/CheckoutAgg/ICheckoutRepository.cs +++ b/Company.Domain/CheckoutAgg/ICheckoutRepository.cs @@ -18,7 +18,7 @@ public interface ICheckoutRepository : IRepository /// /// /// - (bool hasChekout, double FamilyAlloance, double OverTimePay) HasCheckout(long workshopId, long employeId, + (bool hasChekout, double FamilyAlloance, double OverTimePay, double RotatingShift, double Nightwork, double Fridaywork, double YraesPay) HasCheckout(long workshopId, long employeId, string year, string month); EditCheckout GetDetails(long id); diff --git a/CompanyManagment.Application/InsuranceListApplication.cs b/CompanyManagment.Application/InsuranceListApplication.cs index 08f07cf2..c9f83c64 100644 --- a/CompanyManagment.Application/InsuranceListApplication.cs +++ b/CompanyManagment.Application/InsuranceListApplication.cs @@ -440,6 +440,12 @@ public class InsuranceListApplication : IInsuranceListApplication bool employeeHasCheckout = true; double familyAllowance = 0; double overTimePay = 0; + + double rotatingShift = 0; + double nightWork = 0; + double fridayWork = 0; + double yearsPay = 0; + if (hasWorkshopOverTimeOrFamilyAllowance && (leftDate >= startDateGr || employee.LeftWorkDateGr == null)) { var checkout = _checkoutRepository.HasCheckout(workshopId, employee.EmployeeId, @@ -450,6 +456,11 @@ public class InsuranceListApplication : IInsuranceListApplication familyAllowance = checkout.FamilyAlloance; overTimePay = checkout.OverTimePay; + rotatingShift = checkout.RotatingShift; + nightWork = checkout.Nightwork; + fridayWork = checkout.Fridaywork; + yearsPay = checkout.YraesPay; + } else { @@ -541,9 +552,17 @@ public class InsuranceListApplication : IInsuranceListApplication // employeeListData != null ? employeeListData.BenefitsIncludedNonContinuous : 0; double benefitsIncludedNonContinuous = 0; if (workshop.InsuranceCheckoutFamilyAllowance && employeeHasCheckout && !isManager) - { + { + double addOptionsfromCheckout = familyAllowance; - benefitsIncludedNonContinuous = GetRoundValue(benefitsIncludedNonContinuous + familyAllowance); + //استثنا کارگته پایا تجارت مهراکو + if (workshopId == 652) + { + addOptionsfromCheckout = familyAllowance + rotatingShift + nightWork + fridayWork + yearsPay; + } + + + benefitsIncludedNonContinuous = GetRoundValue(benefitsIncludedNonContinuous + addOptionsfromCheckout); } diff --git a/CompanyManagment.EFCore/Repository/CheckoutRepository.cs b/CompanyManagment.EFCore/Repository/CheckoutRepository.cs index 478b00fb..665291da 100644 --- a/CompanyManagment.EFCore/Repository/CheckoutRepository.cs +++ b/CompanyManagment.EFCore/Repository/CheckoutRepository.cs @@ -71,7 +71,7 @@ public class CheckoutRepository : RepositoryBase, ICheckoutRepos /// /// /// - public (bool hasChekout, double FamilyAlloance, double OverTimePay) HasCheckout(long workshopId, long employeId, string year, string month) + public (bool hasChekout, double FamilyAlloance, double OverTimePay, double RotatingShift, double Nightwork, double Fridaywork, double YraesPay) HasCheckout(long workshopId, long employeId, string year, string month) { var farisMonthName = Tools.ToFarsiMonthByNumber(month); @@ -79,9 +79,9 @@ public class CheckoutRepository : RepositoryBase, ICheckoutRepos x.WorkshopId == workshopId && x.EmployeeId == employeId && x.Year == year && x.Month == farisMonthName && x.IsActiveString == "true"); if (res == null) - return (false, 0, 0); + return (false, 0, 0,0,0,0,0); - return (true, res.FamilyAllowance, res.OvertimePay); + return (true, res.FamilyAllowance, res.OvertimePay, res.ShiftPay, res.NightworkPay, res.FridayPay,res.YearsPay); } public EditCheckout GetDetails(long id)