|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.ibm.commerce.price.commands.DiscountCalculationCodeApplyCmdImpl
The default implementation for the discount calculationUsage adds the specified MonetaryAmounts to the total adjustment of the orderItem. Order item adjustments and an order adjustment are also created for each calculation code applied.
NOTE : Order adjustments can not make the net price of an order item cross the zero boundary. That is, if an order item has a gross price that is on the opposite side of zero from the resulting net price (after applying the discount) then the net price is adjusted to zero and the discount is changed accordingly. Any left-over discount is distributed over the other order items that also qualify for the same discount. The distribution is done in proportion to the original discount. Any order item that has a gross price that is zero can only have a net price (price after applying discounts) that is positive.
Constructor Summary | |
DiscountCalculationCodeApplyCmdImpl()
DiscountCalculationCodeApplyCmdImpl constructor. |
Method Summary | |
protected void |
distributeExtraDiscount(java.math.BigDecimal discountToRedistribute,
java.math.BigDecimal[] weights,
java.math.BigDecimal[] netPrices,
java.math.BigDecimal[] discounts)
|
void |
performExecute()
Execute the command. |
protected java.math.BigDecimal |
roundCustomized(java.math.BigDecimal value,
java.lang.String currency)
|
void |
setCalculationCodeAB(CalculationCodeAccessBean calculationCodeAB)
Set the CalculationCodeAccessBean. |
void |
setOrderItemABHash(java.util.Hashtable orderItemABHash)
Set the orderItemABHash. |
Constructor Detail |
public DiscountCalculationCodeApplyCmdImpl()
Method Detail |
protected void distributeExtraDiscount(java.math.BigDecimal discountToRedistribute, java.math.BigDecimal[] weights, java.math.BigDecimal[] netPrices, java.math.BigDecimal[] discounts)
public void performExecute() throws ECException
protected java.math.BigDecimal roundCustomized(java.math.BigDecimal value, java.lang.String currency) throws ECException
public void setCalculationCodeAB(CalculationCodeAccessBean calculationCodeAB)
calculationCodeAB
- A CalculationCodeAccessBean.public void setOrderItemABHash(java.util.Hashtable orderItemABHash)
orderItemABHash
- An orderItemABHash.
java.util.Hashtable orderItemABHash
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |