Insurance HasCheckout change

This commit is contained in:
SamSys
2025-12-15 12:15:00 +03:30
parent 73bef104fb
commit e67aca37f9

View File

@@ -64,7 +64,7 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
}
/// <summary>
/// چیک میکند که آیا پرسنل در سال و ماه درخواستی در این کارگاه فیش حقوقی دارد یا خیر
/// چک میکند که آیا پرسنل در سال و ماه درخواستی در این کارگاه فیش حقوقی دارد یا خیر
/// </summary>
/// <param name="workshopId"></param>
/// <param name="employeId"></param>
@@ -79,7 +79,16 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
x.WorkshopId == workshopId && x.EmployeeId == employeId && x.Year == year && x.Month == farisMonthName &&
x.IsActiveString == "true");
if (res == null)
{
var checkLeftDate = ($"{year}/{month}/01").ToGeorgianDateTime();
var hasLeftwork = _context.LeftWorkList.Any(x =>
x.EmployeeId == employeId && x.WorkshopId == workshopId && x.LeftWorkDate == checkLeftDate);
if(hasLeftwork)
return (true, 0, 0, 0, 0, 0, 0);
return (false, 0, 0, 0, 0, 0, 0);
}
return (true, res.FamilyAllowance, res.OvertimePay, res.ShiftPay, res.NightworkPay, res.FridayPay,res.YearsPay);
}