.lazyLoadOrder(order, new LazyLoadOrderEnum[] {
LazyLoadOrderEnum.POST_SHIPMENTS,
LazyLoadOrderEnum.COMMENTS,
LazyLoadOrderEnum.COLLIES });
} else {
PostShipment postShipment = (PostShipment) transportable;
postShipmentManager.lazyLoad(postShipment,
new LazyLoadPostShipmentEnum[] {
LazyLoadPostShipmentEnum.POST_SHIPMENT_REFS,
LazyLoadPostShipmentEnum.ORDER_COMMENTS,
LazyLoadPostShipmentEnum.COLLIES });
}
if (transportable.getPostShipments() != null
&& transportable.getPostShipments().size() != 0) {
Util.showErrorDialog(window1, "Ordre har etterleveringer",
"Kan ikke fjerne ordre som har etterleveringer.");
return;
}
transportable.setSentBool(false);
transportable.setTransport(null);
if (transportable instanceof Order) {
Order order = (Order) transportable;
orderViewHandler.lazyLoadOrder(order, new LazyLoadOrderEnum[] {
LazyLoadOrderEnum.COLLIES,
LazyLoadOrderEnum.ORDER_LINES,
LazyLoadOrderEnum.ORDER_COSTS });
Set<Colli> collies = order.getCollies();
removeSentFromCollies(collies);
Set<OrderLine> orderLines = order.getOrderLines();
if (orderLines != null) {
PostShipment postShipment;
for (OrderLine orderLine : orderLines) {
postShipment = orderLine.getPostShipment();
Deviation deviation;
if (postShipment != null) {
orderLine.setPostShipment(null);
deviation = postShipment.getDeviation();
postShipment.setOrder(null);
postShipmentManager
.removePostShipment(postShipment);
if (deviation != null) {