From 44d5225ff35a27573f87b2ec767c142c043d94be Mon Sep 17 00:00:00 2001 From: SamSys Date: Sun, 25 May 2025 19:08:49 +0330 Subject: [PATCH] Static Chekoout Bug Fixed --- .../Repository/CheckoutRepository.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/CompanyManagment.EFCore/Repository/CheckoutRepository.cs b/CompanyManagment.EFCore/Repository/CheckoutRepository.cs index c3034a1b..9284e09e 100644 --- a/CompanyManagment.EFCore/Repository/CheckoutRepository.cs +++ b/CompanyManagment.EFCore/Repository/CheckoutRepository.cs @@ -1146,9 +1146,15 @@ public class CheckoutRepository : RepositoryBase, ICheckoutRepos var firstRollCall = orderedRollcalls.FirstOrDefault(); var secondRollCall = orderedRollcalls.Skip(1).FirstOrDefault(); + DateTime? secondRCEndDate = null; + DateTime? firstRCEndDate = null; - var firstRCEndDate = firstRollCall.ShiftEndWithoutRest ?? firstRollCall.EndDate; - var secondRCEndDate = secondRollCall.ShiftEndWithoutRest ?? secondRollCall.EndDate; + if (firstRollCall != null) + firstRCEndDate = firstRollCall.ShiftEndWithoutRest ?? firstRollCall.EndDate; + if (secondRollCall != null) + secondRCEndDate = secondRollCall.ShiftEndWithoutRest ?? secondRollCall.EndDate; + + return new CheckoutDailyRollCallViewModel() {