protected Integer calcTotalUnitCount(final AbstractOrderModel source) {
   int totalUnitCount = 0;
   for (final AbstractOrderEntryModel orderEntryModel : source.getEntries()) {
     totalUnitCount += orderEntryModel.getQuantity().intValue();
   }
   return Integer.valueOf(totalUnitCount);
 }
  protected double getProductsDiscountsAmount(final AbstractOrderModel source) {
    double discounts = 0.0d;

    final List<AbstractOrderEntryModel> entries = source.getEntries();
    if (entries != null) {
      for (final AbstractOrderEntryModel entry : entries) {
        final List<DiscountValue> discountValues = entry.getDiscountValues();
        if (discountValues != null) {
          for (final DiscountValue dValue : discountValues) {
            discounts += dValue.getAppliedValue();
          }
        }
      }
    }
    return discounts;
  }
 protected void addEntries(final AbstractOrderModel source, final AbstractOrderData prototype) {
   prototype.setEntries(Converters.convertAll(source.getEntries(), getOrderEntryConverter()));
 }
 protected Integer calcTotalItems(final AbstractOrderModel source) {
   return Integer.valueOf(source.getEntries().size());
 }