Package org.libreplan.business.planner.entities

Examples of org.libreplan.business.planner.entities.SubcontractedTaskData


        if (id == null) {
            return false;
        }

        try {
            SubcontractedTaskData found = find(id);
            return (found != null) && (found.getId().equals(id));
        } catch (InstanceNotFoundException e) {
            return false;
        }
    }
View Full Code Here


                int currentCommunications = subcontractorCommunicationDAO.getAll().size();
                assertThat((previousCommunications + 1), equalTo(currentCommunications));

                Task task = (Task) orderElement.getTaskSource().getTask();
                SubcontractedTaskData subcontractedTaskData = task.getSubcontractedTaskData();
                assertNotNull(subcontractedTaskData);
                assertThat(subcontractedTaskData.getEndDatesCommunicatedFromSubcontractor().size(),
                        equalTo(1));
                } catch (InstanceNotFoundException e) {
                    throw new RuntimeException();
                }
                return null;
View Full Code Here

                    int currentCommunications = subcontractorCommunicationDAO.getAll().size();
                    assertThat((previousCommunications + 2), equalTo(currentCommunications));

                    Task task = (Task) orderElement.getTaskSource().getTask();
                    SubcontractedTaskData subcontractedTaskData = task.getSubcontractedTaskData();
                    assertNotNull(subcontractedTaskData);
                    assertThat(subcontractedTaskData.getEndDatesCommunicatedFromSubcontractor()
                            .size(), equalTo(1));
                } catch (InstanceNotFoundException e) {
                    throw new RuntimeException();
                }
                return null;
View Full Code Here

    }

    public SubcontractedTaskData createValidSubcontractedTaskData(final String name,
            final OrderLine orderLine) {
        Task task = createValidTask(orderLine);
        SubcontractedTaskData subcontractedTaskData = SubcontractedTaskData.create(task);
        subcontractedTaskData.addRequiredDeliveringDates(SubcontractorDeliverDate
                .create(new Date(),new Date(), null));
        subcontractedTaskData.setExternalCompany(getSubcontractorExternalCompanySaved());

        task.setSubcontractedTaskData(subcontractedTaskData);
        taskElementDAO.save(task);
        task.dontPoseAsTransientObjectAnymore();
        taskElementDAO.flush();
View Full Code Here

    private class SubcontractedTasksRenderer implements RowRenderer {

        @Override
        public void render(Row row, Object data) {
            SubcontractedTaskData subcontractedTaskData = (SubcontractedTaskData) data;
            row.setValue(subcontractedTaskData);

            Order order = getOrder(subcontractedTaskData);

            appendLabel(row, Util.formatDateTime(subcontractedTaskData
                    .getSubcontratationDate()));
            appendLabel(row, Util.formatDateTime(subcontractedTaskData
                    .getSubcontractCommunicationDate()));
            appendLabel(row, getExternalCompany(subcontractedTaskData));
            appendLabel(row, getOrderCode(order));
            appendLabel(row, getOrderName(order));
            appendLabel(row, subcontractedTaskData.getSubcontractedCode());
            appendLabel(row, getTaskName(subcontractedTaskData));
            row.setTooltiptext(subcontractedTaskData.getWorkDescription());
            appendLabel(row, Util.addCurrencySymbol(subcontractedTaskData.getSubcontractPrice()));
            appendLabel(row, Util.formatDate(subcontractedTaskData
                    .getLastRequiredDeliverDate()));
            appendLabel(row, _(toString(subcontractedTaskData.getState())));
            appendOperations(row, subcontractedTaskData);
        }
View Full Code Here

    public void createSubcontractorCommunicationWithNewProgress(OrderElement orderElement,
            Set<AdvanceMeasurementDTO> advanceMeasurementDTOs) throws InstanceNotFoundException {
        if (orderElement != null && orderElement.getTaskSource() != null
                && orderElement.getTaskSource().getTask().isSubcontracted()) {
            Task task = (Task) orderElement.getTaskSource().getTask();
            SubcontractedTaskData subcontractedTaskData = task.getSubcontractedTaskData();
            if (subcontractedTaskData != null) {
                SubcontractorCommunication subcontractorCommunication = SubcontractorCommunication
                        .create(subcontractedTaskData, CommunicationType.PROGRESS_UPDATE,
                                new Date(), false);
View Full Code Here

            if (orderElement != null && orderElement.getTaskSource() != null
                    && orderElement.getTaskSource().getTask().isSubcontracted()) {

                Task task = (Task) orderElement.getTaskSource().getTask();
                SubcontractedTaskData subcontractedTaskData = task.getSubcontractedTaskData();
                EndDateCommunicationToCustomerDTO endDateDTO = orderElementWithAdvanceMeasurementsOrEndDateDTO.endDateCommunicationToCustomerDTO;

                Date endDate = DateConverter.toDate(endDateDTO.endDate);
                Date communicationDate = DateConverter.toDate(endDateDTO.communicationDate);

                subcontractedTaskData.getEndDatesCommunicatedFromSubcontractor().add(
                        EndDateCommunication.create(new Date(), endDate,
                                communicationDate));
                subcontractedTaskDataDAO.save(subcontractedTaskData);

                createSubcontractorCommunicationWithNewEndDate(subcontractedTaskData, endDateDTO);
View Full Code Here

        this.startDate = task.getIntraDayStartDate();
        this.endDate = task.getIntraDayEndDate();

        this.ganttTask = ganttTask;

        SubcontractedTaskData subcontractedTaskData = task
                .getSubcontractedTaskData();

        this.currentSubcontractedTaskData = subcontractedTaskData;

        if (subcontractedTaskData == null) {
View Full Code Here

        return task;
    }

    public SubcontractedTaskData createValidSubcontractedTaskData(String name) {
        Task task = createValidTask();
        SubcontractedTaskData subcontractedTaskData = SubcontractedTaskData
                .create(task);
        subcontractedTaskData.addRequiredDeliveringDates(SubcontractorDeliverDate
                .create(new Date(),new Date(), null));
        subcontractedTaskData.setExternalCompany(getSubcontractorExternalCompanySaved());

        task.setSubcontractedTaskData(subcontractedTaskData);
        taskElementDAO.save(task);
        taskElementDAO.flush();
        sessionFactory.getCurrentSession().evict(task);
View Full Code Here

        subcontractedTaskDataDAO.save(subcontractedTaskData);
        return subcontractedTaskData;
    }

    public SubcontractorCommunication createValidSubcontractorCommunication(){
        SubcontractedTaskData subcontractedTaskData = createValidSubcontractedTaskData("Task A");
        Date communicationDate = new Date();
        SubcontractorCommunication subcontractorCommunication = SubcontractorCommunication
                .create(subcontractedTaskData, CommunicationType.NEW_PROJECT,
                        communicationDate, false);
        return subcontractorCommunication;
View Full Code Here

TOP

Related Classes of org.libreplan.business.planner.entities.SubcontractedTaskData

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.