Package org.libreplan.business.workingday

Examples of org.libreplan.business.workingday.EffortDuration


                }

                IntraDayDate start = taskElement.getIntraDayStartDate();
                IntraDayDate end = taskElement.getIntraDayEndDate();

                EffortDuration effortBetween = start.effortUntil(end);
                int seconds = new BigDecimal(effortBetween.getSeconds())
                        .multiply(proportion).toBigInteger().intValue();
                return TaskElementAdapter.toGantt(
                        start.addEffort(EffortDuration.seconds(seconds)),
                        EffortDuration.hours(8));
            }
View Full Code Here


             * <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;
View Full Code Here

             * @param orderElement
             */
            private EffortDuration getSumChargedEffort(OrderElement orderElement) {
                SumChargedEffort sumChargedEffort = orderElement
                        .getSumChargedEffort();
                EffortDuration totalChargedEffort = sumChargedEffort != null ? sumChargedEffort
                        .getTotalChargedEffort() : EffortDuration.zero();
                return totalChargedEffort;
            }
View Full Code Here

        return getRootTask() != null;
    }

    @Override
    public BigDecimal getOvertimeRatio() {
        EffortDuration totalLoad = sumAll(resourceLoadCalculator.getAllLoad());
        EffortDuration overload = sumAll(resourceLoadCalculator
                .getAllOverload());
        return overload.dividedByAndResultAsBigDecimal(totalLoad).setScale(2,
                RoundingMode.HALF_UP);
    }
View Full Code Here

                RoundingMode.HALF_UP);
    }

    private EffortDuration sumAll(
            ContiguousDaysLine<EffortDuration> contiguousDays) {
        EffortDuration result = EffortDuration.zero();
        Iterator<OnDay<EffortDuration>> iterator = contiguousDays
                .iterator();
        while (iterator.hasNext()) {
            OnDay<EffortDuration> value = iterator.next();
            EffortDuration effort = value.getValue();
            result = EffortDuration.sum(result, effort);
        }
        return result;
    }
View Full Code Here

        return result;
    }

    @Override
    public BigDecimal getAvailabilityRatio() {
        EffortDuration totalLoad = sumAll(resourceLoadCalculator.getAllLoad());
        EffortDuration overload = sumAll(resourceLoadCalculator
                .getAllOverload());
        EffortDuration load = totalLoad.minus(overload);

        EffortDuration capacity = sumAll(resourceLoadCalculator
                .getMaxCapacityOnResources());
        return BigDecimal.ONE.setScale(2, RoundingMode.HALF_UP).subtract(
                load.dividedByAndResultAsBigDecimal(capacity));
    }
View Full Code Here

            return EffortDuration.zero();
        }
        if (orderElement.getChildren().isEmpty()) {
            return EffortDuration.zero();
        }
        EffortDuration totalAssignedEffort = getTotalAssignedEffort();
        // FIXME Once we're able to reproduce and fix the cause of bugs like
        // #1529, we could remove this if
        if (totalAssignedEffort.compareTo(assignedDirectEffort) < 0) {
            orderElement.getOrder()
                    .markAsNeededToRecalculateSumChargedEfforts();
            return EffortDuration.zero();
        }
        return totalAssignedEffort.minus(this.assignedDirectEffort);
    }
View Full Code Here

            LOG
                    .warn("the start date is after end date. Inconsistent state for "
                            + allocationsOnInterval + ". LoadPeriod ignored");
            return null;
        }
        EffortDuration totalEffort = getTotalAvailableEffort();
        EffortDuration effortAssigned = getEffortAssigned();
        return new LoadPeriod(asGantt(start), asGantt(end),
                totalEffort.toFormattedString(),
                effortAssigned.toFormattedString(),
                new LoadLevel(calculateLoadPercentage(totalEffort,
                        effortAssigned)));
    }
View Full Code Here

    private EffortDuration inferDayCapacity(
            List<ResourceAllocation<?>> allocationsOnInterval, PartialDay day) {
        if (allocationsOnInterval.isEmpty()) {
            return null;
        }
        EffortDuration result = EffortDuration.zero();
        for (ResourceAllocation<?> each : allocationsOnInterval) {
            ICalendar allocationCalendar = each.getAllocationCalendar();
            result = result.plus(allocationCalendar.getCapacityOn(day));
        }
        return result.divideBy(allocationsOnInterval.size());
    }
View Full Code Here

            List<ProjectStatusReportDTO> toDiscount) {
        if (toDiscount.isEmpty()) {
            return originalDto;
        }

        EffortDuration estimatedHours = originalDto.getEstimatedHoursAsEffortDuration();
        EffortDuration plannedHours = originalDto.getPlannedHoursAsEffortDuration();
        EffortDuration imputedHours = originalDto.getImputedHoursAsEffortDuration();

        BigDecimal budget = originalDto.getBudget();
        BigDecimal resourcesBudget = originalDto.getResourcesBudget();
        BigDecimal expensesBudget = originalDto.getExpensesBudget();
View Full Code Here

TOP

Related Classes of org.libreplan.business.workingday.EffortDuration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.