public class ApplyCouponUsageCmdImpl extends CalculationCmdImpl implements ApplyCouponUsageCmd
This task command is called from OrderPrepare command to incorporate the eCoupon discount onto the Adjustments in ORDERS and ORDERITEMS table. The command is invoked when user asks to redeem the eCoupons before preparing order.
The eCoupons which are to be applied to an order are found out from OrderCouponMapAccessBean. They are removed from OrderCouponMapAccessBean and CouponItemMapAccessBean. The eCoupons are checked for expiry by calling CheckValidityTaskCmd command. The eCoupons that are not expired are checked for applicability by calling CheckApplicabilityTaskCmd command. The CalculateDiscountAmountCmd task command is called on the applicable coupons to find the discount amount to be incorporated in the currect order.
Modifier and Type | Field and Description |
---|---|
protected java.lang.Long | orderId
Deprecated.
The ID of the order which is being prepared.
|
protected CommandContext | processingContext
Deprecated.
The command context is kept in this.
|
Constructor and Description |
---|
ApplyCouponUsageCmdImpl()
Deprecated.
Constructor for ApplyCouponUsageCmdImpl call super.
|
Modifier and Type | Method and Description |
---|---|
protected void | callCodeApply(Group aGroup)
Deprecated.
This method is called by performExecute() to invoke the CalculationCodeApply calculation method.
|
void | checkAppliedItems()
Deprecated.
It checks applied items.
|
java.util.Set | getAppliedItems()
Deprecated.
Gets the applied items.
|
protected Item[] | getItems()
Deprecated.
Gets the items.
|
java.lang.Long | getOrderId()
Deprecated.
Gets the orderId.
|
CommandContext | getProcessingContext()
Deprecated.
Gets the processing context.
|
protected java.lang.Integer[] | getTaxCategoryIds()
Deprecated.
Gets the tax categories.
|
void | insertIntoDB(java.lang.Long orderId, java.util.Hashtable couponHashtable)
Deprecated.
It inserts data into database.
|
void | performExecute()
Deprecated.
The eCoupons which are to be applied to an order are found out from OrderCouponMapAccessBean.
|
void | removeOldEntries()
Deprecated.
It removes the old entries.
|
void | reset()
Deprecated.
Sets the various variables to their default values (null).
|
void | setItems(Item[] aItems)
Deprecated.
Sets the items.
|
void | setOrderId(java.lang.Long newOrderId)
Deprecated.
Sets the order IDs.
|
void | setProcessingContext(CommandContext newProcessingContext)
Deprecated.
Sets the processing context.
|
void | setTaxCategoryIds(java.lang.Integer[] anTaxCategoryIds)
Deprecated.
Sets the tax category..
|
void | validateParameters()
Deprecated.
Checks the parameters.
|
protected CommandContext processingContext
protected java.lang.Long orderId
public ApplyCouponUsageCmdImpl()
protected void callCodeApply(Group aGroup) throws ECException
public void checkAppliedItems() throws ECException
public java.util.Set getAppliedItems()
protected Item[] getItems()
public java.lang.Long getOrderId()
public CommandContext getProcessingContext()
protected java.lang.Integer[] getTaxCategoryIds()
public void insertIntoDB(java.lang.Long orderId, java.util.Hashtable couponHashtable) throws ECSystemException
public void performExecute() throws ECException
The eCoupons which are to be applied to an order are found out from OrderCouponMapAccessBean. They are removed from OrderCouponMapAccessBean and CouponItemMapAccessBean. The eCoupons are checked for expiry by calling CheckValidityTaskCmd command. The eCoupons that are not expired are checked for applicability by calling CheckApplicabilityTaskCmd command. The CalculateDiscountAmountCmd task command is called on the applicable coupons to find the discount amount to be incorporated in the currect order.
public void removeOldEntries() throws ECSystemException
public void reset()
public void setItems(Item[] aItems)
public void setOrderId(java.lang.Long newOrderId)
public void setProcessingContext(CommandContext newProcessingContext)
public void setTaxCategoryIds(java.lang.Integer[] anTaxCategoryIds)
public void validateParameters() throws ECException