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.BigDecimal
getCustomRefundAmount(ReturnRequestModel returnRequest)
Returns the custom refund amount for aReturnRequestModel
.java.math.BigDecimal
getCustomRefundEntryAmount(ReturnEntryModel returnEntryModel)
Gets theRefundEntryModel#_amount
based on the basePrice of products being returned in the entry.protected int
getNumberOfDigits(ReturnRequestModel returnRequest)
Retrieves the number of digits to use base on aReturnRequestModel
java.math.BigDecimal
getOriginalRefundAmount(ReturnRequestModel returnRequest)
Returns the original refund amount for aReturnRequestModel
.java.math.BigDecimal
getOriginalRefundEntryAmount(ReturnEntryModel returnEntryModel)
Calculates and persists theRefundEntryModel#_amount
based on the amount of products being returned in the entry.
-
-
-
Method Detail
-
getCustomRefundAmount
public java.math.BigDecimal getCustomRefundAmount(ReturnRequestModel returnRequest)
Description copied from interface:RefundAmountCalculationService
Returns the custom refund amount for aReturnRequestModel
.- Specified by:
getCustomRefundAmount
in interfaceRefundAmountCalculationService
- Parameters:
returnRequest
- theReturnRequestModel
for which refund amount needs to be calculated- Returns:
BigDecimal
representing the custom refund amount
-
getCustomRefundEntryAmount
public java.math.BigDecimal getCustomRefundEntryAmount(ReturnEntryModel returnEntryModel)
Description copied from interface:RefundAmountCalculationService
Gets theRefundEntryModel#_amount
based on the basePrice of products being returned in the entry.- Specified by:
getCustomRefundEntryAmount
in interfaceRefundAmountCalculationService
- Parameters:
returnEntryModel
- theRefundEntryModel
for 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:RefundAmountCalculationService
Returns the original refund amount for aReturnRequestModel
.- Specified by:
getOriginalRefundAmount
in interfaceRefundAmountCalculationService
- Parameters:
returnRequest
- theReturnRequestModel
for which refund amount needs to be calculated- Returns:
BigDecimal
representing the original refund amount
-
getOriginalRefundEntryAmount
public java.math.BigDecimal getOriginalRefundEntryAmount(ReturnEntryModel returnEntryModel)
Description copied from interface:RefundAmountCalculationService
Calculates and persists theRefundEntryModel#_amount
based on the amount of products being returned in the entry.- Specified by:
getOriginalRefundEntryAmount
in interfaceRefundAmountCalculationService
- Parameters:
returnEntryModel
- theRefundEntryModel
for which refund entry amount needs to be calculated- Returns:
- the sum of all refund amount
RefundEntryModel
for 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
-
-