atg.commerce.csr.returns
Class ReturnTools

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.commerce.csr.returns.ReturnTools
All Implemented Interfaces:
atg.naming.AbsoluteNameable, NameContextBindingListener, NameContextElement, atg.naming.NameContextParentable, NameResolver, AdminableService, atg.nucleus.Configured, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, java.util.EventListener

public class ReturnTools
extends GenericService

This class contains the utility API for returns & exchanges


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
static java.lang.String DEFAULT
           
protected  java.lang.String mAmountAdjustmentPropertyName
           
protected  java.util.Properties mBeanNameToItemDescriptorMap
           
protected  java.lang.String[] mFulfilledOrderStates
           
protected  GWPManager mGwpManager
          Manager component for gift with purchase promotions
protected  java.lang.String mManualAdjustmentShareAdjustmentPropertyName
           
protected  java.lang.String mNonReturnItemCostAdjustmentsPropertyName
           
protected  java.lang.String mOrderDiscountShareAdjustmentPropertyName
           
protected  java.lang.String mOrderPropertyName
           
protected  java.lang.String[] mPendingReturnStates
           
protected  boolean mPerformanceMonitorEnabled
           
protected  PricingTools mPricingTools
           
protected  ProfileTools mProfileTools
           
protected  PromotionTools mPromotionTools
           
protected  java.lang.String mPromotionValueAdjustmentsPropertyName
           
protected  java.lang.String mQuantityAdjustedPropertyName
           
protected  java.util.Properties mRefundMethodTypeClassMap
           
protected  java.util.Properties mReturnItemTypeClassMap
           
protected  java.lang.Class<ReturnRequest> mReturnRequestClass
           
protected  java.util.Properties mReturnShippingTypeClassMap
           
protected static ReturnTools mReturnTools
           
static java.lang.String mReturnToolsComponentPath
           
protected  java.lang.String mShippingShareAdjustmentPropertyName
           
protected  SiteContextManager mSiteContextManager
           
protected  SiteManager mSiteManager
           
protected  java.lang.String mTaxShareAdjustmentPropertyName
           
protected static java.util.ResourceBundle sResourceBundle
           
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging
DEFAULT_LOG_TRACE_STATUS
 
Fields inherited from interface atg.nucleus.logging.ApplicationLogging
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
 
Constructor Summary
ReturnTools()
           
 
Method Summary
 java.util.Map addDisableGWPProcessParameter(java.util.Map pExtraParameters)
          Adds the extra parameter that disables the processing of GWPInfo objects at the end of pricing.
 java.util.Map addDisableReturnTotalValidationParameter(java.util.Map pExtraParameters)
          Adds the parameter to disable the refund total validation processor.
 java.util.Map addExchangeOrderPricingParameters(java.util.Map pExtraParameterMap, ReturnRequest pReturnRequest)
          Adds the extra parameters for pricing the exchange order.
protected  void addRefundMethodsToReturnRequest(java.util.Set pRefundMethods, RepositoryItem pReturnRequest)
          Adds a set of refund methods to the return request
protected  void addReturnItemsToReturnRequest(java.util.Set pReturnItems, RepositoryItem pReturnRequest)
          Adds a set of return items to the return request
 java.util.Map addReturnRequestParameter(java.util.Map pExtraParameters, ReturnRequest pReturnRequest)
          Adds the current ReturnRequest to the parameter map
 java.util.Map addReturnRequestPricelistParameters(java.util.Map pExtraParameters, ReturnRequest pReturnRequest)
          Adds the ReturnRequest's price lists to the given parameter map.
 java.util.Map addWorkingOrderPricingParams(java.util.Map pExtraParameterMap, ReturnRequest pReturnRequest)
          Deprecated. in favor of addWorkingOrderPricingParams(ReturnRequest, Order, Map)
 java.util.Map addWorkingOrderPricingParams(ReturnRequest pReturnRequest, Order pWorkingOrder, java.util.Map pExtraParameterMap)
          Adss the extra paramters necessary for pricing the given working order.
 void adjustExchangeItemPriceInfo(ReturnRequest pReturnRequest, CommerceItem pExchangeItem, ItemPriceInfo pItemPriceInfo)
          This method is called by a CSC item post calcualtor and will copy the information from the corresponding item in promotion evaluation order.
 boolean associateAgentAndReturnRequest(ReturnRequest pReturnRequest)
          Deprecated.  
 boolean associateAgentAndReturnRequest(ReturnRequest pReturnRequest, java.lang.String pAgentId)
          Associates the given agent id to the ReturnRequest.
protected  double calculateAmountDetailShareForRange(DetailedItemPriceInfo pDetailedItemPriceInfo, atg.core.util.Range pRange)
          Calculates the share of the detail's amount for the given range.
protected  void calculateNonReturnItemSubtotalAdjustment(ReturnRequest pReturnRequest)
          Sets the nonReturnItemRefundSubtotalAdjustment value of the return request.
protected  double calculateShareForRange(DetailedItemPriceInfo pDetailedItemPriceInfo, atg.core.util.Range pRange, double pAmount)
          Calculates the share of the given amount for the given range within the given detail.
protected  void clearAllItemCostAdjustments(ReturnRequest pReturnRequest)
          This method clears all the ItemCostAdjustments from the ReturnRequest and ReturnItems.
 void copyGWPItemMarkersFromPEO(ReturnRequest pReturnRequest, CommerceItem pExchangeItem)
          Copies the GWP Item markers from the matching item in the PEO to the given exchange item.
protected  void copyItemsAndShippingGroups(Order pOrderFrom, Order pOrderTo, java.util.Map pItemMap, java.util.Map pShippingGroupMap, java.util.Map pPropExceptions, java.util.Map pExcludedProperties)
          Util method that copies the items and shipping groups from one Order to the other.
protected  void copyPEOPricingInfo(ReturnRequest pReturnRequest, CommerceItem pPEOItem, ItemPriceInfo pPEOItemPriceInfo, CommerceItem pExchangeItem, ItemPriceInfo pExchangeItemPriceInfo)
          Copies pricing info from the PEO ItemPriceInfo to the exhange ItemPriceInfo.
protected  Query createExcludedReturnRequests(QueryBuilder pQueryBuilder, java.util.Collection pExcludedReturnRequests)
          Creates a query the excludes all return requests in the collection
protected  ItemCostAdjustment createItemCostAdjustment()
          Creates a new ItemCostAdjustment object.
protected  ItemCostAdjustment createItemCostAdjustment(RepositoryItem pItemCostAdjustmentItem)
          This method is used when reconstituting the ItemCostAdjustmments of the ReturnRequest from the repository.
protected  ItemCostAdjustment createItemCostAdjustmentFromItem(RepositoryItem pItemCostAdjustmentItem)
          This method generates and new ItemCostAdjustment object from the given itemCostAdjustment repository item.
protected  MutableRepositoryItem createItemCostAdjustmentItem(ItemCostAdjustment pItemCostAdjustment)
          The method is called when saving the ItemCostAdjustments of the ReturnRequest to the repository.
protected  MutableRepositoryItem createItemCostAdjustmentRepositoryItem(ItemCostAdjustment pItemCostAdjustment)
          The method is called when saving the ItemCostAdjustments of the ReturnRequest to the repository.
protected  java.util.Map createPipelineExtraParameterMap(ReturnRequest pReturnRequest)
          Creates the extra parameter map that's passed to pipeline execution used to create the working orders.
 RefundMethod createRefundMethodInstance(java.lang.String pType)
          This method returns RefundMethod instance.
protected  RepositoryItem createRefundMethodItem(RefundMethod pRefundMethod)
          Creates a refundMethod repository item, populates its properties, and adds it to the repository
 RepositoryItem createReturnComment(java.lang.String pReturnRequestId, java.lang.String pComment, java.lang.String pAgentId)
          Creates a new comment item for the given return.
 ReturnItem createReturnItemInstance(CommerceItem pCommerceItem)
          This method returns ReturnItem instance.
protected  MutableRepositoryItem createReturnItemItem(java.lang.String pRequestId, ReturnItem pReturnItem)
          Create a repository item that represents an item in a return request
 ReturnRequest createReturnRequestInstance(Order pOrder)
          This method creates ReturnRequest instance.
protected  MutableRepositoryItem createReturnRequestItem(ReturnRequest pReturnRequest)
          Create a repository item that represents a return request record.
protected  Query createReturnRequestSearchQuery(QueryBuilder pQueryBuilder, java.lang.String pOrderId)
          Creates a query to find all return requests where the order is either the original order or the exchange order.
 ReturnShippingGroup createReturnShippingGroupInstance(ShippingGroup pShippingGroup)
          This method returns ReturnShippingGroup instance.
 void determineOriginatingOrder(ReturnRequest pReturnRequest)
          Determines and sets the originatingOrder property of a return request.
 void determinePricelistsForReturn(ReturnRequest pReturnRequest)
          Sets the priceList and salePricelist properties of the ReturnRequest based on the price lists extracted from the originating Order referenced in the ReturnRequest.
 void determinePromotionsForReturn(ReturnRequest pReturnRequest)
          This API will determine and set the item and order promotions to be used for the given return request.
protected  java.util.Collection findAdjustmentsForItem(java.util.Collection pAdjustments, java.lang.String pCommerceItemId, java.lang.String pShippingGroupId)
          Returns the adjustments that match by commerce item id and shipping group id
protected  java.util.Collection findAllAdjustmentsForNonReturnItems(ReturnRequest pReturnRequest, java.util.Collection pAdjustments)
          Returns all the adjustments that reference a commerce item and shipping group not being returned.
 java.util.List findAllRelatedReturnRequests(java.lang.String pOrderId)
          returns a list of all return requests related to the given order id.
protected  java.lang.String findExchangeOrderItemForPEOItem(ReturnRequest pReturnRequest, java.lang.String pPEOItemId)
          Returns the corresponding exchange order item id for the given promotion evaluation order item id.
protected  java.lang.String findExchangeOrderShippingGroupForPEOShippingGroup(ReturnRequest pReturnRequest, java.lang.String pPEOShippingGroupId)
          Returns the corresponding exchange order shipping group id for the given promotion evaluation order shipping group id.
protected  java.lang.String findOriginalItemForPEOItem(ReturnRequest pReturnRequest, java.lang.String pPEOItemId)
          Returns the original commerce item corresponds with the gigve PEO item.
protected  java.lang.String findOriginalItemForRAOItem(ReturnRequest pReturnRequest, java.lang.String pRAOItemId)
          Returns the original commerce item that corresponds with the given RAO Item.
protected  java.lang.String findOriginalItemForRCOItem(ReturnRequest pReturnRequest, java.lang.String pRCOItemId)
          Returns the original commerce item that corresponds with the given RCO item.
protected  java.lang.String findOriginalItemForWorkingItem(ReturnRequest pReturnRequest, java.lang.String pWorkingItemId)
          Returns the original item id for the given working item.
protected  java.lang.String findOriginalShippingGroupForPEOShippingGroup(ReturnRequest pReturnRequest, java.lang.String pPEOShippingGroupId)
          Returns the original commerce shipping group corresponds with an shipping group in the PEO.
protected  java.lang.String findOriginalShippingGroupForRAOShippingGroup(ReturnRequest pReturnRequest, java.lang.String pRAOShippingGroupId)
          Returns the original shipping group that corresponds with a shipping group in the RAO
protected  java.lang.String findOriginalShippingGroupForRCOShippingGroup(ReturnRequest pReturnRequest, java.lang.String pRCOShippingGroup)
          Returns the original shipping group corresponds with an shipping group in the RCO.
protected  java.lang.String findOriginalShippingGroupForWorkingShippingGroup(ReturnRequest pReturnRequest, java.lang.String pWorkingShippingGroupId)
          Returns the original shipping group id for the given working shipping group.
protected  java.lang.String findOriginalShippingGrouporPEOShippingGroup(ReturnRequest pReturnRequest, java.lang.String pPEOShippingGroupId)
          Returns the original shipping group corresponds with an shipping group in the PEO.
protected  java.lang.String findPEOItemForExchangeItem(ReturnRequest pReturnRequest, java.lang.String pExchangeItemId)
          Returns the corresponding PEO item id for the given exchange item id.
protected  java.lang.String findPEOShippingGroupForExchangeShippingGroup(ReturnRequest pReturnRequest, java.lang.String pExchangeShippingGroupId)
          Returns the corresponding PEO shipping group id for the given exchange shipping group id.
protected  java.lang.String findRAOItemForOriginalItem(ReturnRequest pReturnRequest, java.lang.String pOriginalItemId)
          Returns the id of the item in the RAO that corresponds to the given original item.
protected  java.lang.String findRAOItemForRCOItem(ReturnRequest pReturnRequest, java.lang.String pRCOItemId)
          Returns the id of the corresponding item in the RAO for the given RCO item id
protected  java.lang.String findRAOShippingGroupForOriginalShippingGroup(ReturnRequest pReturnRequest, java.lang.String pOriginalShippingGroupId)
          Finds the corresponding shipping group in the RAO for the original shipping group
protected  java.lang.String findRAOShippingGroupForRCOShippingGroup(ReturnRequest pReturnRequest, java.lang.String pRCOShippingGroupId)
          Returns the id of the corresponding shipping group in the RAO for the given RCO shipping group id
protected  java.lang.String findRCOItemForOriginalItem(ReturnRequest pReturnRequest, java.lang.String pOriginalItemId)
          Returns the id of the item in the RCO that corresponds to the given original item.
protected  java.lang.String findRCOItemForPEOItem(ReturnRequest pReturnRequest, java.lang.String pPEOItemId)
          Finds the item in the RCO that corresponds to the given PEO item.
protected  java.lang.String findRCOItemForRAOItem(ReturnRequest pReturnRequest, java.lang.String pRAOItemId)
          Returns the id of the corresponding item that was originally created in the RCO for the given RAOItemId
protected  java.lang.String findRCOShippingGroupForOriginalShippingGroup(ReturnRequest pReturnRequest, java.lang.String pOriginalShippingGroupId)
          Returns the corresponding shipping group in the Return Calculation Order to the original shipping group.
protected  java.lang.String findRCOShippingGroupForPEOShippingGroup(ReturnRequest pReturnRequest, java.lang.String pPEOShippingGroupId)
          Finds the corresponding shipping group in the RCO for the given PEO shipping group.
protected  java.lang.String findRCOShippingGroupForRAOShippingGroup(ReturnRequest pReturnRequest, java.lang.String pRAOShippingGroupId)
          Returns the id of the corresponding shipping group that was originally created in the RCO for the given RAOShippingGroupId
protected  java.util.List findReturnItemsForItemAndGroup(java.lang.String pCommerceItemId, java.lang.String pShippingGroupId, java.util.List pReturnItems)
          Gets the ReturnItems for the given commerce item id and shipping group.
 RepositoryItem[] findReturnRequestsByBalancingPaymentGroupId(java.lang.String pBalancingPaymentGroupId)
          Finds all return requests that reference the given balancing payment group id
 RepositoryItem[] findReturnRequestsByExchangeOrder(java.lang.String pOrderId)
          Finds all return requests that reference this given order as the replacement order
 java.util.List<ReturnRequest> findReturnRequestsForProfile(java.lang.String pProfileId, int pStartIndex, int pNumReturns, java.lang.String[] pStates, java.lang.String pSortProperty, boolean pAscending, java.util.Collection<java.lang.String> pSiteIds)
          Finds all return request for the given profile.
 java.util.Map generateItemToReturnQuantityMap(java.util.Collection pReturnRequestRepositoryItems)
          generates a map that summarizes the quantity to return for each commerce item in the provided return requests
protected  void generatePromotionValueAdjustmentMap(ReturnRequest pReturnRequest)
          This method will generate the promotion value adjustment map and store it in the promotionValueAdjustments property of the ReturnRequest
 java.lang.Object[] generateSortedRelatedReturnRequests(java.lang.String pOrderId)
          Returns all return requests related to the given order id sorted by creation date.
 java.lang.String getActualShippingRefundPropertyName()
           
 java.lang.String getActualShippingRefundSharePropertyName()
           
 java.lang.String getActualTaxRefundPropertyName()
           
 java.lang.String getActualTaxRefundSharePropertyName()
           
protected  java.util.Collection getAllItemCostAdjustments(ReturnRequest pReturnRequest)
          returns all the ItemCostAdjustments for this return request.
protected  java.util.List getAllRelatedReplacementOrders(ReturnRequest pReturnRequest)
          Builds a list of all replacement orders related to the current return request.
 java.lang.String getAmountAdjustmentPropertyName()
          Property name on the item cost adjustment item that contains the amount adjustment value
 java.lang.String getAmountPropertyName()
           
 java.lang.String getBalancingPaymentIdPropertyName()
          Returns the balancingPaymentIdPropertyName.
 java.util.Properties getBeanNameToItemDescriptorMap()
          Returns the beanNameToItemDescriptorMap
 java.lang.String getBonusRefundPropertyName()
           
 ClaimableManager getClaimableManager()
           
 java.lang.String getCommentAgentPropertyName()
           
 java.lang.String getCommentCreationDatePropertyName()
           
 java.lang.String getCommentOwnerPropertyName()
           
 java.lang.String getCommentPropertyName()
           
 java.lang.String getCommerceItemIdPropertyName()
           
 CommercePropertyManager getCommercePropertyManager()
           
 java.lang.String getCreatedDatePropertyName()
           
 java.lang.String getCreditCardRefundMethodItemDescriptorName()
          Returns the creditCardRefundMethodItemDescriptorName.
 java.util.List getDispositionCodes()
          Retrieve a list of disposition codes
 java.lang.String getDispositionPropertyName()
           
 java.lang.String[] getFulfilledOrderStates()
           
 GWPManager getGwpManager()
          Getter for the gift with purchase manager property.
 java.lang.String getItemCostAdjustmentDescriptorName()
           
 java.lang.String getItemPromotionsPropertyName()
           
 java.lang.String getItemReturnableState(RepositoryItem pCommerceItem)
          Determines the returnable state for the given item.
 java.lang.String getManualAdjustmentShareAdjustmentPropertyName()
          Property name on the item cost adjustment item that contains the manual adjustment share adjustment value
 java.lang.String getMappedItemDescriptorName(java.lang.String pBeanName)
          Returns the repository item name mapped to the bean name.
 java.lang.String getMethodTypePropertyName()
           
 java.lang.String getNonReturnItemCostAdjustmentsPropertyName()
           
protected  double getNonReturnItemTotalShippingAdjustment(ReturnRequest pReturnRequest)
          Returns the total shipping adjustments for non-return items.
protected  double getNonReturnItemTotalTaxAdjustment(ReturnRequest pReturnRequest)
          Returns the total tax adjustments for non-return items.
 java.lang.String getOrderDiscountShareAdjustmentPropertyName()
          Property name on the item cost adjustment item that contains the order discount share adjustment value
protected  java.lang.String getOrderIdFromPaymentGroup(PaymentGroup pPaymentGroup)
          Returns the order id associated with the given payment group
protected  java.lang.String getOrderIdFromPaymentGroupItem(RepositoryItem pPaymentGroupItem)
          Returns the order id associated with the given payment group
 OrderManager getOrderManager()
          Returns the order manager
 java.lang.String getOrderPromotionsPropertyName()
           
 java.lang.String getOrderPropertyName()
           
 java.lang.String getOrderReturnableState(RepositoryItem pOrderItem)
          Determines the returnable state for the given order.
 java.lang.String getOriginalOrderIdPropertyName()
           
 java.lang.String getOtherRefundPropertyName()
          Returns the otherRefundPropertyName.
protected  java.lang.String getPaymentGroupIdFromRefundMethod(RepositoryItem pRefundMethod)
          Returns the payment group id from the given refundMethod item
 java.lang.String getPaymentGroupIdPropertyName()
           
 java.lang.String[] getPendingReturnStates()
           
 PricingTools getPricingTools()
           
 java.lang.String getProcessedPropertyName()
           
 java.lang.String getProcessImmediatelyPropertyName()
           
 ProfileTools getProfileTools()
          The ProfileTools component
 java.util.Collection getPromotionsLost(ReturnRequest pReturnRequest)
          Generates a collection of promotion ids that contains all the promotions that no longer apply as a result of the return.
 PromotionTools getPromotionTools()
           
 java.lang.String getPromotionValueAdjustmentsPropertyName()
          Returns the return request property name used for storing the promotion value adjustments
 java.lang.String getQuantityAdjustedPropertyName()
          Property name on the item cost adjustment item that contains the quantity adjusted value
 java.lang.String getQuantityReceivedPropertyName()
           
 java.lang.String getQuantityToExchangePropertyName()
           
 java.lang.String getQuantityToReturnPropertyName()
           
 java.util.List getReasonCodes()
          Retrieve a list of reason codes
 java.lang.String getReasonPropertyName()
           
 java.lang.String getRefundAmountPropertyName()
           
protected  RefundMethod getRefundMethod(RepositoryItem pRefundMethodItem, Order pOrder)
          Create a RefundMethod object based on information in the given repository item
protected  RefundMethod getRefundMethod(java.lang.String pRefundMethodId, Order pOrder)
          Create a RefundMethod object based on information in the repository designated by the given id
 java.lang.String getRefundMethodItemDescriptorName()
           
 java.lang.String getRefundMethodsPropertyName()
           
 java.util.Properties getRefundMethodTypeClassMap()
          Returns the refundMethodTypeClassMap
 java.lang.String getReplacementOrderIdPropertyName()
           
 java.lang.String getReturnAgentPropertyName()
          Gets property returnAgentPropertyName
 java.lang.String getReturnCommentItemDescriptorName()
           
 java.lang.String getReturnFeePropertyName()
           
protected  ReturnItem getReturnItem(RepositoryItem pReturnItemItem, Order pOrder)
          Create a ReturnItem object based on information in the given repository item
protected  ReturnItem getReturnItem(java.lang.String pReturnItemId, Order pOrder)
          Create a ReturnItem object based on information in the repository designated by the given id
 java.lang.String getReturnItemDispositionItemDescriptorName()
           
 java.lang.String getReturnItemItemDescriptorName()
           
 java.util.List<ReturnItem> getReturnItems(ShippingGroup pShippingGroup)
          Return all ReturnItem in the pShippingGroup
 java.lang.String getReturnItemsPropertyName()
           
 java.lang.String getReturnItemStatePropertyName()
           
 ReturnItemStates getReturnItemStates()
           
 java.util.Properties getReturnItemTypeClassMap()
          Returns the returnItemTypeClassMap
 java.lang.String getReturnOriginOfReturnPropertyName()
          Gets property returnOriginOfReturnPropertyName
 java.lang.String getReturnReasonsItemDescriptorName()
           
 java.lang.String getReturnRefPropertyName()
           
 MutableRepository getReturnRepository()
          Returns the return repository
 ReturnRequest getReturnRequest(java.lang.String pReturnRequestId)
          Create a ReturnRequest object based on information in the repository designated by the given id.
 java.lang.Class<ReturnRequest> getReturnRequestClass()
          Returns the returnRequestClass
 int getReturnRequestCountForProfile(java.lang.String pProfileId, java.lang.String[] pStates, java.util.Collection<java.lang.String> pSiteIds)
          Returns the total number of return requests for the given profile
 java.lang.String getReturnRequestItemDescriptorName()
           
 Query getReturnRequestQueryForProfile(java.lang.String pProfileId, java.lang.String[] pStates, java.util.Collection<java.lang.String> pSiteIds, RepositoryView pView)
          Constructs a Query to get the returns for the given profile.
 java.util.List getReturnRequestsByOrderId(java.lang.String pOrderId)
           
 java.util.List getReturnRequestsByReplacementOrderId(java.lang.String pReplacementOrderId)
          This method gets all return requests for a given replacement order.
protected  RepositoryView getReturnRequestView()
           
 java.lang.String getReturnRequiredPropertyName()
           
 java.util.Collection<ReturnShippingGroup> getReturnShippingGroups(Order pOrder)
          Return all ReturnShippingGroup in the order
 java.util.Properties getReturnShippingTypeClassMap()
          Returns the returnShippingTypeClassMap
 ReturnStates getReturnStates()
           
static ReturnTools getReturnTools()
          Returns the ReturnTools component.
 java.lang.String getRmaPropertyName()
           
 java.lang.String getShippingGroupIdPropertyName()
           
 java.lang.String getShippingPromotionsPropertyName()
           
 java.lang.String getShippingShareAdjustmentPropertyName()
          Property name on the item cost adjustment item that contains the shipping share adjustment value
 SiteContextManager getSiteContextManager()
          Returns the siteContextManager
 SiteManager getSiteManager()
          Returns the siteManager
 java.lang.String getStatePropertyName()
           
 java.lang.String getStoreCreditNumberPropertyName()
          Returns the storeCreditNumberPropertyName.
 java.lang.String getStoreCreditRefundMethodItemDescriptorName()
          Returns the storeCreditRefundMethodItemDescriptorName.
 java.lang.String getSuggestedShippingRefundPropertyName()
           
 java.lang.String getSuggestedShippingRefundSharePropertyName()
           
 java.lang.String getSuggestedTaxRefundPropertyName()
           
 java.lang.String getSuggestedTaxRefundSharePropertyName()
           
 java.lang.String getTaxShareAdjustmentPropertyName()
          Property name on the item cost adjustment item that contains the tax share adjustment value
 double getTotalAdjustments(java.util.Collection pItemCostAdjustments)
          Sums all adjustments
 double getTotalAmountAdjustments(java.util.Collection pItemCostAdjustments)
          Sums the amountAdjustment property of all the refund adjustments
 double getTotalItemAdjustments(java.util.Collection pItemCostAdjustments)
          Sums the amountAdjustment, orderDiscountShareAdjustment and manualDiscountShareAdjustment properties of all the refund adjustments
 double getTotalManualAdjustmentAdjustments(java.util.Collection pItemCostAdjustments)
          Sums the manualAdjustmentShareAdjustment property for all the refund adjustments
 double getTotalManualAdjustmentValue(Order pOrder, java.lang.String pManualAdjustmentId)
          returns the total adjustment made by an order promotion
 double getTotalOrderDiscountAdjustments(java.util.Collection pItemCostAdjustments)
          Sums the orderDiscountShareAdjustment property of all the refund adjustments
 double getTotalOrderPromotionValue(Order pOrder, java.lang.String pOrderPromotionId)
          returns the total adjustment made by an order promotion
 double getTotalShippingAdjustments(java.util.Collection pItemCostAdjustments)
          Sums the shippingAdjustment property of all the refund adjustments
 double getTotalTaxAdjustments(java.util.Collection pItemCostAdjustments)
          Sums the taxAdjustment property of all the refund adjustments
 java.lang.String getUpdateInventoryPropertyName()
           
 boolean isFulfilledOrderState(java.lang.String pState)
          Determines if the given state is one of the states defined in the fulfilledOrderStates property.
 boolean isItemReturnable(CommerceItem pCommerceItem)
          Determines if the given commerce item is returnable
 boolean isItemReturnable(RepositoryItem pCommerceItem)
          Determines if the given commerce item is returnable.
 boolean isOrderFulfilled(Order pOrder)
          Determines if an order is fulfilled based on the states defined in the fulfilledOrderStates property.
 boolean isOrderFulfilled(RepositoryItem pOrderItem)
          Determines if an order is fulfilled based on the states defined in the fulfilledOrderStates property.
 boolean isOrderPendingReturn(Order pOrder)
          Determines if the order is in a state that means it is waiting for items to be returned.
 boolean isPerformanceMonitorEnabled()
           
 boolean isReturnable(Order pOrder)
          Determines if an return or exchange can be initiated for the given Order.
 boolean isReturnable(RepositoryItem pOrderItem)
          This method determines whether a return or exchange can be initiated for the given order.
protected  void loadAppliedPromotions(ReturnRequest pReturnRequest, RepositoryItem pReturnRequestItem)
          Loads the itemPromotions and orderPromotionsproperties of the ReturnRequest from the corresponding properties in the return request item.
protected  void loadItemCostAdjustments(ReturnRequest pReturnRequest, RepositoryItem pReturnRequestItem)
          Loads the ItemCostAdjustments for the non-return items by creating a new ItemCostAjustment for each itemCostAdjustment repository item found on the return request item and adding it to the ReturnRequest object.
protected  void loadPromotionValueAdjustments(ReturnRequest pReturnRequest, RepositoryItem pReturnRequestItem)
          Loads the promotion value adjustment map on the return request repository item into the ReturnRequest's promotionValueAdjustments property
protected  void loadRefundMethodsList(ReturnRequest pReturnRequest, RepositoryItem pReturnRequestItem)
          Loads the refund methods from the given returnrequest item into the given ReturnRequest object.
 void loadRelatedReplacementOrders(ReturnRequest pReturnRequest)
          Loads the relatedReplacementOrders property of the ReturnRequest based on the sortedReturnRequests in the ReturnRequest.
protected  ReturnRequest loadReturnRequest(RepositoryItem pReturnRequestItem)
          Creates and loads a ReturnRequest object for the given return request repository item
 java.lang.String logGWPItemMarkers(CommerceItem pCommerceItem)
          Generates a String that details the GWP items markers on the given CommerceItem
 java.lang.String logGWPOrderMarkers(Order pOrder)
          Generates a String that details the GWP order markers on the given Order
protected  java.lang.String logOrderInfo(ReturnRequest pReturnRequest, Order pOrder)
          Generates a String that details the contents of the Order.
 java.lang.String logReturnRequest(ReturnRequest pReturnRequest)
          Generates a String that details the contents of the ReturnRequest.
protected  void removeEmptyShippingGroups(Order pOrder)
          Util method that removes all shipping groups in the order that have no CommerceItemRelationships
 void removeUnallocatedRefundMethods(ReturnRequest pReturnRequest)
          Removes the refund methods that have an allocated amount of 0.
protected  void removeZeroQuantityItems(Order pOrder)
          Removes all items from the order with a quantity of 0.
protected  void removeZeroQuantityRelationships(Order pOrder)
          Removes all ShippingGroupCommerceItemRelationships that have a quantity of 0.
protected  void repriceCurrentExchangeOrder(ReturnRequest pReturnRequest)
          Reprices the current exchange order.
 void repriceWorkingOrder(ReturnRequest pReturnRequest, Order pWorkingOrder, java.util.Locale pLocale, RepositoryItem pCustomerProfile, java.util.Map pExtraParameters)
          This method should be used to price the working orders: return adjusted, return calculation and promotion evaluation.
protected  RepositoryItem retrieveDisposition(java.lang.String pDisposition)
          Load an item disposition from the repository
protected  MutableRepositoryItem retrieveRefundMethod(java.lang.String pRefundMethodId)
          Load an updateable refund method from the repository
protected  MutableRepositoryItem retrieveReturnItem(java.lang.String pReturnItemId)
          Load an updateable returned item from the repository
protected  MutableRepositoryItem retrieveReturnRequest(java.lang.String pRequestId)
          Load an updateable return request from the repository
 void rollbackTransaction()
          This method is used to roll-back the current transaction.
protected  void saveAppliedPromotions(ReturnRequest pReturnRequest, MutableRepositoryItem pReturnRequestItem)
          Extracts the promotions that still apply and saves their ids with the return request item.
protected  void saveItemCostAdjustments(ReturnRequest pReturnRequest, MutableRepositoryItem pReturnRequestItem)
          The method is called when saving the ItemCostAdjustments of the ReturnRequest to the repository.
protected  void savePromotionValueAdjustments(ReturnRequest pReturnRequest, MutableRepositoryItem pReturnRequestItem)
          Transfers the map in the ReturnRequest to the promotionValueAdjustments property of the return request repository item.
 void setActualShippingRefundPropertyName(java.lang.String pActualShippingRefundPropertyName)
          Set the name of the returnRequest property that identifies the actual shipping refund amount
 void setActualShippingRefundSharePropertyName(java.lang.String pActualShippingRefundSharePropertyName)
           
 void setActualTaxRefundPropertyName(java.lang.String pActualTaxRefundPropertyName)
          Set the name of the returnRequest property that identifies the actual tax refund amount
 void setActualTaxRefundSharePropertyName(java.lang.String pActualTaxRefundSharePropertyName)
           
 void setAmountAdjustmentPropertyName(java.lang.String pAmountAdjustmentPropertyName)
           
 void setAmountPropertyName(java.lang.String pAmountPropertyName)
          Set the name of the refundMethod property that indicates the amount for this refund method
 void setBalancingPaymentIdPropertyName(java.lang.String pBalancingPaymentIdPropertyName)
          Sets the balancingPaymentIdPropertyName.
protected  void setBasePropertiesOfItemCostAdjustment(ItemCostAdjustment pItemCostAdjustment, RepositoryItem pItemCostAdjustmentItem)
          This method is used when reconstituting the ItemCostAdjustmments of the ReturnRequest from the repository.
protected  void setBasePropertiesOfRepositoryItem(ItemCostAdjustment pItemCostAdjustment, MutableRepositoryItem pItemCostAdjustmentItem)
          This method will set the properties of the given repository item based on the content of the given ItemCostAdjustment object.
 void setBeanNameToItemDescriptorMap(java.util.Properties pBeanNameToItemDescriptorMap)
          Sets the beanNameToItemDescriptorMap
 void setBonusRefundPropertyName(java.lang.String pBonusRefundPropertyName)
          Set the name of the bonusRefund property in the returnItem item descriptor
 void setClaimableManager(ClaimableManager pClaimableManager)
          Sets the Claimable manager
 void setCommentAgentPropertyName(java.lang.String pCommentAgentPropertyName)
          Set the name of the comment property that holds the id of the agent who placed the comment
 void setCommentCreationDatePropertyName(java.lang.String pCommentCreationDatePropertyName)
          Set the name of the comment property that holds the comment's creation date
 void setCommentOwnerPropertyName(java.lang.String pCommentOwnerPropertyName)
          Set the name of the comment property that holds the id of the return request that owns the comment
 void setCommentPropertyName(java.lang.String pCommentPropertyName)
          Set the name of the comment property that holds the actual comment
 void setCommerceItemIdPropertyName(java.lang.String pCommerceItemIdPropertyName)
          Set the name of the returnItem property that identifies the commerce item that is being returned
 void setCommercePropertyManager(CommercePropertyManager pCommercePropertyManager)
          Sets the component that defines properties of the profile for Commerce
 void setCreatedDatePropertyName(java.lang.String pCreatedDatePropertyName)
          Set the name of the returnRequest property that identifies the date the request was created
 void setCreditCardRefundMethodItemDescriptorName(java.lang.String pCreditCardRefundMethodItemDescriptorName)
          Sets the creditCardRefundMethodItemDescriptorName.
 void setDispositionPropertyName(java.lang.String pDispositionPropertyName)
          Set the name of the returnItem property that indicates the disposition of the returned item
 void setFulfilledOrderStates(java.lang.String[] pFulfilledOrderStates)
          Sets array of order states that indicate that an order is fulfilled
 void setGwpManager(GWPManager pGwpManager)
          Setter for the gift with purchase manager property.
 void setItemCostAdjustmentDescriptorName(java.lang.String pItemCostAdjustmentDescriptorName)
          Set the name of the itemCostAdjustment item-descriptor
 void setItemPromotionsPropertyName(java.lang.String pItemPromotionsPropertyName)
          Set the name of the returnRequest property that holds the item promotion ids used to calculated refund values and replacement item prices.
 void setManualAdjustmentShareAdjustmentPropertyName(java.lang.String pManualAdjustmentShareAdjustmentPropertyName)
           
 void setMethodTypePropertyName(java.lang.String pMethodTypePropertyName)
          Set the name of the refundMethod property that indicates the type of refund method
 void setNonReturnItemCostAdjustmentsPropertyName(java.lang.String pNonReturnItemCostAdjustmentsPropertyName)
          Set the name of the returnRequest property that holds the ItemCostAdjustment objects for non-return items.
 void setOrderDiscountShareAdjustmentPropertyName(java.lang.String pOrderDiscountShareAdjustmentPropertyName)
           
 void setOrderManager(OrderManager pOrderManager)
          Sets the order manager
 void setOrderPromotionsPropertyName(java.lang.String pOrderPromotionsPropertyName)
          Set the name of the returnRequest property that holds the order promotion ids used to calculated refund values and replacement item prices.
 void setOrderPropertyName(java.lang.String pOrderPropertyName)
           
 void setOriginalOrderIdPropertyName(java.lang.String pOriginalOrderIdPropertyName)
          Set the name of the returnRequest property that holds the id of the original order
 void setOtherRefundPropertyName(java.lang.String pOtherRefundPropertyName)
          Sets the otherRefundPropertyName.
 void setPaymentGroupIdPropertyName(java.lang.String pPaymentGroupIdPropertyName)
          Set the name of the refundMethod property that identifies the payment group that this refund method is related to
 void setPendingReturnStates(java.lang.String[] pPendingReturnStates)
          Sets array of order states that indicate that an order is pending a return (i.e.
 void setPerformanceMonitorEnabled(boolean pPerformanceMonitorEnabled)
           
 void setPricingTools(PricingTools pPricingTools)
           
 void setProcessedPropertyName(java.lang.String pProcessedPropertyName)
          Set the name of the returnRequest property that identifies the 'request has been processed' setting
 void setProcessImmediatelyPropertyName(java.lang.String pProcessImmediatelyPropertyName)
          Set the name of the returnRequest property that identifies the 'process immediately' setting
 void setProfileTools(ProfileTools pProfileTools)
          Sets the ProfileTools component
 void setPromotionTools(PromotionTools pPromotionTools)
           
 void setPromotionValueAdjustmentsPropertyName(java.lang.String pPromotionValueAdjustmentsPropertyName)
           
 void setQuantityAdjustedPropertyName(java.lang.String pQuantityAdjustedPropertyName)
           
 void setQuantityReceivedPropertyName(java.lang.String pQuantityReceivedPropertyName)
          Set the name of the returnItem property that identifies the quantity of this item that has been received
 void setQuantityToExchangePropertyName(java.lang.String pQuantityToExchangePropertyName)
          Set the name of the returnItem property that identifies the quantity that will be replaced
 void setQuantityToReturnPropertyName(java.lang.String pQuantityToReturnPropertyName)
          Set the name of the returnItem property that identifies the quantity that will be returned
 void setReasonPropertyName(java.lang.String pReasonPropertyName)
          Set the name of the returnItem property that identifies the reason that the item is being returned/replaced
 void setRefundAmountPropertyName(java.lang.String pRefundAmountPropertyName)
          Set the name of the returnItem property that identifies the amount that will be refunded for this item
 void setRefundMethodItemDescriptorName(java.lang.String pRefundMethodItemDescriptorName)
          Set the name of the RefundMethod item-descriptor
 void setRefundMethodsPropertyName(java.lang.String pRefundMethodsPropertyName)
          Set the name of the returnRequest property that identifies the the refund methods for this request
 void setRefundMethodTypeClassMap(java.util.Properties pRefundMethodTypeClassMap)
          Sets the refundMethodTypeClassMap
 void setReplacementOrderIdPropertyName(java.lang.String pReplacementOrderIdPropertyName)
          Set the name of the returnRequest property that holds the replacement order id
 void setReturnAgentPropertyName(java.lang.String pReturnAgentPropertyName)
          Sets property returnAgentPropertyName
 void setReturnCommentItemDescriptorName(java.lang.String pReturnCommentItemDescriptorName)
          Set the name of the item descriptor that holds the return request's comments
 void setReturnFeePropertyName(java.lang.String pReturnFeePropertyName)
          Set the name of the returnRequest property that holds the return fee
 void setReturnItemDispositionItemDescriptorName(java.lang.String pReturnItemDispositionItemDescriptorName)
          Set the name of the ReturnItemDisposition item-descriptor
 void setReturnItemItemDescriptorName(java.lang.String pReturnItemItemDescriptorName)
          Set the name of the returnItem item-descriptor
protected  void setReturnItemProperties(ReturnItem pReturnItem, MutableRepositoryItem pReturnItemItem, java.lang.String pRequestId)
          Sets the properties in a returnItem repository item based on the given ReturnItem object
 void setReturnItemsPropertyName(java.lang.String pReturnItemsPropertyName)
          Set the name of the returnRequest property that identifies the items that are being exchanged/returned
 void setReturnItemStatePropertyName(java.lang.String pReturnItemStatePropertyName)
          Set the name of the returnItem property that identifies the indicates state of the item
 void setReturnItemStates(ReturnItemStates pReturnItemStates)
          Sets the returned item states
 void setReturnItemTypeClassMap(java.util.Properties pReturnItemTypeClassMap)
          Sets the returnItemTypeClassMap
 void setReturnOriginOfReturnPropertyName(java.lang.String pReturnOriginOfReturnPropertyName)
          Sets property returnOriginOfReturnPropertyName
 void setReturnReasonsItemDescriptorName(java.lang.String pReturnReasonsItemDescriptorName)
          Set the name of the returnReasons item-descriptor
 void setReturnRefPropertyName(java.lang.String pReturnRefPropertyName)
          Set the name of the returnItem property that identifies the returnRequest that this item is related to
 void setReturnRepository(MutableRepository pReturnRepository)
          sets the return repository
 void setReturnRequestClass(java.lang.Class<ReturnRequest> pReturnRequestClass)
          Sets the returnRequestClass
 void setReturnRequestItemDescriptorName(java.lang.String pReturnRequestItemDescriptorName)
          Set the name of the returnRequest item-descriptor
 void setReturnRequiredPropertyName(java.lang.String pReturnRequiredPropertyName)
          Set the name of the returnItem property that indicates if the item must be physically returned
 void setReturnShippingTypeClassMap(java.util.Properties pReturnShippingTypeClassMap)
          Sets the returnShippingTypeClassMap
 void setReturnStates(ReturnStates pReturnStates)
          Sets the return request states
 void setRmaPropertyName(java.lang.String pRmaPropertyName)
          Set the name of the returnRequest property that identifies the RMA
 void setShippingGroupIdPropertyName(java.lang.String pShippingGroupIdPropertyName)
          Set the name of the returnItem property that identifies the shipping group that the returned item is related to
 void setShippingPromotionsPropertyName(java.lang.String pShippingPromotionsPropertyName)
          Set the name of the returnRequest property that holds the shipping promotion ids used to calculated refund values and replacement item prices.
 void setShippingShareAdjustmentPropertyName(java.lang.String pShippingShareAdjustmentPropertyName)
           
 void setSiteContextManager(SiteContextManager pSiteContextManager)
          Sets the siteContextManager
 void setSiteManager(SiteManager pSiteManager)
          Sets the siteManager
 void setStatePropertyName(java.lang.String pStatePropertyName)
          Set the name of the returnRequest property that identifies the state of the request
 void setStoreCreditNumberPropertyName(java.lang.String pStoreCreditNumberPropertyName)
          Sets the storeCreditNumberPropertyName.
 void setStoreCreditRefundMethodItemDescriptorName(java.lang.String pStoreCreditRefundMethodItemDescriptorName)
          Sets the storeCreditRefundMethodItemDescriptorName.
 void setSuggestedShippingRefundPropertyName(java.lang.String pSuggestedShippingRefundPropertyName)
          Set the name of the returnRequest property that identifies the suggested shipping refund amount
 void setSuggestedShippingRefundSharePropertyName(java.lang.String pSuggestedShippingRefundSharePropertyName)
           
 void setSuggestedTaxRefundPropertyName(java.lang.String pSuggestedTaxRefundPropertyName)
          Set the name of the returnRequest property that identifies the suggested tax refund amount
 void setSuggestedTaxRefundSharePropertyName(java.lang.String pSuggestedTaxRefundSharePropertyName)
           
 void setTaxShareAdjustmentPropertyName(java.lang.String pTaxShareAdjustmentPropertyName)
           
 void setUpdateInventoryPropertyName(java.lang.String pUpdateInventoryPropertyName)
          Set the name of the returnItemDisposition property that indicates whether the the inventory should be updated when the item is received
protected  boolean shouldUpdateInventory(ReturnItem pReturnItem)
          Indicates if the inventory of the return item should be updated upon receipt
protected  java.lang.String stateToString(ObjectStates pObjectStates, java.lang.String pStateString)
          Convert a state string
protected  double sumDetails(CommerceItem pCommerceItem, atg.core.util.Range pRange, java.lang.String pDetailPropertyName)
          Iterates over the DetailedItemPriceInfos for the item and returns the total value of the given property.
protected  void updateItem(MutableRepositoryItem pRepositoryItem)
          Update the repository item
protected  void updateReturnItemState(ReturnItem pReturnItem)
          Updates the ReturnItem state in the repository.
protected  void updateReturnRequestState(ReturnRequest pReturnRequest)
          This method updates the return request state in the repository.
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string


sResourceBundle

protected static java.util.ResourceBundle sResourceBundle

DEFAULT

public static final java.lang.String DEFAULT
See Also:
Constant Field Values

mProfileTools

protected ProfileTools mProfileTools

mFulfilledOrderStates

protected java.lang.String[] mFulfilledOrderStates

mSiteContextManager

protected SiteContextManager mSiteContextManager

mSiteManager

protected SiteManager mSiteManager

mGwpManager

protected GWPManager mGwpManager
Manager component for gift with purchase promotions


mPerformanceMonitorEnabled

protected boolean mPerformanceMonitorEnabled

mPendingReturnStates

protected java.lang.String[] mPendingReturnStates

mPromotionValueAdjustmentsPropertyName

protected java.lang.String mPromotionValueAdjustmentsPropertyName

mPromotionTools

protected PromotionTools mPromotionTools

mPricingTools

protected PricingTools mPricingTools

mNonReturnItemCostAdjustmentsPropertyName

protected java.lang.String mNonReturnItemCostAdjustmentsPropertyName

mOrderPropertyName

protected java.lang.String mOrderPropertyName

mQuantityAdjustedPropertyName

protected java.lang.String mQuantityAdjustedPropertyName

mAmountAdjustmentPropertyName

protected java.lang.String mAmountAdjustmentPropertyName

mOrderDiscountShareAdjustmentPropertyName

protected java.lang.String mOrderDiscountShareAdjustmentPropertyName

mManualAdjustmentShareAdjustmentPropertyName

protected java.lang.String mManualAdjustmentShareAdjustmentPropertyName

mTaxShareAdjustmentPropertyName

protected java.lang.String mTaxShareAdjustmentPropertyName

mShippingShareAdjustmentPropertyName

protected java.lang.String mShippingShareAdjustmentPropertyName

mReturnRequestClass

protected java.lang.Class<ReturnRequest> mReturnRequestClass

mReturnShippingTypeClassMap

protected java.util.Properties mReturnShippingTypeClassMap

mRefundMethodTypeClassMap

protected java.util.Properties mRefundMethodTypeClassMap

mReturnItemTypeClassMap

protected java.util.Properties mReturnItemTypeClassMap

mBeanNameToItemDescriptorMap

protected java.util.Properties mBeanNameToItemDescriptorMap

mReturnTools

protected static ReturnTools mReturnTools

mReturnToolsComponentPath

public static java.lang.String mReturnToolsComponentPath
Constructor Detail

ReturnTools

public ReturnTools()
Method Detail

setProfileTools

public void setProfileTools(ProfileTools pProfileTools)
Sets the ProfileTools component

Parameters:
pProfileTools - the ProfileTools component

getProfileTools

public ProfileTools getProfileTools()
The ProfileTools component

Returns:
the ProfileTools component

setFulfilledOrderStates

public void setFulfilledOrderStates(java.lang.String[] pFulfilledOrderStates)
Sets array of order states that indicate that an order is fulfilled

Parameters:
pFulfilledOrderStates - an array of order states that indicate that an order is fulfilled

getFulfilledOrderStates

public java.lang.String[] getFulfilledOrderStates()
Returns:
array of order states that indicate that an order is fulfilled

getSiteContextManager

public SiteContextManager getSiteContextManager()
Returns the siteContextManager

Returns:
the siteContextManager

setSiteContextManager

public void setSiteContextManager(SiteContextManager pSiteContextManager)
Sets the siteContextManager

Parameters:
pSiteContextManager - the siteContextManager to set

getSiteManager

public SiteManager getSiteManager()
Returns the siteManager

Returns:
the siteManager

setSiteManager

public void setSiteManager(SiteManager pSiteManager)
Sets the siteManager

Parameters:
pSiteManager - the siteManager to set

setCommercePropertyManager

public void setCommercePropertyManager(CommercePropertyManager pCommercePropertyManager)
Sets the component that defines properties of the profile for Commerce

Parameters:
pCommercePropertyManager - the component that defines properties of the profile for Commerce

getCommercePropertyManager

public CommercePropertyManager getCommercePropertyManager()
Returns:
the component that defines properties of the profile for Commerce

setGwpManager

public void setGwpManager(GWPManager pGwpManager)
Setter for the gift with purchase manager property.

Parameters:
pGwpManager - GWPManager

getGwpManager

public GWPManager getGwpManager()
Getter for the gift with purchase manager property.

Returns:
GWPManager

isPerformanceMonitorEnabled

public boolean isPerformanceMonitorEnabled()

setPerformanceMonitorEnabled

public void setPerformanceMonitorEnabled(boolean pPerformanceMonitorEnabled)

setPendingReturnStates

public void setPendingReturnStates(java.lang.String[] pPendingReturnStates)
Sets array of order states that indicate that an order is pending a return (i.e. an exchange order)

Parameters:
pPendingReturnStates - an array of order states that indicate that an order is pending return

getPendingReturnStates

public java.lang.String[] getPendingReturnStates()
Returns:
array of order states that indicate that an order is submitted

getPromotionValueAdjustmentsPropertyName

public java.lang.String getPromotionValueAdjustmentsPropertyName()
Returns the return request property name used for storing the promotion value adjustments


setPromotionValueAdjustmentsPropertyName

public void setPromotionValueAdjustmentsPropertyName(java.lang.String pPromotionValueAdjustmentsPropertyName)

getPromotionTools

public PromotionTools getPromotionTools()
Returns:
the PromotionTools component

setPromotionTools

public void setPromotionTools(PromotionTools pPromotionTools)

getPricingTools

public PricingTools getPricingTools()
Returns:
the PricingTools component

setPricingTools

public void setPricingTools(PricingTools pPricingTools)

getOtherRefundPropertyName

public java.lang.String getOtherRefundPropertyName()
Returns the otherRefundPropertyName.

Returns:
otherRefundPropertyName

setOtherRefundPropertyName

public void setOtherRefundPropertyName(java.lang.String pOtherRefundPropertyName)
Sets the otherRefundPropertyName.

Parameters:
pOtherRefundPropertyName -

getBalancingPaymentIdPropertyName

public java.lang.String getBalancingPaymentIdPropertyName()
Returns the balancingPaymentIdPropertyName.

Returns:
balancingPaymentIdPropertyName

setBalancingPaymentIdPropertyName

public void setBalancingPaymentIdPropertyName(java.lang.String pBalancingPaymentIdPropertyName)
Sets the balancingPaymentIdPropertyName.

Parameters:
pBalancingPaymentIdPropertyName -

getStoreCreditNumberPropertyName

public java.lang.String getStoreCreditNumberPropertyName()
Returns the storeCreditNumberPropertyName.

Returns:
storeCreditNumberPropertyName

setStoreCreditNumberPropertyName

public void setStoreCreditNumberPropertyName(java.lang.String pStoreCreditNumberPropertyName)
Sets the storeCreditNumberPropertyName.

Parameters:
pStoreCreditNumberPropertyName -

getCreditCardRefundMethodItemDescriptorName

public java.lang.String getCreditCardRefundMethodItemDescriptorName()
Returns the creditCardRefundMethodItemDescriptorName.

Returns:
creditCardRefundMethodItemDescriptorName

setCreditCardRefundMethodItemDescriptorName

public void setCreditCardRefundMethodItemDescriptorName(java.lang.String pCreditCardRefundMethodItemDescriptorName)
Sets the creditCardRefundMethodItemDescriptorName.

Parameters:
pCreditCardRefundMethodItemDescriptorName -

getStoreCreditRefundMethodItemDescriptorName

public java.lang.String getStoreCreditRefundMethodItemDescriptorName()
Returns the storeCreditRefundMethodItemDescriptorName.

Returns:
storeCreditRefundMethodItemDescriptorName

setStoreCreditRefundMethodItemDescriptorName

public void setStoreCreditRefundMethodItemDescriptorName(java.lang.String pStoreCreditRefundMethodItemDescriptorName)
Sets the storeCreditRefundMethodItemDescriptorName.

Parameters:
pStoreCreditRefundMethodItemDescriptorName -

setActualShippingRefundPropertyName

public void setActualShippingRefundPropertyName(java.lang.String pActualShippingRefundPropertyName)
Set the name of the returnRequest property that identifies the actual shipping refund amount

Parameters:
pActualShippingRefundPropertyName - the name of the returnRequest property that identifies the actual shipping refund amount

getActualShippingRefundPropertyName

public java.lang.String getActualShippingRefundPropertyName()
Returns:
String the name of the returnRequest property that identifies the actual shipping refund amount

setActualTaxRefundPropertyName

public void setActualTaxRefundPropertyName(java.lang.String pActualTaxRefundPropertyName)
Set the name of the returnRequest property that identifies the actual tax refund amount

Parameters:
pActualTaxRefundPropertyName - the name of the returnRequest property that identifies the actual tax refund amount

getActualTaxRefundPropertyName

public java.lang.String getActualTaxRefundPropertyName()
Returns:
String the name of the returnRequest property that identifies the actual tax refund amount

setAmountPropertyName

public void setAmountPropertyName(java.lang.String pAmountPropertyName)
Set the name of the refundMethod property that indicates the amount for this refund method

Parameters:
pAmountPropertyName - the name of the refundMethod property that indicates the amount for this refund method

getAmountPropertyName

public java.lang.String getAmountPropertyName()
Returns:
String the name of the refundMethod property that indicates the amount for this refund method

setBonusRefundPropertyName

public void setBonusRefundPropertyName(java.lang.String pBonusRefundPropertyName)
Set the name of the bonusRefund property in the returnItem item descriptor

Parameters:
pBonusRefundPropertyName - the name of the bonusRefund property in the returnItem item descriptor

getBonusRefundPropertyName

public java.lang.String getBonusRefundPropertyName()
Returns:
String the name of the bonusRefund property in the returnItem item descriptor

setCommentPropertyName

public void setCommentPropertyName(java.lang.String pCommentPropertyName)
Set the name of the comment property that holds the actual comment

Parameters:
pCommentPropertyName - the name of the comment property that holds the actual comment

getCommentPropertyName

public java.lang.String getCommentPropertyName()
Returns:
String the name of the comment property that holds the actual comment

setCommentAgentPropertyName

public void setCommentAgentPropertyName(java.lang.String pCommentAgentPropertyName)
Set the name of the comment property that holds the id of the agent who placed the comment

Parameters:
pCommentAgentPropertyName - the name of the comment property that holds the id of the agent who placed the comment

getCommentAgentPropertyName

public java.lang.String getCommentAgentPropertyName()
Returns:
String the name of the comment property that holds the id of the agent who placed the comment

setCommentCreationDatePropertyName

public void setCommentCreationDatePropertyName(java.lang.String pCommentCreationDatePropertyName)
Set the name of the comment property that holds the comment's creation date

Parameters:
pCommentCreationDatePropertyName - the name of the comment property that holds the comment's creation date

getCommentCreationDatePropertyName

public java.lang.String getCommentCreationDatePropertyName()
Returns:
String the name of the comment property that holds the comment's creation date

setCommentOwnerPropertyName

public void setCommentOwnerPropertyName(java.lang.String pCommentOwnerPropertyName)
Set the name of the comment property that holds the id of the return request that owns the comment

Parameters:
pCommentOwnerPropertyName - the name of the comment property that holds the id of the return request that owns the comment

getCommentOwnerPropertyName

public java.lang.String getCommentOwnerPropertyName()
Returns:
String the name of the comment property that holds the id of the return request that owns the comment

setCommerceItemIdPropertyName

public void setCommerceItemIdPropertyName(java.lang.String pCommerceItemIdPropertyName)
Set the name of the returnItem property that identifies the commerce item that is being returned

Parameters:
pCommerceItemIdPropertyName - the name of the returnItem property that identifies the commerce item that is being returned

getCommerceItemIdPropertyName

public java.lang.String getCommerceItemIdPropertyName()
Returns:
String the name of the returnItem property that identifies the commerce item that is being returned

setCreatedDatePropertyName

public void setCreatedDatePropertyName(java.lang.String pCreatedDatePropertyName)
Set the name of the returnRequest property that identifies the date the request was created

Parameters:
pCreatedDatePropertyName - the name of the returnRequest property that identifies the date the request was created

getCreatedDatePropertyName

public java.lang.String getCreatedDatePropertyName()
Returns:
String the name of the returnRequest property that identifies the date the request was created

setDispositionPropertyName

public void setDispositionPropertyName(java.lang.String pDispositionPropertyName)
Set the name of the returnItem property that indicates the disposition of the returned item

Parameters:
pDispositionPropertyName - the name of the returnItem property that indicates the disposition of the returned item

getDispositionPropertyName

public java.lang.String getDispositionPropertyName()
Returns:
String the name of the returnItem property that indicates the disposition of the returned item

setMethodTypePropertyName

public void setMethodTypePropertyName(java.lang.String pMethodTypePropertyName)
Set the name of the refundMethod property that indicates the type of refund method

Parameters:
pMethodTypePropertyName - the name of the refundMethod property that indicates the type of refund method

getMethodTypePropertyName

public java.lang.String getMethodTypePropertyName()
Returns:
String the name of the refundMethod property that indicates the type of refund method

setOrderManager

public void setOrderManager(OrderManager pOrderManager)
Sets the order manager

Parameters:
pOrderManager - the order manager

getOrderManager

public OrderManager getOrderManager()
Returns the order manager


setNonReturnItemCostAdjustmentsPropertyName

public void setNonReturnItemCostAdjustmentsPropertyName(java.lang.String pNonReturnItemCostAdjustmentsPropertyName)
Set the name of the returnRequest property that holds the ItemCostAdjustment objects for non-return items. Non-return items are those that were not returned but were adjusted in price and therefore, affected the refund amount.

Parameters:
pNonReturnItemCostAdjustmentsPropertyName - the name of the returnRequest property that holds holds the ItemCostAdjustment objects for non-return items

getNonReturnItemCostAdjustmentsPropertyName

public java.lang.String getNonReturnItemCostAdjustmentsPropertyName()
Returns:
String the name of the returnRequest property that holds holds the ItemCostAdjustment objects for non-return items

setItemPromotionsPropertyName

public void setItemPromotionsPropertyName(java.lang.String pItemPromotionsPropertyName)
Set the name of the returnRequest property that holds the item promotion ids used to calculated refund values and replacement item prices.

Parameters:
pPromotionsPropertyName - the name of the returnRequest property that holds the item promotion ids used to calculated refund values and replacement item prices.

getItemPromotionsPropertyName

public java.lang.String getItemPromotionsPropertyName()
Returns:
String the name of the returnRequest property that holds the item promotion ids used to calculated refund values and replacement

setShippingPromotionsPropertyName

public void setShippingPromotionsPropertyName(java.lang.String pShippingPromotionsPropertyName)
Set the name of the returnRequest property that holds the shipping promotion ids used to calculated refund values and replacement item prices.

Parameters:
pPromotionsPropertyName - the name of the returnRequest property that holds the item promotion ids used to calculated refund values and replacement item prices.

getShippingPromotionsPropertyName

public java.lang.String getShippingPromotionsPropertyName()
Returns:
String the name of the returnRequest property that holds the shipping promotion ids used to calculated refund values and replacement

setOrderPromotionsPropertyName

public void setOrderPromotionsPropertyName(java.lang.String pOrderPromotionsPropertyName)
Set the name of the returnRequest property that holds the order promotion ids used to calculated refund values and replacement item prices.

Parameters:
pPromotionsPropertyName - the name of the returnRequest property that holds the order promotion ids used to calculated refund values and replacement item prices.

getOrderPromotionsPropertyName

public java.lang.String getOrderPromotionsPropertyName()
Returns:
String the name of the returnRequest property that holds the order promotion ids used to calculated refund values and replacement

getOrderPropertyName

public java.lang.String getOrderPropertyName()
Returns:
the name of the return request's order property name

setOrderPropertyName

public void setOrderPropertyName(java.lang.String pOrderPropertyName)

setOriginalOrderIdPropertyName

public void setOriginalOrderIdPropertyName(java.lang.String pOriginalOrderIdPropertyName)
Set the name of the returnRequest property that holds the id of the original order

Parameters:
pOriginalOrderIdPropertyName - the name of the returnRequest property that holds the id of the original order

getOriginalOrderIdPropertyName

public java.lang.String getOriginalOrderIdPropertyName()
Returns:
String the name of the returnRequest property that holds the id of the original order

setPaymentGroupIdPropertyName

public void setPaymentGroupIdPropertyName(java.lang.String pPaymentGroupIdPropertyName)
Set the name of the refundMethod property that identifies the payment group that this refund method is related to

Parameters:
pPaymentGroupIdPropertyName - the name of the refundMethod property that identifies the payment group that this refund method is related to

getPaymentGroupIdPropertyName

public java.lang.String getPaymentGroupIdPropertyName()
Returns:
String the name of the RefundMethod property that indicates the payment group that this refund method is related to

setProcessedPropertyName

public void setProcessedPropertyName(java.lang.String pProcessedPropertyName)
Set the name of the returnRequest property that identifies the 'request has been processed' setting

Parameters:
pProcessedPropertyName - the name of the returnRequest property that identifies the 'request has been processed' setting

getProcessedPropertyName

public java.lang.String getProcessedPropertyName()
Returns:
the name of the returnRequest property that identifies the 'request has been processed' setting

setProcessImmediatelyPropertyName

public void setProcessImmediatelyPropertyName(java.lang.String pProcessImmediatelyPropertyName)
Set the name of the returnRequest property that identifies the 'process immediately' setting

Parameters:
pProcessImmediatelyPropertyName - the name of the returnRequest property that identifies the 'process immediately' setting

getProcessImmediatelyPropertyName

public java.lang.String getProcessImmediatelyPropertyName()
Returns:
the name of the returnRequest property that identifies the 'process immediately' setting

setQuantityReceivedPropertyName

public void setQuantityReceivedPropertyName(java.lang.String pQuantityReceivedPropertyName)
Set the name of the returnItem property that identifies the quantity of this item that has been received

Parameters:
pQuantityReceivedPropertyName - the name of the returnItem property that identifies the quantity of this item that has been received

getQuantityReceivedPropertyName

public java.lang.String getQuantityReceivedPropertyName()
Returns:
String the name of the returnItem property that identifies the quantity of this item that has been received

setQuantityToExchangePropertyName

public void setQuantityToExchangePropertyName(java.lang.String pQuantityToExchangePropertyName)
Set the name of the returnItem property that identifies the quantity that will be replaced

Parameters:
pQuantityToExchangePropertyName - the name of the returnItem property that identifies the quantity that will be replaced

getQuantityToExchangePropertyName

public java.lang.String getQuantityToExchangePropertyName()
Returns:
the name of the returnItem property that identifies the quantity that will be replaced

setQuantityToReturnPropertyName

public void setQuantityToReturnPropertyName(java.lang.String pQuantityToReturnPropertyName)
Set the name of the returnItem property that identifies the quantity that will be returned

Parameters:
pQuantityToReturnPropertyName - the name of the returnItem property that identifies the quantity that will be returned

getQuantityToReturnPropertyName

public java.lang.String getQuantityToReturnPropertyName()
Returns:
the name of the returnItem property that identifies the quantity that will be returned

setReasonPropertyName

public void setReasonPropertyName(java.lang.String pReasonPropertyName)
Set the name of the returnItem property that identifies the reason that the item is being returned/replaced


getReasonPropertyName

public java.lang.String getReasonPropertyName()
Returns:
String the name of the returnItem property that identifies the reason that the item is being returned/replaced

setRefundAmountPropertyName

public void setRefundAmountPropertyName(java.lang.String pRefundAmountPropertyName)
Set the name of the returnItem property that identifies the amount that will be refunded for this item

Parameters:
pRefundAmountPropertyName - the name of the returnItem property that identifies the amount that will be refunded for this item

getRefundAmountPropertyName

public java.lang.String getRefundAmountPropertyName()
Returns:
String the name of the returnItem property that identifies the amount that will be refunded for this item

setRefundMethodItemDescriptorName

public void setRefundMethodItemDescriptorName(java.lang.String pRefundMethodItemDescriptorName)
Set the name of the RefundMethod item-descriptor

Parameters:
pRefundMethodItemDescriptorName - the name of the refundMethod item descriptor

getRefundMethodItemDescriptorName

public java.lang.String getRefundMethodItemDescriptorName()
Returns:
String the name of the RefundMethod item-descriptor

setRefundMethodsPropertyName

public void setRefundMethodsPropertyName(java.lang.String pRefundMethodsPropertyName)
Set the name of the returnRequest property that identifies the the refund methods for this request

Parameters:
pRefundMethodsPropertyName - the name of the returnRequest property that identifies the the refund methods for this request

getRefundMethodsPropertyName

public java.lang.String getRefundMethodsPropertyName()
Returns:
String the name of the returnRequest property that identifies the the refund methods for this request

setReplacementOrderIdPropertyName

public void setReplacementOrderIdPropertyName(java.lang.String pReplacementOrderIdPropertyName)
Set the name of the returnRequest property that holds the replacement order id

Parameters:
pReplacementOrderIdPropertyName - the name of the returnRequest property that holds the replacemnet order id

getReplacementOrderIdPropertyName

public java.lang.String getReplacementOrderIdPropertyName()
Returns:
String the name of the returnRequest property that holds the replacement order id

setReturnFeePropertyName

public void setReturnFeePropertyName(java.lang.String pReturnFeePropertyName)
Set the name of the returnRequest property that holds the return fee

Parameters:
pReturnFeePropertyName - the name of the returnRequest property that holds the return fee

getReturnFeePropertyName

public java.lang.String getReturnFeePropertyName()
Returns:
String the name of the returnRequest property that holds the return fee

getReturnAgentPropertyName

public java.lang.String getReturnAgentPropertyName()
Gets property returnAgentPropertyName

Returns:
returnAgentPropertyName

setReturnAgentPropertyName

public void setReturnAgentPropertyName(java.lang.String pReturnAgentPropertyName)
Sets property returnAgentPropertyName

Parameters:
pReturnAgentPropertyName -

getReturnOriginOfReturnPropertyName

public java.lang.String getReturnOriginOfReturnPropertyName()
Gets property returnOriginOfReturnPropertyName

Returns:
returnOriginOfReturnPropertyName

setReturnOriginOfReturnPropertyName

public void setReturnOriginOfReturnPropertyName(java.lang.String pReturnOriginOfReturnPropertyName)
Sets property returnOriginOfReturnPropertyName

Parameters:
pReturnOriginOfReturnPropertyName -

getSuggestedShippingRefundSharePropertyName

public java.lang.String getSuggestedShippingRefundSharePropertyName()

setSuggestedShippingRefundSharePropertyName

public void setSuggestedShippingRefundSharePropertyName(java.lang.String pSuggestedShippingRefundSharePropertyName)

getSuggestedTaxRefundSharePropertyName

public java.lang.String getSuggestedTaxRefundSharePropertyName()

setSuggestedTaxRefundSharePropertyName

public void setSuggestedTaxRefundSharePropertyName(java.lang.String pSuggestedTaxRefundSharePropertyName)

getActualShippingRefundSharePropertyName

public java.lang.String getActualShippingRefundSharePropertyName()

setActualShippingRefundSharePropertyName

public void setActualShippingRefundSharePropertyName(java.lang.String pActualShippingRefundSharePropertyName)

getActualTaxRefundSharePropertyName

public java.lang.String getActualTaxRefundSharePropertyName()

setActualTaxRefundSharePropertyName

public void setActualTaxRefundSharePropertyName(java.lang.String pActualTaxRefundSharePropertyName)

setReturnCommentItemDescriptorName

public void setReturnCommentItemDescriptorName(java.lang.String pReturnCommentItemDescriptorName)
Set the name of the item descriptor that holds the return request's comments

Parameters:
pReturnCommentItemDescriptorName - the name of the item descriptor that holds the return request's comments

getReturnCommentItemDescriptorName

public java.lang.String getReturnCommentItemDescriptorName()
Returns:
String the name of the item descriptor that holds the return request's comments

setReturnItemDispositionItemDescriptorName

public void setReturnItemDispositionItemDescriptorName(java.lang.String pReturnItemDispositionItemDescriptorName)
Set the name of the ReturnItemDisposition item-descriptor

Parameters:
pReturnItemDispositionItemDescriptorName - the name of the ReturnItemDisposition item-descriptor

getReturnItemDispositionItemDescriptorName

public java.lang.String getReturnItemDispositionItemDescriptorName()
Returns:
String the name of the ReturnItemDisposition item-descriptor

setReturnItemItemDescriptorName

public void setReturnItemItemDescriptorName(java.lang.String pReturnItemItemDescriptorName)
Set the name of the returnItem item-descriptor

Parameters:
pReturnItemItemDescriptorName - the name of the returnItem item-descriptor

getReturnItemItemDescriptorName

public java.lang.String getReturnItemItemDescriptorName()
Returns:
the name of the returnItem item-descriptor

setReturnItemsPropertyName

public void setReturnItemsPropertyName(java.lang.String pReturnItemsPropertyName)
Set the name of the returnRequest property that identifies the items that are being exchanged/returned

Parameters:
pReturnItemsPropertyName - the name of the returnRequest property that identifies the items that are being exchanged/returned

getReturnItemsPropertyName

public java.lang.String getReturnItemsPropertyName()
Returns:
the name of the returnRequest property that identifies the items that are being exchanged/returned

setReturnItemStatePropertyName

public void setReturnItemStatePropertyName(java.lang.String pReturnItemStatePropertyName)
Set the name of the returnItem property that identifies the indicates state of the item

Parameters:
pReturnItemStatePropertyName - the name of the returnItem property that identifies the indicates state of the item

getReturnItemStatePropertyName

public java.lang.String getReturnItemStatePropertyName()
Returns:
String the name of the returnItem property that indicates state of the item

setReturnItemStates

public void setReturnItemStates(ReturnItemStates pReturnItemStates)
Sets the returned item states

Parameters:
pReturnItemStates - the returned item states

getReturnItemStates

public ReturnItemStates getReturnItemStates()
Returns:
the returned item states

setReturnReasonsItemDescriptorName

public void setReturnReasonsItemDescriptorName(java.lang.String pReturnReasonsItemDescriptorName)
Set the name of the returnReasons item-descriptor

Parameters:
pReturnReasonsItemDescriptorName - the name of the returnReasonsItemDescriptor

getReturnReasonsItemDescriptorName

public java.lang.String getReturnReasonsItemDescriptorName()
Returns:
the name of the returnReasons item-descriptor

setReturnRefPropertyName

public void setReturnRefPropertyName(java.lang.String pReturnRefPropertyName)
Set the name of the returnItem property that identifies the returnRequest that this item is related to

Parameters:
pReturnRefPropertyName - the name of the returnItem property that identifies the returnRequest that this item is related to

getReturnRefPropertyName

public java.lang.String getReturnRefPropertyName()
Returns:
String the name of the returnItem property that identifies the returnRequest that this item is related to

setReturnRepository

public void setReturnRepository(MutableRepository pReturnRepository)
sets the return repository

Parameters:
pReturnRepository - the return repository

getReturnRepository

public MutableRepository getReturnRepository()
Returns the return repository


setItemCostAdjustmentDescriptorName

public void setItemCostAdjustmentDescriptorName(java.lang.String pItemCostAdjustmentDescriptorName)
Set the name of the itemCostAdjustment item-descriptor

Parameters:
pItemCostAdjustmentDescriptorName - the name of the itemCostAdjustment item-descriptor

getItemCostAdjustmentDescriptorName

public java.lang.String getItemCostAdjustmentDescriptorName()
Returns:
String the name of the itemCostAdjustment item-descriptor

setReturnRequestItemDescriptorName

public void setReturnRequestItemDescriptorName(java.lang.String pReturnRequestItemDescriptorName)
Set the name of the returnRequest item-descriptor

Parameters:
pReturnRequestItemDescriptorName - the name of the returnRequest item-descriptor

getReturnRequestItemDescriptorName

public java.lang.String getReturnRequestItemDescriptorName()
Returns:
String the name of the returnRequest item-descriptor

setReturnRequiredPropertyName

public void setReturnRequiredPropertyName(java.lang.String pReturnRequiredPropertyName)
Set the name of the returnItem property that indicates if the item must be physically returned

Parameters:
pReturnRequiredPropertyName - the name of the returnItem property that indicates if the item must be physically returned

getReturnRequiredPropertyName

public java.lang.String getReturnRequiredPropertyName()
Returns:
the name of the returnItem property that indicates if the item must be physically returned

setReturnStates

public void setReturnStates(ReturnStates pReturnStates)
Sets the return request states

Parameters:
pReturnStates - the returned request states

getReturnStates

public ReturnStates getReturnStates()
Returns:
the returned request states

setRmaPropertyName

public void setRmaPropertyName(java.lang.String pRmaPropertyName)
Set the name of the returnRequest property that identifies the RMA

Parameters:
pRmaPropertyName - the name of the returnRequest property that identifies the RMA

getRmaPropertyName

public java.lang.String getRmaPropertyName()
Returns:
String the name of the returnRequest property that identifies the RMA

setShippingGroupIdPropertyName

public void setShippingGroupIdPropertyName(java.lang.String pShippingGroupIdPropertyName)
Set the name of the returnItem property that identifies the shipping group that the returned item is related to

Parameters:
pShippingGroupIdPropertyName - the name of the returnItem property that identifies the shipping group that the returned item is related to

getShippingGroupIdPropertyName

public java.lang.String getShippingGroupIdPropertyName()
Returns:
String the name of the returnItem property that identifies the shipping group that the returned item is related to

setStatePropertyName

public void setStatePropertyName(java.lang.String pStatePropertyName)
Set the name of the returnRequest property that identifies the state of the request

Parameters:
pStatePropertyName - the name of the returnRequest property that identifies the state of the request

getStatePropertyName

public java.lang.String getStatePropertyName()
Returns:
String the name of the returnRequest property that identifies the state of the request

setSuggestedShippingRefundPropertyName

public void setSuggestedShippingRefundPropertyName(java.lang.String pSuggestedShippingRefundPropertyName)
Set the name of the returnRequest property that identifies the suggested shipping refund amount

Parameters:
pSuggestedShippingRefundPropertyName - the name of the returnRequest property that identifies the suggested shipping refund amount

getSuggestedShippingRefundPropertyName

public java.lang.String getSuggestedShippingRefundPropertyName()
Returns:
String the name of the returnRequest property that identifies the suggested shipping refund amount

setSuggestedTaxRefundPropertyName

public void setSuggestedTaxRefundPropertyName(java.lang.String pSuggestedTaxRefundPropertyName)
Set the name of the returnRequest property that identifies the suggested tax refund amount

Parameters:
pSuggestedTaxRefundPropertyName - the name of the returnRequest property that identifies the suggested tax refund amount

getSuggestedTaxRefundPropertyName

public java.lang.String getSuggestedTaxRefundPropertyName()
Returns:
String the name of the returnRequest property that identifies the suggested tax refund amount

setUpdateInventoryPropertyName

public void setUpdateInventoryPropertyName(java.lang.String pUpdateInventoryPropertyName)
Set the name of the returnItemDisposition property that indicates whether the the inventory should be updated when the item is received

Parameters:
pUpdateInventoryPropertyName - the name of the returnItemDisposition property that indicates whether the the inventory should be updated when the item is received

getUpdateInventoryPropertyName

public java.lang.String getUpdateInventoryPropertyName()
Returns:
String the name returnItemDisposition property that indicates whether the the inventory should be updated when the item is received

getQuantityAdjustedPropertyName

public java.lang.String getQuantityAdjustedPropertyName()
Property name on the item cost adjustment item that contains the quantity adjusted value


setQuantityAdjustedPropertyName

public void setQuantityAdjustedPropertyName(java.lang.String pQuantityAdjustedPropertyName)

getAmountAdjustmentPropertyName

public java.lang.String getAmountAdjustmentPropertyName()
Property name on the item cost adjustment item that contains the amount adjustment value


setAmountAdjustmentPropertyName

public void setAmountAdjustmentPropertyName(java.lang.String pAmountAdjustmentPropertyName)

getOrderDiscountShareAdjustmentPropertyName

public java.lang.String getOrderDiscountShareAdjustmentPropertyName()
Property name on the item cost adjustment item that contains the order discount share adjustment value


setOrderDiscountShareAdjustmentPropertyName

public void setOrderDiscountShareAdjustmentPropertyName(java.lang.String pOrderDiscountShareAdjustmentPropertyName)

getManualAdjustmentShareAdjustmentPropertyName

public java.lang.String getManualAdjustmentShareAdjustmentPropertyName()
Property name on the item cost adjustment item that contains the manual adjustment share adjustment value


setManualAdjustmentShareAdjustmentPropertyName

public void setManualAdjustmentShareAdjustmentPropertyName(java.lang.String pManualAdjustmentShareAdjustmentPropertyName)

getTaxShareAdjustmentPropertyName

public java.lang.String getTaxShareAdjustmentPropertyName()
Property name on the item cost adjustment item that contains the tax share adjustment value


setTaxShareAdjustmentPropertyName

public void setTaxShareAdjustmentPropertyName(java.lang.String pTaxShareAdjustmentPropertyName)

getShippingShareAdjustmentPropertyName

public java.lang.String getShippingShareAdjustmentPropertyName()
Property name on the item cost adjustment item that contains the shipping share adjustment value


setShippingShareAdjustmentPropertyName

public void setShippingShareAdjustmentPropertyName(java.lang.String pShippingShareAdjustmentPropertyName)

setClaimableManager

public void setClaimableManager(ClaimableManager pClaimableManager)
Sets the Claimable manager

Parameters:
pClaimableManager - the claimable manager

getClaimableManager

public ClaimableManager getClaimableManager()
Returns:
the Claimable manager

getReturnRequestClass

public java.lang.Class<ReturnRequest> getReturnRequestClass()
Returns the returnRequestClass

Returns:
the returnRequestClass

setReturnRequestClass

public void setReturnRequestClass(java.lang.Class<ReturnRequest> pReturnRequestClass)
Sets the returnRequestClass

Parameters:
pReturnRequestClass - the returnRequestClass to set

getReturnShippingTypeClassMap

public java.util.Properties getReturnShippingTypeClassMap()
Returns the returnShippingTypeClassMap

Returns:
the returnShippingTypeClassMap

setReturnShippingTypeClassMap

public void setReturnShippingTypeClassMap(java.util.Properties pReturnShippingTypeClassMap)
Sets the returnShippingTypeClassMap

Parameters:
pReturnShippingTypeClassMap - the returnShippingTypeClassMap to set

getRefundMethodTypeClassMap

public java.util.Properties getRefundMethodTypeClassMap()
Returns the refundMethodTypeClassMap

Returns:
the refundMethodTypeClassMap

setRefundMethodTypeClassMap

public void setRefundMethodTypeClassMap(java.util.Properties pRefundMethodTypeClassMap)
Sets the refundMethodTypeClassMap

Parameters:
pRefundMethodTypeClassMap - the refundMethodTypeClassMap to set

getReturnItemTypeClassMap

public java.util.Properties getReturnItemTypeClassMap()
Returns the returnItemTypeClassMap

Returns:
the returnItemTypeClassMap

setReturnItemTypeClassMap

public void setReturnItemTypeClassMap(java.util.Properties pReturnItemTypeClassMap)
Sets the returnItemTypeClassMap

Parameters:
pReturnItemTypeClassMap - the returnItemTypeClassMap to set

getBeanNameToItemDescriptorMap

public java.util.Properties getBeanNameToItemDescriptorMap()
Returns the beanNameToItemDescriptorMap


setBeanNameToItemDescriptorMap

public void setBeanNameToItemDescriptorMap(java.util.Properties pBeanNameToItemDescriptorMap)
Sets the beanNameToItemDescriptorMap


getMappedItemDescriptorName

public java.lang.String getMappedItemDescriptorName(java.lang.String pBeanName)
Returns the repository item name mapped to the bean name. If there is no name mapped then the value supplied in pBeanName is returned because that is assumed to be the repository item name also.

Parameters:
pBeanName - the bean name
Returns:
the repository item name

addRefundMethodsToReturnRequest

protected void addRefundMethodsToReturnRequest(java.util.Set pRefundMethods,
                                               RepositoryItem pReturnRequest)
Adds a set of refund methods to the return request

Parameters:
pRefundMethods - a set of refund method ids
pReturnRequest - the returnRequest repository item

addReturnItemsToReturnRequest

protected void addReturnItemsToReturnRequest(java.util.Set pReturnItems,
                                             RepositoryItem pReturnRequest)
Adds a set of return items to the return request

Parameters:
pReturnItems - a Set of return items
pReturnRequest - the returnRequest repository item

createRefundMethodItem

protected RepositoryItem createRefundMethodItem(RefundMethod pRefundMethod)
                                         throws RepositoryException
Creates a refundMethod repository item, populates its properties, and adds it to the repository

Parameters:
pRefundMethod - the refund method
Returns:
RepositoryItem the created repository item
Throws:
RepositoryException
See Also:
getMappedItemDescriptorName(String), RefundMethod.saveRefundMethod(MutableRepositoryItem)

createReturnComment

public RepositoryItem createReturnComment(java.lang.String pReturnRequestId,
                                          java.lang.String pComment,
                                          java.lang.String pAgentId)
Creates a new comment item for the given return.

Parameters:
pReturnRequestId - the return request that will own the comment
pComment - the comment data
Returns:
the comment repository item.

createReturnItemItem

protected MutableRepositoryItem createReturnItemItem(java.lang.String pRequestId,
                                                     ReturnItem pReturnItem)
                                              throws RepositoryException,
                                                     CommerceException
Create a repository item that represents an item in a return request

Parameters:
pRequestId - the id of the request that this item is related to
pReturnItem - the returned item that should be used
Returns:
the ID of the newly created repository item
Throws:
RepositoryException
CommerceException
See Also:
getMappedItemDescriptorName(String), setReturnItemProperties(ReturnItem, MutableRepositoryItem, String)

createReturnRequestItem

protected MutableRepositoryItem createReturnRequestItem(ReturnRequest pReturnRequest)
                                                 throws RepositoryException
Create a repository item that represents a return request record. In certain cases, the external OMS system may generate a authorization number. In those cases, this method expects the authorization number to be available in the ReturnRequest. If the authorization number is empty, then this method sets the return request item's repository id as authorization number.

Parameters:
pReturnRequest - the return request to use when populating the repository item
Returns:
the newly created repository item
Throws:
RepositoryException
See Also:
#getMappedItemDescriptorName(String)}, ReturnRequest.saveReturnRequest(MutableRepositoryItem)

getReasonCodes

public java.util.List getReasonCodes()
Retrieve a list of reason codes


getDispositionCodes

public java.util.List getDispositionCodes()
Retrieve a list of disposition codes


getRefundMethod

protected RefundMethod getRefundMethod(java.lang.String pRefundMethodId,
                                       Order pOrder)
                                throws RepositoryException,
                                       CommerceException
Create a RefundMethod object based on information in the repository designated by the given id

Parameters:
pRefundMethodId - the id of the refundMethod repository item
pOrder - the original order this return is based on
Returns:
the RefundMethod object that reflects the information in the repository item
Throws:
RepositoryException
CommerceException

getRefundMethod

protected RefundMethod getRefundMethod(RepositoryItem pRefundMethodItem,
                                       Order pOrder)
                                throws CommerceException
Create a RefundMethod object based on information in the given repository item

Parameters:
pRefundMethodItem - the refundMethod repository item
pOrder - the order from where this payment group originated.
Returns:
the RefundMethod object that reflects the information in the repository item
Throws:
CommerceException
See Also:
createRefundMethodInstance(String), RefundMethod.loadRefundMethod(RepositoryItem, Order)

getReturnItem

protected ReturnItem getReturnItem(java.lang.String pReturnItemId,
                                   Order pOrder)
                            throws RepositoryException,
                                   CommerceException
Create a ReturnItem object based on information in the repository designated by the given id

Parameters:
pReturnItemId - the id of the returnItem repository item
pOrder - the order the return was originally based on
Returns:
the ReturnItem object that reflects the information in the repository item
Throws:
RepositoryException
CommerceException

getReturnItem

protected ReturnItem getReturnItem(RepositoryItem pReturnItemItem,
                                   Order pOrder)
                            throws RepositoryException,
                                   CommerceException
Create a ReturnItem object based on information in the given repository item

Parameters:
pReturnItemItem - the returnItem repository item
pOrder - the order the return was originally based on
Returns:
the ReturnItem object that reflects the information in the repository item
Throws:
RepositoryException
CommerceException
See Also:
createReturnItemInstance(CommerceItem), ReturnItem.loadReturnItem(RepositoryItem)

getOrderIdFromPaymentGroup

protected java.lang.String getOrderIdFromPaymentGroup(PaymentGroup pPaymentGroup)
Returns the order id associated with the given payment group

Parameters:
pPaymentGroup -

getOrderIdFromPaymentGroupItem

protected java.lang.String getOrderIdFromPaymentGroupItem(RepositoryItem pPaymentGroupItem)
Returns the order id associated with the given payment group

Parameters:
pPaymentGroup -

getReturnRequest

public ReturnRequest getReturnRequest(java.lang.String pReturnRequestId)
                               throws RepositoryException,
                                      CommerceException
Create a ReturnRequest object based on information in the repository designated by the given id.

Parameters:
pReturnRequestId - the id of the returnRequest repository item
Returns:
the ReturnRequest object that reflects the information in the repository item
Throws:
RepositoryException
CommerceException
See Also:
createReturnRequestInstance(Order), ReturnRequest.loadReturnRequest(RepositoryItem)

loadReturnRequest

protected ReturnRequest loadReturnRequest(RepositoryItem pReturnRequestItem)
                                   throws ReturnException
Creates and loads a ReturnRequest object for the given return request repository item

Parameters:
pReturnRequestItem -
Returns:
ReturnRequest
Throws:
RepositoryException
CommerceException
ReturnException

loadRefundMethodsList

protected void loadRefundMethodsList(ReturnRequest pReturnRequest,
                                     RepositoryItem pReturnRequestItem)
                              throws RepositoryException,
                                     CommerceException
Loads the refund methods from the given returnrequest item into the given ReturnRequest object.

Parameters:
pReturnRequest -
pReturnRequestItem -
Throws:
RepositoryException
CommerceException

getPaymentGroupIdFromRefundMethod

protected java.lang.String getPaymentGroupIdFromRefundMethod(RepositoryItem pRefundMethod)
Returns the payment group id from the given refundMethod item

Parameters:
pRefundMethod -
Returns:
the refund method's payment group id

retrieveDisposition

protected RepositoryItem retrieveDisposition(java.lang.String pDisposition)
                                      throws RepositoryException
Load an item disposition from the repository

Parameters:
pDisposition - the disposition code
Returns:
the item disposition
Throws:
RepositoryException
ReturnException

retrieveRefundMethod

protected MutableRepositoryItem retrieveRefundMethod(java.lang.String pRefundMethodId)
                                              throws RepositoryException
Load an updateable refund method from the repository

Parameters:
pRefundMethodId - the id of the returned item
Returns:
the refund method
Throws:
RepositoryException
ReturnException

retrieveReturnItem

protected MutableRepositoryItem retrieveReturnItem(java.lang.String pReturnItemId)
                                            throws RepositoryException
Load an updateable returned item from the repository

Parameters:
pReturnItemId - the id of the returned item
Returns:
the returned item
Throws:
RepositoryException
ReturnException

retrieveReturnRequest

protected MutableRepositoryItem retrieveReturnRequest(java.lang.String pRequestId)
                                               throws RepositoryException
Load an updateable return request from the repository

Parameters:
pRequestId - the id of the return request
Returns:
the return request
Throws:
RepositoryException
ReturnException

updateReturnRequestState

protected void updateReturnRequestState(ReturnRequest pReturnRequest)
                                 throws RepositoryException
This method updates the return request state in the repository.

Throws:
RepositoryException

updateReturnItemState

protected void updateReturnItemState(ReturnItem pReturnItem)
                              throws RepositoryException
Updates the ReturnItem state in the repository.

Parameters:
pReturnItem -
Throws:
RepositoryException

setReturnItemProperties

protected void setReturnItemProperties(ReturnItem pReturnItem,
                                       MutableRepositoryItem pReturnItemItem,
                                       java.lang.String pRequestId)
                                throws RepositoryException
Sets the properties in a returnItem repository item based on the given ReturnItem object

Parameters:
pReturnItem - the ReturnItem object
pReturnItemItem - the returnItem repository item
Throws:
RepositoryException
See Also:
ReturnItem.saveReturnItem(MutableRepositoryItem)

shouldUpdateInventory

protected boolean shouldUpdateInventory(ReturnItem pReturnItem)
                                 throws RepositoryException
Indicates if the inventory of the return item should be updated upon receipt

Parameters:
pReturnItem - the returnItem
Throws:
RepositoryException

stateToString

protected java.lang.String stateToString(ObjectStates pObjectStates,
                                         java.lang.String pStateString)
Convert a state string

Parameters:
pObjectStates - the object states object to use
pStateString - the state string to convert
Returns:
the converted state string

updateItem

protected void updateItem(MutableRepositoryItem pRepositoryItem)
                   throws RepositoryException
Update the repository item

Parameters:
pRepositoryItem - the repository item
Throws:
RepositoryException

getReturnRequestsByOrderId

public java.util.List getReturnRequestsByOrderId(java.lang.String pOrderId)
                                          throws ReturnException
Throws:
ReturnException

getReturnRequestsByReplacementOrderId

public java.util.List getReturnRequestsByReplacementOrderId(java.lang.String pReplacementOrderId)
                                                     throws ReturnException
This method gets all return requests for a given replacement order.

Parameters:
pReplacementOrderId -
Returns:
List
Throws:
ReturnException

associateAgentAndReturnRequest

public boolean associateAgentAndReturnRequest(ReturnRequest pReturnRequest,
                                              java.lang.String pAgentId)
                                       throws RepositoryException
Associates the given agent id to the ReturnRequest.

This method updates the agentId property of the return request.

Parameters:
pReturnRequest - -- The return request that need to be associated with an agent.
pAgentId - -- The agent id to associate.
Returns:
true if successfully associated
Throws:
RepositoryException

associateAgentAndReturnRequest

public boolean associateAgentAndReturnRequest(ReturnRequest pReturnRequest)
                                       throws RepositoryException
Deprecated. 

Throws:
RepositoryException
See Also:
associateAgentAndReturnRequest(ReturnRequest, String)

generateItemToReturnQuantityMap

public java.util.Map generateItemToReturnQuantityMap(java.util.Collection pReturnRequestRepositoryItems)
generates a map that summarizes the quantity to return for each commerce item in the provided return requests

Parameters:
pReturnRequestRepositoryItems -
Returns:
Map

generateSortedRelatedReturnRequests

public java.lang.Object[] generateSortedRelatedReturnRequests(java.lang.String pOrderId)
Returns all return requests related to the given order id sorted by creation date.

All return requests are part of a tree that originates with a single order (e.g. the original order that was submitted) and continues up through the orderId or replacementOrderId properties.

                |-> Exchange Order -> Exchange Order -> Return
 Original Order |-> Exchange Order -> Return
                |-> Return
 

This API returns all return requests in the tree based on any order created within the tree

Parameters:
pOrderId - any order within the tree
See Also:
findAllRelatedReturnRequests(String)

findAllRelatedReturnRequests

public java.util.List findAllRelatedReturnRequests(java.lang.String pOrderId)
returns a list of all return requests related to the given order id.

Parameters:
pOrderId -
Returns:

createReturnRequestSearchQuery

protected Query createReturnRequestSearchQuery(QueryBuilder pQueryBuilder,
                                               java.lang.String pOrderId)
                                        throws RepositoryException
Creates a query to find all return requests where the order is either the original order or the exchange order.

Parameters:
pQueryBuilder -
pOrderId -
pExcludedReturnRequests -
Returns:
Throws:
RepositoryException

findReturnRequestsByExchangeOrder

public RepositoryItem[] findReturnRequestsByExchangeOrder(java.lang.String pOrderId)
                                                   throws RepositoryException
Finds all return requests that reference this given order as the replacement order

Parameters:
pOrderId -
Returns:
return request repository items
Throws:
RepositoryException

findReturnRequestsByBalancingPaymentGroupId

public RepositoryItem[] findReturnRequestsByBalancingPaymentGroupId(java.lang.String pBalancingPaymentGroupId)
                                                             throws RepositoryException
Finds all return requests that reference the given balancing payment group id

Parameters:
pBalancingPaymentGroupId -
Returns:
Throws:
RepositoryException

removeUnallocatedRefundMethods

public void removeUnallocatedRefundMethods(ReturnRequest pReturnRequest)
Removes the refund methods that have an allocated amount of 0.

Parameters:
pReturnRequest -

createExcludedReturnRequests

protected Query createExcludedReturnRequests(QueryBuilder pQueryBuilder,
                                             java.util.Collection pExcludedReturnRequests)
                                      throws RepositoryException
Creates a query the excludes all return requests in the collection

Parameters:
pQueryBuilder - the query builder to use
pExcludedReturnRequests - the return requests to exclude
Returns:
the NotQuery for all excluded return requests. returns null if collection is null or empty
Throws:
RepositoryException

createPipelineExtraParameterMap

protected java.util.Map createPipelineExtraParameterMap(ReturnRequest pReturnRequest)
Creates the extra parameter map that's passed to pipeline execution used to create the working orders.


repriceWorkingOrder

public void repriceWorkingOrder(ReturnRequest pReturnRequest,
                                Order pWorkingOrder,
                                java.util.Locale pLocale,
                                RepositoryItem pCustomerProfile,
                                java.util.Map pExtraParameters)
                         throws ReturnException
This method should be used to price the working orders: return adjusted, return calculation and promotion evaluation. It establishes the consistent pricing context by providing the original order promotions, the necessary extra params and setting the correct site context.

The promotions used are extracted fromt the Originating order in the ret

Extra parameters include the ReturnRequest's list of ItemPriceSource objects and the global price lists. Note that because an ItemPriceSource is provided for all the items in the order, the price list context isn't really relevant to the working orders. The items will end up with their original prices and price list designations since the ItemPriceSource provides that info.

The site context is determined from the originating order's site property. This is necessary to maintain a consistent application of the original promotions, which may be site specific. The originating site can be different from the current global site context since the agent can browse to a different site within the same group during an exchange. This method calls PricingTools.priceOrderTotal using the item and order promotions contained in the given ReturnRequest

Parameters:
pReturnRequest - the return request
pWorkingOrder - one of the working orders: Return Adjusted, Return Calculation and Promotion Evaluation.
pLocale -
pCustomerProfile -
pExtraParameters -
Throws:
ReturnException
See Also:
addWorkingOrderPricingParams(Map, ReturnRequest)

addWorkingOrderPricingParams

public java.util.Map addWorkingOrderPricingParams(java.util.Map pExtraParameterMap,
                                                  ReturnRequest pReturnRequest)
Deprecated. in favor of addWorkingOrderPricingParams(ReturnRequest, Order, Map)

Adds the extra parameters necessary for pricing the working orders used to calculator the refund amounts.

Parameters:
pExtraParameterMap -
pReturnRequest -
Returns:
the parameter map with the additional parameters added.
See Also:
CSRAgentTools#addPriceListParameter(Map), CSRAgentTools#addItemPriceSourceParameter(Map, List), CSRAgentTools#addBypassPromotionVetoersParameter(Map), CSRAgentTools#addDisableAutoGWPParameter(Map);

addWorkingOrderPricingParams

public java.util.Map addWorkingOrderPricingParams(ReturnRequest pReturnRequest,
                                                  Order pWorkingOrder,
                                                  java.util.Map pExtraParameterMap)
Adss the extra paramters necessary for pricing the given working order.

Parameters:
pReturnRequest -
pWorkingOrder -
pExtraParameterMap -
Returns:
the parameter map with the additional parameters added.

repriceCurrentExchangeOrder

protected void repriceCurrentExchangeOrder(ReturnRequest pReturnRequest)
                                    throws ReturnException
Reprices the current exchange order.

Parameters:
pReturnRequest -
Throws:
ReturnException

removeZeroQuantityItems

protected void removeZeroQuantityItems(Order pOrder)
                                throws CommerceException
Removes all items from the order with a quantity of 0.

Parameters:
pOrder - the order for which to remove the items
Throws:
CommerceException

removeEmptyShippingGroups

protected void removeEmptyShippingGroups(Order pOrder)
                                  throws CommerceException
Util method that removes all shipping groups in the order that have no CommerceItemRelationships

Parameters:
pOrder - the order from which the shipping groups will be removed
Throws:
CommerceException

removeZeroQuantityRelationships

protected void removeZeroQuantityRelationships(Order pOrder)
                                        throws CommerceException
Removes all ShippingGroupCommerceItemRelationships that have a quantity of 0.

Parameters:
pOrder - the order for which to remove the relationships
Throws:
CommerceException

findOriginalItemForRAOItem

protected java.lang.String findOriginalItemForRAOItem(ReturnRequest pReturnRequest,
                                                      java.lang.String pRAOItemId)
Returns the original commerce item that corresponds with the given RAO Item.

Parameters:
pReturnRequest -
pRAOItemId -
Returns:
the original commerce id that corresponds to the given RAO item id.
See Also:
ReturnRequest.getRAOToReplacementItemMap(), ReturnRequest.getRAOToOriginatingItemMap()

findRCOItemForPEOItem

protected java.lang.String findRCOItemForPEOItem(ReturnRequest pReturnRequest,
                                                 java.lang.String pPEOItemId)
Finds the item in the RCO that corresponds to the given PEO item.

Parameters:
pReturnRequest -
pPEOItemId -
Returns:
RCO item id that corresponds to the given PEO Item id

findOriginalItemForRCOItem

protected java.lang.String findOriginalItemForRCOItem(ReturnRequest pReturnRequest,
                                                      java.lang.String pRCOItemId)
Returns the original commerce item that corresponds with the given RCO item.

Parameters:
pReturnRequest -
pRCOItemId - item id in the RCO
Returns:
the original commerce id that corresponds to the given rco item id.

findOriginalItemForPEOItem

protected java.lang.String findOriginalItemForPEOItem(ReturnRequest pReturnRequest,
                                                      java.lang.String pPEOItemId)
Returns the original commerce item corresponds with the gigve PEO item.

Parameters:
pReturnRequest -
pPEOItemId - item id in the PEO
Returns:
the original commerce id that corresponds to the given PEO item id.

findOriginalShippingGrouporPEOShippingGroup

protected java.lang.String findOriginalShippingGrouporPEOShippingGroup(ReturnRequest pReturnRequest,
                                                                       java.lang.String pPEOShippingGroupId)
Returns the original shipping group corresponds with an shipping group in the PEO.

Parameters:
pReturnRequest -
pPEOShippingGroupId - item id in the PEO
Returns:
the original shipping group id that corresponds to the given PEO shipping group id.

findRCOShippingGroupForPEOShippingGroup

protected java.lang.String findRCOShippingGroupForPEOShippingGroup(ReturnRequest pReturnRequest,
                                                                   java.lang.String pPEOShippingGroupId)
Finds the corresponding shipping group in the RCO for the given PEO shipping group.

Parameters:
pReturnRequest -
pPEOShippingGroupId -
Returns:
RCO shipping group id that corresponds to the given PEO shipping group id

findOriginalShippingGroupForRCOShippingGroup

protected java.lang.String findOriginalShippingGroupForRCOShippingGroup(ReturnRequest pReturnRequest,
                                                                        java.lang.String pRCOShippingGroup)
Returns the original shipping group corresponds with an shipping group in the RCO.

Parameters:
pReturnRequest -
pRCOShippingGroup - shipping group id in the RCO
Returns:
the original shipping group id that corresponds to the given rco shipping group id.

findRAOShippingGroupForRCOShippingGroup

protected java.lang.String findRAOShippingGroupForRCOShippingGroup(ReturnRequest pReturnRequest,
                                                                   java.lang.String pRCOShippingGroupId)
Returns the id of the corresponding shipping group in the RAO for the given RCO shipping group id

Parameters:
pReturnRequest -
pRCOShippingGroupId - the RCO shipping group for which to get the corresponding rao shipping group id.
Returns:
the rao shipping group id that corresponds to the given rco shipping group id

findOriginalItemForWorkingItem

protected java.lang.String findOriginalItemForWorkingItem(ReturnRequest pReturnRequest,
                                                          java.lang.String pWorkingItemId)
Returns the original item id for the given working item. The working item can be from any one of the working orders.

Parameters:
pReturnRequest -
pWorkingItemId -
Returns:

findOriginalShippingGroupForPEOShippingGroup

protected java.lang.String findOriginalShippingGroupForPEOShippingGroup(ReturnRequest pReturnRequest,
                                                                        java.lang.String pPEOShippingGroupId)
Returns the original commerce shipping group corresponds with an shipping group in the PEO.

Parameters:
pReturnRequest -
pPEOShippingGroupId - shipping group id in the PEO
Returns:
the original shipping group id that corresponds to the given working shipping group id.

findOriginalShippingGroupForWorkingShippingGroup

protected java.lang.String findOriginalShippingGroupForWorkingShippingGroup(ReturnRequest pReturnRequest,
                                                                            java.lang.String pWorkingShippingGroupId)
Returns the original shipping group id for the given working shipping group. The working shipping group can be from any one of the working orders.

Parameters:
pReturnRequest -
pWorkingShippingGroupId -
Returns:
the original shipping group that corresponds to the given workinng shipping group

findOriginalShippingGroupForRAOShippingGroup

protected java.lang.String findOriginalShippingGroupForRAOShippingGroup(ReturnRequest pReturnRequest,
                                                                        java.lang.String pRAOShippingGroupId)
Returns the original shipping group that corresponds with a shipping group in the RAO

Parameters:
pReturnRequest -
pRAOShippingGroupId -
Returns:
the the original shipping group that corresponds with a shipping group in the RAO
See Also:
ReturnRequest.getRAOToReplacementShippingGroupMap(), ReturnRequest.getRAOToOriginatingShippingGroupMap()

findRCOItemForOriginalItem

protected java.lang.String findRCOItemForOriginalItem(ReturnRequest pReturnRequest,
                                                      java.lang.String pOriginalItemId)
Returns the id of the item in the RCO that corresponds to the given original item.

Parameters:
pReturnRequest -
pOriginalItemId - the original item for which to get the corresponding rco item id.
Returns:
the rco item id

findRCOItemForRAOItem

protected java.lang.String findRCOItemForRAOItem(ReturnRequest pReturnRequest,
                                                 java.lang.String pRAOItemId)
Returns the id of the corresponding item that was originally created in the RCO for the given RAOItemId

Parameters:
pReturnRequest -
pRAOItemId - the RAO Item for which to get the corresponding rco item id.
Returns:
the rco item id

findRAOItemForRCOItem

protected java.lang.String findRAOItemForRCOItem(ReturnRequest pReturnRequest,
                                                 java.lang.String pRCOItemId)
Returns the id of the corresponding item in the RAO for the given RCO item id

Parameters:
pReturnRequest -
pRCOItemId - the RCO Item for which to get the corresponding rao item id.
Returns:
the rao item id

findRAOItemForOriginalItem

protected java.lang.String findRAOItemForOriginalItem(ReturnRequest pReturnRequest,
                                                      java.lang.String pOriginalItemId)
Returns the id of the item in the RAO that corresponds to the given original item.

Parameters:
pReturnRequest -
pOriginalItemId - the original item for which to get the corresponding rao item id.
Returns:
the RAO item id

findRCOShippingGroupForOriginalShippingGroup

protected java.lang.String findRCOShippingGroupForOriginalShippingGroup(ReturnRequest pReturnRequest,
                                                                        java.lang.String pOriginalShippingGroupId)
Returns the corresponding shipping group in the Return Calculation Order to the original shipping group.

The corresponding shipping group in the Return Adjusted Order must be determined first, which can be used to identify the corresponding shipping group in the Return Calculcation Order.

Parameters:
pReturnRequest -
pOriginalShippingGroupId - the original shipping group from submitted order
Returns:
the shipping group id in the RCO that corresponds to the give ReturnItem

findRCOShippingGroupForRAOShippingGroup

protected java.lang.String findRCOShippingGroupForRAOShippingGroup(ReturnRequest pReturnRequest,
                                                                   java.lang.String pRAOShippingGroupId)
Returns the id of the corresponding shipping group that was originally created in the RCO for the given RAOShippingGroupId

Parameters:
pReturnRequest -
pRAOItemId - the RAO shipping group for which to get the corresponding rco shipping group id.
Returns:
the rco shipping group id

findRAOShippingGroupForOriginalShippingGroup

protected java.lang.String findRAOShippingGroupForOriginalShippingGroup(ReturnRequest pReturnRequest,
                                                                        java.lang.String pOriginalShippingGroupId)
Finds the corresponding shipping group in the RAO for the original shipping group

Parameters:
pReturnRequest -
pOriginalShippingGroupId -
Returns:
corresponding shipping group in the RAO

findPEOItemForExchangeItem

protected java.lang.String findPEOItemForExchangeItem(ReturnRequest pReturnRequest,
                                                      java.lang.String pExchangeItemId)
                                               throws ReturnException
Returns the corresponding PEO item id for the given exchange item id.

Parameters:
pReturnRequest -
pExchangeItemId - the exchange item id for which the corresponding peo item id is returned.
Returns:
the corresponding peo item id.
Throws:
ReturnException

findPEOShippingGroupForExchangeShippingGroup

protected java.lang.String findPEOShippingGroupForExchangeShippingGroup(ReturnRequest pReturnRequest,
                                                                        java.lang.String pExchangeShippingGroupId)
                                                                 throws ReturnException
Returns the corresponding PEO shipping group id for the given exchange shipping group id.

Parameters:
pReturnRequest -
pExchangeShippingGroupId - the shipping group id for which the corresponding shipping group id is returned.
Returns:
the corresponding peo shipping group id.
Throws:
ReturnException

findExchangeOrderItemForPEOItem

protected java.lang.String findExchangeOrderItemForPEOItem(ReturnRequest pReturnRequest,
                                                           java.lang.String pPEOItemId)
                                                    throws ReturnException
Returns the corresponding exchange order item id for the given promotion evaluation order item id.

Using the maps orignally generated when the exchange order items were cloned for the promotion evaluation order, the associated itemid is determined.

Parameters:
pReturnRequest -
pPEOItemId - the PEO item id for which the corresponding exchange item id is found.
Returns:
the corresponding exchange order item id for the given promotion evaluation order item id.
Throws:
ReturnException

findExchangeOrderShippingGroupForPEOShippingGroup

protected java.lang.String findExchangeOrderShippingGroupForPEOShippingGroup(ReturnRequest pReturnRequest,
                                                                             java.lang.String pPEOShippingGroupId)
                                                                      throws ReturnException
Returns the corresponding exchange order shipping group id for the given promotion evaluation order shipping group id.

Parameters:
pReturnRequest -
pPEOShippingGroupId - the PEO shipping group id for which the corresponding exchange shipping group id is found.
Returns:
the corresponding exchange order shipping group id for the given promotion evaluation order shipping group id.
Throws:
ReturnException

copyItemsAndShippingGroups

protected void copyItemsAndShippingGroups(Order pOrderFrom,
                                          Order pOrderTo,
                                          java.util.Map pItemMap,
                                          java.util.Map pShippingGroupMap,
                                          java.util.Map pPropExceptions,
                                          java.util.Map pExcludedProperties)
                                   throws CommerceException
Util method that copies the items and shipping groups from one Order to the other.

Parameters:
pOrderFrom - the order containing the items and groups to copy
pOrderTo - the order to which the copied items will be added
pItemMap - a Map this process will update with entries that map the From item id to the To item id
pShippingGroupMap - a Map this process will update with entries that map the From shipping group id to the To shipping group id
pPropExceptions - Optional. Map of property exceptions passed to the repository cloning process .
pExcludedProperties - Properties to exclude from repository cloning process
Throws:
CommerceException
See Also:
RepositoryUtils.cloneItem(RepositoryItem, boolean, Map, Map, MutableRepository, String), RepositoryUtils.cloneItem

adjustExchangeItemPriceInfo

public void adjustExchangeItemPriceInfo(ReturnRequest pReturnRequest,
                                        CommerceItem pExchangeItem,
                                        ItemPriceInfo pItemPriceInfo)
                                 throws ReturnException
This method is called by a CSC item post calcualtor and will copy the information from the corresponding item in promotion evaluation order.

Parameters:
pReturnRequest - the current return request
pExchangeItem - the item from the exchange order
pItemPriceInfo - the price info of the exchange item to where peo pricing information is copied
Throws:
ReturnException
See Also:
copyPEOPricingInfo(ReturnRequest, CommerceItem, ItemPriceInfo, CommerceItem, ItemPriceInfo)

copyGWPItemMarkersFromPEO

public void copyGWPItemMarkersFromPEO(ReturnRequest pReturnRequest,
                                      CommerceItem pExchangeItem)
                               throws ReturnException
Copies the GWP Item markers from the matching item in the PEO to the given exchange item.

Parameters:
pReturnRequest -
pExchangeItem -
Throws:
ReturnException

copyPEOPricingInfo

protected void copyPEOPricingInfo(ReturnRequest pReturnRequest,
                                  CommerceItem pPEOItem,
                                  ItemPriceInfo pPEOItemPriceInfo,
                                  CommerceItem pExchangeItem,
                                  ItemPriceInfo pExchangeItemPriceInfo)
                           throws PricingException
Copies pricing info from the PEO ItemPriceInfo to the exhange ItemPriceInfo.

Currently copies the amount, listPrice, salePrice, discounted, adjustments and currentPriceDetails.

Also resets order discount share and manual adjustment shares to 0 in the exchange item price info.

Parameters:
pReturnRequest - the return request
pPEOItem - the commerce item from the PEO
pPEOItemPriceInfo - the PEO item's price info.
pExchangeItem - the commerce item form the exchange order
pExchangeItemPriceInfo - the exchange items's price info
Throws:
PricingException

getTotalOrderPromotionValue

public double getTotalOrderPromotionValue(Order pOrder,
                                          java.lang.String pOrderPromotionId)
returns the total adjustment made by an order promotion

Parameters:
pOrder - the order
pOrderPromotionId - the order promotion for which to return the total adjustment
Returns:
total adjustment made to the order

getTotalManualAdjustmentValue

public double getTotalManualAdjustmentValue(Order pOrder,
                                            java.lang.String pManualAdjustmentId)
returns the total adjustment made by an order promotion

Parameters:
pOrder - the order
pManualAdjustmentId - the order promotion for which to return the total adjustment
Returns:
total adjustment made to the order

generatePromotionValueAdjustmentMap

protected void generatePromotionValueAdjustmentMap(ReturnRequest pReturnRequest)
This method will generate the promotion value adjustment map and store it in the promotionValueAdjustments property of the ReturnRequest

It uses the pre-return promotion value map located in the preReturnPromotionValue property of the ReturnRequest and compares that to a newly generated map of promotion values.

The newly generated map is generated from either the Return Calculation Order or the Promotion Evaluation Order depending on whether a return or exchange is being done.

Parameters:
pReturnRequest -
See Also:
PromotionTools.createPromotionValueMap(Order, boolean, boolean, boolean, boolean)

getPromotionsLost

public java.util.Collection getPromotionsLost(ReturnRequest pReturnRequest)
Generates a collection of promotion ids that contains all the promotions that no longer apply as a result of the return.

This method is only valid for determining the promotions lost for the active current return request.

The promotions are determined by comparing the promotion active at the start of the return to the promotions applied to the return's Return Calculation Order or Promotion Evaluation Order for exchanges.

Parameters:
pReturnRequest -
Returns:
a Collection of promotions that that no longer apply because of the items being returned.

getReturnRequestView

protected RepositoryView getReturnRequestView()
Returns:
the RepositoryView for the returnRequest item

determineOriginatingOrder

public void determineOriginatingOrder(ReturnRequest pReturnRequest)
                               throws CommerceException
Determines and sets the originatingOrder property of a return request.

To determine the originating order the sorted array of related return requests is generated and stored in the ReturnRequest's sortedRealtedReturnRequests property.

If related returns are found, it sets the originating order to the first return request's order.

If no related returns are found, this is considered the first return and the originating order is set to the same value as the order property.

Parameters:
pReturnRequest -
Throws:
CommerceException
See Also:
generateSortedRelatedReturnRequests(String)

loadRelatedReplacementOrders

public void loadRelatedReplacementOrders(ReturnRequest pReturnRequest)
                                  throws ReturnException
Loads the relatedReplacementOrders property of the ReturnRequest based on the sortedReturnRequests in the ReturnRequest.

Parameters:
pReturnRequest -
Throws:
ReturnException

determinePricelistsForReturn

public void determinePricelistsForReturn(ReturnRequest pReturnRequest)
                                  throws ReturnException
Sets the priceList and salePricelist properties of the ReturnRequest based on the price lists extracted from the originating Order referenced in the ReturnRequest.

Throws:
ReturnException

determinePromotionsForReturn

public void determinePromotionsForReturn(ReturnRequest pReturnRequest)
                                  throws ReturnException
This API will determine and set the item and order promotions to be used for the given return request.

The promotions are either extracted from the originating order of the return request when it's the first return, or from the last return request obtained from the sortedReturnRequest property of the ReturnRequest.

Parameters:
pReturnRequest -
Throws:
ReturnException

saveAppliedPromotions

protected void saveAppliedPromotions(ReturnRequest pReturnRequest,
                                     MutableRepositoryItem pReturnRequestItem)
Extracts the promotions that still apply and saves their ids with the return request item. For an exchange, promotions are extracted from the the promotion evaluation order. For a return, promotions are extracted from the return calculation order.

Parameters:
pReturnRequest -
pReturnRequestItem -

loadItemCostAdjustments

protected void loadItemCostAdjustments(ReturnRequest pReturnRequest,
                                       RepositoryItem pReturnRequestItem)
                                throws RepositoryException
Loads the ItemCostAdjustments for the non-return items by creating a new ItemCostAjustment for each itemCostAdjustment repository item found on the return request item and adding it to the ReturnRequest object.

Parameters:
pReturnRequest -
pReturnRequestItem -
Throws:
RepositoryException
See Also:
createItemCostAdjustmentFromItem(RepositoryItem), ReturnRequest.addNonReturnItemCostAdjustment(ItemCostAdjustment)

setBasePropertiesOfItemCostAdjustment

protected void setBasePropertiesOfItemCostAdjustment(ItemCostAdjustment pItemCostAdjustment,
                                                     RepositoryItem pItemCostAdjustmentItem)
This method is used when reconstituting the ItemCostAdjustmments of the ReturnRequest from the repository.

Values of the given ItemCostAdjustment are set from the given item cost adjustment repository item

Parameters:
pItemCostAdjustment -
pItemCostAdjustmentItem -

createItemCostAdjustmentFromItem

protected ItemCostAdjustment createItemCostAdjustmentFromItem(RepositoryItem pItemCostAdjustmentItem)
                                                       throws RepositoryException
This method generates and new ItemCostAdjustment object from the given itemCostAdjustment repository item.

Parameters:
pItemCostAdjustmentItem -
Returns:
a new ItemCostAdjustment object
Throws:
RepositoryException
See Also:
createItemCostAdjustment(RepositoryItem), setBasePropertiesOfItemCostAdjustment(ItemCostAdjustment, RepositoryItem)

createItemCostAdjustment

protected ItemCostAdjustment createItemCostAdjustment(RepositoryItem pItemCostAdjustmentItem)
                                               throws RepositoryException
This method is used when reconstituting the ItemCostAdjustmments of the ReturnRequest from the repository. It is used to instantiate a new ItemCostAdjustment for the given item cost adjustment repository item

Parameters:
pItemCostAdjustmentItem -
Returns:
a new ItemCostAdjustment
Throws:
RepositoryException

saveItemCostAdjustments

protected void saveItemCostAdjustments(ReturnRequest pReturnRequest,
                                       MutableRepositoryItem pReturnRequestItem)
                                throws RepositoryException
The method is called when saving the ItemCostAdjustments of the ReturnRequest to the repository.

This implemention saves the non-return item cost adjustments only.

Parameters:
pReturnRequest -
pReturnRequestItem -
Throws:
RepositoryException
See Also:
createItemCostAdjustmentItem(ItemCostAdjustment)

createItemCostAdjustmentItem

protected MutableRepositoryItem createItemCostAdjustmentItem(ItemCostAdjustment pItemCostAdjustment)
                                                      throws RepositoryException
The method is called when saving the ItemCostAdjustments of the ReturnRequest to the repository. It generates a new item cost adjustment repository item from on the given ItemCostAdjusment

Parameters:
pItemCostAdjustment -
Returns:
a mutable itemCostAdjustment repository item that represents the content of the given ItemCostAdjustment object
Throws:
RepositoryException
See Also:
createItemCostAdjustmentRepositoryItem(ItemCostAdjustment), setBasePropertiesOfRepositoryItem(ItemCostAdjustment, MutableRepositoryItem)

createItemCostAdjustmentRepositoryItem

protected MutableRepositoryItem createItemCostAdjustmentRepositoryItem(ItemCostAdjustment pItemCostAdjustment)
                                                                throws RepositoryException
The method is called when saving the ItemCostAdjustments of the ReturnRequest to the repository. It instantiates a new item cost adjustment repository item based on the given ItemCostAdjusment

Parameters:
pItemCostAdjustment -
Returns:
Throws:
RepositoryException

setBasePropertiesOfRepositoryItem

protected void setBasePropertiesOfRepositoryItem(ItemCostAdjustment pItemCostAdjustment,
                                                 MutableRepositoryItem pItemCostAdjustmentItem)
This method will set the properties of the given repository item based on the content of the given ItemCostAdjustment object.

Parameters:
pItemCostAdjustment -
pItemCostAdjustmentItem -

loadAppliedPromotions

protected void loadAppliedPromotions(ReturnRequest pReturnRequest,
                                     RepositoryItem pReturnRequestItem)
                              throws ReturnException
Loads the itemPromotions and orderPromotionsproperties of the ReturnRequest from the corresponding properties in the return request item.

Parameters:
pReturnRequest -
pReturnRequestItem -
Throws:
ReturnException

savePromotionValueAdjustments

protected void savePromotionValueAdjustments(ReturnRequest pReturnRequest,
                                             MutableRepositoryItem pReturnRequestItem)
Transfers the map in the ReturnRequest to the promotionValueAdjustments property of the return request repository item.

Parameters:
pReturnRequest -
pReturnRequestItem -

loadPromotionValueAdjustments

protected void loadPromotionValueAdjustments(ReturnRequest pReturnRequest,
                                             RepositoryItem pReturnRequestItem)
Loads the promotion value adjustment map on the return request repository item into the ReturnRequest's promotionValueAdjustments property

Parameters:
pReturnRequest -
pReturnRequestItem -

calculateAmountDetailShareForRange

protected double calculateAmountDetailShareForRange(DetailedItemPriceInfo pDetailedItemPriceInfo,
                                                    atg.core.util.Range pRange)
Calculates the share of the detail's amount for the given range.

Parameters:
pDetailedItemPriceInfo - the detail for which the share value of the range is determined.
pRange - range for which to calculate the share. this range must be within the range covered by the detail's range.
Returns:
the share of the detail's amount value for the given range
See Also:
calculateShareForRange(DetailedItemPriceInfo, Range, double)

calculateShareForRange

protected double calculateShareForRange(DetailedItemPriceInfo pDetailedItemPriceInfo,
                                        atg.core.util.Range pRange,
                                        double pAmount)
Calculates the share of the given amount for the given range within the given detail.

If the range includes the last unit within the detail's range, any remaining amount is rolled into the share. For example, if the range covers a quantity of 3 and the amount is 10, the .01 will be included in the share value of the last unit.

Parameters:
pDetailedItemPriceInfo - the detail price info that contains the given range.
pRange - range for which to calculate the share. this range must be within the range covered by the detail's range.
pAmount - the amount for which the share is determined.
Returns:
the share of the amount for the given range.

sumDetails

protected double sumDetails(CommerceItem pCommerceItem,
                            atg.core.util.Range pRange,
                            java.lang.String pDetailPropertyName)
Iterates over the DetailedItemPriceInfos for the item and returns the total value of the given property.

Parameters:
pCommerceItem - the commerce item
pShippingGroupId - optional. used to limit the number of details used to those in the item's relationship range. if not null and the relationship cannot be found, 0.0 is returned
pDetailAmountProperty -
Returns:
total value of the given property across the item details

addExchangeOrderPricingParameters

public java.util.Map addExchangeOrderPricingParameters(java.util.Map pExtraParameterMap,
                                                       ReturnRequest pReturnRequest)
Adds the extra parameters for pricing the exchange order.

Adds the current ReturnRequest and the the ReturnRequest's ItemPriceSource objects to the parameter map.

Adds the param to bypass the Promotion vetoers during pricing.

Parameters:
pExtraParameterMap -
pReturnRequest - the current return request
See Also:
addReturnRequestParameter(Map, ReturnRequest), CSRAgentTools#addBypassPromotionVetoersParameter(Map), CSRAgentTools#addItemPriceSourceParameter(Map, List)

addReturnRequestPricelistParameters

public java.util.Map addReturnRequestPricelistParameters(java.util.Map pExtraParameters,
                                                         ReturnRequest pReturnRequest)
Adds the ReturnRequest's price lists to the given parameter map.

Parameters:
pExtraParameters -
pReturnRequest -
Returns:
the parameter map with the price list entries added.

addDisableReturnTotalValidationParameter

public java.util.Map addDisableReturnTotalValidationParameter(java.util.Map pExtraParameters)
Adds the parameter to disable the refund total validation processor.

Parameters:
pExtraParameters -
Returns:
the parameter map with the price list entries added.

addDisableGWPProcessParameter

public java.util.Map addDisableGWPProcessParameter(java.util.Map pExtraParameters)
Adds the extra parameter that disables the processing of GWPInfo objects at the end of pricing.

Parameters:
pExtraParameters -
Returns:
the parameter map with the param added
See Also:
atg.commerce.pricing.Constants.DISABLE_PROCESS_GWPINFOS

addReturnRequestParameter

public java.util.Map addReturnRequestParameter(java.util.Map pExtraParameters,
                                               ReturnRequest pReturnRequest)
Adds the current ReturnRequest to the parameter map

Parameters:
pExtraParameterMap - the parameter map to add to.
pReturnRequest - the return request to pass in the params
Returns:
the extra parameter map with the new parameter added

findAdjustmentsForItem

protected java.util.Collection findAdjustmentsForItem(java.util.Collection pAdjustments,
                                                      java.lang.String pCommerceItemId,
                                                      java.lang.String pShippingGroupId)
Returns the adjustments that match by commerce item id and shipping group id

Parameters:
pAdjustments - collection of adjustments
pCommerceItemId - the commerce item id
pShippingGroupId - optional. the shipping group id. if null, all adjustments for the commerce item will be included
Returns:
the collection of adjustments that match the commerce item and shipping group

getAllRelatedReplacementOrders

protected java.util.List getAllRelatedReplacementOrders(ReturnRequest pReturnRequest)
                                                 throws ReturnException
Builds a list of all replacement orders related to the current return request.

Parameters:
pReturnRequest -
Returns:
List of related replacement orders.
Throws:
ReturnException

createItemCostAdjustment

protected ItemCostAdjustment createItemCostAdjustment()
Creates a new ItemCostAdjustment object. This method is called by CSC subroutines to create new objects of this type.

Extend this method to extend the ItemCostAdjustment object

Returns:
a new ItemCostAdjustment
See Also:
ItemCostAdjustment

findAllAdjustmentsForNonReturnItems

protected java.util.Collection findAllAdjustmentsForNonReturnItems(ReturnRequest pReturnRequest,
                                                                   java.util.Collection pAdjustments)
Returns all the adjustments that reference a commerce item and shipping group not being returned.

Parameters:
pReturnRequest -
pAdjustments - the adjustments from which the non-return adjusts should be returned
Returns:

getNonReturnItemTotalTaxAdjustment

protected double getNonReturnItemTotalTaxAdjustment(ReturnRequest pReturnRequest)
Returns the total tax adjustments for non-return items.

Parameters:
pReturnRequest -
Returns:
the total tax adjustments for non-return items.

getNonReturnItemTotalShippingAdjustment

protected double getNonReturnItemTotalShippingAdjustment(ReturnRequest pReturnRequest)
Returns the total shipping adjustments for non-return items.

Parameters:
pReturnRequest -
Returns:
the total tax shipping for non-return items.

findReturnItemsForItemAndGroup

protected java.util.List findReturnItemsForItemAndGroup(java.lang.String pCommerceItemId,
                                                        java.lang.String pShippingGroupId,
                                                        java.util.List pReturnItems)
Gets the ReturnItems for the given commerce item id and shipping group.

Parameters:
pCommerceItemId -
pShippingGroup -
pReturnItems -
Returns:
List of return items that reference the given item and shipping group

clearAllItemCostAdjustments

protected void clearAllItemCostAdjustments(ReturnRequest pReturnRequest)
This method clears all the ItemCostAdjustments from the ReturnRequest and ReturnItems.

Parameters:
pReturnRequest -

getAllItemCostAdjustments

protected java.util.Collection getAllItemCostAdjustments(ReturnRequest pReturnRequest)
returns all the ItemCostAdjustments for this return request.

Parameters:
pReturnRequest -
Returns:
Collection of ItemCostAdjustment objects

getTotalItemAdjustments

public double getTotalItemAdjustments(java.util.Collection pItemCostAdjustments)
Sums the amountAdjustment, orderDiscountShareAdjustment and manualDiscountShareAdjustment properties of all the refund adjustments

Parameters:
pItemCostAdjustments - the adjustments to total
Returns:
sum of the given adjustments

getTotalAdjustments

public double getTotalAdjustments(java.util.Collection pItemCostAdjustments)
Sums all adjustments

Parameters:
pItemCostAdjustments - the adjustments to total
Returns:
sum of all adjustments

getTotalAmountAdjustments

public double getTotalAmountAdjustments(java.util.Collection pItemCostAdjustments)
Sums the amountAdjustment property of all the refund adjustments

Parameters:
pItemCostAdjustments - the adjustments to total
Returns:
sum of amount adjustments

getTotalTaxAdjustments

public double getTotalTaxAdjustments(java.util.Collection pItemCostAdjustments)
Sums the taxAdjustment property of all the refund adjustments

Parameters:
pItemCostAdjustments - the adjustments to total
Returns:
sum of tax adjustment

getTotalShippingAdjustments

public double getTotalShippingAdjustments(java.util.Collection pItemCostAdjustments)
Sums the shippingAdjustment property of all the refund adjustments

Parameters:
pItemCostAdjustments - the adjustments to total
Returns:
sum of shipping adjustments

getTotalOrderDiscountAdjustments

public double getTotalOrderDiscountAdjustments(java.util.Collection pItemCostAdjustments)
Sums the orderDiscountShareAdjustment property of all the refund adjustments

Parameters:
pItemCostAdjustments - the adjustments to total
Returns:
sum of order discount share adjustments

getTotalManualAdjustmentAdjustments

public double getTotalManualAdjustmentAdjustments(java.util.Collection pItemCostAdjustments)
Sums the manualAdjustmentShareAdjustment property for all the refund adjustments

Parameters:
pItemCostAdjustments - the adjustments to total
Returns:
sum of manual adjustment share adjustments

calculateNonReturnItemSubtotalAdjustment

protected void calculateNonReturnItemSubtotalAdjustment(ReturnRequest pReturnRequest)
Sets the nonReturnItemRefundSubtotalAdjustment value of the return request.

This value is determined by totaling the amount, order discount share and manual discount share adjustments of the non-return item ItemCostAdjustments in the ReturnRequest. The sign of the final total is flipped and stored as the nonReturnItemRefundSubtotalAdjustment value in the ReturnRequest

Parameters:
pReturnRequest -

isReturnable

public boolean isReturnable(RepositoryItem pOrderItem)
This method determines whether a return or exchange can be initiated for the given order.

This API returns true if the returnable state is {@link ReturnableStates#ORDER_RETURNABLE. Otherwise it returns false.

Parameters:
pOrderItem - the order
Returns:
whether a return or exchange can be initiated against the order
See Also:
getOrderReturnableState(RepositoryItem)

isReturnable

public boolean isReturnable(Order pOrder)
Determines if an return or exchange can be initiated for the given Order.

Parameters:
pOrder -
Returns:
true if a return can be initiated on the order
See Also:
isReturnable(RepositoryItem)

isOrderPendingReturn

public boolean isOrderPendingReturn(Order pOrder)
Determines if the order is in a state that means it is waiting for items to be returned.

Parameters:
pOrder -
Returns:
true if the order is pending items being returned

isItemReturnable

public boolean isItemReturnable(CommerceItem pCommerceItem)
Determines if the given commerce item is returnable

Parameters:
pCommmerceItem -
Returns:
true if returnable
See Also:
isReturnable(RepositoryItem)

isItemReturnable

public boolean isItemReturnable(RepositoryItem pCommerceItem)
Determines if the given commerce item is returnable.

This API returns true if the returnable state is {@link ReturnableStates#ITEM_RETURNABLE. Otherwise it returns false.

Parameters:
RepositoryItem - the commerce item repository item
Returns:
true if returnable
See Also:
getItemReturnableState(RepositoryItem)

getItemReturnableState

public java.lang.String getItemReturnableState(RepositoryItem pCommerceItem)
Determines the returnable state for the given item.

An item is not returnable if it has already been completely returned or if the product or sku is flagged as non-returnable in the catalog.

Parameters:
pCommerceItem -
Returns:
true if a return can be done on the item.
See Also:
ReturnableStates

getOrderReturnableState

public java.lang.String getOrderReturnableState(RepositoryItem pOrderItem)
Determines the returnable state for the given order.

An order is not returnable if it is not completely fulfilled or if there are no items in it that can be returned.

Parameters:
pOrderItem -
Returns:
true if a return can be done on the order.
See Also:
isOrderFulfilled(RepositoryItem), isItemReturnable(RepositoryItem), ReturnableStates

createReturnRequestInstance

public ReturnRequest createReturnRequestInstance(Order pOrder)
                                          throws ReturnException
This method creates ReturnRequest instance.

This method calls ReturnRequest.ReturnRequest(Order) constructor and returns ReturnRequest instance.

Parameters:
pOrder -
Returns:
Throws:
ReturnException
See Also:
ReturnRequest#ReturnRequest(Order)}, getReturnRequestClass()

createReturnShippingGroupInstance

public ReturnShippingGroup createReturnShippingGroupInstance(ShippingGroup pShippingGroup)
                                                      throws ReturnException
This method returns ReturnShippingGroup instance.

If there is a class configured for ShippingGroup.getShippingGroupClassType() in the getReturnShippingTypeClassMap(), then that class instance is created and returned. Otherwise default configured class instance is returned.

Parameters:
pShippingGroup -
Returns:
Throws:
ReturnException
See Also:
ReturnShippingGroup.ReturnShippingGroup(ShippingGroup), getReturnShippingTypeClassMap()

createReturnItemInstance

public ReturnItem createReturnItemInstance(CommerceItem pCommerceItem)
                                    throws ReturnException
This method returns ReturnItem instance.

If there is a class configured for CommerceItem.getCommerceItemClassType() in the getReturnItemTypeClassMap(), then that class instance is created and returned. Otherwise default configured class instance is returned.

Parameters:
pCommerceItem -
Returns:
Throws:
ReturnException
See Also:
getReturnItemTypeClassMap(), ReturnItem.ReturnItem(CommerceItem)

createRefundMethodInstance

public RefundMethod createRefundMethodInstance(java.lang.String pType)
                                        throws ReturnException
This method returns RefundMethod instance.

If there is a class configured for pType in the getRefundMethodTypeClassMap(), then that class instance is created and returned.

Parameters:
pType -
Returns:
Throws:
ReturnException
See Also:
RefundMethod.RefundMethod(String), getRefundMethodTypeClassMap()

getReturnShippingGroups

public java.util.Collection<ReturnShippingGroup> getReturnShippingGroups(Order pOrder)
                                                                  throws ReturnException
Return all ReturnShippingGroup in the order

Iterates through all shipping groups in the order and creates ReturnShippingGroup instances and returns them.

Parameters:
pOrder -
Throws:
ReturnException

getReturnItems

public java.util.List<ReturnItem> getReturnItems(ShippingGroup pShippingGroup)
                                          throws ReturnException
Return all ReturnItem in the pShippingGroup

Iterates through all commerce items in the shipping group and creates ReturnItem instances and returns them.

Parameters:
pShippingGroup -
Throws:
ReturnException

getReturnTools

public static ReturnTools getReturnTools()
Returns the ReturnTools component. if the mReturnTools is null, then the ReturnTools is resolved using Nucleus#getGlobalNucleus()#resolveName(String) and the mReturnTools variable is set.

Returns:
ReturnTools return the resolved ReturnTools component.

isOrderFulfilled

public boolean isOrderFulfilled(RepositoryItem pOrderItem)
Determines if an order is fulfilled based on the states defined in the fulfilledOrderStates property.

Parameters:
pOrderItem -
Returns:
true if the order is considered fulfilled.

isOrderFulfilled

public boolean isOrderFulfilled(Order pOrder)
Determines if an order is fulfilled based on the states defined in the fulfilledOrderStates property.

Parameters:
pOrderItem -
Returns:
true if the order is considered fulfilled.

isFulfilledOrderState

public boolean isFulfilledOrderState(java.lang.String pState)
Determines if the given state is one of the states defined in the fulfilledOrderStates property.

Parameters:
pState -
Returns:
true if the pState is considered a fulfilled Order state.

rollbackTransaction

public void rollbackTransaction()
This method is used to roll-back the current transaction.


findReturnRequestsForProfile

public java.util.List<ReturnRequest> findReturnRequestsForProfile(java.lang.String pProfileId,
                                                                  int pStartIndex,
                                                                  int pNumReturns,
                                                                  java.lang.String[] pStates,
                                                                  java.lang.String pSortProperty,
                                                                  boolean pAscending,
                                                                  java.util.Collection<java.lang.String> pSiteIds)
                                                           throws ReturnException
Finds all return request for the given profile.

Parameters:
pProfileId - This is the user whose returns will be returned
pStartIndex - The index into the result set of the first returned ReturnRequest, use 0 to start at the beginning
pNumOrders - The number of ReturnRequests to return, use -1 to return all of them
pStates - All returned ReturnRequests will have a state that is in this list of states. If there are no states here then results are not limited by state.
pSortProperty - The property to sort the results on, use null to not sort.
pAscending - If true, the returns will be sorted on pSortProperty in ascending order, If false, then descending order is used. If pSortProperty is null, then pAscending is ignored.
pSiteIds - The sites the returns should belong to, null for all sites
Returns:
List of ReturnRequest objects
Throws:
ReturnException

getReturnRequestCountForProfile

public int getReturnRequestCountForProfile(java.lang.String pProfileId,
                                           java.lang.String[] pStates,
                                           java.util.Collection<java.lang.String> pSiteIds)
                                    throws CommerceException
Returns the total number of return requests for the given profile

Parameters:
pProfileId - the id of the profile
pStates - Optional. Constrains the query by state
pSiteIds - Optional. Constrains the query by site
Returns:
total number of returns find
Throws:
CommerceException

getReturnRequestQueryForProfile

public Query getReturnRequestQueryForProfile(java.lang.String pProfileId,
                                             java.lang.String[] pStates,
                                             java.util.Collection<java.lang.String> pSiteIds,
                                             RepositoryView pView)
                                      throws RepositoryException
Constructs a Query to get the returns for the given profile.

Parameters:
pProfileId - the id of the profile
pStates - Optional. Constrains the query by state
pSiteIds - Optional. Constrains the query by site
pView - the RepositoryView for the return request repository item
Returns:
Query
Throws:
RepositoryException

logOrderInfo

protected java.lang.String logOrderInfo(ReturnRequest pReturnRequest,
                                        Order pOrder)
Generates a String that details the contents of the Order.

Used for logging purposes

Parameters:
pOrder -

logGWPItemMarkers

public java.lang.String logGWPItemMarkers(CommerceItem pCommerceItem)
Generates a String that details the GWP items markers on the given CommerceItem

Parameters:
pCommerceItem -

logGWPOrderMarkers

public java.lang.String logGWPOrderMarkers(Order pOrder)
Generates a String that details the GWP order markers on the given Order

Parameters:
Order -

logReturnRequest

public java.lang.String logReturnRequest(ReturnRequest pReturnRequest)
Generates a String that details the contents of the ReturnRequest.

Used for logging purposes

Parameters:
pReturnRequest -