* <code>orderElement</code>
*
* @param orderElement
*/
private ProjectStatusEnum getProjectHourStatus(OrderElement orderElement) {
EffortDuration sumChargedEffort = getSumChargedEffort(orderElement);
EffortDuration estimatedEffort = getEstimatedEffort(orderElement);
if (sumChargedEffort.isZero()
|| sumChargedEffort.compareTo(estimatedEffort) <= 0) {
return ProjectStatusEnum.AS_PLANNED;
}
EffortDuration withMarginEstimatedHours = orderElement
.getWithMarginCalculatedHours();
if (estimatedEffort.compareTo(sumChargedEffort) < 0
&& sumChargedEffort.compareTo(withMarginEstimatedHours) <= 0) {
return ProjectStatusEnum.WITHIN_MARGIN;