use of com.axelor.apps.production.db.ManufOrder in project axelor-open-suite by axelor.
the class ManufOrderController method pause.
public void pause(ActionRequest request, ActionResponse response) {
try {
Long manufOrderId = (Long) request.getContext().get("id");
ManufOrder manufOrder = Beans.get(ManufOrderRepository.class).find(manufOrderId);
Beans.get(ManufOrderWorkflowService.class).pause(manufOrder);
response.setReload(true);
} catch (Exception e) {
TraceBackService.trace(response, e);
}
}
use of com.axelor.apps.production.db.ManufOrder in project axelor-open-suite by axelor.
the class ManufOrderController method updateRealQty.
/**
* Called from manuf order wizard view. Call {@link ManufOrderService#updateRealQty(ManufOrder,
* BigDecimal)}
*
* @param request
* @param response
*/
public void updateRealQty(ActionRequest request, ActionResponse response) {
try {
ManufOrder manufOrder = request.getContext().asType(ManufOrder.class);
manufOrder = Beans.get(ManufOrderRepository.class).find(manufOrder.getId());
BigDecimal qtyToUpdate = new BigDecimal(request.getContext().get("qtyToUpdate").toString());
Beans.get(ManufOrderService.class).updateRealQty(manufOrder, qtyToUpdate);
response.setReload(true);
response.setCanClose(true);
} catch (Exception e) {
TraceBackService.trace(response, e);
}
}
use of com.axelor.apps.production.db.ManufOrder in project axelor-open-suite by axelor.
the class ManufOrderController method partialFinish.
public void partialFinish(ActionRequest request, ActionResponse response) {
try {
ManufOrder manufOrder = request.getContext().asType(ManufOrder.class);
manufOrder = Beans.get(ManufOrderRepository.class).find(manufOrder.getId());
// we have to inject TraceBackService to use non static methods
TraceBackService traceBackService = Beans.get(TraceBackService.class);
long tracebackCount = traceBackService.countMessageTraceBack(manufOrder);
if (!Beans.get(ManufOrderWorkflowService.class).partialFinish(manufOrder)) {
response.setNotify(I18n.get(IExceptionMessage.MANUF_ORDER_EMAIL_NOT_SENT));
} else if (traceBackService.countMessageTraceBack(manufOrder) > tracebackCount) {
traceBackService.findLastMessageTraceBack(manufOrder).ifPresent(traceback -> response.setNotify(String.format(I18n.get(com.axelor.apps.message.exception.IExceptionMessage.SEND_EMAIL_EXCEPTION), traceback.getMessage())));
}
response.setReload(true);
} catch (Exception e) {
TraceBackService.trace(response, e);
}
}
use of com.axelor.apps.production.db.ManufOrder in project axelor-open-suite by axelor.
the class ManufOrderController method updateProducedStockMoveFromManufOrder.
/**
* Called from manuf order form, on produced stock move line change. Call {@link
* ManufOrderService#updateProducedStockMoveFromManufOrder(ManufOrder)}.
*
* @param request
* @param response
*/
public void updateProducedStockMoveFromManufOrder(ActionRequest request, ActionResponse response) {
try {
ManufOrder manufOrder = request.getContext().asType(ManufOrder.class);
manufOrder = Beans.get(ManufOrderRepository.class).find(manufOrder.getId());
Beans.get(ManufOrderService.class).updateProducedStockMoveFromManufOrder(manufOrder);
response.setReload(true);
} catch (Exception e) {
TraceBackService.trace(response, e);
}
}
use of com.axelor.apps.production.db.ManufOrder in project axelor-open-suite by axelor.
the class ManufOrderController method start.
public void start(ActionRequest request, ActionResponse response) {
try {
Long manufOrderId = (Long) request.getContext().get("id");
ManufOrder manufOrder = Beans.get(ManufOrderRepository.class).find(manufOrderId);
Beans.get(ManufOrderWorkflowService.class).start(manufOrder);
response.setReload(true);
} catch (Exception e) {
TraceBackService.trace(response, e);
}
}
Aggregations