Package org.apache.ofbiz.order.order
Class OrderReturnServices
java.lang.Object
org.apache.ofbiz.order.order.OrderReturnServices
OrderReturnServices
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionautoCancelReplacementOrders
(DispatchContext dctx, Map<String, ? extends Object> context) checkPaymentAmountForRefund
(DispatchContext dctx, Map<String, ? extends Object> context) checkReturnComplete
(DispatchContext dctx, Map<String, ? extends Object> context) createPaymentApplicationsFromReturnItemResponse
(DispatchContext dctx, Map<String, ? extends Object> context) createReturnAdjustment
(DispatchContext dctx, Map<String, Object> context) createReturnItemOrAdjustment
(DispatchContext dctx, Map<String, ? extends Object> context) filterServiceContext
(DispatchContext dctx, String serviceName, Map<String, ? extends Object> context) Deprecated.- Use DispatchContext.makeValidContext(String, String, Map) insteadstatic BigDecimal
getAdjustmentAmount
(boolean isSalesTax, BigDecimal returnTotal, BigDecimal originalTotal, BigDecimal amount) Calculate new returnAdjustment amount and set scale and rounding mode based on returnAdjustmentType: RET_SALES_TAX_ADJ use sales.tax.getOrderAvailableReturnedTotal
(DispatchContext dctx, Map<String, ? extends Object> context) getReturnableItems
(DispatchContext dctx, Map<String, ? extends Object> context) getReturnableQuantity
(DispatchContext dctx, Map<String, ? extends Object> context) static BigDecimal
getReturnAdjustmentTotal
(Delegator delegator, Map<String, ? extends Object> condition) Get the total return adjustments for a set of key -> value condition pairs.getReturnAmountByOrder
(DispatchContext dctx, Map<String, ? extends Object> context) static BigDecimal
getReturnItemInitialCost
(Delegator delegator, String returnId, String returnItemSeqId) getReturnItemInitialCost
(DispatchContext dctx, Map<String, ? extends Object> context) static void
groupReturnItemsByOrder
(List<GenericValue> returnItems, Map<String, List<GenericValue>> returnItemsByOrderId, Map<String, BigDecimal> totalByOrder, Delegator delegator, String returnId, String returnTypeId) Takes a List of returnItems and returns a Map of orderId -> items and a Map of orderId -> orderTotalstatic boolean
needRecalculate
(String returnAdjustmentTypeId) These return adjustment types need to be recalculated when the return item is updatedprocessCreditReturn
(DispatchContext dctx, Map<String, ? extends Object> context) processRefundReturn
(DispatchContext dctx, Map<String, ? extends Object> context) processRefundReturnForReplacement
(DispatchContext dctx, Map<String, ? extends Object> context) processReplacementReturn
(DispatchContext dctx, Map<String, ? extends Object> context) processSubscriptionReturn
(DispatchContext dctx, Map<String, ? extends Object> context) refundBillingAccountPayment
(DispatchContext dctx, Map<String, ? extends Object> context) sendReturnAcceptNotification
(DispatchContext dctx, Map<String, ? extends Object> context) sendReturnCancelNotification
(DispatchContext dctx, Map<String, ? extends Object> context) sendReturnCompleteNotification
(DispatchContext dctx, Map<String, ? extends Object> context) updateReturnAdjustment
(DispatchContext dctx, Map<String, Object> context) updateReturnItemOrAdjustment
(DispatchContext dctx, Map<String, ? extends Object> context)
-
Constructor Details
-
OrderReturnServices
public OrderReturnServices()
-
-
Method Details
-
getReturnItemInitialCost
-
getOrderAvailableReturnedTotal
-
getReturnItemInitialCost
public static BigDecimal getReturnItemInitialCost(Delegator delegator, String returnId, String returnItemSeqId) -
sendReturnAcceptNotification
-
sendReturnCompleteNotification
-
sendReturnCancelNotification
-
autoCancelReplacementOrders
-
getReturnableQuantity
-
getReturnableItems
-
checkReturnComplete
-
processCreditReturn
-
processRefundReturnForReplacement
-
processRefundReturn
-
refundBillingAccountPayment
-
createPaymentApplicationsFromReturnItemResponse
-
processReplacementReturn
-
processSubscriptionReturn
-
groupReturnItemsByOrder
public static void groupReturnItemsByOrder(List<GenericValue> returnItems, Map<String, List<GenericValue>> returnItemsByOrderId, Map<String, BigDecimal> totalByOrder, Delegator delegator, String returnId, 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
-
checkPaymentAmountForRefund
-
createReturnAdjustment
-
updateReturnAdjustment
-
createReturnItemOrAdjustment
-
updateReturnItemOrAdjustment
-
needRecalculate
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 BigDecimal getReturnAdjustmentTotal(Delegator delegator, Map<String, ? extends 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 Map<String,Object> filterServiceContext(DispatchContext dctx, String serviceName, Map<String, ? extends Object> context) throws GenericServiceExceptionDeprecated.- 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 BigDecimal getAdjustmentAmount(boolean isSalesTax, BigDecimal returnTotal, BigDecimal originalTotal, BigDecimal amount) Calculate new returnAdjustment amount and set scale and rounding mode based on returnAdjustmentType: RET_SALES_TAX_ADJ use sales.tax.- Parameters:
isSalesTax
- if returnAdjustmentType is SaleTaxreturnTotal
-originalTotal
-amount
-- Returns:
- new returnAdjustment amount
-