Package org.libreplan.business.orders.entities

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


    @Test
    @Transactional
    @Ignore("Only working if you have a JIRA server configured")
    public void testReSyncOrderElementsOfAnExistingOrderWithOrderLines() {
        Order order = givenOrderWithValidOrderLines();
        Integer workingHours = order.getWorkHours();
        jiraOrderElementSynchronizer.syncOrderElementsWithJiraIssues(issues, order);
        assertEquals(order.getOrderElements().size(), issues.size());
        assertEquals(workingHours.intValue(), order.getWorkHours().intValue());
    }
View Full Code Here


            TaskSource taskSource) {
        taskElement.setTaskSource(taskSource);
        taskElement.updateDeadlineFromOrderElement();
        taskElement.setName(taskElement.getOrderElement().getName());
        taskElement.updateAdvancePercentageFromOrderElement();
        Order order = taskElement.getOrderElement().getOrder();
        if (order.isScheduleBackwards()) {
            taskElement.setEndDate(order.getDeadline());
        } else {
            taskElement.setStartDate(order.getInitDate());
        }
        return create(taskElement);
    }
View Full Code Here

    public Boolean belongsClosedProject() {
        EnumSet<OrderStatusEnum> CLOSED = EnumSet.of(OrderStatusEnum.CANCELLED,
                OrderStatusEnum.FINISHED, OrderStatusEnum.STORED);

        Order order = getOrderElement().getOrder();
        if(CLOSED.contains(order.getState())) {
            return true;
        }

        return false;
    }
View Full Code Here

            this.source = source;
        }

        @Override
        public void render(Listitem item, Object data) {
            Order order = (Order) data;
            item.setValue(data);

            item.appendChild(new Listcell(order.getCode()));
            item.appendChild(new Listcell(order.getName()));
            Scenario scenario = source ? transferOrdersModel
                    .getSourceScenario() : transferOrdersModel
                    .getDestinationScenario();
            item.appendChild(new Listcell(transferOrdersModel.getVersion(order,
                    scenario)));
View Full Code Here

     */
    @Override
    @Transactional
    public TaskGroup createTask(OrderDTO project, boolean importCalendar) {

        Order order = project.order;

        TaskSource taskSource = TaskSource.createForGroup(order
                .getCurrentSchedulingDataForVersion());

        TaskGroup taskGroup = taskSource
                .createTaskGroupWithoutDatesInitializedAndLinkItToTaskSource();

View Full Code Here

        }
    }

    private boolean areInTheSameOrder(OrderElement orderElement1,
            OrderElement orderElement2) {
        Order order1 = orderElement1.getOrder();
        Order order2 = orderElement2.getOrder();
        if (order1 == null || order2 == null) {
            return false;
        }
        return ObjectUtils.equals(order1.getId(), order2.getId());
    }
View Full Code Here

    }

    private LimitingResourceQueueElementDTO toLimitingResourceQueueElementDTO(
            LimitingResourceQueueElement element) {
        final Task task = element.getResourceAllocation().getTask();
        final Order order = limitingResourceQueueModel.getOrderByTask(task);
        return new LimitingResourceQueueElementDTO(element, order
                .getName(), task.getName(), element
                .getEarliestStartDateBecauseOfGantt());
    }
View Full Code Here

    @Autowired
    private IBaseCalendarDAO calendarDAO;

    public Order createValidOrder(String name) {
        Order order = Order.create();
        order.setName(name);
        order.setCode(UUID.randomUUID().toString());
        order.setInitDate(new Date());
        BaseCalendar basicCalendar = BaseCalendarTest.createBasicCalendar();
        calendarDAO.save(basicCalendar);
        order.setCalendar(basicCalendar);
        orderDAO.save(order);
        return order;
    }
View Full Code Here

        date.plusMonths(months);
        return date.toDateTimeAtStartOfDay().toDate();
    }

    public CustomerCommunication createValidCustomerCommunication() {
        Order order = createValidOrder("Order A");
        CustomerCommunication customerCommunication = CustomerCommunication
                .createTodayNewProject(givenDeadLine(2));
        customerCommunication.setOrder(order);
        return customerCommunication;
    }
View Full Code Here

            }

            if (orderElement.isOrder()) {
                orderModel.remove((Order) orderElement);
            } else {
                Order order = orderDAO.loadOrderAvoidingProxyFor(orderElement);
                orderModel.initEdit(order, null);
                order = orderModel.getOrder();

                orderElement = findOrderElement(order, orderElement.getId());

                OrderLineGroup parent = orderElement.getParent();
                parent.remove(orderElement);
                orderElement.detachFromParent();

                if (!parent.isOrder() && parent.getChildren().isEmpty()) {
                    OrderElement newElement = parent.toLeaf();
                    if (!order.isCodeAutogenerated()) {
                        newElement.setCode(UUID.randomUUID().toString());
                    }
                    parent.getParent().replace(parent, newElement);
                    parent.detachFromParent();
                }
View Full Code Here

TOP

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

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.