The ReturnItem
is called by the ReturnManager
, and encapsulates the data that is related to a specific return item. It loads the return item properties from the repository item and initializes a ReturnItem
based on the commerce item, identifies the quantity available to return, returns the collection of ItemCostAdjustment
objects that help to determine the suggested refund amounts for the return and adds the ItemCostAdjustment
to the return.
The ReturnItem
sets these properties:
Property | Description |
---|---|
| The commerce item related to the return item. |
| The item’s disposition. |
| The ID of the return item. |
| The quantity that has been received. |
| The quantities of this item that have previously been returned. |
| The quantity of the item that was originally shipped. |
| The quantity that should be exchanged or returned. |
| The refund amount for the item. |
| The ID of the shipping group. |
| The state of the return item. |
| The reason this item is being returned. |
| Identifies if a return shipment is required. |
| The suggested shipping refund share. |
| The suggested tax refund share. |
| The suggested refund amount. |
| The actual shipping refund share. |
| The actual tax refund share. |
Extending Return Items
To add properties to ReturnItem
that are loaded to the ReturnItem
object, you must extend the loadReturnItem(RepositoryItem)
method.
This example adds a State Tax Refund property and share method:
String disposition = getDisposition(); if (disposition != null) { RepositoryItem dispositionItem = rtools.retrieveDisposition(disposition); pDestination.setPropertyValue(rtools.getDispositionPropertyName(), dispositionItem); } pDestination.setPropertyValue(rtools.getSuggestedShippingRefundSharePropertyName() , getSuggestedShippingRefundShare()); pDestination.setPropertyValue(rtools.getSuggestedTaxRefundSharePropertyName(), getSuggestedTaxRefundShare()); pDestination.setPropertyValue(rtools.getActualShippingRefundSharePropertyName(), getActualShippingRefundShare()); pDestination.setPropertyValue(rtools.getActualTaxRefundSharePropertyName(), getActualTaxRefundShare()); pDestination.setPropertyValue(rtools.getActualStateTaxRefundSharePropertyName(), getActualStateTaxRefundShare());
Return Item States
Return states can be defined using the /atg/commerce/csr/returns/ReturnItemStates
component. This component uses the atg.commerce.states.ReturnStatesResources
file to provide resourced definition for the states.
Each state is defined using two different key prefixes. The first prefix is RETURNITEM
. The second prefix, RETURNITEMDESC
, provides the ability to create a more detailed description of the state. You can use the /atg/commerce/custsvc/returns/ReturnStateDescription
droplet to provide more descriptive text for a state.
The ReturnRequest
also provides two APIs for returning both resourced values:
public String getStateAsUserResource()
public String getStateDetailAsUserResource()
Return Item State | Description |
---|---|
| Returning the item is not required. |
| The return has been approved. |
| The item has been partially returned. |
| The item has been returned. |
| The return process has been initialized. |
| Return not required. |
| Approved. |
| Partial return. |
| Returned. |
| Initialized. |