use of com.axelor.apps.crm.db.CrmBatch 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.crm.db.CrmBatch 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.crm.db.CrmBatch in project axelor-open-suite by axelor.
the class CrmBatchCrmRepository method copy.
@Override
public CrmBatch copy(CrmBatch entity, boolean deep) {
CrmBatch copy = super.copy(entity, deep);
copy.setBatchList(null);
return copy;
}
use of com.axelor.apps.crm.db.CrmBatch 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;
}
Aggregations