diff --git a/AsbCloudInfrastructure/Services/WellOperationService/OperationsStatService.cs b/AsbCloudInfrastructure/Services/WellOperationService/OperationsStatService.cs index f783967e..1e1dd035 100644 --- a/AsbCloudInfrastructure/Services/WellOperationService/OperationsStatService.cs +++ b/AsbCloudInfrastructure/Services/WellOperationService/OperationsStatService.cs @@ -177,14 +177,17 @@ namespace AsbCloudInfrastructure.Services.WellOperationService if (lastCorrespondingFactOperation is null) return 0d; + + var lastCorrespondingPlanOperation = wellOperations.FirstOrDefault(o => o.Id == lastCorrespondingFactOperation.IdPlan); var lastFactOperation = factOperations.LastOrDefault(); var remainingPlanOperations = operationsOrdered .Where(o => o.IdType == WellOperation.IdOperationTypePlan) - .Where(o => o.DateStart > lastCorrespondingFactOperation.OperationPlan.DateStart); + .Where(o => o.DateStart > lastCorrespondingPlanOperation.DateStart); var durationRemain = remainingPlanOperations.Sum(o => o.DurationHours); + var factEnd = lastFactOperation.DateStart.AddHours(durationRemain + lastFactOperation.DurationHours); var planEnd = lastCorrespondingFactOperation.DateStart.AddHours(durationRemain + lastCorrespondingFactOperation.DurationHours); var lagDays = (planEnd - factEnd).TotalDays; diff --git a/AsbCloudWebApi/Properties/PublishProfiles/FolderProfile.pubxml b/AsbCloudWebApi/Properties/PublishProfiles/FolderProfile.pubxml new file mode 100644 index 00000000..9ceab80c --- /dev/null +++ b/AsbCloudWebApi/Properties/PublishProfiles/FolderProfile.pubxml @@ -0,0 +1,22 @@ + + + + + false + false + true + Debug + Any CPU + FileSystem + bin\pubLinuxDebug\ + FileSystem + <_TargetId>Folder + + net6.0 + linux-x64 + a2768702-47cb-4127-941c-e339d5efcffe + true + + \ No newline at end of file