Class OrderReturnServices


  • public class OrderReturnServices
    extends java.lang.Object
    OrderReturnServices
    • Method Summary

      All Methods Static Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      static java.util.Map<java.lang.String,​java.lang.Object> autoCancelReplacementOrders​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> checkPaymentAmountForRefund​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> checkReturnComplete​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> createPaymentApplicationsFromReturnItemResponse​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> createReturnAdjustment​(DispatchContext dctx, java.util.Map<java.lang.String,​java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> createReturnItemOrAdjustment​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> filterServiceContext​(DispatchContext dctx, java.lang.String serviceName, java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      Deprecated.
      - Use DispatchContext.makeValidContext(String, String, Map) instead
      static java.math.BigDecimal getAdjustmentAmount​(boolean isSalesTax, java.math.BigDecimal returnTotal, java.math.BigDecimal originalTotal, java.math.BigDecimal amount)
      Calculate new returnAdjustment amount and set scale and rounding mode based on returnAdjustmentType: RET_SALES_TAX_ADJ use sales.tax._ and others use order._
      static java.util.Map<java.lang.String,​java.lang.Object> getOrderAvailableReturnedTotal​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> getReturnableItems​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> getReturnableQuantity​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.math.BigDecimal getReturnAdjustmentTotal​(Delegator delegator, java.util.Map<java.lang.String,​? extends java.lang.Object> condition)
      Get the total return adjustments for a set of key -> value condition pairs.
      static java.util.Map<java.lang.String,​java.lang.Object> getReturnAmountByOrder​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.math.BigDecimal getReturnItemInitialCost​(Delegator delegator, java.lang.String returnId, java.lang.String returnItemSeqId)  
      static java.util.Map<java.lang.String,​java.lang.Object> getReturnItemInitialCost​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static void groupReturnItemsByOrder​(java.util.List<GenericValue> returnItems, java.util.Map<java.lang.String,​java.util.List<GenericValue>> returnItemsByOrderId, java.util.Map<java.lang.String,​java.math.BigDecimal> totalByOrder, Delegator delegator, java.lang.String returnId, java.lang.String returnTypeId)
      Takes a List of returnItems and returns a Map of orderId -> items and a Map of orderId -> orderTotal
      static boolean needRecalculate​(java.lang.String returnAdjustmentTypeId)
      These return adjustment types need to be recalculated when the return item is updated
      static java.util.Map<java.lang.String,​java.lang.Object> processCreditReturn​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> processRefundReturn​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> processRefundReturnForReplacement​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> processReplacementReturn​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> processSubscriptionReturn​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> refundBillingAccountPayment​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> sendReturnAcceptNotification​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> sendReturnCancelNotification​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> sendReturnCompleteNotification​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> updateReturnAdjustment​(DispatchContext dctx, java.util.Map<java.lang.String,​java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> updateReturnItemOrAdjustment​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • module

        public static final java.lang.String module
      • decimals

        public static final int decimals
      • rounding

        public static final java.math.RoundingMode rounding
      • ZERO

        public static final java.math.BigDecimal ZERO
    • Constructor Detail

      • OrderReturnServices

        public OrderReturnServices()
    • Method Detail

      • getReturnItemInitialCost

        public static java.util.Map<java.lang.String,​java.lang.Object> getReturnItemInitialCost​(DispatchContext dctx,
                                                                                                      java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • getOrderAvailableReturnedTotal

        public static java.util.Map<java.lang.String,​java.lang.Object> getOrderAvailableReturnedTotal​(DispatchContext dctx,
                                                                                                            java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • getReturnItemInitialCost

        public static java.math.BigDecimal getReturnItemInitialCost​(Delegator delegator,
                                                                    java.lang.String returnId,
                                                                    java.lang.String returnItemSeqId)
      • sendReturnAcceptNotification

        public static java.util.Map<java.lang.String,​java.lang.Object> sendReturnAcceptNotification​(DispatchContext dctx,
                                                                                                          java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • sendReturnCompleteNotification

        public static java.util.Map<java.lang.String,​java.lang.Object> sendReturnCompleteNotification​(DispatchContext dctx,
                                                                                                            java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • sendReturnCancelNotification

        public static java.util.Map<java.lang.String,​java.lang.Object> sendReturnCancelNotification​(DispatchContext dctx,
                                                                                                          java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • autoCancelReplacementOrders

        public static java.util.Map<java.lang.String,​java.lang.Object> autoCancelReplacementOrders​(DispatchContext dctx,
                                                                                                         java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • getReturnableQuantity

        public static java.util.Map<java.lang.String,​java.lang.Object> getReturnableQuantity​(DispatchContext dctx,
                                                                                                   java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • getReturnableItems

        public static java.util.Map<java.lang.String,​java.lang.Object> getReturnableItems​(DispatchContext dctx,
                                                                                                java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • checkReturnComplete

        public static java.util.Map<java.lang.String,​java.lang.Object> checkReturnComplete​(DispatchContext dctx,
                                                                                                 java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • processCreditReturn

        public static java.util.Map<java.lang.String,​java.lang.Object> processCreditReturn​(DispatchContext dctx,
                                                                                                 java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • processRefundReturnForReplacement

        public static java.util.Map<java.lang.String,​java.lang.Object> processRefundReturnForReplacement​(DispatchContext dctx,
                                                                                                               java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • processRefundReturn

        public static java.util.Map<java.lang.String,​java.lang.Object> processRefundReturn​(DispatchContext dctx,
                                                                                                 java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • refundBillingAccountPayment

        public static java.util.Map<java.lang.String,​java.lang.Object> refundBillingAccountPayment​(DispatchContext dctx,
                                                                                                         java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • createPaymentApplicationsFromReturnItemResponse

        public static java.util.Map<java.lang.String,​java.lang.Object> createPaymentApplicationsFromReturnItemResponse​(DispatchContext dctx,
                                                                                                                             java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • processReplacementReturn

        public static java.util.Map<java.lang.String,​java.lang.Object> processReplacementReturn​(DispatchContext dctx,
                                                                                                      java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • processSubscriptionReturn

        public static java.util.Map<java.lang.String,​java.lang.Object> processSubscriptionReturn​(DispatchContext dctx,
                                                                                                       java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • groupReturnItemsByOrder

        public static void groupReturnItemsByOrder​(java.util.List<GenericValue> returnItems,
                                                   java.util.Map<java.lang.String,​java.util.List<GenericValue>> returnItemsByOrderId,
                                                   java.util.Map<java.lang.String,​java.math.BigDecimal> totalByOrder,
                                                   Delegator delegator,
                                                   java.lang.String returnId,
                                                   java.lang.String returnTypeId)
        Takes a List of returnItems and returns a Map of orderId -> items and a Map of orderId -> orderTotal
        Parameters:
        returnItems - a List of return items
        returnItemsByOrderId - the return items by order id
        totalByOrder - the total by order id
        delegator - the delegator
        returnId - the return id
        returnTypeId - the return type id
      • getReturnAmountByOrder

        public static java.util.Map<java.lang.String,​java.lang.Object> getReturnAmountByOrder​(DispatchContext dctx,
                                                                                                    java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • checkPaymentAmountForRefund

        public static java.util.Map<java.lang.String,​java.lang.Object> checkPaymentAmountForRefund​(DispatchContext dctx,
                                                                                                         java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • createReturnAdjustment

        public static java.util.Map<java.lang.String,​java.lang.Object> createReturnAdjustment​(DispatchContext dctx,
                                                                                                    java.util.Map<java.lang.String,​java.lang.Object> context)
      • updateReturnAdjustment

        public static java.util.Map<java.lang.String,​java.lang.Object> updateReturnAdjustment​(DispatchContext dctx,
                                                                                                    java.util.Map<java.lang.String,​java.lang.Object> context)
      • createReturnItemOrAdjustment

        public static java.util.Map<java.lang.String,​java.lang.Object> createReturnItemOrAdjustment​(DispatchContext dctx,
                                                                                                          java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • updateReturnItemOrAdjustment

        public static java.util.Map<java.lang.String,​java.lang.Object> updateReturnItemOrAdjustment​(DispatchContext dctx,
                                                                                                          java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • needRecalculate

        public static boolean needRecalculate​(java.lang.String returnAdjustmentTypeId)
        These return adjustment types need to be recalculated when the return item is updated
        Parameters:
        returnAdjustmentTypeId - the return adjustment type id
        Returns:
        returns if the returnn adjustment need to be recalculated
      • getReturnAdjustmentTotal

        public static java.math.BigDecimal getReturnAdjustmentTotal​(Delegator delegator,
                                                                    java.util.Map<java.lang.String,​? extends java.lang.Object> condition)
        Get the total return adjustments for a set of key -> value condition pairs. Done for code efficiency.
        Parameters:
        delegator - the delegator
        condition - the conditions to use
        Returns:
        return the total return adjustments
      • filterServiceContext

        @Deprecated
        public static java.util.Map<java.lang.String,​java.lang.Object> filterServiceContext​(DispatchContext dctx,
                                                                                                  java.lang.String serviceName,
                                                                                                  java.util.Map<java.lang.String,​? extends java.lang.Object> context)
                                                                                           throws GenericServiceException
        Deprecated.
        - Use DispatchContext.makeValidContext(String, String, Map) instead
        Get rid of unnecessary parameters based on the given service name
        Parameters:
        dctx - Service DispatchContext
        serviceName - the service name
        context - context before clean up
        Returns:
        filtered context
        Throws:
        GenericServiceException
      • getAdjustmentAmount

        public static java.math.BigDecimal getAdjustmentAmount​(boolean isSalesTax,
                                                               java.math.BigDecimal returnTotal,
                                                               java.math.BigDecimal originalTotal,
                                                               java.math.BigDecimal amount)
        Calculate new returnAdjustment amount and set scale and rounding mode based on returnAdjustmentType: RET_SALES_TAX_ADJ use sales.tax._ and others use order._
        Parameters:
        isSalesTax - if returnAdjustmentType is SaleTax
        returnTotal -
        originalTotal -
        amount -
        Returns:
        new returnAdjustment amount