public class DiscountCalculationCodeApplyCmdImpl extends CalculationCmdImpl implements DiscountCalculationCodeApplyCmd
The default implementation of DiscountCalculationCodeApplyCmd.
Its behavior is as follows:
Commands used:
Modifier and Type | Field and Description |
---|---|
static java.lang.String | COPYRIGHT
The IBM copyright notice field.
|
Constructor and Description |
---|
DiscountCalculationCodeApplyCmdImpl()
Constructor for DiscountCalculationCodeApplyCmdImpl.
|
Modifier and Type | Method and Description |
---|---|
protected OrderAdjustmentAccessBean | createOrderAdjustment(java.lang.Long anOrderId, java.math.BigDecimal adOrderAdjustmentAmount)
Creates an order adjustment for an order.
|
protected java.math.BigDecimal[] | getAffectedBaseMonetaryValues(PromotionExecutionRecord aRecord, Adjustment aAdjustment)
Returns the base monetary values of order items affected by a given adjustment.
|
protected java.math.BigDecimal[] | getAffectedQuantities(PromotionExecutionRecord aRecord, Adjustment aAdjustment)
Returns the quantities of order items affected by a given adjustment.
|
protected java.lang.Integer | getApplicableUsageId(Adjustment aAdjustment)
Returns the calculation usage a given adjustment is applicable to.
|
protected java.math.BigDecimal | getBaseMonetaryValue(Item aItem)
Returns the base monetary value of a given item.
|
protected CalculationCodeAccessBean | getCode()
Returns the calculation code.
|
protected java.math.BigDecimal[] | getCurrentBaseMonetaryValues()
Returns the base monetary values of order items adjusted by current adjustment amount.
|
protected java.util.List | getDiscountUsages()
This method returns a list of discount calculation usages.
|
protected Item[] | getItems()
Returns the items.
|
protected PromotionExecutionRecord | getPromotionExecutionRecord()
Returns the promotion execution record.
|
protected java.math.BigDecimal[] | getValues()
Returns the order item adjustment amounts.
|
protected boolean | isPriceMonetaryAdjustment(Adjustment aAdjustment)
Returns whether the adjustment is a MonetaryAdjustment of type MonetaryAdjustment.PRICE.
|
void | performExecute()
This method performs the business logic for this command.
|
protected void | process(PromotionExecutionRecord aRecord)
Process a given promotion execution record.
|
protected void | process(PromotionExecutionRecord aRecord, Adjustment aAdjustment)
Process a given adjustment for specific calculation usage.
|
protected void | processExtendedPriceAdjustment(PromotionExecutionRecord aRecord, Adjustment aAdjustment)
Process an extended price adjustment which may be the customer provided Adjustment implementation for Order or Product promotion.
|
protected void | processExtendedShippingAdjustment(PromotionExecutionRecord aRecord, Adjustment aAdjustment)
Process an extended shipping adjustment which may be the customer provided Adjustment implementation for Shipping promotion.
|
protected void | refreshItemAdjustmentTotals(Item item, java.math.BigDecimal idValue)
This methods is used to add a value to the adjustment total for the specified item and the current usage.
|
void | reset()
This method is called after a command has been executed.
|
void | setCode(CalculationCodeAccessBean aabCode)
Sets the calculation code.
|
void | setItems(Item[] aItems)
Sets the items.
|
void | setValues(java.math.BigDecimal[] adValues)
Sets the order item adjustment amounts.
|
void | setValues(java.lang.Integer anTaxCategoryId, java.math.BigDecimal[] adValues)
Sets the order item adjustment amounts.
|
public static final java.lang.String COPYRIGHT
public DiscountCalculationCodeApplyCmdImpl()
protected OrderAdjustmentAccessBean createOrderAdjustment(java.lang.Long anOrderId, java.math.BigDecimal adOrderAdjustmentAmount) throws ECException
public void performExecute() throws ECException
protected void refreshItemAdjustmentTotals(Item item, java.math.BigDecimal idValue)
public void reset()
public void setCode(CalculationCodeAccessBean aabCode)
public void setItems(Item[] aItems)
public void setValues(java.math.BigDecimal[] adValues)
public void setValues(java.lang.Integer anTaxCategoryId, java.math.BigDecimal[] adValues)
protected CalculationCodeAccessBean getCode()
protected Item[] getItems()
protected java.math.BigDecimal[] getValues()
protected PromotionExecutionRecord getPromotionExecutionRecord()
protected void process(PromotionExecutionRecord aRecord) throws ECException
protected boolean isPriceMonetaryAdjustment(Adjustment aAdjustment)
protected java.lang.Integer getApplicableUsageId(Adjustment aAdjustment)
protected void process(PromotionExecutionRecord aRecord, Adjustment aAdjustment) throws ECException
protected void processExtendedPriceAdjustment(PromotionExecutionRecord aRecord, Adjustment aAdjustment) throws ECException
protected void processExtendedShippingAdjustment(PromotionExecutionRecord aRecord, Adjustment aAdjustment) throws ECException
protected java.math.BigDecimal[] getAffectedQuantities(PromotionExecutionRecord aRecord, Adjustment aAdjustment) throws ECException
protected java.math.BigDecimal[] getAffectedBaseMonetaryValues(PromotionExecutionRecord aRecord, Adjustment aAdjustment) throws ECException
protected java.math.BigDecimal[] getCurrentBaseMonetaryValues() throws ECException
protected java.math.BigDecimal getBaseMonetaryValue(Item aItem) throws ECException
Calculation Usage | Base Monetary Value |
---|---|
Discount | Product Total + Discount Adjustment Total |
Shipping adjustment | Base Shipping Charge + Shipping Adjustment Total |
Sales Tax | Sales Tax Total |
Shipping Tax | Shipping Tax Total |
Others | 1 |
protected java.util.List getDiscountUsages()