public interface DiscountService
DiscountModel.
There are different kinds of discounts: absolute or relative, and global and non-global. Absolute discounts contain a real price value (price and currency), whereas relative discounts are discounts in percent. Global discounts are applied on order level, which means that they can not be applied to a single entry. Non-global discounts are only applicable on entry - level.
Since all price calculation is done be the currently installed pricefactory refer to it for maybe differing behavior.| Modifier and Type | Method and Description |
|---|---|
DiscountModel |
getDiscountForCode(java.lang.String code)
Gets the
DiscountModel with the specified code. |
default java.util.List<DiscountInformation> |
getDiscountInformation(BaseCriteria baseCriteria)
Get discounts
DiscountInformations for given criteria. |
java.util.Collection<DiscountModel> |
getDiscountsForCode(java.lang.String matchedCode)
Gets all
DiscountModels which match the specified code. |
java.util.Collection<DiscountModel> |
getDiscountsForCurrency(CurrencyModel currency)
Gets all
DiscountModels which match the specified currency. |
DiscountModel getDiscountForCode(java.lang.String code)
DiscountModel with the specified code.code - the discount codeDiscountModel with the specified codejava.util.Collection<DiscountModel> getDiscountsForCode(java.lang.String matchedCode)
DiscountModels which match the specified code.matchedCode - an SQL-Like statement as String, such as %discountCode%Collection of all DiscountModels which match the specified codejava.util.Collection<DiscountModel> getDiscountsForCurrency(CurrencyModel currency)
DiscountModels which match the specified currency.currency - target CurrencyModelCollection of all DiscountModels which matching currency. If no matching discounts
were found, an empty collection is returned.java.lang.IllegalArgumentException - if currency is nulldefault java.util.List<DiscountInformation> getDiscountInformation(BaseCriteria baseCriteria) throws CalculationException
DiscountInformations for given criteria.baseCriteria - BaseCriteriaList of all DiscountInformations which matching baseCriteria. If no matching
discounts were found, an empty collection is returned.CalculationException - if error occurredCopyright © 2018 SAP SE. All Rights Reserved.