com.ibm.commerce.returns.commands
Class CalculateReturnItemAdjustmentPercentagePolicyCmdImpl
java.lang.Object
|
+--com.ibm.commerce.command.AbstractECCommand
|
+--com.ibm.commerce.command.TaskCommandImpl
|
+--com.ibm.commerce.command.BusinessPolicyCommandImpl
|
+--com.ibm.commerce.returns.commands.CalculateReturnItemAdjustmentPolicyCmdImpl
|
+--com.ibm.commerce.returns.commands.CalculateReturnItemAdjustmentPercentagePolicyCmdImpl
- All Implemented Interfaces:
- BusinessPolicyCommand, CalculateReturnItemAdjustmentPolicyCmd, ECCommand, TaskCommand
- public class CalculateReturnItemAdjustmentPercentagePolicyCmdImpl
- extends CalculateReturnItemAdjustmentPolicyCmdImpl
- implements CalculateReturnItemAdjustmentPolicyCmd
Calculate the adjustment for a return mechandise authorization (RMA) item based on a percentage. The properties passed
to this policy may be of the following form:
- default=-15 (this value is used if no other days_i/percent_i pair applies).
- days_i=30&percent_i=10 (where i changes).
If a days property is specified and no percent property, then percent=0 is assumed (that is, no adjustment).
If the number of
days since the item was shipped is more than any of the days_i properties then percent = 0 is assumed (unless
a default value is specified).
An example property string is:
days_1=30&percent_1=0&days_2=90&percent_2=-10&default=-20
This translates into "If the item is returned within 30 days of it being shipped then there is no charge. If
it is returned within 90 days then there is a 10% charge. Otherwise, there is a 20% charge."
Method Summary |
protected java.math.BigDecimal |
calcAdjustment()
Calculate the RMA item adjustment (charge). |
protected int |
findAppropriatePercent(int aDaysSinceShipped)
Find the appropriate percent charge. |
protected java.lang.Integer |
getDefault()
Get the default percentage (if specified). |
void |
reset()
Reset the command. |
void |
setRequestProperties(TypedProperty requestProperties)
Set the request properties for the policy. |
Methods inherited from class com.ibm.commerce.returns.commands.CalculateReturnItemAdjustmentPolicyCmdImpl |
calcTimestampShipped, createCharge, findBestDays, getAdjustment, getDaysSince, getOrderItemAB, getRMAItemAB, getTotalToAdjust, performExecute, removeExistingCharges, setOrderItemAB, setRMAItemAB, validateParameters |
Methods inherited from class com.ibm.commerce.command.AbstractECCommand |
accessControlCheck, checkIsAllowed, checkResourcePermission, execute, finalize, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getResources, getStoreId, getUser, getUserId, isReadyToCallExecute, setAccCheck, setCommandContext, setCommandIfName, setDefaultProperties |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.ibm.commerce.command.ECCommand |
checkIsAllowed, checkResourcePermission, execute, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getResources, getStoreId, getUser, getUserId, performExecute, setAccCheck, setCommandContext, setCommandIfName, setDefaultProperties, validateParameters |
CalculateReturnItemAdjustmentPercentagePolicyCmdImpl
public CalculateReturnItemAdjustmentPercentagePolicyCmdImpl()
- CalculateReturnItemAdjustmentPercentagePolicyCmdImpl constructor.
calcAdjustment
protected java.math.BigDecimal calcAdjustment()
throws ECException
- Calculate the RMA item adjustment (charge).
- Overrides:
calcAdjustment
in class CalculateReturnItemAdjustmentPolicyCmdImpl
- Returns:
- The adjustment (charge) amount.
findAppropriatePercent
protected int findAppropriatePercent(int aDaysSinceShipped)
- Find the appropriate percent charge.
- Parameters:
aDaysSinceShipped
- The number of days since the item was shipped.- Returns:
- The percent amount.
getDefault
protected java.lang.Integer getDefault()
- Get the default percentage (if specified).
- Returns:
- The default percentage.
reset
public void reset()
- Reset the command.
- Overrides:
reset
in class CalculateReturnItemAdjustmentPolicyCmdImpl
setRequestProperties
public void setRequestProperties(TypedProperty requestProperties)
- Set the request properties for the policy.
- Specified by:
setRequestProperties
in interface BusinessPolicyCommand
- Overrides:
setRequestProperties
in class CalculateReturnItemAdjustmentPolicyCmdImpl
- Parameters:
requestProperties
- The request properties.