use of com.axelor.apps.base.db.Batch in project axelor-open-suite by axelor.
the class MailBatchController method remindTimesheetGeneral.
public void remindTimesheetGeneral(ActionRequest request, ActionResponse response) throws AxelorException {
MailBatch mailBatch = Beans.get(MailBatchRepository.class).findByCode(MailBatchRepository.CODE_BATCH_EMAIL_TIME_SHEET);
if (mailBatch != null) {
Batch batch = null;
batch = Beans.get(MailBatchService.class).remindMail(mailBatch);
if (batch != null)
response.setFlash(batch.getComments());
response.setReload(true);
} else {
throw new AxelorException(TraceBackRepository.CATEGORY_INCONSISTENCY, I18n.get(IExceptionMessage.BASE_BATCH_2), MailBatchRepository.CODE_BATCH_EMAIL_TIME_SHEET);
}
}
use of com.axelor.apps.base.db.Batch 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.base.db.Batch in project axelor-open-suite by axelor.
the class SaleBatchController method run.
/**
* Lancer le batch à travers un web service.
*
* @param request
* @param response
* @throws AxelorException
*/
public void run(ActionRequest request, ActionResponse response) throws AxelorException {
Batch batch = Beans.get(SaleBatchService.class).run((String) request.getContext().get("code"));
Map<String, Object> mapData = new HashMap<String, Object>();
mapData.put("anomaly", batch.getAnomaly());
response.setData(mapData);
}
use of com.axelor.apps.base.db.Batch in project axelor-open-suite by axelor.
the class BankPaymentBatchController method actionBankStatement.
public void actionBankStatement(ActionRequest request, ActionResponse response) {
try {
BankPaymentBatch bankPaymentBatch = request.getContext().asType(BankPaymentBatch.class);
bankPaymentBatch = Beans.get(BankPaymentBatchRepository.class).find(bankPaymentBatch.getId());
Batch batch = Beans.get(BatchBankStatement.class).bankStatement(bankPaymentBatch);
if (batch != null)
response.setFlash(batch.getComments());
} catch (Exception e) {
TraceBackService.trace(response, e);
} finally {
response.setReload(true);
}
}
use of com.axelor.apps.base.db.Batch in project axelor-open-suite by axelor.
the class BatchController method createBankOrder.
public void createBankOrder(ActionRequest request, ActionResponse response) {
try {
Batch batch = request.getContext().asType(Batch.class);
batch = Beans.get(BatchRepository.class).find(batch.getId());
Beans.get(BatchBankPaymentService.class).createBankOrder(batch);
response.setReload(true);
} catch (Exception e) {
TraceBackService.trace(response, e, ResponseMessageType.ERROR);
}
}
Aggregations