public interface RuleEngineCalculationService
| Modifier and Type | Method and Description |
|---|---|
java.util.List<DiscountRAO> |
addFixedPriceEntriesDiscount(CartRAO cartRao,
java.util.Map<java.lang.Integer,java.lang.Integer> selectedOrderEntryMap,
java.util.Set<OrderEntryRAO> selectedOrderEntryRaos,
java.math.BigDecimal fixedPrice)
Creates order entry level discounts for the cart
cartRao, with the fixedPrice given as parameter
and for the products from entries in selectedOrderEntryRaos and related quantities given in
selectedOrderEntryMap. |
DiscountRAO |
addFixedPriceEntryDiscount(OrderEntryRAO orderEntryRao,
java.math.BigDecimal fixedPrice)
Creates a new order entry level discount such that the order entry's price will be equal to the given
fixedPrice multiplied by quantity. |
DiscountRAO |
addFixedPriceEntryDiscountStackable(OrderEntryRAO orderEntryRao,
java.math.BigDecimal fixedPrice)
Deprecated.
since 6.7
|
FreeProductRAO |
addFreeProductsToCart(CartRAO cartRao,
ProductModel product,
int quantity)
Adds free product items to the cart.
|
java.util.List<DiscountRAO> |
addOrderEntryLevelDiscount(java.util.Map<java.lang.Integer,java.lang.Integer> selectedOrderEntryMap,
java.util.Set<OrderEntryRAO> selectedOrderEntryRaos,
boolean absolute,
java.math.BigDecimal amount)
Creates order entry level discounts for the cart
cartRao, adds it to the cartRao and updates the cartRao
totals. |
DiscountRAO |
addOrderEntryLevelDiscount(OrderEntryRAO orderEntryRao,
boolean absolute,
java.math.BigDecimal amount)
Creates a new order entry level discount based on the given values, adds it to the corresponding orderRao and
updates the orderRao totals.
|
DiscountRAO |
addOrderEntryLevelDiscountStackable(OrderEntryRAO orderEntryRao,
boolean absolute,
java.math.BigDecimal amount)
Deprecated.
since 6.7
|
DiscountRAO |
addOrderLevelDiscount(CartRAO cartRao,
boolean absolute,
java.math.BigDecimal amount)
Creates a new order level discount based on the given values, adds it to the cartRao and updates the cartRao
totals.
|
java.math.BigDecimal |
calculateSubTotals(CartRAO cartRao,
java.util.Collection<ProductRAO> excludedProducts)
Runs cart calculation for cart not including the excluded products.
|
void |
calculateTotals(AbstractOrderRAO abstractOrderRao)
performs a (re)calculation on the given abstractOrderRao and updates these properties:
AbstractOrderRAO.getTotal()
AbstractOrderRAO.getSubTotal()
AbstractOrderRAO.getDeliveryCost()
AbstractOrderRAO.getPaymentCost()
|
ShipmentRAO |
changeDeliveryMode(CartRAO cartRAO,
DeliveryModeRAO deliveryModeRAO)
Changes the current delivery mode to the given values, adds it to the cartRao and updates the carRao totals.
|
java.math.BigDecimal |
getAdjustedUnitPrice(int quantity,
OrderEntryRAO orderEntryRao)
Gets the total discount for line item and recalculates the discounted unit price.
|
int |
getConsumedQuantityForOrderEntry(OrderEntryRAO orderEntryRao)
Return consumed quantity for a given order entry
|
java.math.BigDecimal |
getCurrentPrice(java.util.Set<OrderEntryRAO> orderEntryForDiscounts,
java.util.Map<java.lang.Integer,java.lang.Integer> discountedOrderEntryMap)
Calculates current price of the set of Order Entries using only specified quantity of units for every Order Entry.
|
<T extends AbstractOrderRAO> |
getOrderTotalAvailableQuantity(T orderRAO)
Deprecated.
since 6.7
|
int |
getProductAvailableQuantityInOrderEntry(OrderEntryRAO orderEntryRAO)
give the order entry and the product, return the number of available product items to consume
|
void calculateTotals(AbstractOrderRAO abstractOrderRao)
abstractOrderRao - the abstractOrderRao to calculateDiscountRAO addOrderLevelDiscount(CartRAO cartRao, boolean absolute, java.math.BigDecimal amount)
absolute flag is set to true, the discount is absolute, otherwise its a percentage based
discount.cartRao - the cartRao to add the discount toabsolute - whether the discount is absolute or percentage-basedamount - the amount of the discountDiscountRAO addOrderEntryLevelDiscount(OrderEntryRAO orderEntryRao, boolean absolute, java.math.BigDecimal amount)
absolute flag is set to true, the discount is absolute, otherwise its
a percentage based discount.orderEntryRao - the orderEntryRao to add the discount toabsolute - whether the discount is absolute or percentage-basedamount - the amount of the discount@Deprecated DiscountRAO addOrderEntryLevelDiscountStackable(OrderEntryRAO orderEntryRao, boolean absolute, java.math.BigDecimal amount)
absolute flag is set to true, the discount
is absolute, otherwise its a percentage based discount.orderEntryRao - the orderEntryRao to add the discount toabsolute - whether the discount is absolute or percentage-basedamount - the amount of the discountShipmentRAO changeDeliveryMode(CartRAO cartRAO, DeliveryModeRAO deliveryModeRAO)
cartRAO - the cartRao to change the delivery mode fordeliveryModeRAO - the new delivery modeFreeProductRAO addFreeProductsToCart(CartRAO cartRao, ProductModel product, int quantity)
cartRao - cart where to add the productproduct - a product to addquantity - quantity of product items to addDiscountRAO addFixedPriceEntryDiscount(OrderEntryRAO orderEntryRao, java.math.BigDecimal fixedPrice)
fixedPrice multiplied by quantity.orderEntryRao - the orderEntryRao to add the discount tofixedPrice - the target unit price@Deprecated DiscountRAO addFixedPriceEntryDiscountStackable(OrderEntryRAO orderEntryRao, java.math.BigDecimal fixedPrice)
fixedPrice multiplied by quantity.orderEntryRao - the orderEntryRao to add the discount tofixedPrice - the target unit pricejava.math.BigDecimal calculateSubTotals(CartRAO cartRao, java.util.Collection<ProductRAO> excludedProducts)
cartRao - Cart to be calculatedexcludedProducts - List of products to be excluded from the cart calculationjava.math.BigDecimal getCurrentPrice(java.util.Set<OrderEntryRAO> orderEntryForDiscounts, java.util.Map<java.lang.Integer,java.lang.Integer> discountedOrderEntryMap)
orderEntryForDiscounts - set with Order Entries which price need to be calculateddiscountedOrderEntryMap - Map having orderEntry.entryNumber as keys and Unit Quantity To Be Consumed as valuesjava.math.BigDecimal getAdjustedUnitPrice(int quantity,
OrderEntryRAO orderEntryRao)
quantity - quantity of line itemorderEntryRao - orderEntryRao to get discounted unit price forjava.util.List<DiscountRAO> addFixedPriceEntriesDiscount(CartRAO cartRao, java.util.Map<java.lang.Integer,java.lang.Integer> selectedOrderEntryMap, java.util.Set<OrderEntryRAO> selectedOrderEntryRaos, java.math.BigDecimal fixedPrice)
cartRao, with the fixedPrice given as parameter
and for the products from entries in selectedOrderEntryRaos and related quantities given in
selectedOrderEntryMap.cartRao - Cart RAO used for totals calculationsselectedOrderEntryMap - Map having orderEntry.entryNumber as keys and unit quantity to be consumed as valuesselectedOrderEntryRaos - Order entries to be discountedfixedPrice - Target price for discounted productjava.util.List<DiscountRAO> addOrderEntryLevelDiscount(java.util.Map<java.lang.Integer,java.lang.Integer> selectedOrderEntryMap, java.util.Set<OrderEntryRAO> selectedOrderEntryRaos, boolean absolute, java.math.BigDecimal amount)
cartRao, adds it to the cartRao and updates the cartRao
totals. Discounts are applied to entries contained within the selectedOrderEntryMap selectedOrderEntryRaos
based on strategy.selectedOrderEntryMap - Map having orderEntry.entryNumber as keys and unit quantity to be consumed as valuesselectedOrderEntryRaos - Order entries to be discountedabsolute - boolean value true is discount is absolute currency amountamount - value of discountint getConsumedQuantityForOrderEntry(OrderEntryRAO orderEntryRao)
orderEntryRao - Cart order entry@Deprecated <T extends AbstractOrderRAO> int getOrderTotalAvailableQuantity(T orderRAO)
orderRAO - instance of AbstractOrderRAOint getProductAvailableQuantityInOrderEntry(OrderEntryRAO orderEntryRAO)
orderEntryRAO - instance of OrderEntryRAOCopyright © 2018 SAP SE. All Rights Reserved.