Search in sources :

Example 21 with Batch

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

the class AccountingBatchBankPaymentService method run.

@Override
public Batch run(Model batchModel) throws AxelorException {
    Batch batch;
    AccountingBatch accountingBatch = (AccountingBatch) batchModel;
    if (!Beans.get(AppBankPaymentService.class).isApp("bank-payment")) {
        return super.run(accountingBatch);
    }
    switch(accountingBatch.getActionSelect()) {
        case AccountingBatchRepository.ACTION_DIRECT_DEBIT:
            batch = directDebit(accountingBatch);
            break;
        default:
            batch = super.run(accountingBatch);
    }
    return batch;
}
Also used : Batch(com.axelor.apps.base.db.Batch) AccountingBatch(com.axelor.apps.account.db.AccountingBatch) AccountingBatch(com.axelor.apps.account.db.AccountingBatch)

Example 22 with Batch

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

the class SupplychainBatchService method run.

@Override
public Batch run(Model batchModel) throws AxelorException {
    Batch batch;
    SupplychainBatch supplychainBatch = (SupplychainBatch) batchModel;
    switch(supplychainBatch.getActionSelect()) {
        case SupplychainBatchRepository.ACTION_ACCOUNTING_CUT_OFF:
            batch = accountingCutOff(supplychainBatch);
            break;
        case SupplychainBatchRepository.ACTION_INVOICE_OUTGOING_STOCK_MOVES:
            batch = invoiceOutgoingStockMoves(supplychainBatch);
            break;
        case SupplychainBatchRepository.ACTION_INVOICE_ORDERS:
            batch = invoiceOrders(supplychainBatch);
            break;
        default:
            throw new AxelorException(TraceBackRepository.CATEGORY_INCONSISTENCY, I18n.get(IExceptionMessage.BASE_BATCH_1), supplychainBatch.getActionSelect(), supplychainBatch.getCode());
    }
    return batch;
}
Also used : AxelorException(com.axelor.exception.AxelorException) Batch(com.axelor.apps.base.db.Batch) SupplychainBatch(com.axelor.apps.supplychain.db.SupplychainBatch) SupplychainBatch(com.axelor.apps.supplychain.db.SupplychainBatch)

Example 23 with Batch

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

the class AccountingBatchController method actionRealizeFixedAssetLines.

public void actionRealizeFixedAssetLines(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).realizeFixedAssetLines(accountingBatch);
    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)

Example 24 with Batch

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

the class AccountingBatchController method actionCloseAnnualAccounts.

public void actionCloseAnnualAccounts(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).closeAnnualAccounts(accountingBatch);
    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)

Example 25 with Batch

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

the class AccountingBatchController method actionDoubtfulCustomer.

/**
 * Lancer le batch de détermination des créances douteuses
 *
 * @param request
 * @param response
 */
public void actionDoubtfulCustomer(ActionRequest request, ActionResponse response) {
    AccountingBatch accountingBatch = request.getContext().asType(AccountingBatch.class);
    Batch batch = null;
    batch = Beans.get(AccountingBatchService.class).doubtfulCustomer(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)

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