price = fulfillmentGroupItem.getOrderItem().getRetailPrice().getAmount().multiply(BigDecimal.valueOf(fulfillmentGroupItem.getQuantity()));
}
retailTotal = retailTotal.add(price);
}
ShippingRate sr = shippingRateService.readShippingRateByFeeTypesUnityQty(feeType, feeSubType, retailTotal);
if (sr == null) {
throw new NotImplementedException("Shipping rate " + fulfillmentGroup.getMethod() + " not supported");
}
BigDecimal shippingPrice = new BigDecimal(0);
if (sr.getBandResultPercent().compareTo(0) > 0) {
BigDecimal percent = new BigDecimal(sr.getBandResultPercent() / 100);
shippingPrice = retailTotal.multiply(percent);
} else {
shippingPrice = sr.getBandResultQuantity();
}
fulfillmentGroup.setShippingPrice(BroadleafCurrencyUtils.getMoney(shippingPrice, fulfillmentGroup.getOrder().getCurrency()));
fulfillmentGroup.setSaleShippingPrice(fulfillmentGroup.getShippingPrice());
fulfillmentGroup.setRetailShippingPrice(fulfillmentGroup.getSaleShippingPrice());
}