Search in sources :

Example 26 with Batch

use of com.axelor.apps.base.db.Batch in project axelor-open-suite by axelor.

the class AccountingBatchController method actionDebtRecovery.

/**
 * Lancer le batch de relance
 *
 * @param request
 * @param response
 */
public void actionDebtRecovery(ActionRequest request, ActionResponse response) {
    AccountingBatch accountingBatch = request.getContext().asType(AccountingBatch.class);
    Batch batch = null;
    if (accountingBatch.getActionSelect() == AccountingBatchRepository.ACTION_DEBT_RECOVERY) {
        batch = Beans.get(AccountingBatchService.class).debtRecovery(Beans.get(AccountingBatchRepository.class).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) AccountingBatchRepository(com.axelor.apps.account.db.repo.AccountingBatchRepository)

Example 27 with Batch

use of com.axelor.apps.base.db.Batch 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)

Example 28 with Batch

use of com.axelor.apps.base.db.Batch in project axelor-open-suite by axelor.

the class AccountingBatchController method actionAccountingCustomer.

/**
 * Lancer le batch de calcul du compte client
 *
 * @param request
 * @param response
 */
public void actionAccountingCustomer(ActionRequest request, ActionResponse response) {
    AccountingBatch accountingBatch = request.getContext().asType(AccountingBatch.class);
    Batch batch = null;
    batch = Beans.get(AccountingBatchService.class).accountCustomer(Beans.get(AccountingBatchRepository.class).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) AccountingBatchRepository(com.axelor.apps.account.db.repo.AccountingBatchRepository)

Example 29 with Batch

use of com.axelor.apps.base.db.Batch in project axelor-open-suite by axelor.

the class AccountingBatchController method actionCreditTransfer.

public void actionCreditTransfer(ActionRequest request, ActionResponse response) {
    AccountingBatch accountingBatch = request.getContext().asType(AccountingBatch.class);
    accountingBatch = Beans.get(AccountingBatchRepository.class).find(accountingBatch.getId());
    Batch batch = Beans.get(AccountingBatchService.class).creditTransfer(accountingBatch);
    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)

Example 30 with Batch

use of com.axelor.apps.base.db.Batch in project axelor-open-suite by axelor.

the class BaseBatchController method run.

// WS
/**
 * Lancer le batch à travers un web service.
 *
 * @param request
 * @param response
 * @throws AxelorException
 */
public void run(ActionRequest request, ActionResponse response) throws AxelorException {
    Batch batch = Beans.get(BaseBatchService.class).run((String) request.getContext().get("code"));
    Map<String, Object> mapData = new HashMap<String, Object>();
    mapData.put("anomaly", batch.getAnomaly());
    response.setData(mapData);
}
Also used : Batch(com.axelor.apps.base.db.Batch) BaseBatch(com.axelor.apps.base.db.BaseBatch) HashMap(java.util.HashMap) BaseBatchService(com.axelor.apps.base.service.batch.BaseBatchService)

Aggregations

Batch (com.axelor.apps.base.db.Batch)43 AccountingBatch (com.axelor.apps.account.db.AccountingBatch)12 AxelorException (com.axelor.exception.AxelorException)12 AccountingBatchService (com.axelor.apps.account.service.batch.AccountingBatchService)6 AccountingBatchRepository (com.axelor.apps.account.db.repo.AccountingBatchRepository)5 HashMap (java.util.HashMap)5 CrmBatch (com.axelor.apps.crm.db.CrmBatch)4 InvoiceBatch (com.axelor.apps.account.db.InvoiceBatch)3 BankPaymentBatch (com.axelor.apps.bankpayment.db.BankPaymentBatch)3 ProjectInvoicingAssistantBatch (com.axelor.apps.businessproject.db.ProjectInvoicingAssistantBatch)3 CrmBatchService (com.axelor.apps.crm.service.batch.CrmBatchService)3 SupplychainBatch (com.axelor.apps.supplychain.db.SupplychainBatch)3 SupplychainBatchService (com.axelor.apps.supplychain.service.batch.SupplychainBatchService)3 InvoiceBatchService (com.axelor.apps.account.service.invoice.InvoiceBatchService)2 BaseBatch (com.axelor.apps.base.db.BaseBatch)2 MailBatch (com.axelor.apps.base.db.MailBatch)2 MailBatchRepository (com.axelor.apps.base.db.repo.MailBatchRepository)2 ProjectInvoicingAssistantBatchService (com.axelor.apps.businessproject.service.batch.ProjectInvoicingAssistantBatchService)2 Account (com.axelor.apps.account.db.Account)1 AccountConfig (com.axelor.apps.account.db.AccountConfig)1