Package org.apache.ofbiz.order.order
Class OrderReturnServices
- java.lang.Object
-
- org.apache.ofbiz.order.order.OrderReturnServices
-
public class OrderReturnServices extends java.lang.Object
OrderReturnServices
-
-
Field Summary
Fields Modifier and Type Field Description static int
decimals
static java.lang.String
module
static java.lang.String
resource
static java.lang.String
resource_error
static java.lang.String
resourceProduct
static java.math.RoundingMode
rounding
static java.math.BigDecimal
ZERO
-
Constructor Summary
Constructors Constructor Description 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) insteadstatic 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 -> orderTotalstatic boolean
needRecalculate(java.lang.String returnAdjustmentTypeId)
These return adjustment types need to be recalculated when the return item is updatedstatic 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)
-
-
-
Field Detail
-
module
public static final java.lang.String module
-
resource
public static final java.lang.String resource
- See Also:
- Constant Field Values
-
resource_error
public static final java.lang.String resource_error
- See Also:
- Constant Field Values
-
resourceProduct
public static final java.lang.String resourceProduct
- See Also:
- Constant Field Values
-
decimals
public static final int decimals
-
rounding
public static final java.math.RoundingMode rounding
-
ZERO
public static final java.math.BigDecimal ZERO
-
-
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 itemsreturnItemsByOrderId
- the return items by order idtotalByOrder
- the total by order iddelegator
- the delegatorreturnId
- the return idreturnTypeId
- 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 delegatorcondition
- 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) insteadGet rid of unnecessary parameters based on the given service name- Parameters:
dctx
- Service DispatchContextserviceName
- the service namecontext
- 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 SaleTaxreturnTotal
-originalTotal
-amount
-- Returns:
- new returnAdjustment amount
-
-