Search in sources :

Example 6 with Batch

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

the class HrBatchController method launchHrBatch.

/**
 * Launch any type of HR batch
 *
 * @param request
 * @param response
 * @throws AxelorException
 */
public void launchHrBatch(ActionRequest request, ActionResponse response) throws AxelorException {
    HrBatch hrBatch = request.getContext().asType(HrBatch.class);
    Batch batch = Beans.get(HrBatchService.class).run(Beans.get(HrBatchRepository.class).find(hrBatch.getId()));
    if (batch != null) {
        response.setFlash(batch.getComments());
    }
    response.setReload(true);
}
Also used : Batch(com.axelor.apps.base.db.Batch) HrBatch(com.axelor.apps.hr.db.HrBatch) HrBatchService(com.axelor.apps.hr.service.batch.HrBatchService) HrBatch(com.axelor.apps.hr.db.HrBatch)

Example 7 with Batch

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

the class ProductionBatchController method computeValuation.

public void computeValuation(ActionRequest request, ActionResponse response) {
    ProductionBatch productionBatch = request.getContext().asType(ProductionBatch.class);
    productionBatch = Beans.get(ProductionBatchRepository.class).find(productionBatch.getId());
    Batch batch = Beans.get(ProductionBatchService.class).computeValuation(productionBatch);
    if (batch != null) {
        response.setFlash(batch.getComments());
    }
    response.setReload(true);
}
Also used : ProductionBatchService(com.axelor.apps.production.service.batch.ProductionBatchService) ProductionBatch(com.axelor.apps.production.db.ProductionBatch) Batch(com.axelor.apps.base.db.Batch) ProductionBatch(com.axelor.apps.production.db.ProductionBatch)

Example 8 with Batch

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

the class InvoiceBatchController method run.

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

Example 9 with Batch

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

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

the class BaseBatchController method actionSynchronizeCalendars.

public void actionSynchronizeCalendars(ActionRequest request, ActionResponse response) {
    try {
        BaseBatch baseBatch = request.getContext().asType(BaseBatch.class);
        baseBatch = Beans.get(BaseBatchRepository.class).find(baseBatch.getId());
        Batch batch = Beans.get(BaseBatchService.class).synchronizeCalendars(baseBatch);
        response.setFlash(batch.getComments());
    } catch (Exception e) {
        TraceBackService.trace(response, e);
    } finally {
        response.setReload(true);
    }
}
Also used : BaseBatch(com.axelor.apps.base.db.BaseBatch) Batch(com.axelor.apps.base.db.Batch) BaseBatch(com.axelor.apps.base.db.BaseBatch) BaseBatchService(com.axelor.apps.base.service.batch.BaseBatchService) AxelorException(com.axelor.exception.AxelorException)

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