Package org.libreplan.business.externalcompanies.entities

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


        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


    }

    @Test
    @Transactional
    public void testSaveCustomerCommunication() {
        CustomerCommunication customerCommunication = createValidCustomerCommunication();
        customerCommunicationDAO.save(customerCommunication);
        assertTrue(customerCommunication.getId() != null);
    }
View Full Code Here

    @Test
    @Transactional
    public void testRemoveCustomerCommunication()
            throws InstanceNotFoundException {
        CustomerCommunication customerCommunication = createValidCustomerCommunication();
        customerCommunicationDAO.save(customerCommunication);
        assertTrue(customerCommunication.getId() != null);
        customerCommunicationDAO.remove(customerCommunication.getId());
        assertFalse(customerCommunicationDAO
                .exists(customerCommunication.getId()));
    }
View Full Code Here

    @Test
    @Transactional
    public void testSaveCustomerCommunicationWithoutOrder()
            throws InstanceNotFoundException {
        CustomerCommunication customerCommunication = createValidCustomerCommunication();
        customerCommunication.setOrder(null);
        try {
            customerCommunicationDAO.save(customerCommunication);
            fail("It should throw an exception");
        } catch (ValidationException e) {
            // Ok
View Full Code Here

    private class CustomerCommunicationRenderer implements
            RowRenderer {

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

            final CommunicationType type = customerCommunication.getCommunicationType();
            final boolean reviewed = customerCommunication.getReviewed();
            if(!customerCommunication.getReviewed()){
                row.setSclass("communication-not-reviewed");
            }

            appendLabel(row, toString(type));
            appendLabel(row, customerCommunication.getOrder().getName());
            appendLabel(row,
                    Util.formatDate(customerCommunication.getDeadline()));
            appendLabel(row, customerCommunication.getOrder().getCode());
            appendLabel(row, customerCommunication.getOrder()
                    .getCustomerReference());
            appendLabel(row, Util.formatDateTime(customerCommunication
                    .getCommunicationDate()));
            appendCheckbox(row, customerCommunication);
            appendOperations(row, customerCommunication);
        }
View Full Code Here

        if(type.equals(CommunicationType.NEW_PROJECT)){
             deadline = order.getDeadline();
        }else{
            deadline = order.getDeliveringDates().first().getDeliverDate();
        }
        CustomerCommunication customerCommunication = CustomerCommunication
                .create(deadline, communicationDate,
                        type, order);
        customerCommunicationDAO.save(customerCommunication);
    }
View Full Code Here

TOP

Related Classes of org.libreplan.business.externalcompanies.entities.CustomerCommunication

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.