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

commerceItem

The commerce item related to the return item.

disposition

The item’s disposition.

id

The ID of the return item.

quantityReceived

The quantity that has been received.

quantityReturned

The quantities of this item that have previously been returned.

quantityShipped

The quantity of the item that was originally shipped.

quantityToExchange,
quantityToReturn

The quantity that should be exchanged or returned.

refundAmount

The refund amount for the item.

shippingGroupId

The ID of the shipping group.

state

The state of the return item.

returnReason

The reason this item is being returned.

returnShipmentRequired

Identifies if a return shipment is required.

suggestedShippingRefundShare

The suggested shipping refund share.

suggestedTaxRefundShare

The suggested tax refund share.

suggestedRefundAmount

The suggested refund amount.

actualShippingRefundShare

The actual shipping refund share.

actualTaxRefundShare

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

RETURNITEM.RETURN_NOT_REQUIRED

Returning the item is not required.

RETURNITEM.AWAITING_RETURN

The return has been approved.

RETURNITEM.PARTIAL_RETURN

The item has been partially returned.

RETURNITEM.RETURNED

The item has been returned.

RETURNITEM.INITIAL

The return process has been initialized.

RETURNITEMDESC.RETURN_NOT_REQUIRED

Return not required.

RETURNITEMDESC.AWAITING_RETURN

Approved.

RETURNITEMDESC.PARTIAL_RETURN

Partial return.

RETURNITEMDESC.RETURNED

Returned.

RETURNITEMDESC.INITIAL

Initialized.


Copyright © 1997, 2015 Oracle and/or its affiliates. All rights reserved. Legal Notices