Search in sources :

Example 1 with InvoiceBatch

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);
}
Also used : InvoiceBatch(com.axelor.apps.account.db.InvoiceBatch) Batch(com.axelor.apps.base.db.Batch) InvoiceBatchService(com.axelor.apps.account.service.invoice.InvoiceBatchService) InvoiceBatch(com.axelor.apps.account.db.InvoiceBatch)

Example 2 with InvoiceBatch

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;
}
Also used : InvoiceBatch(com.axelor.apps.account.db.InvoiceBatch)

Example 3 with InvoiceBatch

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;
}
Also used : AxelorException(com.axelor.exception.AxelorException) InvoiceBatch(com.axelor.apps.account.db.InvoiceBatch) Batch(com.axelor.apps.base.db.Batch) InvoiceBatch(com.axelor.apps.account.db.InvoiceBatch)

Aggregations

InvoiceBatch (com.axelor.apps.account.db.InvoiceBatch)3 Batch (com.axelor.apps.base.db.Batch)2 InvoiceBatchService (com.axelor.apps.account.service.invoice.InvoiceBatchService)1 AxelorException (com.axelor.exception.AxelorException)1