com.ibm.commerce.returns.commands
Class CalculateReturnItemAdjustmentFlatPolicyCmdImpl
java.lang.Object
|
+--CacheableCommandImpl
|
+--com.ibm.commerce.command.AbstractECTargetableCommand
|
+--com.ibm.commerce.command.TaskCommandImpl
|
+--com.ibm.commerce.command.BusinessPolicyCommandImpl
|
+--com.ibm.commerce.returns.commands.CalculateReturnItemAdjustmentPolicyCmdImpl
|
+--com.ibm.commerce.returns.commands.CalculateReturnItemAdjustmentFlatPolicyCmdImpl
- All Implemented Interfaces:
-
BusinessPolicyCommand,
CalculateReturnItemAdjustmentPolicyCmd,
ECCommand,
ECTargetableCommand,
TaskCommand
- public class CalculateReturnItemAdjustmentFlatPolicyCmdImpl
- extends
CalculateReturnItemAdjustmentPolicyCmdImpl
- implements
CalculateReturnItemAdjustmentPolicyCmd
Calculate the adjustment for a return mechandise authorization (RMA) item
based on a flat fee. The properties passed to this policy may be of the
following form:
- default=CAD-15.00 (this value is used if no other days_i/flat_i pair
applies).
- days_i=30, flat_i=CAD-10.24 (where i changes).
If a days property is specified and no flat property, then flat=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 flat = 0 is assumed (unless a
default value is specified).
An example property string is:
-
days_1=30&flat_1=CAD-5.00&flat_1=USD-3.00&days_2=90&flat_2=CAD-10&default=CAD-20
This translates into "If the item is returned within 30 days of it being
shipped then there is a $5.00 charge if the RMA is in CAD currency or a $3.00
charge if the RMA is in USD currency. If it is returned within 90 days then
there is a $10.00 CAD charge and if the RMA is in USD and there is a conversion
from CAD->USD then they will be charged the equivalent of the converted
amount in USD (or another currency). Otherwise, there is a $20.00 CAD charge
(or the equivalent if there is a conversion to the RMA currency)."
If there is no conversion to the RMA currency for a particular days_i value
then the default will be used. If there is no conversion to the RMA currency
for the default then 0 will be used.
- See Also:
-
Serialized Form
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.
AbstractECTargetableCommand |
accessControlCheck,
checkIsAllowed,
checkParameters,
checkResourcePermission,
createCommandExecutionEvent,
execute,
finalize,
getAccCheck,
getCommandContext,
getCommandIfName,
getCommandName,
getCommandStoreId,
getDefaultProperties,
getResources,
getStoreId,
getUser,
getUserId,
isReadyToCallExecute,
setAccCheck,
setCommandContext,
setCommandIfName,
setCommandStoreId,
setDefaultProperties |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait,
wait, wait |
CalculateReturnItemAdjustmentFlatPolicyCmdImpl
public CalculateReturnItemAdjustmentFlatPolicyCmdImpl()
- CalculateReturnItemAdjustmentFlatPolicyCmdImpl constructor.
calcAdjustment
protected java.math.BigDecimal calcAdjustment()
throws ECException
- Calculate the RMA item adjustment (charge).
-
- Specified by:
-
calcAdjustment
in class
CalculateReturnItemAdjustmentPolicyCmdImpl
-
- Returns:
- The adjustment (charge) amount.
-
ECException
findAppropriateMonetaryAmount
protected MonetaryAmount[] findAppropriateMonetaryAmount(int aDaysSinceShipped)
- Find the appropriate flat fee charge.
-
- Parameters:
aDaysSinceShipped
- The number of days since the item was
shipped.
- Returns:
- The flat fee array.
getDefault
protected com.ibm.commerce.price.utils.MonetaryAmount[] getDefault()
- Get the default values.
-
- Returns:
- The default flat fee array.
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.