diff --git a/models/workflow_execution/workflow_execution.go b/models/workflow_execution/workflow_execution.go index 217067e..e8d9822 100755 --- a/models/workflow_execution/workflow_execution.go +++ b/models/workflow_execution/workflow_execution.go @@ -215,9 +215,12 @@ func (d *WorkflowExecution) bookEach(executionsID string, wfID string, dt tools. if s := priced.GetLocationStart(); s != nil && s.After(time.Now()) { start = *s } - durationS := priced.GetExplicitDurationInS() + // Prefer LocationEnd set by Planify; fall back to ExplicitDurationInS only + // when Planify did not compute an end (open-ended / service resources). var endDate *time.Time - if durationS > 0 { + if locEnd := priced.GetLocationEnd(); locEnd != nil { + endDate = locEnd + } else if durationS := priced.GetExplicitDurationInS(); durationS > 0 { e := start.Add(time.Duration(durationS) * time.Second) endDate = &e }