Package org.libreplan.business.orders.entities

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


            }
        });
    }

    private Order givenValidOrderAlreadyStored() {
        Order order = Order.create();
        order.setCode(UUID.randomUUID().toString());
        order.setName("Order name " + UUID.randomUUID());
        order.setInitDate(new Date());
        order.setCalendar(configurationDAO.getConfiguration().getDefaultCalendar());
        OrderVersion version = OrderModelTest.setupVersionUsing(scenarioManager, order);
        order.useSchedulingDataFor(version);

        OrderLine orderLine = OrderLine.createOrderLineWithUnfixedPercentage(1000);
        orderLine.useSchedulingDataFor(version);
        order.add(orderLine);
        orderLine.setCode(UUID.randomUUID().toString());
        orderLine.setName("Order line name" + UUID.randomUUID().toString());

        orderDAO.save(order);
        orderDAO.flush();
        try {
            return orderDAO.find(order.getId());
        } catch (InstanceNotFoundException e) {
            return null;
        }
    }
View Full Code Here


    private OrderLine createOrderLine() {
        return transactionService.runOnAnotherTransaction(new IOnTransaction<OrderLine>() {
            @Override
            public OrderLine execute() {
                Order order = givenValidOrderAlreadyStored();
                OrderLine orderLine = (OrderLine) order.getChildren().get(0);
                createValidSubcontractedTaskData(
                        "subcotrated_task_" + UUID.randomUUID().toString(), orderLine);
                return orderLine;
            }
        });
View Full Code Here

            listOrderCostMasterDTO.add(createEmptyOrderCostMasterDTO());
        } else {
            for (OrderElement orderElement : listOrderElement) {
                List<OrderCostsPerResourceDTO> listWorkReportLineDTO = mapWRL.get(orderElement);
                if (listWorkReportLineDTO == null || listWorkReportLineDTO.isEmpty()) {
                    Order order = Order.create();
                    order.setName(_("All projects"));
                    listWorkReportLineDTO = createEmptyWorkReportLineList(order);
                }

                JRDataSource dsWRL = new JRBeanCollectionDataSource(listWorkReportLineDTO);
View Full Code Here

    private void initOrderInOrderCostMasterDTO(OrderCostMasterDTO orderCostMasterDTO,
            List<OrderCostsPerResourceDTO> listWorkReportLineDTO,
            List<CostExpenseSheetDTO> listExpenseSheetDTO) {
        if (listExpenseSheetDTO != null && !listExpenseSheetDTO.isEmpty()) {
            Order order = listExpenseSheetDTO.get(0).getOrder();
            orderCostMasterDTO.setOrderCode(order.getCode());
            orderCostMasterDTO.setOrderName(order.getName());
        } else if (listWorkReportLineDTO != null && !listWorkReportLineDTO.isEmpty()) {
            orderCostMasterDTO.setOrderCode(listWorkReportLineDTO.get(0).getOrderCode());
            orderCostMasterDTO.setOrderName(listWorkReportLineDTO.get(0).getOrderName());
        }
    }
View Full Code Here

        return emptyDTO;
    }

    private OrderCostMasterDTO createEmptyOrderCostMasterDTO() {
        // create empty order
        Order order = Order.create();
        order.setName(_("All projects"));

        // create empty subreport to expense sheets
        JRDataSource emptyES = new JRBeanCollectionDataSource(
                createEmptyExpenseSheetLineList(order));
View Full Code Here

                    public void doAction(
                            IContextWithPlannerTask<TaskElement> context,
                            TaskElement task) {
                        OrderElement orderElement = task.getOrderElement();
                        if (orderElement instanceof Order) {
                            Order order = (Order) orderElement;
                            mode.goToOrderMode(order);
                        }
                    }

                    @Override
                    public String getName() {
                        return _("Schedule");
                    }

                    @Override
                    public String getIcon() {
                        return "/common/img/ico_menu_scheduling.png";
                    }

                    @Override
                    public boolean isApplicableTo(TaskElement task) {
                        return true;
                    }
                };
            }

            private ICommandOnTask<TaskElement> buildOrderDetailsCommand() {
                return new ICommandOnTask<TaskElement>() {

                    @Override
                    public void doAction(
                            IContextWithPlannerTask<TaskElement> context,
                            TaskElement task) {
                        OrderElement orderElement = task.getOrderElement();
                        if (orderElement instanceof Order) {
                            Order order = (Order) orderElement;
                            tabsController.goToOrderDetails(order);
                        }
                    }

                    @Override
View Full Code Here

            @Override
            protected void afterShowAction() {

                orderPlanningController.setOrder(reload(mode.getOrder()));
                orderPlanningController.setShowedTask(null);
                Order order = orderPlanningController.getOrder();
                Map<String, Object> arguments = new HashMap<String, Object>();
                arguments.put("orderPlanningController",
                        orderPlanningController);

                if (breadcrumbs.getChildren() != null) {
                    breadcrumbs.getChildren().clear();
                }
                breadcrumbs.appendChild(new Image(BREADCRUMBS_SEPARATOR));
                breadcrumbs.appendChild(new Label(getSchedulingLabel()));
                breadcrumbs.appendChild(new Image(BREADCRUMBS_SEPARATOR));
                breadcrumbs.appendChild(new Label(_("Project Scheduling")));
                if (mode.isOf(ModeType.ORDER)) {

                    orderPlanningController.getOrderCRUDController()
                            .checkUserCanRead(order);
                    Label nameLabel = new Label(order.getName());
                    nameLabel.setTooltiptext(order.getName() + "."
                            + order.getDescription());
                    nameLabel.setMaxlength(MAX_ORDERNAME_LENGHT);

                    Label schedulingStateLabel = new Label(_(order.getState()
                            .toString()));

                    schedulingStateLabel.setSclass("scheduling-state "
                            + order.getSchedulingState().getCssClass());
                    schedulingStateLabel.setTooltiptext(_(order
                            .getSchedulingState().getStateName()));

                    breadcrumbs.appendChild(new Image(BREADCRUMBS_SEPARATOR));
                    breadcrumbs.appendChild(nameLabel);
                    breadcrumbs.appendChild(schedulingStateLabel);
View Full Code Here

        calendarImporterMPXJ.storeBaseCalendars(baseCalendars);

        OrderDTO importData = calendarImporterMPXJ.getOrderDTO(file);

        Order order = orderImporterMPXJ.convertImportDataToOrder(importData,
                true);

        TaskGroup taskGroup = orderImporterMPXJ.createTask(importData, true);

        List<Dependency> dependencies = orderImporterMPXJ
View Full Code Here

    @Transactional
    private void importProject(InputStream streamData, String file) {

        OrderDTO importData = orderImporterMPXJ.getImportData(streamData, file);

        Order order = orderImporterMPXJ.convertImportDataToOrder(importData,
                false);

        TaskGroup taskGroup = orderImporterMPXJ.createTask(importData, false);

        List<Dependency> dependencies = orderImporterMPXJ
View Full Code Here

        importOrderFiltersFromSession();
        disableCreateTemplateButtonIfNeeded(comp);
    }

    private void importOrderFiltersFromSession() {
        Order order = orderModel.getOrder();
        filterNameOrderElement.setValue(FilterUtils
.readOrderTaskName(order));
        filterStartDateOrderElement.setValue(FilterUtils
                .readOrderStartDate(order));
        filterFinishDateOrderElement.setValue(FilterUtils
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.