use of com.axelor.apps.base.db.Batch in project axelor-open-suite by axelor.
the class CrmBatchService method run.
@Override
public Batch run(Model batchModel) throws AxelorException {
Batch batch;
CrmBatch crmBatch = (CrmBatch) batchModel;
switch(crmBatch.getActionSelect()) {
case CrmBatchRepository.ACTION_BATCH_EVENT_REMINDER:
batch = eventReminder(crmBatch);
break;
case CrmBatchRepository.ACTION_BATCH_TARGET:
batch = target(crmBatch);
break;
default:
throw new AxelorException(TraceBackRepository.CATEGORY_INCONSISTENCY, I18n.get(IExceptionMessage.BASE_BATCH_1), crmBatch.getActionSelect(), crmBatch.getCode());
}
return batch;
}
use of com.axelor.apps.base.db.Batch in project axelor-open-suite by axelor.
the class BankPaymentBatchService method run.
@Override
public Batch run(Model batchModel) throws AxelorException {
Batch batch;
BankPaymentBatch bankPaymentBatch = (BankPaymentBatch) batchModel;
switch(bankPaymentBatch.getActionSelect()) {
case BankPaymentBatchRepository.ACTION_EBICS_CERTIFICATE:
batch = ebicsCertificate(bankPaymentBatch);
break;
case BankPaymentBatchRepository.ACTION_BANK_STATEMENT:
batch = bankStatement(bankPaymentBatch);
break;
default:
throw new AxelorException(TraceBackRepository.CATEGORY_INCONSISTENCY, I18n.get(IExceptionMessage.BASE_BATCH_1), bankPaymentBatch.getActionSelect(), bankPaymentBatch.getCode());
}
return batch;
}
use of com.axelor.apps.base.db.Batch in project axelor-open-suite by axelor.
the class BankPaymentBatchController method actionEbicsCertificate.
public void actionEbicsCertificate(ActionRequest request, ActionResponse response) {
BankPaymentBatch bankPaymentBatch = request.getContext().asType(BankPaymentBatch.class);
bankPaymentBatch = Beans.get(BankPaymentBatchRepository.class).find(bankPaymentBatch.getId());
Batch batch = Beans.get(BatchEbicsCertificate.class).ebicsCertificate(bankPaymentBatch);
if (batch != null) {
response.setFlash(batch.getComments());
}
response.setReload(true);
}
use of com.axelor.apps.base.db.Batch 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.base.db.Batch 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