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);
}
Aggregations