return;
}
TaskGroup rootTask = getRootTask();
LocalDate endDate = TaskElement.maxDate(rootTask.getChildren())
.asExclusiveEnd();
Days orderDuration = Days.daysBetween(
TaskElement.minDate(rootTask.getChildren()).getDate(), endDate);
LocalDate deadLineAsLocalDate = LocalDate.fromDateFields(currentOrder
.getDeadline());
Days deadlineOffset = Days.daysBetween(endDate,
deadLineAsLocalDate.plusDays(1));
BigDecimal outcome = new BigDecimal(deadlineOffset.getDays(),
MathContext.DECIMAL32);
this.marginWithDeadLine = outcome.divide(
new BigDecimal(orderDuration.getDays()), 8,
BigDecimal.ROUND_HALF_EVEN);
}