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