diff --git a/AsbCloudInfrastructure/Services/WellInfoService.cs b/AsbCloudInfrastructure/Services/WellInfoService.cs index 60693eeb..0bf2fd0c 100644 --- a/AsbCloudInfrastructure/Services/WellInfoService.cs +++ b/AsbCloudInfrastructure/Services/WellInfoService.cs @@ -82,7 +82,7 @@ public class WellInfoService } var wellOperationsStat = operationsStat.FirstOrDefault(s => s.Id == well.Id); - var wellLastFactSection = wellOperationsStat?.Sections.LastOrDefault(s => s.Fact is not null); + var wellLastFactSection = wellOperationsStat?.Sections.OrderBy(s => s.Fact?.WellDepthStart).LastOrDefault(s => s.Fact is not null); currentDepth ??= wellLastFactSection?.Fact?.WellDepthEnd; var wellProcessMaps = processMapPlanWellDrillings