Up to three orders are used for calculating the correct refund amount and exchange item prices. A Return Adjusted Order and a Return Calculation Order are generated for all returns. A Promotions Evaluation Order is generated when performing an exchange. Collectively, these orders are known as the working order:
Return Adjusted Order (RAO) – This order provides the context for pricing all items still owned by the customer. It contains the items from the originating order and replacement items from any replacement orders. The original items and shipping group IDs are mapped to the RAO items and shipping group IDs. This order is available in the
ReturnRequest
through thegetReturnAdjustedOrder()
.Return Calculation Order (RCO) – This order provides the context for pricing all items still owned by the customer, minus the items being returned. This order is a clone of the RAO but is adjusted for the items being returned in the current return request. Each item that is returned has a quantity adjustment in this order. The price change between the RCO and RAO is used to calculate the suggested refund amount. This order is regenerated each time new return items are selected. This order is available in the
ReturnRequest
through thegetReturnCalculationOrder()
. Because the RCO identifies all items still owned by the customer, minus the items being returned in the current return request, it allows still-owned items to be put into a single order and priced together. The items and associated shipping groups are then mapped to their matching counterparts in the Promotions Evaluation Order (PEO) and the RAO.The Promotion Evaluation Order (PEO) – This order provides the context for pricing all the items still owned by the customer, minus the items being returned, plus the replacement items. This order, which is created only for exchanges, is created by cloning the RCO. It determines how the original promotions affect the cost of the replacement items and changes in cost to the other items not being returned due to the inclusion of the replacement items. This order is in the
ReturnRequest
through thegetPromotionEvaluationOrder()
. Because the PEO identifies all the items still owned by the customer, minus the items being returned, they can be put into a single order along with the exchange items where they can be priced together. These items and associated shipping groups are then mapped between the RCO and the PEO.
Creation of Working Orders
The return process creates the working orders to calculate the proper refund amount. These orders are created by a cloning process. For example, the RAO is initially created by cloning the original order, the RCO is initially created by cloning the RAO, and the PEO is initially created by cloning the RCO.
The ReturnManager
is configured with a CloneEditManager
instance that performs the actual cloning:
CloneEditManager=/atg/commerce/custsvc/returns/CloneEditManager
Note: This CloneEditManager
is configured for the sole purpose of creating the working order used within the returns process.
Working Order Pipelines
The following pipelines define the working order components:
Pipeline Chain | Description |
---|---|
| This chain is executed by the |
| This chain is executed by the |
| This chain is executed by the |
For additional information on cloning and the CloneEditManager
, refer to the ATG Commerce Service Center Installation and Programming Guide.