use of com.axelor.apps.base.db.Batch in project axelor-open-suite by axelor.
the class ProjectInvoicingAssistantBatchController method showRecords.
private void showRecords(ActionRequest request, ActionResponse response, Map<String, Object> values) throws ClassNotFoundException {
Batch batch = request.getContext().asType(Batch.class);
batch = Beans.get(BatchRepository.class).find(batch.getId());
String ids = Beans.get(ProjectInvoicingAssistantBatchService.class).getShowRecordIds(batch, values.get("field").toString());
response.setView(ActionView.define(values.get("title").toString()).model(values.get("model").toString()).add("grid", values.get("grid").toString()).add("form", values.get("form").toString()).domain("self.id IN (" + ids + ")").map());
}
use of com.axelor.apps.base.db.Batch in project axelor-open-suite by axelor.
the class ProductionBatchService method run.
@Override
public Batch run(Model model) throws AxelorException {
Batch batch;
ProductionBatch productionBatch = (ProductionBatch) model;
switch(productionBatch.getActionSelect()) {
case ProductionBatchRepository.ACTION_COMPUTE_WORK_IN_PROGRESS_VALUATION:
batch = computeValuation(productionBatch);
break;
default:
throw new AxelorException(TraceBackRepository.CATEGORY_INCONSISTENCY, I18n.get(IExceptionMessage.BASE_BATCH_1), productionBatch.getActionSelect(), productionBatch.getCode());
}
return batch;
}
use of com.axelor.apps.base.db.Batch in project axelor-open-suite by axelor.
the class InvoiceBatchService method run.
/**
* Lancer un batch à partir de son code.
*
* @param batchCode Le code du batch souhaité.
* @throws AxelorException
*/
public Batch run(String batchCode) throws AxelorException {
Batch batch;
InvoiceBatch invoiceBatch = invoiceBatchRepo.findByCode(batchCode);
if (invoiceBatch != null) {
switch(invoiceBatch.getActionSelect()) {
case InvoiceBatchRepository.BATCH_STATUS:
batch = wkf(invoiceBatch);
break;
default:
throw new AxelorException(TraceBackRepository.CATEGORY_INCONSISTENCY, I18n.get(IExceptionMessage.BASE_BATCH_1), invoiceBatch.getActionSelect(), batchCode);
}
} else {
throw new AxelorException(TraceBackRepository.CATEGORY_INCONSISTENCY, I18n.get(IExceptionMessage.BASE_BATCH_2), batchCode);
}
return batch;
}
Aggregations