use of com.axelor.apps.base.db.Batch in project axelor-open-suite by axelor.
the class CrmBatchController method run.
// WS
/**
* 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(CrmBatchService.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 CrmBatchController method actionEventReminder.
/**
* Lancer le batch de relance
*
* @param request
* @param response
*/
public void actionEventReminder(ActionRequest request, ActionResponse response) {
CrmBatch crmBatch = request.getContext().asType(CrmBatch.class);
Batch batch = Beans.get(CrmBatchService.class).eventReminder(Beans.get(CrmBatchRepository.class).find(crmBatch.getId()));
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 CrmBatchController method actionTarget.
/**
* Lancer le batch des objectifs
*
* @param request
* @param response
*/
public void actionTarget(ActionRequest request, ActionResponse response) {
CrmBatch crmBatch = request.getContext().asType(CrmBatch.class);
Batch batch = Beans.get(CrmBatchService.class).target(Beans.get(CrmBatchRepository.class).find(crmBatch.getId()));
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 ContractBatchController method runBatch.
public void runBatch(ActionRequest request, ActionResponse response) {
try {
ContractBatch contractBatch = request.getContext().asType(ContractBatch.class);
contractBatch = Beans.get(ContractBatchRepository.class).find(contractBatch.getId());
Batch batch = Beans.get(BatchContract.class).run(contractBatch);
response.setFlash(batch.getComments());
response.setReload(true);
} catch (Exception e) {
TraceBackService.trace(response, e);
}
}
use of com.axelor.apps.base.db.Batch in project axelor-open-suite by axelor.
the class AccountingBatchService method run.
@Override
public Batch run(Model batchModel) throws AxelorException {
Batch batch;
AccountingBatch accountingBatch = (AccountingBatch) batchModel;
switch(accountingBatch.getActionSelect()) {
case AccountingBatchRepository.ACTION_REIMBURSEMENT:
if (accountingBatch.getReimbursementTypeSelect() == AccountingBatchRepository.REIMBURSEMENT_TYPE_EXPORT) {
batch = reimbursementExport(accountingBatch);
} else if (accountingBatch.getReimbursementTypeSelect() == AccountingBatchRepository.REIMBURSEMENT_TYPE_IMPORT) {
batch = reimbursementImport(accountingBatch);
}
batch = null;
break;
case AccountingBatchRepository.ACTION_DEBT_RECOVERY:
batch = debtRecovery(accountingBatch);
break;
case AccountingBatchRepository.ACTION_DOUBTFUL_CUSTOMER:
batch = doubtfulCustomer(accountingBatch);
break;
case AccountingBatchRepository.ACTION_ACCOUNT_CUSTOMER:
batch = accountCustomer(accountingBatch);
break;
case AccountingBatchRepository.ACTION_MOVE_LINE_EXPORT:
batch = moveLineExport(accountingBatch);
break;
case AccountingBatchRepository.ACTION_CREDIT_TRANSFER:
batch = creditTransfer(accountingBatch);
break;
case AccountingBatchRepository.ACTION_REALIZE_FIXED_ASSET_LINES:
batch = realizeFixedAssetLines(accountingBatch);
break;
default:
throw new AxelorException(TraceBackRepository.CATEGORY_INCONSISTENCY, I18n.get(IExceptionMessage.BASE_BATCH_1), accountingBatch.getActionSelect(), accountingBatch.getCode());
}
return batch;
}
Aggregations