public class OrderUtils extends Object
| Constructor and Description |
|---|
OrderUtils() |
| Modifier and Type | Method and Description |
|---|---|
BigDecimal |
applyRounding(BigDecimal price,
String currencyIsoCode)
Applies the scaling and rounding to a given price, based on declared currency code
|
BigDecimal |
convertCurrency(String sourceCurrencyIsoCode,
String targetCurrencyIsoCode,
BigDecimal sourceValue)
given the source and target currency codes, converts the value from one currency to another
|
OrderCharge |
createShippingCharge(Currency currency,
boolean absolute,
BigDecimal value)
Creates an
OrderCharge of AbstractCharge.ChargeType.SHIPPING for the given values. |
protected CommonI18NService |
getCommonI18NService() |
protected CurrencyModel |
getCurrency(String currencyCode) |
protected Optional<Integer> |
getDigitsOfCurrency(String currencyIsoCode) |
void |
setCommonI18NService(CommonI18NService commonI18NService) |
public OrderCharge createShippingCharge(Currency currency, boolean absolute, BigDecimal value)
OrderCharge of AbstractCharge.ChargeType.SHIPPING for the given values.currency - the currency to useabsolute - whether the shipping charge is percentage-based or absolute.value - the value of the chargepublic BigDecimal applyRounding(BigDecimal price, String currencyIsoCode)
price - - the value to apply the rounding tocurrencyIsoCode - - currency codepublic BigDecimal convertCurrency(String sourceCurrencyIsoCode, String targetCurrencyIsoCode, BigDecimal sourceValue)
sourceCurrencyIsoCode - - source currency codetargetCurrencyIsoCode - - target currency codesourceValue - - the source value to apply the conversion forprotected CurrencyModel getCurrency(String currencyCode) throws RuleEvaluationException
RuleEvaluationExceptionprotected CommonI18NService getCommonI18NService()
public void setCommonI18NService(CommonI18NService commonI18NService)
Copyright © 2000-2016 SAP SE. All Rights Reserved.