Search in sources :

Example 31 with Batch

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

the class HrBatchService method run.

@Override
public Batch run(Model batchModel) throws AxelorException {
    HrBatch hrBatch = (HrBatch) batchModel;
    Batch batch = null;
    switch(hrBatch.getActionSelect()) {
        case HrBatchRepository.ACTION_LEAVE_MANAGEMENT:
            batch = leaveManagement(hrBatch);
            break;
        case HrBatchRepository.ACTION_SENIORITY_LEAVE_MANAGEMENT:
            batch = seniorityLeaveManagement(hrBatch);
            break;
        case HrBatchRepository.ACTION_PAYROLL_PREPARATION_GENERATION:
            batch = payrollPreparationGeneration(hrBatch);
            break;
        case HrBatchRepository.ACTION_PAYROLL_PREPARATION_EXPORT:
            batch = payrollPreparationExport(hrBatch);
            break;
        case HrBatchRepository.ACTION_LEAVE_MANAGEMENT_RESET:
            batch = leaveManagementReset(hrBatch);
            break;
        case HrBatchRepository.ACTION_EMPLOYMENT_CONTRACT_EXPORT:
            batch = employmentContractExport(hrBatch);
            break;
        case HrBatchHRRepository.ACTION_TIMESHEET_REMINDER:
            batch = runTimesheetReminderBatch(hrBatch);
            break;
        default:
            throw new AxelorException(TraceBackRepository.CATEGORY_INCONSISTENCY, I18n.get(IExceptionMessage.BASE_BATCH_1), hrBatch.getActionSelect(), hrBatch.getCode());
    }
    return batch;
}
Also used : AxelorException(com.axelor.exception.AxelorException) Batch(com.axelor.apps.base.db.Batch) HrBatch(com.axelor.apps.hr.db.HrBatch) HrBatch(com.axelor.apps.hr.db.HrBatch)

Example 32 with Batch

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

the class SaleBatchController method actionInvoicing.

public void actionInvoicing(ActionRequest request, ActionResponse response) throws AxelorException {
    SaleBatch saleBatch = request.getContext().asType(SaleBatch.class);
    saleBatch = Beans.get(SaleBatchRepository.class).find(saleBatch.getId());
    Batch batch = Beans.get(BatchInvoicing.class).run(saleBatch);
    response.setFlash(batch.getComments());
    response.setReload(true);
}
Also used : SaleBatch(com.axelor.apps.sale.db.SaleBatch) Batch(com.axelor.apps.base.db.Batch) BatchInvoicing(com.axelor.apps.supplychain.service.batch.BatchInvoicing) SaleBatch(com.axelor.apps.sale.db.SaleBatch)

Example 33 with Batch

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

the class SupplychainBatchController method accountingCutOff.

public void accountingCutOff(ActionRequest request, ActionResponse response) {
    try {
        SupplychainBatch supplychainBatch = request.getContext().asType(SupplychainBatch.class);
        supplychainBatch = Beans.get(SupplychainBatchRepository.class).find(supplychainBatch.getId());
        Batch batch = Beans.get(SupplychainBatchService.class).accountingCutOff(supplychainBatch);
        response.setFlash(batch.getComments());
        response.setReload(true);
    } catch (Exception e) {
        TraceBackService.trace(response, e);
    }
}
Also used : Batch(com.axelor.apps.base.db.Batch) SupplychainBatch(com.axelor.apps.supplychain.db.SupplychainBatch) SupplychainBatch(com.axelor.apps.supplychain.db.SupplychainBatch) SupplychainBatchService(com.axelor.apps.supplychain.service.batch.SupplychainBatchService)

Example 34 with Batch

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

the class SupplychainBatchController method invoiceOrders.

public void invoiceOrders(ActionRequest request, ActionResponse response) {
    try {
        SupplychainBatch supplychainBatch = request.getContext().asType(SupplychainBatch.class);
        supplychainBatch = Beans.get(SupplychainBatchRepository.class).find(supplychainBatch.getId());
        Batch batch = Beans.get(SupplychainBatchService.class).invoiceOrders(supplychainBatch);
        response.setFlash(batch.getComments());
        response.setReload(true);
    } catch (Exception e) {
        TraceBackService.trace(response, e);
    }
}
Also used : Batch(com.axelor.apps.base.db.Batch) SupplychainBatch(com.axelor.apps.supplychain.db.SupplychainBatch) SupplychainBatch(com.axelor.apps.supplychain.db.SupplychainBatch) SupplychainBatchService(com.axelor.apps.supplychain.service.batch.SupplychainBatchService)

Example 35 with Batch

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

the class SupplychainBatchController method invoiceOutgoingStockMoves.

public void invoiceOutgoingStockMoves(ActionRequest request, ActionResponse response) {
    try {
        SupplychainBatch supplychainBatch = request.getContext().asType(SupplychainBatch.class);
        supplychainBatch = Beans.get(SupplychainBatchRepository.class).find(supplychainBatch.getId());
        Batch batch = Beans.get(SupplychainBatchService.class).invoiceOutgoingStockMoves(supplychainBatch);
        response.setFlash(batch.getComments());
        response.setReload(true);
    } catch (Exception e) {
        TraceBackService.trace(response, e);
    }
}
Also used : Batch(com.axelor.apps.base.db.Batch) SupplychainBatch(com.axelor.apps.supplychain.db.SupplychainBatch) SupplychainBatch(com.axelor.apps.supplychain.db.SupplychainBatch) SupplychainBatchService(com.axelor.apps.supplychain.service.batch.SupplychainBatchService)

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