Package org.libreplan.business.orders.entities

Examples of org.libreplan.business.orders.entities.Order.useSchedulingDataFor()


    @Test
    @Transactional
    public  void checkChangeIndirectCriterionToInvalid() {
        Order order = Order.create();
        order.useSchedulingDataFor(mockedOrderVersion);
        OrderLineGroup container1 = OrderLineGroup.create();
        container1.useSchedulingDataFor(mockedOrderVersion);
        order.add(container1);
        OrderLineGroup container2 = OrderLineGroup.create();
        container2.useSchedulingDataFor(mockedOrderVersion);
View Full Code Here


        // Create basic data
        hoursGroup = new HoursGroup();
        hoursGroup.setWorkingHours(3);
        Order order = new Order();
        order.useSchedulingDataFor(mockedOrderVersion);
        order.setInitDate(new Date());
        OrderLine orderLine = OrderLine.create();
        order.add(orderLine);
        order.setCalendar(stubCalendar());
        SchedulingDataForVersion version = TaskElementTest
View Full Code Here

    public static Task createValidTask() {
        HoursGroup hoursGroup = new HoursGroup();
        hoursGroup.setWorkingHours(3);
        OrderLine orderLine = OrderLine.create();
        Order order = new Order();
        order.useSchedulingDataFor(mockedOrderVersion);
        order.setInitDate(new Date());
        order.add(orderLine);
        SchedulingDataForVersion version = TaskElementTest
                .mockSchedulingDataForVersion(orderLine);
        TaskSource taskSource = TaskSource.create(version, Arrays
View Full Code Here

                order.getDeliveringDates().add(deadlineCommunication);

                LocalDate newLocalDeliverDate = new LocalDate(newDeliverDate);
                OrderVersion orderVersion = order.getOrderVersionFor(Registry
                        .getScenarioManager().getCurrent());
                order.useSchedulingDataFor(orderVersion);
                if (order.getAssociatedTaskElement() != null) {
                    order.getAssociatedTaskElement().setDeadline(
                            newLocalDeliverDate);
                }
                createCustomerCommunication(order, CommunicationType.UPDATE_DELIVERING_DATE);
View Full Code Here

        Order order;
        if (orderElement instanceof Order) {
            order = (Order) orderElement;
            order.setVersionForScenario(current, version);
            order.useSchedulingDataFor(version);
            order.setExternalCode(order.getCode());
        } else {
            order = wrapInOrder(current, version,
                    orderElement);
        }
View Full Code Here

            return (Order) orderElement;
        }

        Order order = Order.create();
        order.setVersionForScenario(current, version);
        order.useSchedulingDataFor(version);
        order.add(orderElement);

        order.setName("Project from client");
        order.setInitDate(orderElement.getInitDate());
        order.setDeadline(orderElement.getDeadline());
View Full Code Here

                }
                Order order = (Order) orderElement;
                orderVersion = order.getOrderVersionFor(Registry
                        .getScenarioManager()
                        .getCurrent());
                order.useSchedulingDataFor(orderVersion);
                Boolean dependenciesConstraintsHavePriority = ((OrderDTO) orderElementDTO).dependenciesConstraintsHavePriority;
                if (dependenciesConstraintsHavePriority != null) {
                    ((Order) orderElement)
                            .setDependenciesConstraintsHavePriority(dependenciesConstraintsHavePriority);
                }
View Full Code Here

        }
        int i = 1;
        for (Entry<Order, OrderVersion> each : needingReassignation) {
            OrderVersion orderVersion = each.getValue();
            Order order = each.getKey();
            order.useSchedulingDataFor(scenario);
            if (order.isScheduled()) {
                doReassignationsOn(order, orderVersion.getOwnerScenario(),
                        scenario);
                orderVersion.savingThroughOwner();
                orderVersionDAO.save(orderVersion);
View Full Code Here

    private OrderLine createValidOrderLine() {
        Order order = new Order();
        order.setInitDate(new Date());
        OrderVersion orderVersion = setupVersionUsing(scenarioManager, order);
        order.useSchedulingDataFor(orderVersion);
        OrderLine orderLine = OrderLine.create();
        order.add(orderLine);
        orderLine.setName(UUID.randomUUID().toString());
        orderLine.setCode(UUID.randomUUID().toString());
        orderElementDAO.save(orderLine);
View Full Code Here

    @Test
    @Transactional
    public void testAddingOrderElement() {
        Order order = Order.create();
        order.useSchedulingDataFor(mockedOrderVersion);
        OrderLineGroup container = OrderLineGroup.create();
        OrderLine leaf = OrderLine.create();
        order.add(container);
        container.add(leaf);
        assertThat(order.getOrderElements().size(), equalTo(1));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.