Search in sources :

Example 1 with AccountingBatchService

use of com.axelor.apps.account.service.batch.AccountingBatchService in project axelor-open-suite by axelor.

the class AccountingBatchController method actionReimbursement.

/**
 * Lancer le batch de remboursement
 *
 * @param request
 * @param response
 */
public void actionReimbursement(ActionRequest request, ActionResponse response) {
    AccountingBatch accountingBatch = request.getContext().asType(AccountingBatch.class);
    AccountingBatchService accountingBatchService = Beans.get(AccountingBatchService.class);
    AccountingBatchRepository accountingBatchRepository = Beans.get(AccountingBatchRepository.class);
    Batch batch = null;
    if (accountingBatch.getReimbursementTypeSelect() == AccountingBatchRepository.REIMBURSEMENT_TYPE_EXPORT) {
        batch = accountingBatchService.reimbursementExport(accountingBatchRepository.find(accountingBatch.getId()));
    } else if (accountingBatch.getReimbursementTypeSelect() == AccountingBatchRepository.REIMBURSEMENT_TYPE_IMPORT) {
        batch = accountingBatchService.reimbursementImport(accountingBatchRepository.find(accountingBatch.getId()));
    }
    if (batch != null)
        response.setFlash(batch.getComments());
    response.setReload(true);
}
Also used : Batch(com.axelor.apps.base.db.Batch) AccountingBatch(com.axelor.apps.account.db.AccountingBatch) AccountingBatch(com.axelor.apps.account.db.AccountingBatch) AccountingBatchService(com.axelor.apps.account.service.batch.AccountingBatchService) AccountingBatchRepository(com.axelor.apps.account.db.repo.AccountingBatchRepository)

Aggregations

AccountingBatch (com.axelor.apps.account.db.AccountingBatch)1 AccountingBatchRepository (com.axelor.apps.account.db.repo.AccountingBatchRepository)1 AccountingBatchService (com.axelor.apps.account.service.batch.AccountingBatchService)1 Batch (com.axelor.apps.base.db.Batch)1