Examples of DeadlineCommunication


Examples of org.libreplan.business.externalcompanies.entities.DeadlineCommunication

            if((orderElement != null) && (orderElement instanceof Order)) {
                Order order = (Order)orderElement;

                Date newDeliverDate = DateConverter.toDate(updateDeliveringDateDTO.deliverDate);
                DeadlineCommunication deadlineCommunication = DeadlineCommunication
                        .create(new Date(), newDeliverDate);
                order.getDeliveringDates().add(deadlineCommunication);

                LocalDate newLocalDeliverDate = new LocalDate(newDeliverDate);
                OrderVersion orderVersion = order.getOrderVersionFor(Registry
View Full Code Here

Examples of org.libreplan.business.externalcompanies.entities.DeadlineCommunication

        order.setWorkBudget(subcontractedTaskDataDTO.subcontractPrice);

        if (subcontractedTaskDataDTO.deliverDate != null) {
            Date deliveryDate = DateConverter
                    .toDate(subcontractedTaskDataDTO.deliverDate);
            DeadlineCommunication deadlineCommunication = DeadlineCommunication
                    .create(new Date(), deliveryDate);
            order.getDeliveringDates().add(deadlineCommunication);
            order.setDeadline(deliveryDate);
        }
View Full Code Here

Examples of org.libreplan.business.externalcompanies.entities.DeadlineCommunication

    }

    public void setCurrentDeliveryDate(Grid listDeliveryDates) {
        if (getOrder() != null && getOrder().getDeliveringDates() != null
                && !getOrder().getDeliveringDates().isEmpty()) {
            DeadlineCommunication lastDeliveryDate = getOrder()
                    .getDeliveringDates().first();
            if (listDeliveryDates != null) {
                listDeliveryDates.renderAll();
                final Rows rows = listDeliveryDates.getRows();
                for (Iterator i = rows.getChildren().iterator(); i.hasNext();) {
                    final Row row = (Row) i.next();
                    final DeadlineCommunication deliveryDate = (DeadlineCommunication) row
                            .getValue();
                    if (deliveryDate.equals(lastDeliveryDate)) {
                        row.setSclass("current-delivery-date");
                        return;
                    }
                }
            }
View Full Code Here

Examples of org.libreplan.business.externalcompanies.entities.DeadlineCommunication

        //create two deadline communications
        Date date1 = (new Date());
        Date date2 = (new LocalDate(date1).plusDays(3)).toDateTimeAtStartOfDay().toDate();

        DeadlineCommunication deadlineCommunication1 = DeadlineCommunication.create(date1, null);
        DeadlineCommunication deadlineCommunication2 = DeadlineCommunication.create(date2, null);

        order.getDeliveringDates().add(deadlineCommunication1);
        order.getDeliveringDates().add(deadlineCommunication2);

        return order;
View Full Code Here

Examples of org.libreplan.business.externalcompanies.entities.DeadlineCommunication

        orderDAO.save(order);
        orderDAO.flush();

        assertThat(order.getDeliveringDates().size(), equalTo(2));

        DeadlineCommunication dcFirst = order.getDeliveringDates().first();
        DeadlineCommunication dcLast = order.getDeliveringDates().last();

        assertTrue(dcFirst.getSaveDate().after(dcLast.getSaveDate()));


        //A new DeadlineCommunication is placed between the existing communications.
        Date date = (new LocalDate(dcLast.getSaveDate()).plusDays(2)).toDateTimeAtStartOfDay().toDate();
        DeadlineCommunication deadlineCommunication = DeadlineCommunication.create(date, null);
        order.getDeliveringDates().add(deadlineCommunication);

        orderDAO.save(order);
        orderDAO.flush();

        assertThat(order.getDeliveringDates().size(), equalTo(3));

        dcFirst = order.getDeliveringDates().first();
        dcLast =  order.getDeliveringDates().last();
        DeadlineCommunication new_dc = (DeadlineCommunication) order.getDeliveringDates().toArray()[1];

        assertTrue(dcFirst.getSaveDate().after(dcLast.getSaveDate()));
        assertTrue(dcFirst.getSaveDate().after(new_dc.getSaveDate()));
        assertFalse(dcLast.equals(new_dc));
        assertTrue(dcLast.getSaveDate().before(new_dc.getSaveDate()));
    }
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.