use of com.axelor.apps.account.db.InvoiceBatch in project axelor-open-suite by axelor.
the class InvoiceBatchController method actionStatus.
/**
* Lancer le batch de mise à jour de statut.
*
* @param request
* @param response
* @throws AxelorException
*/
public void actionStatus(ActionRequest request, ActionResponse response) throws AxelorException {
InvoiceBatch invoiceBatch = request.getContext().asType(InvoiceBatch.class);
Batch batch = Beans.get(InvoiceBatchService.class).wkf(Beans.get(InvoiceBatchRepository.class).find(invoiceBatch.getId()));
response.setFlash(batch.getComments());
response.setReload(true);
}
use of com.axelor.apps.account.db.InvoiceBatch in project axelor-open-suite by axelor.
the class InvoiceBatchAccountRepository method copy.
@Override
public InvoiceBatch copy(InvoiceBatch entity, boolean deep) {
InvoiceBatch copy = super.copy(entity, deep);
copy.setBatchList(null);
return copy;
}
use of com.axelor.apps.account.db.InvoiceBatch 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