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