use of com.axelor.apps.businessproject.db.ProjectInvoicingAssistantBatch in project axelor-open-suite by axelor.
the class ProjectInvoicingAssistantBatchController method actionUpdateTask.
public void actionUpdateTask(ActionRequest request, ActionResponse response) {
try {
ProjectInvoicingAssistantBatch projectInvoicingAssistantBatch = request.getContext().asType(ProjectInvoicingAssistantBatch.class);
projectInvoicingAssistantBatch = Beans.get(ProjectInvoicingAssistantBatchRepository.class).find(projectInvoicingAssistantBatch.getId());
Batch batch = Beans.get(ProjectInvoicingAssistantBatchService.class).updateTask(projectInvoicingAssistantBatch);
response.setFlash(batch.getComments());
} catch (Exception e) {
TraceBackService.trace(response, e);
} finally {
response.setReload(true);
}
}
use of com.axelor.apps.businessproject.db.ProjectInvoicingAssistantBatch in project axelor-open-suite by axelor.
the class ProjectInvoicingAssistantBatchService method run.
@Override
public Batch run(Model model) throws AxelorException {
Batch batch;
ProjectInvoicingAssistantBatch projectInvoicingAssistantBatch = (ProjectInvoicingAssistantBatch) model;
switch(projectInvoicingAssistantBatch.getActionSelect()) {
case ProjectInvoicingAssistantBatchRepository.ACTION_UPDATE_TASKS:
batch = updateTask(projectInvoicingAssistantBatch);
break;
case ProjectInvoicingAssistantBatchRepository.ACTION_GENERATE_INVOICING_PROJECT:
batch = generateInvoicingProject(projectInvoicingAssistantBatch);
break;
default:
throw new AxelorException(TraceBackRepository.CATEGORY_INCONSISTENCY, I18n.get(IExceptionMessage.BASE_BATCH_1), projectInvoicingAssistantBatch.getActionSelect(), projectInvoicingAssistantBatch.getCode());
}
return batch;
}
use of com.axelor.apps.businessproject.db.ProjectInvoicingAssistantBatch in project axelor-open-suite by axelor.
the class ProjectInvoicingAssistantBatchController method actionGenerateInvoicingProject.
public void actionGenerateInvoicingProject(ActionRequest request, ActionResponse response) {
try {
ProjectInvoicingAssistantBatch projectInvoicingAssistantBatch = request.getContext().asType(ProjectInvoicingAssistantBatch.class);
projectInvoicingAssistantBatch = Beans.get(ProjectInvoicingAssistantBatchRepository.class).find(projectInvoicingAssistantBatch.getId());
Batch batch = Beans.get(ProjectInvoicingAssistantBatchService.class).generateInvoicingProject(projectInvoicingAssistantBatch);
response.setFlash(batch.getComments());
} catch (Exception e) {
TraceBackService.trace(response, e);
} finally {
response.setReload(true);
}
}
Aggregations