Insurance HasCheckout change
This commit is contained in:
@@ -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)
|
||||
return (false, 0, 0,0,0,0,0);
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user