Package org.libreplan.business.orders.entities

Examples of org.libreplan.business.orders.entities.OrderElement


    }

    public Treeitem getTreeitemByOrderElement(OrderElement element) {
        List<Treeitem> listItems = new ArrayList<Treeitem>(this.tree.getItems());
        for (Treeitem item : listItems) {
            OrderElement orderElement = (OrderElement) item.getValue();
            if (orderElement.getId().equals(element.getId())) {
                return item;
            }
        }
        return null;
    }
View Full Code Here


    }

    public void goToEdit(SubcontractorCommunication subcontractorCommunication) {
        if(subcontractorCommunication != null){
            TaskElement task = subcontractorCommunication.getSubcontractedTaskData().getTask();
            OrderElement orderElement = task.getOrderElement();
            Order order = subcontractorCommunicationModel.getOrder(orderElement);

            if(subcontractorCommunication.getCommunicationType().equals(CommunicationType.PROGRESS_UPDATE)){
                globalView.goToAdvanceTask(order,task);
            }else{
View Full Code Here

    @Override
    @Transactional
    public OrderElement findOrderElement(String orderCode)
            throws InstanceNotFoundException {
        OrderElement result =  orderElementDAO.findUniqueByCode(orderCode);
        initializeChildren(result);
        return result;
    }
View Full Code Here

            // Only adapt task leafs
            if (!taskElement.isTask()) {
                continue;
            }

            OrderElement orderElement = taskElement.getOrderElement();
            // Reset status to allow move the task if needed while adapting the
            // planning
            taskElement.setUpdatedFromTimesheets(false);

            if (orderElement.hasTimesheetsReportingHours()) {
                setStartDateAndConstraint(taskElement,
                        orderElement.getFirstTimesheetDate());
                Date lastTimesheetDate = orderElement.getLastTimesheetDate();
                setEndDateIfNeeded(taskElement, lastTimesheetDate);

                if (orderElement.isFinishedTimesheets()) {
                    setEndDate(taskElement, lastTimesheetDate);
                    addTimesheetsProgress(orderElement, lastTimesheetDate);
                    removeResourceAllocationsBeyondEndDate(taskElement);
                } else {
                    removeTimesheetsProgressIfAny(orderElement);
View Full Code Here

        // Add dependencies
        if (showDependencies) {
            taskDAO.reattach(task);
            for (Dependency each : dependencies) {
                final OrderElement orderElement = each.getOrigin()
                        .getOrderElement();
                DependencyWorkingArrangementDTO dependencyDTO = new DependencyWorkingArrangementDTO(
                        orderElement.getName(), orderElement.getCode(), each
                                .getType().toString(), orderElement
                                .getAdvancePercentage());
                WorkingArrangementPerOrderDTO dto = new WorkingArrangementPerOrderDTO(
                        task, taskStatus, dependencyDTO);
                dto.setStatus(_(dto.getStatus()));
                result.add(dto);
View Full Code Here

        return null;
    }

    private boolean matchTaskStatusFinished(Task task) {
        final OrderElement order = task.getOrderElement();
        BigDecimal measuredProgress = order.getAdvancePercentage();
        return isFinished(measuredProgress);
    }
View Full Code Here

                .setScale(0, BigDecimal.ROUND_UP);
        return measuredProgress.equals(new BigDecimal(100));
    }

    private boolean matchTaskStatusInProgress(Task task) {
        final OrderElement order = task.getOrderElement();
        final BigDecimal measuredProgress = order.getAdvancePercentage();
        return isInProgress(measuredProgress)
                || (hasNotYetStarted(measuredProgress) && hasAtLeastOneWorkReportLine(order));
    }
View Full Code Here

    private List<WorkReportLine> getWorkReportLines(OrderElement order) {
        return workReportLineDAO.findByOrderElement(order);
    }

    private boolean matchTaskStatusPending(Task task) {
        final OrderElement order = task.getOrderElement();
        final BigDecimal measuredProgress = order.getAdvancePercentage();

        return hasNotYetStarted(measuredProgress)
                && hasNotWorkReports(order)
                && (!isBlockedByDepedendantTasks(task));
    }
View Full Code Here

        return measuredProgress.setScale(2).equals(
                new BigDecimal(0).setScale(2));
    }

    private boolean matchTaskStatusBlocked(Task task) {
        final OrderElement order = task.getOrderElement();
        final BigDecimal measuredProgress = order.getAdvancePercentage();

        return hasNotYetStarted(measuredProgress)
                && hasNotWorkReports(order)
                && isBlockedByDepedendantTasks(task);
    }
View Full Code Here

    @Transactional(readOnly = true)
    public void createTemplateFrom(OrderElement orderElement) {
        initializeAcompanyingObjectsOnConversation();
        Order order = orderDAO.loadOrderAvoidingProxyFor(orderElement);
        order.useSchedulingDataFor(getCurrentScenario());
        OrderElement orderElementOrigin = orderElementDAO
                .findExistingEntity(orderElement
                .getId());
        template = orderElementOrigin.createTemplate();
        loadAssociatedData(template);
        treeModel = new TemplatesTree(template);
    }
View Full Code Here

TOP

Related Classes of org.libreplan.business.orders.entities.OrderElement

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.