public class DefaultOndemandPromotionService extends Object implements OndemandPromotionService
OndemandPromotionService to distribute the promotions across the lines and units. It is
important to note that unit prices are imprecise as the discounted line price may not be perfectly divisible by the
quantity after the promotions are applied. This will result in a loss of cents if the unit prices are totalled.| Constructor and Description |
|---|
DefaultOndemandPromotionService() |
public List<OndemandDiscountedOrderEntry> calculateProportionalDiscountForEntries(AbstractOrderModel abstractOrder)
calculateProportionalDiscountForEntries in interface OndemandPromotionServiceprotected void calculateProportionalDiscountForEntries(AbstractOrderModel abstractOrder, List<AbstractOrderEntryModel> orderedAbstractOrderEntries, BigDecimal globalDiscountTotal, Map<AbstractOrderEntryModel,BigDecimal> orderLineEntries)
abstractOrder - the order modelglobalDiscountTotal - the global discount totalorderLineEntries - map of discounts to be updatedprotected BigDecimal getTotalOfDiscountableEntries(AbstractOrderModel abstractOrder)
abstractOrder - Hybris order or cartprotected OndemandDiscountedOrderEntry createOndemandDiscountedOrderEntry(AbstractOrderEntryModel abstractOrderEntry, BigDecimal calculatedOrderLineDiscount)
abstractOrderEntry - - AbstractOrderEntry that is associated with the calculatedOrderLineTotalcalculatedOrderLineDiscount - - Calculated (with order promotions) total of the line itemprotected OndemandDiscountableEntryStrategy getDiscountableEntryStrategy()
public void setDiscountableEntryStrategy(OndemandDiscountableEntryStrategy discountableEntryStrategy)
protected OndemandTaxCalculationService getTaxCalculationService()
public void setTaxCalculationService(OndemandTaxCalculationService taxCalculationService)
Copyright © 2017 SAP SE. All Rights Reserved.