Class DefaultRefundAmountCalculationService
- java.lang.Object
-
- de.hybris.platform.warehousing.returns.service.impl.DefaultRefundAmountCalculationService
-
- All Implemented Interfaces:
RefundAmountCalculationService
public class DefaultRefundAmountCalculationService extends java.lang.Object implements RefundAmountCalculationService
Calculates the refund amount based on the basePrice of products being returned.
-
-
Constructor Summary
Constructors Constructor Description DefaultRefundAmountCalculationService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.math.BigDecimalgetCustomRefundAmount(ReturnRequestModel returnRequest)Returns the custom refund amount for aReturnRequestModel.java.math.BigDecimalgetCustomRefundEntryAmount(ReturnEntryModel returnEntryModel)Gets theRefundEntryModel#_amountbased on the basePrice of products being returned in the entry.protected intgetNumberOfDigits(ReturnRequestModel returnRequest)Retrieves the number of digits to use base on aReturnRequestModeljava.math.BigDecimalgetOriginalRefundAmount(ReturnRequestModel returnRequest)Returns the original refund amount for aReturnRequestModel.java.math.BigDecimalgetOriginalRefundEntryAmount(ReturnEntryModel returnEntryModel)Calculates and persists theRefundEntryModel#_amountbased on the amount of products being returned in the entry.
-
-
-
Method Detail
-
getCustomRefundAmount
public java.math.BigDecimal getCustomRefundAmount(ReturnRequestModel returnRequest)
Description copied from interface:RefundAmountCalculationServiceReturns the custom refund amount for aReturnRequestModel.- Specified by:
getCustomRefundAmountin interfaceRefundAmountCalculationService- Parameters:
returnRequest- theReturnRequestModelfor which refund amount needs to be calculated- Returns:
BigDecimalrepresenting the custom refund amount
-
getCustomRefundEntryAmount
public java.math.BigDecimal getCustomRefundEntryAmount(ReturnEntryModel returnEntryModel)
Description copied from interface:RefundAmountCalculationServiceGets theRefundEntryModel#_amountbased on the basePrice of products being returned in the entry.- Specified by:
getCustomRefundEntryAmountin interfaceRefundAmountCalculationService- Parameters:
returnEntryModel- theRefundEntryModelfor which refund amount needs to be calculated- Returns:
- the refundAmount for the requested
RefundEntryModel
-
getOriginalRefundAmount
public java.math.BigDecimal getOriginalRefundAmount(ReturnRequestModel returnRequest)
Description copied from interface:RefundAmountCalculationServiceReturns the original refund amount for aReturnRequestModel.- Specified by:
getOriginalRefundAmountin interfaceRefundAmountCalculationService- Parameters:
returnRequest- theReturnRequestModelfor which refund amount needs to be calculated- Returns:
BigDecimalrepresenting the original refund amount
-
getOriginalRefundEntryAmount
public java.math.BigDecimal getOriginalRefundEntryAmount(ReturnEntryModel returnEntryModel)
Description copied from interface:RefundAmountCalculationServiceCalculates and persists theRefundEntryModel#_amountbased on the amount of products being returned in the entry.- Specified by:
getOriginalRefundEntryAmountin interfaceRefundAmountCalculationService- Parameters:
returnEntryModel- theRefundEntryModelfor which refund entry amount needs to be calculated- Returns:
- the sum of all refund amount
RefundEntryModelfor all entries, otherwise 0
-
getNumberOfDigits
protected int getNumberOfDigits(ReturnRequestModel returnRequest)
Retrieves the number of digits to use base on aReturnRequestModel- Parameters:
returnRequest- the return request from which we want to find the number of digits to use- Returns:
- the number of digits to apply
-
-