*
* @param order
* @param window
*/
private void setHasMissingCollies(Order order, WindowInterface window) {
OrderManager orderManager = (OrderManager) ModelUtil
.getBean("orderManager");
orderManager.lazyLoadOrder(order, new LazyLoadOrderEnum[] {
LazyLoadOrderEnum.ORDER_LINES,
LazyLoadOrderEnum.ORDER_LINE_ORDER_LINES });
List<OrderLine> orderLines = order.getMissingCollies();
if (orderLines != null && orderLines.size() != 0) {
order.setHasMissingCollies(1);
} else {
order.setHasMissingCollies(0);
}
try {
orderManager.saveOrder(order);
} catch (ProTransException e) {
Util.showErrorDialog(window, "Feil", e.getMessage());
e.printStackTrace();
}
}