Search in sources :

Example 1 with InvoicingProjectService

use of com.axelor.apps.businessproject.service.InvoicingProjectService in project axelor-open-suite by axelor.

the class InvoicingProjectController method fillIn.

public void fillIn(ActionRequest request, ActionResponse response) throws AxelorException {
    InvoicingProject invoicingProject = request.getContext().asType(InvoicingProject.class);
    InvoicingProjectService invoicingProjectService = Beans.get(InvoicingProjectService.class);
    Project project = invoicingProject.getProject();
    if (project == null) {
        throw new AxelorException(TraceBackRepository.CATEGORY_CONFIGURATION_ERROR, I18n.get(IExceptionMessage.INVOICING_PROJECT_PROJECT));
    }
    invoicingProjectService.clearLines(invoicingProject);
    invoicingProjectService.setLines(invoicingProject, project, 0);
    response.setValues(invoicingProject);
}
Also used : InvoicingProject(com.axelor.apps.businessproject.db.InvoicingProject) Project(com.axelor.apps.project.db.Project) AxelorException(com.axelor.exception.AxelorException) InvoicingProjectService(com.axelor.apps.businessproject.service.InvoicingProjectService) InvoicingProject(com.axelor.apps.businessproject.db.InvoicingProject)

Aggregations

InvoicingProject (com.axelor.apps.businessproject.db.InvoicingProject)1 InvoicingProjectService (com.axelor.apps.businessproject.service.InvoicingProjectService)1 Project (com.axelor.apps.project.db.Project)1 AxelorException (com.axelor.exception.AxelorException)1