atg.commerce.csr.returns
Class ReturnRequest

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

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

This component encapsulates all data related to a request to return or exchange merchandise.

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

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

See Also:
loadReturnRequest(RepositoryItem), saveReturnRequest(MutableRepositoryItem), Serialized Form

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
protected  java.util.Map mDiscountableMap
           
protected  java.util.Map mExchangeManualAdjustmentValue
           
protected  java.util.Map mExchangeOrderPromotionValue
           
protected  java.util.Map mExchangeToPEOItemMap
           
protected  java.util.Map mExchangeToPEOShippingGroupMap
           
protected  java.util.Map<atg.commerce.promotion.GWPMultiHashKey,GiftWithPurchaseSelection> mGWPSelections
           
protected  java.util.List mItemPriceSources
           
protected  java.util.Collection mItemPromotions
           
protected  java.util.Collection mNonReturnItemCostAdjustments
           
protected  double mNonReturnItemSubtotalAdjustment
           
protected  java.util.Collection mOrderPromotions
           
protected  Order mOriginatingOrder
           
protected  java.util.Map mOriginatingToRAOItemMap
           
protected  java.util.Map mOriginatingToRAOShippingGroupMap
           
protected  java.util.Map mPEOToExchangeItemMap
           
protected  java.util.Map mPEOToExchangeShippingGroupMap
           
protected  java.util.Map mPEOToRCOItemMap
           
protected  java.util.Map mPEOToRCOShippingGroupMap
           
protected  java.util.Map mPreReturnPromotionValue
           
protected  RepositoryItem mPriceList
           
protected  Order mPromotionEvaluationOrder
           
protected  java.util.Map mPromotionValueAdjustment
           
protected  java.util.Map mRAOToOriginatingItemMap
           
protected  java.util.Map mRAOToOriginatingShippingGroupMap
           
protected  java.util.Map mRAOToRCOItemMap
           
protected  java.util.Map mRAOToRCOShippingGroupMap
           
protected  java.util.Map mRAOToReplacementItemMap
           
protected  java.util.Map mRAOToReplacementShippingGroupMap
           
protected  java.util.Map mRCOToPEOItemMap
           
protected  java.util.Map mRCOToPEOShippingGroupMap
           
protected  java.util.Map mRCOToRAOItemMap
           
protected  java.util.Map mRCOToRAOShippingGroupMap
           
protected  java.util.List mRelatedReplacementOrders
           
protected  java.util.Map mReplacementToRAOItemMap
           
protected  java.util.Map mReplacementToRAOShippingGroupMap
           
protected  Order mReturnAdjustedOrder
           
protected  Order mReturnCalculationOrder
           
protected  RepositoryItem mSalePriceList
           
protected  java.util.Map mShippingCostMap
           
protected  java.lang.Object[] mSortedRelatedReturnRequests
           
 
Constructor Summary
ReturnRequest()
          Initializes a ReturnRequest object with a null order
ReturnRequest(Order pOrder)
          Initializes a ReturnRequest object based on the given order.
 
Method Summary
 void addNonReturnItemCostAdjustment(ItemCostAdjustment pItemCostAdjustment)
          Adds a new ItemCostAdjustment to the return.
 void addNonReturnItemCostAdjustments(java.util.Collection pNonReturnItemCostAdjustments)
          Adds a collection of ItemCostAdjustment objects to the return.
 void clearNonReturnItemCostAdjustments()
          Clears all the ItemCostAdjustment objects from the return
 double getActualShippingRefund()
          Returns the actual shipping cost refund amount
 double getActualTaxRefund()
          Returns the actual tax refund amount
 double getAdjustmentAmount()
          returns the total amount of adjustments.
 java.lang.String getAgentId()
          Gets property agentId
 double getAllocatedAmount()
          Returns the total refund amount that has been allocated to refund methods.
 java.util.Date getAuthorizationDate()
          Returns authorization date
 java.lang.String getAuthorizationNumber()
          Returns authorization number
 java.lang.String getComments()
          returns the comments about this return
 atg.commerce.csr.returns.ProcessName getCurrentProcessName()
          This method gets the current process name.
If the process name is null, then based on the replacement order, this method
sets to Return or Exchange.
 java.util.Map getDiscountableMap()
          Returns the Map of discountable flags based on the state saved on the originating order and all related replacement orders.
 java.util.Map getExchangeManualAdjustmentValue()
          Returns the map of manual adjustment to their adjustment value.
 java.util.Map getExchangeOrderPromotionValue()
          Returns the map of order promotion to their adjustment value.
 java.util.Map getExchangeToPEOItemMap()
          This maps items in the new exchange order to their matching counterpart in the promotion evaluation order.
 java.util.Map getExchangeToPEOShippingGroupMap()
          This maps shipping groups in the new exchange order to their matching counterpart in the promotion evaluation order.
 StoreCredit getGeneratedStoreCredit()
          Returns the generatedStoreCredit.
 RepositoryItem getGeneratedStoreCreditItem()
          Returns the transient repository item matching the generatedStoreCredit.
 java.util.Map<atg.commerce.promotion.GWPMultiHashKey,GiftWithPurchaseSelection> getGWPSelections()
          These GiftWithPurchaseSelection objects are generated based on the gwp items that are being exchanged.
static ReturnRequest getInstance()
          Deprecated.  
static ReturnRequest getInstance(Order pOrder)
          Deprecated.  
 java.util.List getItemPriceSources()
          Returns the list of ItemPriceSource objects that are used to price the working orders and the exchange order in the return.
 java.util.Collection getItemPromotions()
           
 java.util.Collection getNonReturnItemCostAdjustments()
          Returns the collection of ItemCostAdjustment objects that were generated for items not being returned and included when calculating the suggested refund amounts for the return.
 double getNonReturnItemSubtotalAdjustment()
          This is the adjustment to the totalItemRefund based on the adjustments to non-return item's amount, order discount share and manual adjustment share
 Order getOrder()
          returns the the order that this return is related to
 java.util.Collection getOrderPromotions()
           
 Order getOriginatingOrder()
          Returns the originating order for this return request.
 java.util.Map getOriginatingToRAOItemMap()
          Maps the commerce item ids in the originating order to their matching counterparts in the Return Adjusted Order.
 java.util.Map getOriginatingToRAOShippingGroupMap()
          Maps the shipping group ids in the originating order to their matching counterparts in the Return Adjusted Order.
 java.lang.String getOriginOfReturn()
          Returns property originOfReturn
 double getOtherRefund()
           
 java.util.Map getPEOToExchangeItemMap()
          This maps items in the promotion evaluation order to their matching counterpart in the new exchange order.
 java.util.Map getPEOToExchangeShippingGroupMap()
          This maps shipping groups in the promotion evaluation order to their matching counterpart in the new exchange order.
 java.util.Map getPEOToRCOItemMap()
          This maps items in the promotion evaluation order to their matching counter part in the return calculation order.
 java.util.Map getPEOToRCOShippingGroupMap()
          This maps items in the promotion evaluation order to their matching counter part in the return calculation order.
 java.util.Map getPreReturnPromotionValue()
          This map contains the adjustment value of each promotion at the start of the return.
 RepositoryItem getPriceList()
           
 atg.commerce.csr.returns.ProcessName getProcessName()
           
 RepositoryItem getProfile()
           
 Order getPromotionEvaluationOrder()
          Returns a reference to the PromotionEvaluationOrder created for the exchange.
 java.util.Map getPromotionValueAdjustments()
          This map contains the change in promotion value as a result of the current return or exchange.
 java.util.Map getRAOToOriginatingItemMap()
          Maps the commerce item ids in the Return Adjusted Order to their matching counterparts in the originating order.
 java.util.Map getRAOToOriginatingShippingGroupMap()
          Maps the shipping group ids in the Return Adjusted Order to their matching counterparts in the originating order.
 java.util.Map getRAOToRCOItemMap()
          This maps items in the return adjusted order to their matching counter part in the return calculation order.
 java.util.Map getRAOToRCOShippingGroupMap()
          This maps shipping groups in the return adjusted order to their matching counter part in the return calculation order.
 java.util.Map getRAOToReplacementItemMap()
          The maps RAO item ids to their original replacement item ids
 java.util.Map getRAOToReplacementShippingGroupMap()
          The maps RAO shipping group ids to their original replacement shipping group ids
 java.util.Map getRCOToPEOItemMap()
          This maps items in the return calcuation order to their matching counter part in the promotion evaluation order.
 java.util.Map getRCOToPEOShippingGroupMap()
          This maps items in the return calculation order to their matching counter part in the promotin evaluation order.
 java.util.Map getRCOToRAOItemMap()
          This maps items in the return calculation order to their matching counter part in the return adjusted order.
 java.util.Map getRCOToRAOShippingGroupMap()
          This maps shipping groups in the return calcuation order to their matching counter part in the return adjusted order.
 java.util.ArrayList<RefundMethod> getRefundMethodList()
          Returns list of refund methods that are available
 double getRefundSubtotal()
          Returns the subtotal amount of this refund.
 java.util.List getRelatedReplacementOrders()
          This list includes all the replacement orders associated with the sortedReturnRequests
 long getReplaceItemCount()
          The number of items being replaced.
 Order getReplacementOrder()
           
 java.util.Map getReplacementToRAOItemMap()
          This maps items copied from each exchange order to their counterpart in the return adjusted order.
 java.util.Map getReplacementToRAOShippingGroupMap()
          This maps shipping groups in the exchange orders to their matching counter parts in the return adjusted order.
 java.lang.String getRequestId()
          returns the ID of the request that this object represents
 Order getReturnAdjustedOrder()
          Returns a reference to the ReturnAdjustedOrder created for the return.
 Order getReturnCalculationOrder()
          Returns a reference to the ReturnCalculationOrder created for the return.
 double getReturnFee()
          Returns the fee associated with the return
 long getReturnItemCount()
          The number of items being returned
 java.util.ArrayList getReturnItemList()
          Returns list of items selected for inclusion in this return
 java.util.HashMap getReturnItemMap()
          Returns map of ReturnItem Ids to the ReturnItems
 atg.commerce.csr.returns.ReturnPaymentState getReturnPaymentState()
          Returns the returnPaymentState.
 RepositoryItem getSalePriceList()
           
 java.util.Map getShippingCostMap()
          Maps ShippingGroupCommerceItemRelationships to the their shipping cost in the original purchase order
 java.util.ArrayList getShippingGroupList()
          Returns list of shipping groups associated with this return request
 java.util.HashMap getShippingGroupMap()
          Returns list of shipping groups associated with this return request
 java.lang.Object[] getSortedRelatedReturnRequests()
          Returns a reference to the sorted array of related return request objects
 java.lang.String getState()
          The state of this return request
 java.lang.String getStateAsUserResource()
          returns the ReturnRequest state as a user resource
 java.lang.String getStateDetailAsUserResource()
          returns the ReturnRequest state detail as a user resource
 double getSuggestedShippingRefund()
          returns the suggested shipping cost refund amount
 double getSuggestedTaxRefund()
          returns the suggested tax refund amount
 double getTotalItemRefund()
          This method returns the item subtotal for this refund, not including refund for taxes & shipping.
 double getTotalRefundAmount()
          returns the total amount of this refund, less the return fee
 double getTotalReturnItemRefund()
          Returns the total refund for the items being returned.
 double getUnallocatedAmount()
          Returns the total refund amount that is not allocated to a refund method.
 boolean isExchangeProcess()
          This is the utility method to find whether the current process is the
exchange process or not.
 boolean isProcessed()
          returns boolean indicating if this request has been processed
 boolean isProcessImmediately()
          returns the 'process immediately' setting
 boolean isReplacingItems()
          Deprecated.  
 boolean isReturningItems()
          Are we returning one or more items?
 boolean isReturnProcess()
          This is the utility method to find whether the current process is the
return process or not.
 void loadReturnRequest(RepositoryItem pSource)
          This method is used to copy the information from the source return request repository item to return request instance.
 void saveReturnRequest(MutableRepositoryItem pDestination)
          This method is used to copy the information from return request instance to repository item.
 void setActualShippingRefund(double pActualShippingRefund)
          Sets the actual shipping cost refund amount
 void setActualTaxRefund(double pActualTaxRefund)
          Sets the actual tax refund amount
 void setAgentId(java.lang.String pAgentId)
          Sets agentId
 void setAuthorizationDate(java.util.Date pAuthorizationDate)
          Sets authorization date
 void setAuthorizationNumber(java.lang.String pAuthorizationNumber)
          Sets authorization number
 void setComments(java.lang.String pComments)
          sets the comments about this return
 void setDiscountableMap(java.util.Map pDiscountableState)
           
 void setExchangeManualAdjustmentValue(java.util.Map pExchangeManualAdjustmentValue)
           
 void setExchangeOrderPromotionValue(java.util.Map pExchangeOrderPromotionValue)
           
 void setExchangeToPEOItemMap(java.util.Map pExchangeToPEOItemMap)
           
 void setExchangeToPEOShippingGroupMap(java.util.Map pExchangeToPEOShippingGroupMap)
           
 void setGeneratedStoreCredit(StoreCredit pGeneratedStoreCredit)
           
 void setGeneratedStoreCredit(StoreCredit pGeneratedStoreCredit, RepositoryItem pItem)
          Sets the generatedStoreCredit.
 void setGWPSelections(java.util.Map<atg.commerce.promotion.GWPMultiHashKey,GiftWithPurchaseSelection> pGWPSelections)
           
 void setItemPriceSources(java.util.List pItemPriceSources)
          Sets the list of ItemPriceSource objects that are used to price the working orders and the exchange order in the return.
 void setItemPromotions(java.util.Collection pItemPromotions)
          Sets the Collection of item level promotions used to calculate pricing of the Return Adjusted, Return Calculation and Promotion Evaluation Orders.
 void setNonReturnItemSubtotalAdjustment(double pNonReturnItemSubtotalAdjustment)
           
protected  void setOrder(Order pOrder)
          sets the the order that this return is related to
 void setOrderPromotions(java.util.Collection pOrderPromotions)
          Sets the Collection of order level promotions used to calculate pricing of the Return Adjusted, Return Calculation and Promotion Evaluation Orders.
 void setOriginatingOrder(Order pOriginatingOrder)
           
 void setOriginatingToRAOItemMap(java.util.Map pOriginatingToRAOItemMap)
           
 void setOriginatingToRAOShippingGroupMap(java.util.Map pOriginatingToRAOShippingGroupMap)
           
 void setOriginOfReturn(java.lang.String pOriginOfReturn)
          Sets property originOfReturn
 void setOtherRefund(double pOtherRefund)
           
 void setPEOToRCOItemMap(java.util.Map pPEOToRCOItemMap)
           
 void setPEOToRCOShippingGroupMap(java.util.Map pPEOToRCOShippingGroupMap)
           
 void setPreReturnPromotionValue(java.util.Map pPreReturnPromotionValue)
           
 void setPriceList(RepositoryItem pPriceList)
           
 void setProcessed(boolean pProcessed)
          sets boolean indicating if this request has been processed
 void setProcessImmediately(boolean pProcessImmediately)
          sets the 'process immediately' setting
 void setProcessName(atg.commerce.csr.returns.ProcessName pProcessName)
           
 void setProfile(RepositoryItem pProfile)
           
 void setPromotionEvaluationOrder(Order pPromotionEvaluationOrder)
           
 void setPromotionValueAdjustments(java.util.Map pPromotionValueAdjustment)
           
 void setRAOToOriginatingItemMap(java.util.Map pRAOToOriginatingItemMap)
           
 void setRAOToOriginatingShippingGroupMap(java.util.Map pRAOToOriginatingShippingGroupMap)
           
 void setRAOToRCOItemMap(java.util.Map pRAOToRCOItemMap)
           
 void setRAOToRCOShippingGroupMap(java.util.Map pRAOToRCOShippingGroupMap)
           
 void setRCOToPEOItemMap(java.util.Map pRCOToPEOItemMap)
           
 void setRCOToPEOShippingGroupMap(java.util.Map pRCOToPEOShippingGroupMap)
           
 void setRCOToRAOItemMap(java.util.Map pRCOToRAOItemMap)
           
 void setRCOToRAOShippingGroupMap(java.util.Map pRCOToRAOShippingGroupMap)
           
 void setRelatedReplacementOrders(java.util.List pRelatedReplacementOrders)
           
protected  void setReplacementOrder(Order pReplacementOrder)
          sets the replacement order
 void setReplacementToRAOItemMap(java.util.Map pReplacementToRAOItemMap)
           
 void setReplacementToRAOShippingGroupMap(java.util.Map pReplacementToRAOShippingGroupMap)
           
protected  void setRequestId(java.lang.String pRequestId)
          sets the ID of the request that this object represents
 void setReturnAdjustedOrder(Order pReturnAdjustedOrder)
           
 void setReturnCalculationOrder(Order pReturnCalculationOrder)
           
 void setReturnFee(double pReturnFee)
          Sets the fee associated with a return
 void setReturnPaymentState(atg.commerce.csr.returns.ReturnPaymentState pReturnPaymentState)
          Sets the returnPaymentState.
 void setSalePriceList(RepositoryItem pSalePriceList)
           
 void setShippingCostMap(java.util.Map pShippingCostMap)
           
 void setSortedRelatedReturnRequests(java.lang.Object[] pSortedRelatedReturnRequests)
           
protected  void setState(java.lang.String pState)
          sets the state of this return request
protected  void setSuggestedShippingRefund(double pSuggestedShippingRefund)
          sets the suggested shipping cost refund amount
protected  void setSuggestedTaxRefund(double pSuggestedTaxRefund)
          sets the suggested tax refund amount
 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

mDiscountableMap

protected java.util.Map mDiscountableMap

mPriceList

protected RepositoryItem mPriceList

mSalePriceList

protected RepositoryItem mSalePriceList

mNonReturnItemSubtotalAdjustment

protected double mNonReturnItemSubtotalAdjustment

mSortedRelatedReturnRequests

protected java.lang.Object[] mSortedRelatedReturnRequests

mReturnAdjustedOrder

protected Order mReturnAdjustedOrder

mOriginatingToRAOItemMap

protected java.util.Map mOriginatingToRAOItemMap

mRAOToOriginatingItemMap

protected java.util.Map mRAOToOriginatingItemMap

mOriginatingToRAOShippingGroupMap

protected java.util.Map mOriginatingToRAOShippingGroupMap

mRAOToOriginatingShippingGroupMap

protected java.util.Map mRAOToOriginatingShippingGroupMap

mReturnCalculationOrder

protected Order mReturnCalculationOrder

mRAOToRCOItemMap

protected java.util.Map mRAOToRCOItemMap

mRCOToRAOItemMap

protected java.util.Map mRCOToRAOItemMap

mRAOToRCOShippingGroupMap

protected java.util.Map mRAOToRCOShippingGroupMap

mRCOToRAOShippingGroupMap

protected java.util.Map mRCOToRAOShippingGroupMap

mPromotionEvaluationOrder

protected Order mPromotionEvaluationOrder

mRCOToPEOItemMap

protected java.util.Map mRCOToPEOItemMap

mPEOToRCOItemMap

protected java.util.Map mPEOToRCOItemMap

mPEOToRCOShippingGroupMap

protected java.util.Map mPEOToRCOShippingGroupMap

mRCOToPEOShippingGroupMap

protected java.util.Map mRCOToPEOShippingGroupMap

mExchangeToPEOItemMap

protected java.util.Map mExchangeToPEOItemMap

mPEOToExchangeItemMap

protected java.util.Map mPEOToExchangeItemMap

mReplacementToRAOItemMap

protected java.util.Map mReplacementToRAOItemMap

mReplacementToRAOShippingGroupMap

protected java.util.Map mReplacementToRAOShippingGroupMap

mRAOToReplacementItemMap

protected java.util.Map mRAOToReplacementItemMap

mRAOToReplacementShippingGroupMap

protected java.util.Map mRAOToReplacementShippingGroupMap

mExchangeToPEOShippingGroupMap

protected java.util.Map mExchangeToPEOShippingGroupMap

mPEOToExchangeShippingGroupMap

protected java.util.Map mPEOToExchangeShippingGroupMap

mOriginatingOrder

protected Order mOriginatingOrder

mItemPromotions

protected java.util.Collection mItemPromotions

mOrderPromotions

protected java.util.Collection mOrderPromotions

mExchangeOrderPromotionValue

protected java.util.Map mExchangeOrderPromotionValue

mExchangeManualAdjustmentValue

protected java.util.Map mExchangeManualAdjustmentValue

mShippingCostMap

protected java.util.Map mShippingCostMap

mPreReturnPromotionValue

protected java.util.Map mPreReturnPromotionValue

mPromotionValueAdjustment

protected java.util.Map mPromotionValueAdjustment

mRelatedReplacementOrders

protected java.util.List mRelatedReplacementOrders

mNonReturnItemCostAdjustments

protected java.util.Collection mNonReturnItemCostAdjustments

mItemPriceSources

protected java.util.List mItemPriceSources

mGWPSelections

protected java.util.Map<atg.commerce.promotion.GWPMultiHashKey,GiftWithPurchaseSelection> mGWPSelections
Constructor Detail

ReturnRequest

public ReturnRequest()
Initializes a ReturnRequest object with a null order


ReturnRequest

public ReturnRequest(Order pOrder)
Initializes a ReturnRequest object based on the given order.

See Also:
ReturnTools.getReturnShippingGroups(Order)
Method Detail

getDiscountableMap

public java.util.Map getDiscountableMap()
Returns the Map of discountable flags based on the state saved on the originating order and all related replacement orders.

This Map is passed to all pricing operations on the working orders to preserve the original discountable state of the items.

Returns:
Map

setDiscountableMap

public void setDiscountableMap(java.util.Map pDiscountableState)

getPriceList

public RepositoryItem getPriceList()
Returns:
the list price list used for pricing the working orders and the exchange order

setPriceList

public void setPriceList(RepositoryItem pPriceList)

getSalePriceList

public RepositoryItem getSalePriceList()
Returns:
the sale price list used for pricing the working orders and the exchange order

setSalePriceList

public void setSalePriceList(RepositoryItem pSalePriceList)

getProfile

public RepositoryItem getProfile()
Returns:
Returns a reference to the external profile that owns the Order for which the request was generated.

This value is filled in when the return request is initialized based on the profileId referenced by the Order


setProfile

public void setProfile(RepositoryItem pProfile)

getReturnPaymentState

public atg.commerce.csr.returns.ReturnPaymentState getReturnPaymentState()
Returns the returnPaymentState.

Returns:
returnPaymentState

setReturnPaymentState

public void setReturnPaymentState(atg.commerce.csr.returns.ReturnPaymentState pReturnPaymentState)
Sets the returnPaymentState.

Parameters:
pReturnPaymentState -

getGeneratedStoreCredit

public StoreCredit getGeneratedStoreCredit()
Returns the generatedStoreCredit.

Returns:
generatedStoreCredit

setGeneratedStoreCredit

public void setGeneratedStoreCredit(StoreCredit pGeneratedStoreCredit,
                                    RepositoryItem pItem)
Sets the generatedStoreCredit.

Parameters:
pGeneratedStoreCredit - the StoreCredit holder for the credit
pItem - the repository item for the store credit, if you have it it helps failover

setGeneratedStoreCredit

public void setGeneratedStoreCredit(StoreCredit pGeneratedStoreCredit)

getGeneratedStoreCreditItem

public RepositoryItem getGeneratedStoreCreditItem()
Returns the transient repository item matching the generatedStoreCredit.

Returns:
the repository item matching the generatedStoreCredit

getOtherRefund

public double getOtherRefund()
Returns:
the otherRefund

setOtherRefund

public void setOtherRefund(double pOtherRefund)
Parameters:
pOtherRefund - The otherRefund to set.

getNonReturnItemSubtotalAdjustment

public double getNonReturnItemSubtotalAdjustment()
This is the adjustment to the totalItemRefund based on the adjustments to non-return item's amount, order discount share and manual adjustment share

This value is updated whenever the suggested amounts are (re)calculated for the return and when the return request is loaded from the repository.

Note that tax and shipping adjustments to non-return items are accounted for in the suggested and actual tax and shipping refund amounts.

This value is not persisted to the repository

Returns:
the NonReturnItemRefundSubtotalAdjustment

setNonReturnItemSubtotalAdjustment

public void setNonReturnItemSubtotalAdjustment(double pNonReturnItemSubtotalAdjustment)
Parameters:
pNonReturnItemSubtotalAdjustment - The nonReturnItemRefundSubtotalAdjustment to set.

getProcessName

public atg.commerce.csr.returns.ProcessName getProcessName()
Returns:
the processName. Defaults is ProcessName.Return

setProcessName

public void setProcessName(atg.commerce.csr.returns.ProcessName pProcessName)
Parameters:
pProcessName - The processName to set.

setActualShippingRefund

public void setActualShippingRefund(double pActualShippingRefund)
Sets the actual shipping cost refund amount

Parameters:
pActualShippingRefund - the actual shipping cost refund amount

getActualShippingRefund

public double getActualShippingRefund()
Returns the actual shipping cost refund amount


setActualTaxRefund

public void setActualTaxRefund(double pActualTaxRefund)
Sets the actual tax refund amount

Parameters:
pActualTaxRefund - the actual tax refund amount

getActualTaxRefund

public double getActualTaxRefund()
Returns the actual tax refund amount


setAuthorizationDate

public void setAuthorizationDate(java.util.Date pAuthorizationDate)
Sets authorization date

Parameters:
pAuthorizationDate - the authorization date

getAuthorizationDate

public java.util.Date getAuthorizationDate()
Returns authorization date


setAuthorizationNumber

public void setAuthorizationNumber(java.lang.String pAuthorizationNumber)
Sets authorization number

Parameters:
pAuthorizationNumber - the authorization number

getAuthorizationNumber

public java.lang.String getAuthorizationNumber()
Returns authorization number


setComments

public void setComments(java.lang.String pComments)
sets the comments about this return

Parameters:
pComments - the comments about this return

getComments

public java.lang.String getComments()
returns the comments about this return


setOrder

protected void setOrder(Order pOrder)
sets the the order that this return is related to

Parameters:
pOrder - the order that this return is related to

getOrder

public Order getOrder()
returns the the order that this return is related to


setProcessed

public void setProcessed(boolean pProcessed)
sets boolean indicating if this request has been processed

Parameters:
pProcessed - a boolean indicating if this request has been processed

isProcessed

public boolean isProcessed()
returns boolean indicating if this request has been processed


setProcessImmediately

public void setProcessImmediately(boolean pProcessImmediately)
sets the 'process immediately' setting

Parameters:
pProcessImmediately - a boolean indicating if this request should be processed immediately

isProcessImmediately

public boolean isProcessImmediately()
returns the 'process immediately' setting


getRefundMethodList

public java.util.ArrayList<RefundMethod> getRefundMethodList()
Returns list of refund methods that are available


setReplacementOrder

protected void setReplacementOrder(Order pReplacementOrder)
sets the replacement order

Parameters:
pReplacementOrder - the replacement order

getReplacementOrder

public Order getReplacementOrder()
Returns:
the replacement order

setRequestId

protected void setRequestId(java.lang.String pRequestId)
sets the ID of the request that this object represents

Parameters:
pRequestId - the ID of the request that this object represents

getRequestId

public java.lang.String getRequestId()
returns the ID of the request that this object represents


setReturnFee

public void setReturnFee(double pReturnFee)
Sets the fee associated with a return

Parameters:
pReturnFee - the fee associated with a return

getReturnFee

public double getReturnFee()
Returns the fee associated with the return


getReturnItemList

public java.util.ArrayList getReturnItemList()
Returns list of items selected for inclusion in this return


getReturnItemMap

public java.util.HashMap getReturnItemMap()
Returns map of ReturnItem Ids to the ReturnItems


getShippingGroupList

public java.util.ArrayList getShippingGroupList()
Returns list of shipping groups associated with this return request


getShippingGroupMap

public java.util.HashMap getShippingGroupMap()
Returns list of shipping groups associated with this return request


setState

protected void setState(java.lang.String pState)
sets the state of this return request

Parameters:
pState - the state of this return request

getState

public java.lang.String getState()
The state of this return request


getStateAsUserResource

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


getStateDetailAsUserResource

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


setSuggestedShippingRefund

protected void setSuggestedShippingRefund(double pSuggestedShippingRefund)
sets the suggested shipping cost refund amount

Parameters:
pSuggestedShippingRefund - the suggested shipping cost refund amount

getSuggestedShippingRefund

public double getSuggestedShippingRefund()
returns the suggested shipping cost refund amount


setSuggestedTaxRefund

protected void setSuggestedTaxRefund(double pSuggestedTaxRefund)
sets the suggested tax refund amount

Parameters:
pSuggestedTaxRefund - the suggested tax refund amount

getSuggestedTaxRefund

public double getSuggestedTaxRefund()
returns the suggested tax refund amount


getAgentId

public java.lang.String getAgentId()
Gets property agentId

Returns:
agentId

setAgentId

public void setAgentId(java.lang.String pAgentId)
Sets agentId

Parameters:
pAgentId -

getOriginOfReturn

public java.lang.String getOriginOfReturn()
Returns property originOfReturn

Returns:
mOriginOfReturn

setOriginOfReturn

public void setOriginOfReturn(java.lang.String pOriginOfReturn)
Sets property originOfReturn

Parameters:
pOriginOfReturn -

getAllocatedAmount

public double getAllocatedAmount()
Returns the total refund amount that has been allocated to refund methods.

This method walks through the refund methods and sums up the RefundMethod.getAmount().

If you want to turn on logging debug for this class, turn on GenericService.isLoggingDebug().

Returns:
the allocated refund amount

getTotalItemRefund

public double getTotalItemRefund()
This method returns the item subtotal for this refund, not including refund for taxes & shipping. It is also adjusted by the nonReturnItemSubtotalAdjustment value.

If you want to turn on logging debug for this class, turn on GenericService.isLoggingDebug().

Returns:
The total item refund amount.

getTotalReturnItemRefund

public double getTotalReturnItemRefund()
Returns the total refund for the items being returned.

This value is calculated by iterating over the return items and totaling the ReturnItem.getRefundAmount()

Returns:
the total refund for the items being returned.

getRefundSubtotal

public double getRefundSubtotal()
Returns the subtotal amount of this refund.

Returns:
subtotal amount of this refund.

getAdjustmentAmount

public double getAdjustmentAmount()
returns the total amount of adjustments. This includes shipping, tax, other refunds and deducting return fee from the amount.

The basic formula is: ActualShippingRefund + ActualTaxRefund + OtherRefund - ReturnFee

Returns:
returns the total adjustment amount.

getTotalRefundAmount

public double getTotalRefundAmount()
returns the total amount of this refund, less the return fee

The basic formula is: RefundSubtotalAmount + TotalAdjustmentAmount

Returns:
returns the total refund amount.

getUnallocatedAmount

public double getUnallocatedAmount()
Returns the total refund amount that is not allocated to a refund method.

The basic formula is: TotalRefundAmount - TotalAllocatedAmount

Returns:
the unallocated refund amount
See Also:
getAllocatedAmount()

getReplaceItemCount

public long getReplaceItemCount()
The number of items being replaced.


isReplacingItems

public boolean isReplacingItems()
Deprecated. 

Are we replacing one or more items?


getReturnItemCount

public long getReturnItemCount()
The number of items being returned


isReturningItems

public boolean isReturningItems()
Are we returning one or more items?


isExchangeProcess

public boolean isExchangeProcess()
This is the utility method to find whether the current process is the
exchange process or not.

If the current process is the exchange process this method returns true. Otherwise returns false.
If the processName is not set on the ReturnRequest, this method checks to see, if there is an replacement
order. If there is an replacement order exists, then this method sets the processName as Exchange and returns
true. If there is no replacement order, then this method sets the processName as Return and returns false.

Returns:
if the process name is exchange returns true, false otherwise.

isReturnProcess

public boolean isReturnProcess()
This is the utility method to find whether the current process is the
return process or not.

If the current process is the return process this method returns true. Otherwise returns false.
If the processName is not set on the ReturnRequest, this method checks to see, if there is an replacement
order. If there is an replacement order exists, then this method sets the processName as Exchange and returns
false. If there is no replacement order, then this method sets the processName as Return and returns true.

Returns:
if the process name is return returns true, false otherwise.

getCurrentProcessName

public atg.commerce.csr.returns.ProcessName getCurrentProcessName()
This method gets the current process name.
If the process name is null, then based on the replacement order, this method
sets to Return or Exchange.

Returns:
ProcessName

getInstance

public static ReturnRequest getInstance()
Deprecated. 

This method calls ReturnRequest() to create
instance of ReturnRequest.

Returns:
ReturnRequest

getInstance

public static ReturnRequest getInstance(Order pOrder)
Deprecated. 

This method calls ReturnRequest(Order) to create
instance of ReturnRequest.

Parameters:
pOrder - The order which is used to initialize ReturnShippingGroup and
ReturnItem.
Returns:
ReturnRequest

getSortedRelatedReturnRequests

public java.lang.Object[] getSortedRelatedReturnRequests()
Returns a reference to the sorted array of related return request objects

Returns:

setSortedRelatedReturnRequests

public void setSortedRelatedReturnRequests(java.lang.Object[] pSortedRelatedReturnRequests)

getReturnAdjustedOrder

public Order getReturnAdjustedOrder()
Returns a reference to the ReturnAdjustedOrder created for the return.

The return adjusted order provides a context in which all items still owned by the customer are put into a single order where they can be priced together

Returns:
Return Adjusted Order

setReturnAdjustedOrder

public void setReturnAdjustedOrder(Order pReturnAdjustedOrder)

getOriginatingToRAOItemMap

public java.util.Map getOriginatingToRAOItemMap()
Maps the commerce item ids in the originating order to their matching counterparts in the Return Adjusted Order.

Returns:
a map of original item id to RAO item id

setOriginatingToRAOItemMap

public void setOriginatingToRAOItemMap(java.util.Map pOriginatingToRAOItemMap)

getRAOToOriginatingItemMap

public java.util.Map getRAOToOriginatingItemMap()
Maps the commerce item ids in the Return Adjusted Order to their matching counterparts in the originating order.

Returns:
a map of RAO item id to original order item id

setRAOToOriginatingItemMap

public void setRAOToOriginatingItemMap(java.util.Map pRAOToOriginatingItemMap)

getOriginatingToRAOShippingGroupMap

public java.util.Map getOriginatingToRAOShippingGroupMap()
Maps the shipping group ids in the originating order to their matching counterparts in the Return Adjusted Order.

Returns:
a map of original ShippingGroup id to RAO ShippingGroup id

setOriginatingToRAOShippingGroupMap

public void setOriginatingToRAOShippingGroupMap(java.util.Map pOriginatingToRAOShippingGroupMap)

getRAOToOriginatingShippingGroupMap

public java.util.Map getRAOToOriginatingShippingGroupMap()
Maps the shipping group ids in the Return Adjusted Order to their matching counterparts in the originating order.

Returns:
a map of RAO ShippingGroup id to original order ShippingGroup id

setRAOToOriginatingShippingGroupMap

public void setRAOToOriginatingShippingGroupMap(java.util.Map pRAOToOriginatingShippingGroupMap)

getReturnCalculationOrder

public Order getReturnCalculationOrder()
Returns a reference to the ReturnCalculationOrder created for the return.

The return calculation order provides a context in which all items still owned by the customer, minus the items being returned in the current request, are put into a single order where they can be priced together

Returns:
Return Calculation Order

setReturnCalculationOrder

public void setReturnCalculationOrder(Order pReturnCalculationOrder)

getRAOToRCOItemMap

public java.util.Map getRAOToRCOItemMap()
This maps items in the return adjusted order to their matching counter part in the return calculation order.

Returns:
a map of RAO item id to RCO Item id

setRAOToRCOItemMap

public void setRAOToRCOItemMap(java.util.Map pRAOToRCOItemMap)

getRCOToRAOItemMap

public java.util.Map getRCOToRAOItemMap()
This maps items in the return calculation order to their matching counter part in the return adjusted order.

Returns:
a map of RCO item id to RAO item id

setRCOToRAOItemMap

public void setRCOToRAOItemMap(java.util.Map pRCOToRAOItemMap)

getRAOToRCOShippingGroupMap

public java.util.Map getRAOToRCOShippingGroupMap()
This maps shipping groups in the return adjusted order to their matching counter part in the return calculation order.

Returns:
a map of RAO ShippingGroup id to RCO ShippingGroup id

setRAOToRCOShippingGroupMap

public void setRAOToRCOShippingGroupMap(java.util.Map pRAOToRCOShippingGroupMap)

getRCOToRAOShippingGroupMap

public java.util.Map getRCOToRAOShippingGroupMap()
This maps shipping groups in the return calcuation order to their matching counter part in the return adjusted order.

Returns:
a map of RCO ShippingGroup id to RAO ShippingGroup id

setRCOToRAOShippingGroupMap

public void setRCOToRAOShippingGroupMap(java.util.Map pRCOToRAOShippingGroupMap)

getPromotionEvaluationOrder

public Order getPromotionEvaluationOrder()
Returns a reference to the PromotionEvaluationOrder created for the exchange.

The promotion evaluation order provides a context in which all items still owned by the customer, minus the items being returned in the current request, are put into a single order along with the exchange items where they can be priced together

Returns:

setPromotionEvaluationOrder

public void setPromotionEvaluationOrder(Order pPromotionEvaluationOrder)

getRCOToPEOItemMap

public java.util.Map getRCOToPEOItemMap()
This maps items in the return calcuation order to their matching counter part in the promotion evaluation order.

Returns:
a map of RCO item id to PEO Item id

setRCOToPEOItemMap

public void setRCOToPEOItemMap(java.util.Map pRCOToPEOItemMap)

getPEOToRCOItemMap

public java.util.Map getPEOToRCOItemMap()
This maps items in the promotion evaluation order to their matching counter part in the return calculation order.

Returns:
a map of PEO item id to RCO Item id

setPEOToRCOItemMap

public void setPEOToRCOItemMap(java.util.Map pPEOToRCOItemMap)

getPEOToRCOShippingGroupMap

public java.util.Map getPEOToRCOShippingGroupMap()
This maps items in the promotion evaluation order to their matching counter part in the return calculation order.

Returns:
a map of PEO item id to RCO Item id

setPEOToRCOShippingGroupMap

public void setPEOToRCOShippingGroupMap(java.util.Map pPEOToRCOShippingGroupMap)

getRCOToPEOShippingGroupMap

public java.util.Map getRCOToPEOShippingGroupMap()
This maps items in the return calculation order to their matching counter part in the promotin evaluation order.

Returns:
a map of PEO item id to RCO Item id

setRCOToPEOShippingGroupMap

public void setRCOToPEOShippingGroupMap(java.util.Map pRCOToPEOShippingGroupMap)

setExchangeToPEOItemMap

public void setExchangeToPEOItemMap(java.util.Map pExchangeToPEOItemMap)

getExchangeToPEOItemMap

public java.util.Map getExchangeToPEOItemMap()
This maps items in the new exchange order to their matching counterpart in the promotion evaluation order.

Returns:
a map of new exchange order item id to PromotionEvaluationOrder item id.

getPEOToExchangeItemMap

public java.util.Map getPEOToExchangeItemMap()
This maps items in the promotion evaluation order to their matching counterpart in the new exchange order.

Note this map is generated whenever a new exchangeItemToPEOItemMap is set.

Returns:
a map of peo item id to exchange order item id.

setReplacementToRAOItemMap

public void setReplacementToRAOItemMap(java.util.Map pReplacementToRAOItemMap)

getReplacementToRAOItemMap

public java.util.Map getReplacementToRAOItemMap()
This maps items copied from each exchange order to their counterpart in the return adjusted order. Returns a map of exchange order item id to ReturnAdjustedOrder item id.

Returns:
map exchange order item to their counterpart in the return adjusted order.

setReplacementToRAOShippingGroupMap

public void setReplacementToRAOShippingGroupMap(java.util.Map pReplacementToRAOShippingGroupMap)

getReplacementToRAOShippingGroupMap

public java.util.Map getReplacementToRAOShippingGroupMap()
This maps shipping groups in the exchange orders to their matching counter parts in the return adjusted order.

Returns:

getRAOToReplacementItemMap

public java.util.Map getRAOToReplacementItemMap()
The maps RAO item ids to their original replacement item ids

This Map is auto-generated whenever the replacementItemMap is set.

Returns:
maps RAO item ids to their original replacement item ids

getRAOToReplacementShippingGroupMap

public java.util.Map getRAOToReplacementShippingGroupMap()
The maps RAO shipping group ids to their original replacement shipping group ids

This Map is auto-generated whenever the replacementShippingGroupMap is set.

Returns:
map of RAO shipping group ids to their original replacement shipping group id

setExchangeToPEOShippingGroupMap

public void setExchangeToPEOShippingGroupMap(java.util.Map pExchangeToPEOShippingGroupMap)

getExchangeToPEOShippingGroupMap

public java.util.Map getExchangeToPEOShippingGroupMap()
This maps shipping groups in the new exchange order to their matching counterpart in the promotion evaluation order.

Returns:
a map of new exchange order shipping group id to PromotionEvaluationOrder shipping group id.

getPEOToExchangeShippingGroupMap

public java.util.Map getPEOToExchangeShippingGroupMap()
This maps shipping groups in the promotion evaluation order to their matching counterpart in the new exchange order.

Note this map is generated whenever a new exchangeShippingGroupToPEOShippingGroupMap is set.

Returns:
a map of peo shipping group id to exchange order shipping group id.

setOriginatingOrder

public void setOriginatingOrder(Order pOriginatingOrder)

getOriginatingOrder

public Order getOriginatingOrder()
Returns the originating order for this return request.

The originating order is the first order purchase from which all returns and exchanges originated.

Parameters:
pOriginatingOrder -

getItemPromotions

public java.util.Collection getItemPromotions()
Returns:
the Collection of item level promotions used to calculate pricing of the Return Adjusted, Return Calculation and Promotion Evaluation Orders.

setItemPromotions

public void setItemPromotions(java.util.Collection pItemPromotions)
Sets the Collection of item level promotions used to calculate pricing of the Return Adjusted, Return Calculation and Promotion Evaluation Orders.


getOrderPromotions

public java.util.Collection getOrderPromotions()
Returns:
the List of order level promotions used to calculate pricing of the Return Adjusted, Return Calculation and Promotion Evaluation Orders.

setOrderPromotions

public void setOrderPromotions(java.util.Collection pOrderPromotions)
Sets the Collection of order level promotions used to calculate pricing of the Return Adjusted, Return Calculation and Promotion Evaluation Orders.


getExchangeOrderPromotionValue

public java.util.Map getExchangeOrderPromotionValue()
Returns the map of order promotion to their adjustment value. This Map is used by the ExchangeOrderDiscountCalculator to apply order discounts to the exchange order.

This map is generated based on the value of order promotions against the replacement items in the promotion evaluation order


setExchangeOrderPromotionValue

public void setExchangeOrderPromotionValue(java.util.Map pExchangeOrderPromotionValue)

getExchangeManualAdjustmentValue

public java.util.Map getExchangeManualAdjustmentValue()
Returns the map of manual adjustment to their adjustment value. This Map is used by the ExchangeOrderAdjustmentCalculator to apply manual adjustments to the exchange order

This map is generated based on the value of manual adjustments against the replacement items in the promotion evaluation order


setExchangeManualAdjustmentValue

public void setExchangeManualAdjustmentValue(java.util.Map pExchangeManualAdjustmentValue)

getShippingCostMap

public java.util.Map getShippingCostMap()
Maps ShippingGroupCommerceItemRelationships to the their shipping cost in the original purchase order

The values in this map are used to determine the shipping refund for return items.


setShippingCostMap

public void setShippingCostMap(java.util.Map pShippingCostMap)

getPreReturnPromotionValue

public java.util.Map getPreReturnPromotionValue()
This map contains the adjustment value of each promotion at the start of the return. It is generated by evaluating the promotions applied to the Return Adjusted Order.

This map is generated once at the start of the return and is used to calculate the change in promotion value by comparing to the promotion value in the Return Calculation Order or Promotion Evaluation Order, depending on whether a return or exchange is being done.

Returns:
Map of promotion id to adjustment value.

setPreReturnPromotionValue

public void setPreReturnPromotionValue(java.util.Map pPreReturnPromotionValue)

getPromotionValueAdjustments

public java.util.Map getPromotionValueAdjustments()
This map contains the change in promotion value as a result of the current return or exchange. It is generated by comparing the pre return promotion values to the current values in either Return Calculation Order or Promotion Evaluation Order, depending on whether a return or exchange is being done.

Returns:
Map of promotion id to change in adjustment value.

setPromotionValueAdjustments

public void setPromotionValueAdjustments(java.util.Map pPromotionValueAdjustment)

getRelatedReplacementOrders

public java.util.List getRelatedReplacementOrders()
This list includes all the replacement orders associated with the sortedReturnRequests

It is used to determine all the items and shipping groups that should be added to the Return Adjusted Orders as well as determining the payment groups available to receive a refund.


setRelatedReplacementOrders

public void setRelatedReplacementOrders(java.util.List pRelatedReplacementOrders)

getNonReturnItemCostAdjustments

public java.util.Collection getNonReturnItemCostAdjustments()
Returns the collection of ItemCostAdjustment objects that were generated for items not being returned and included when calculating the suggested refund amounts for the return.


addNonReturnItemCostAdjustment

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

Parameters:
pItemCostAdjustment -

addNonReturnItemCostAdjustments

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

Parameters:
pNonReturnItemCostAdjustments -

clearNonReturnItemCostAdjustments

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


getItemPriceSources

public java.util.List getItemPriceSources()
Returns the list of ItemPriceSource objects that are used to price the working orders and the exchange order in the return.

This list is automatically generated for all returns and exchanges based on the original order and any exchange order in the return tree. This maintains the original prices for the items to avoid inaccurate refund calculations when product prices have changed since the purchase.

Returns:
a List of ItemPriceSource objects

setItemPriceSources

public void setItemPriceSources(java.util.List pItemPriceSources)
Sets the list of ItemPriceSource objects that are used to price the working orders and the exchange order in the return.


getGWPSelections

public java.util.Map<atg.commerce.promotion.GWPMultiHashKey,GiftWithPurchaseSelection> getGWPSelections()
These GiftWithPurchaseSelection objects are generated based on the gwp items that are being exchanged. These are used to present selection links on the exchange order cart page.

The objects are generated whenever return items are selected by the agent.

See Also:
ReturnManager.generateGWPSelectionsForReturnItems(ReturnRequest), ReturnManager.generateFilteredReturnRequestSelections(ReturnRequest), atg.commerce.csr.promotion.CSRGiftWithPurchaseSelectionsDroplet

setGWPSelections

public void setGWPSelections(java.util.Map<atg.commerce.promotion.GWPMultiHashKey,GiftWithPurchaseSelection> pGWPSelections)

loadReturnRequest

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

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

saveReturnRequest

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

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

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object