use of com.axelor.apps.stock.service.LogisticalFormService in project axelor-open-suite by axelor.
the class LogisticalFormController method addStockMove.
public void addStockMove(ActionRequest request, ActionResponse response) {
try {
@SuppressWarnings("unchecked") Map<String, Object> stockMoveMap = (Map<String, Object>) request.getContext().get("stockMove");
if (stockMoveMap != null) {
StockMove stockMove = Mapper.toBean(StockMove.class, stockMoveMap);
stockMove = Beans.get(StockMoveRepository.class).find(stockMove.getId());
if (stockMove.getStockMoveLineList() != null) {
LogisticalForm logisticalForm = request.getContext().asType(LogisticalForm.class);
LogisticalFormService logisticalFormService = Beans.get(LogisticalFormService.class);
logisticalFormService.addDetailLines(logisticalForm, stockMove);
response.setValue("logisticalFormLineList", logisticalForm.getLogisticalFormLineList());
response.setValue("$stockMove", null);
}
}
} catch (Exception e) {
TraceBackService.trace(response, e);
}
}
use of com.axelor.apps.stock.service.LogisticalFormService in project axelor-open-suite by axelor.
the class LogisticalFormController method checkLines.
public void checkLines(ActionRequest request, ActionResponse response) {
try {
LogisticalForm logisticalForm = request.getContext().asType(LogisticalForm.class);
LogisticalFormService logisticalFormService = Beans.get(LogisticalFormService.class);
logisticalFormService.sortLines(logisticalForm);
logisticalFormService.checkLines(logisticalForm);
} catch (LogisticalFormWarning e) {
response.setAlert(e.getLocalizedMessage());
} catch (LogisticalFormError e) {
response.setError(e.getLocalizedMessage());
} catch (Exception e) {
TraceBackService.trace(response, e);
}
}
use of com.axelor.apps.stock.service.LogisticalFormService in project axelor-open-suite by axelor.
the class LogisticalFormController method refreshProductNetMass.
public void refreshProductNetMass(ActionRequest request, ActionResponse response) {
try {
LogisticalForm logisticalForm = request.getContext().asType(LogisticalForm.class);
LogisticalFormService logisticalFormService = Beans.get(LogisticalFormService.class);
logisticalFormService.updateProductNetMass(logisticalForm);
response.setValue("logisticalFormLineList", logisticalForm.getLogisticalFormLineList());
response.setValue("totalNetMass", logisticalForm.getTotalNetMass());
} catch (Exception e) {
TraceBackService.trace(response, e);
}
}
Aggregations