@Override public Object getGroupingObject(final AbstractOrderEntryModel orderEntry) { return orderEntry.getDeliveryMode() != null ? orderEntry.getDeliveryMode() : orderEntry.getDeliveryPointOfService() == null ? orderEntry.getOrder().getDeliveryMode() : getPickupDeliveryModeDao() .findPickupDeliveryModesForAbstractOrder(orderEntry.getOrder()) .get(0); }
protected boolean checkDeliveryOptions(final OrderModel order) { if (order.getDeliveryMode() == null) { // Order must have an overall delivery mode return false; } if (order.getDeliveryAddress() == null) { for (final AbstractOrderEntryModel entry : order.getEntries()) { if (entry.getDeliveryPointOfService() == null && entry.getDeliveryAddress() == null) { // Order and Entry have no delivery address and some entries are not for pickup return false; } } } return true; }
@Override public Object getGroupingObject(final AbstractOrderEntryModel orderEntry) { return orderEntry.getDeliveryPointOfService(); }