public class DefaultOndemandPromotionService extends java.lang.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() |
| Modifier and Type | Method and Description |
|---|---|
java.util.List<OndemandDiscountedOrderEntry> |
calculateProportionalDiscountForEntries(AbstractOrderModel abstractOrder) |
protected void |
calculateProportionalDiscountForEntries(AbstractOrderModel abstractOrder,
java.util.List<AbstractOrderEntryModel> orderedAbstractOrderEntries,
java.math.BigDecimal globalDiscountTotal,
java.util.Map<AbstractOrderEntryModel,java.math.BigDecimal> orderLineEntries)
Returns the discount value for the given order entry.
|
protected OndemandDiscountedOrderEntry |
createOndemandDiscountedOrderEntry(AbstractOrderEntryModel abstractOrderEntry,
java.math.BigDecimal calculatedOrderLineDiscount)
Method to create the appropriate ondemandDiscountedOrderEntry with the discounted unit price.
|
protected OndemandDiscountableEntryStrategy |
getDiscountableEntryStrategy() |
protected OndemandTaxCalculationService |
getTaxCalculationService() |
protected java.math.BigDecimal |
getTotalOfDiscountableEntries(AbstractOrderModel abstractOrder)
Return the total price that the global discount can be applied to
|
void |
setDiscountableEntryStrategy(OndemandDiscountableEntryStrategy discountableEntryStrategy) |
void |
setTaxCalculationService(OndemandTaxCalculationService taxCalculationService) |
public java.util.List<OndemandDiscountedOrderEntry> calculateProportionalDiscountForEntries(AbstractOrderModel abstractOrder)
calculateProportionalDiscountForEntries in interface OndemandPromotionServiceprotected void calculateProportionalDiscountForEntries(AbstractOrderModel abstractOrder, java.util.List<AbstractOrderEntryModel> orderedAbstractOrderEntries, java.math.BigDecimal globalDiscountTotal, java.util.Map<AbstractOrderEntryModel,java.math.BigDecimal> orderLineEntries)
abstractOrder - the order modelglobalDiscountTotal - the global discount totalorderLineEntries - map of discounts to be updatedprotected java.math.BigDecimal getTotalOfDiscountableEntries(AbstractOrderModel abstractOrder)
abstractOrder - Hybris order or cartprotected OndemandDiscountedOrderEntry createOndemandDiscountedOrderEntry(AbstractOrderEntryModel abstractOrderEntry, java.math.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 © 2018 SAP SE. All Rights Reserved.