atg.commerce.csr.returns
Class ReturnItem

java.lang.Object
  extended by atg.commerce.csr.returns.ReturnItem
All Implemented Interfaces:
java.io.Serializable

public class ReturnItem
extends java.lang.Object
implements java.io.Serializable

This component encapsulates data related to a returned item

The loadReturnItem(RepositoryItem) is used to load return item properties from repository item. if you add additional properties to return item and it needs to be loaded to the return item object, you need to extend this method.

The #loadReturnItem(MutableRepositoryItem) is used to save return item properties to repository item. if you add additional properties to return item and it needs to be saved in the repository, you need to extend this method.

See Also:
loadReturnItem(RepositoryItem), saveReturnItem(MutableRepositoryItem), Serialized Form

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
protected  java.util.Collection mItemCostAdjustments
           
 
Constructor Summary
ReturnItem(CommerceItem pCommerceItem)
          Initialize a ReturnItem based on the given commerce item
 
Method Summary
 void addItemCostAdjustment(ItemCostAdjustment pItemCostAdjustment)
          Adds a new ItemCostAdjustment to the return.
 void addItemCostAdjustments(java.util.Collection pItemCostAdjustments)
          Adds a collection of ItemCostAdjustment objects to the return.
 void clearItemCostAdjustments()
          Clears all the ItemCostAdjustment objects from the return
 double getActualShippingRefundShare()
           
 double getActualTaxRefundShare()
           
 CommerceItem getCommerceItem()
           
 java.lang.String getDisposition()
          Returns the disposition for this item
 java.lang.String getId()
          Returns the id of this return item
static ReturnItem getInstance(CommerceItem pCommerceItem)
          Deprecated.  
 java.util.Collection getItemCostAdjustments()
          Returns the collection of ItemCostAdjustment objects that are used to determine the suggested refund amounts for the return.
 long getQuantityAvailable()
           
 long getQuantityReceived()
          Returns the quantity that has been received
 long getQuantityReturned()
           
 long getQuantityShipped()
           
 long getQuantityToExchange()
           
 long getQuantityToProcess()
           
 long getQuantityToReturn()
          Returns the quantity that should be returned
 double getRefundAmount()
           
 java.lang.String getReturnReason()
          Returns the reason that this item was returned
 java.lang.String getShippingGroupId()
          Returns the id of the shipping group that this record is related to
 java.lang.String getState()
          Returns the state of this return item
 java.lang.String getStateAsUserResource()
          returns the ReturnItem state as a user resource
 java.lang.String getStateDetailAsUserResource()
          returns the ReturnItem state detail as a user resource
 double getSuggestedRefundAmount()
           
 double getSuggestedShippingRefundShare()
           
 double getSuggestedTaxRefundShare()
           
 boolean isEditable()
          Can this item be edited?
 boolean isReturnShipmentRequired()
          Returns the switch that indicates if the item must be returned
 void loadReturnItem(RepositoryItem pSource)
          This method is used to copy the information from the source return item repository item to return item instance.
 void saveReturnItem(MutableRepositoryItem pDestination)
          This method is used to copy the information from return item instance to repository item.
 void setActualShippingRefundShare(double pActualShippingRefundShare)
           
 void setActualTaxRefundShare(double pActualTaxRefundShare)
           
 void setDisposition(java.lang.String pDisposition)
          Sets the disposition for this item
protected  void setId(java.lang.String pId)
          Sets the id of this return item
 void setQuantityReceived(long pQuantityReceived)
          Sets the quantity that has been received
 void setQuantityReturned(long pQuantityReturned)
          Sets the quantity of this item that has previously been returned
 void setQuantityShipped(long pQuantityShipped)
          Sets the quantity of this item that was originally shipped
 void setQuantityToExchange(long pQuantityToExchange)
          Sets the quantity that should be exchanged
 void setQuantityToReturn(long pQuantityToReturn)
          Sets the quantity that should be returned
 void setRefundAmount(double pRefundAmount)
          Sets the refund amount for this item
 void setReturnReason(java.lang.String pReturnReason)
          Sets the reason that this item was returned
 void setReturnShipmentRequired(boolean pReturnShipmentRequired)
          Sets the switch that indicates if the item must be returned
protected  void setShippingGroupId(java.lang.String pShippingGroupId)
          Sets the id of the shipping group that this record is related to
protected  void setState(java.lang.String pState)
          Sets the state of this return item
 void setSuggestedRefundAmount(double pSuggestedRefundAmount)
          Sets the suggested refund amount
 void setSuggestedShippingRefundShare(double pSuggestedShippingRefundShare)
           
 void setSuggestedTaxRefundShare(double pSuggestedTaxRefundShare)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static final java.lang.String CLASS_VERSION
Class version string

See Also:
Constant Field Values

mItemCostAdjustments

protected java.util.Collection mItemCostAdjustments
Constructor Detail

ReturnItem

public ReturnItem(CommerceItem pCommerceItem)
Initialize a ReturnItem based on the given commerce item

See Also:
setCommerceItem(CommerceItem)
Method Detail

getCommerceItem

public CommerceItem getCommerceItem()
Returns:
the commerce item related to this returned item

setDisposition

public void setDisposition(java.lang.String pDisposition)
Sets the disposition for this item

Parameters:
pDisposition - the disposition for this item

getDisposition

public java.lang.String getDisposition()
Returns the disposition for this item


setId

protected void setId(java.lang.String pId)
Sets the id of this return item

Parameters:
pId - the id of this return item

getId

public java.lang.String getId()
Returns the id of this return item


setQuantityReceived

public void setQuantityReceived(long pQuantityReceived)
Sets the quantity that has been received

Parameters:
pQuantityReceived - the quantity that has been received

getQuantityReceived

public long getQuantityReceived()
Returns the quantity that has been received


setQuantityReturned

public void setQuantityReturned(long pQuantityReturned)
Sets the quantity of this item that has previously been returned

Parameters:
pQuantityReturned - the quantity of this item that has previously been returned

getQuantityReturned

public long getQuantityReturned()
Returns:
long the quantity of this item that has previously been returned

setQuantityShipped

public void setQuantityShipped(long pQuantityShipped)
Sets the quantity of this item that was originally shipped

Parameters:
pQuantityShipped - the quantity of this item that was originally shipped

getQuantityShipped

public long getQuantityShipped()
Returns:
long the quantity of this item that was originally shipped

setQuantityToExchange

public void setQuantityToExchange(long pQuantityToExchange)
Sets the quantity that should be exchanged

Parameters:
pQuantityToExchange - the quantity that should be exchanged

getQuantityToExchange

public long getQuantityToExchange()
Returns:
long the quantity that should be exchanged

setQuantityToReturn

public void setQuantityToReturn(long pQuantityToReturn)
Sets the quantity that should be returned

Parameters:
pQuantityToReturn - the quantity that should be returned

getQuantityToReturn

public long getQuantityToReturn()
Returns the quantity that should be returned


setRefundAmount

public void setRefundAmount(double pRefundAmount)
Sets the refund amount for this item

Parameters:
pRefundAmount - the refund amount for this item

getRefundAmount

public double getRefundAmount()
Returns:
double the refund amount for this item

setReturnReason

public void setReturnReason(java.lang.String pReturnReason)
Sets the reason that this item was returned

Parameters:
pReturnReason - the reason that this item was returned

getReturnReason

public java.lang.String getReturnReason()
Returns the reason that this item was returned


setReturnShipmentRequired

public void setReturnShipmentRequired(boolean pReturnShipmentRequired)
Sets the switch that indicates if the item must be returned

Parameters:
pReturnShipmentRequired - boolean indicating if the item must be returned

isReturnShipmentRequired

public boolean isReturnShipmentRequired()
Returns the switch that indicates if the item must be returned


setShippingGroupId

protected void setShippingGroupId(java.lang.String pShippingGroupId)
Sets the id of the shipping group that this record is related to

Parameters:
pShippingGroupId - the id of the shipping group that this record is related to

getShippingGroupId

public java.lang.String getShippingGroupId()
Returns the id of the shipping group that this record is related to


setState

protected void setState(java.lang.String pState)
Sets the state of this return item

Parameters:
pState - the state of this return item

getState

public java.lang.String getState()
Returns the state of this return item


getStateAsUserResource

public java.lang.String getStateAsUserResource()
returns the ReturnItem state as a user resource


getStateDetailAsUserResource

public java.lang.String getStateDetailAsUserResource()
returns the ReturnItem state detail as a user resource


setSuggestedRefundAmount

public void setSuggestedRefundAmount(double pSuggestedRefundAmount)
Sets the suggested refund amount

Parameters:
pSuggestedRefundAmount - the suggested refund amount based on the original price of the item

getSuggestedRefundAmount

public double getSuggestedRefundAmount()
Returns:
the suggested refund amount based on the quantity to return and the original price of the item.

getSuggestedShippingRefundShare

public double getSuggestedShippingRefundShare()

setSuggestedShippingRefundShare

public void setSuggestedShippingRefundShare(double pSuggestedShippingRefundShare)

getSuggestedTaxRefundShare

public double getSuggestedTaxRefundShare()

setSuggestedTaxRefundShare

public void setSuggestedTaxRefundShare(double pSuggestedTaxRefundShare)

getActualShippingRefundShare

public double getActualShippingRefundShare()

setActualShippingRefundShare

public void setActualShippingRefundShare(double pActualShippingRefundShare)

getActualTaxRefundShare

public double getActualTaxRefundShare()

setActualTaxRefundShare

public void setActualTaxRefundShare(double pActualTaxRefundShare)

getQuantityAvailable

public long getQuantityAvailable()
Returns:
long the quantity is available to return

getQuantityToProcess

public long getQuantityToProcess()
Returns:
long the total quantity to process (i.e. return and exchange)

isEditable

public boolean isEditable()
Can this item be edited?


getItemCostAdjustments

public java.util.Collection getItemCostAdjustments()
Returns the collection of ItemCostAdjustment objects that are used to determine the suggested refund amounts for the return.


addItemCostAdjustment

public void addItemCostAdjustment(ItemCostAdjustment pItemCostAdjustment)
Adds a new ItemCostAdjustment to the return.

Parameters:
pItemCostAdjustment -

addItemCostAdjustments

public void addItemCostAdjustments(java.util.Collection pItemCostAdjustments)
Adds a collection of ItemCostAdjustment objects to the return.

Parameters:
pItemCostAdjustments -

clearItemCostAdjustments

public void clearItemCostAdjustments()
Clears all the ItemCostAdjustment objects from the return


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
a String representation of this object

getInstance

public static ReturnItem getInstance(CommerceItem pCommerceItem)
Deprecated. 

This method calls ReturnItem(CommerceItem) to create
instance of ReturnItem.

Returns:
ReturnItem

loadReturnItem

public void loadReturnItem(RepositoryItem pSource)
                    throws ReturnException
This method is used to copy the information from the source return item repository item to return item instance.

Parameters:
pSource - The information to be copied from.
Throws:
ReturnException

saveReturnItem

public void saveReturnItem(MutableRepositoryItem pDestination)
                    throws ReturnException
This method is used to copy the information from return item instance to repository item.

Parameters:
pDestination - The information to be copied
Throws:
ReturnException