Package org.apache.ofbiz.order.order
Class OrderReadHelper
java.lang.Object
org.apache.ofbiz.order.order.OrderReadHelper
Utility class for easily extracting important information from orders
NOTE: in the current scheme order adjustments are never included in tax or shipping, but order item adjustments ARE included in tax and shipping calcs unless they are tax or shipping adjustments or the includeInTax or includeInShipping are set to N.
-
Constructor Summary
ModifierConstructorDescriptionprotected
OrderReadHelper
(List<GenericValue> adjustments, List<GenericValue> orderItems) Instantiates a new Order read helper.OrderReadHelper
(Delegator delegator, String orderId) Instantiates a new Order read helper.OrderReadHelper
(GenericValue orderHeader) Instantiates a new Order read helper.OrderReadHelper
(GenericValue orderHeader, List<GenericValue> adjustments, List<GenericValue> orderItems) Instantiates a new Order read helper. -
Method Summary
Modifier and TypeMethodDescriptionstatic BigDecimal
calcItemAdjustment
(GenericValue itemAdjustment, BigDecimal quantity, BigDecimal unitPrice) Calc item adjustment big decimal.static BigDecimal
calcItemAdjustment
(GenericValue itemAdjustment, GenericValue item) Calc item adjustment big decimal.static BigDecimal
calcItemAdjustmentRecurringBd
(GenericValue itemAdjustment, BigDecimal quantity, BigDecimal unitPrice) Calc item adjustment recurring bd big decimal.static BigDecimal
calcItemAdjustments
(BigDecimal quantity, BigDecimal unitPrice, List<GenericValue> adjustments, boolean includeOther, boolean includeTax, boolean includeShipping, boolean forTax, boolean forShipping) Calc item adjustments big decimal.static BigDecimal
calcItemAdjustmentsRecurringBd
(BigDecimal quantity, BigDecimal unitPrice, List<GenericValue> adjustments, boolean includeOther, boolean includeTax, boolean includeShipping, boolean forTax, boolean forShipping) Calc item adjustments recurring bd big decimal.static BigDecimal
calcOrderAdjustment
(GenericValue orderAdjustment, BigDecimal orderSubTotal) Calc order adjustment big decimal.static BigDecimal
calcOrderAdjustments
(List<GenericValue> orderHeaderAdjustments, BigDecimal subTotal, boolean includeOther, boolean includeTax, boolean includeShipping) Calc order adjustments big decimal.static BigDecimal
calcOrderPromoAdjustmentsBd
(List<GenericValue> allOrderAdjustments) Calc order promo adjustments bd big decimal.static List<GenericValue>
filterOrderAdjustments
(List<GenericValue> adjustments, boolean includeOther, boolean includeTax, boolean includeShipping, boolean forTax, boolean forShipping) Filter order adjustments list.static BigDecimal
getAccountLimit
(GenericValue billingAccount) Returns the accountLimit of the BillingAccount or BigDecimal ZERO if it is nullGets adjustments.getAdjustmentType
(GenericValue adjustment) Gets adjustment type.Gets affiliate id.static BigDecimal
getAllOrderItemsAdjustmentsTotal
(List<GenericValue> orderItems, List<GenericValue> adjustments, boolean includeOther, boolean includeTax, boolean includeShipping) Gets all order items adjustments total.Get orderAdjustments that have no corresponding returnAdjustment It also handles the case of partial adjustment amount.Returns party from OrderRole of BILL_FROM_VENDORGets billing account.static BigDecimal
getBillingAccountBalance
(GenericValue billingAccount) Calculates the "available" balance of a billing account, which is the net balance minus amount of pending (not cancelled, rejected, or received) order payments.Returns the OrderPaymentPreference.maxAmount for the billing account associated with the order, or 0 if there is no billing account or no max amount setGets billing account payment preference total.Get the total return credited to the order billing accounts @return the billing account returned credit total bdGet the total return refunded to the order billing accounts @return the billing account returned refund total bdgetBillingAccountReturnedTotalByTypeBd
(String returnTypeId) Gets the total refunded to the order billing account by type.Deprecated.Gets billing locations.Returns party from OrderRole of BILL_TO_CUSTOMERGets credit card payment preference total.Gets currency.getCurrentItemStatus
(GenericValue orderItem) Gets current item status.getCurrentItemStatusString
(GenericValue orderItem) Gets current item status string.getCurrentOrderItemWorkEffort
(GenericValue orderItem) Gets current order item work effort.Gets current status string.Gets distributor id.Gets earliest ship by date.Returns party from OrderRole of END_USER_CUSTOMERGets externalId.getFeatureIdQtyMap
(String shipGroupSeqId) Gets feature id qty map.Gets gift card payment preference total.Gets header tax total.static OrderReadHelper
getHelper
(GenericValue orderHeader) Gets helper.getItemBackorderedQuantity
(GenericValue orderItem) Gets item backordered quantity.getItemCanceledQuantity
(GenericValue orderItem) Gets item canceled quantity.Gets item feature set.getItemInfoMap
(GenericValue item) Gets item info map.getItemPendingShipmentQuantity
(GenericValue orderItem) Gets item pending shipment quantity.getItemPickedQuantityBd
(GenericValue orderItem) Gets item picked quantity bd.long
Gets item pieces included.getItemReceivedQuantity
(GenericValue orderItem) Gets item received quantity.getItemReservedQuantity
(GenericValue orderItem) Gets item reserved quantity.getItemShipGroupAssocShippedQuantity
(GenericValue orderItem, String shipGroupSeqId) Gets item ship group assoc shipped quantity.getItemShippedQuantity
(GenericValue orderItem) Gets item shipped quantity.getItemSize
(GenericValue item) Gets item size.getItemWeight
(GenericValue item) Gets item weight.Gets latest ship after date.Gets order adjustments total.static BigDecimal
getOrderAdjustmentsTotal
(List<GenericValue> orderItems, List<GenericValue> adjustments) Gets order adjustments total.getOrderAdjustmentTotal
(GenericValue adjustment) Gets order adjustment total.getOrderAttribute
(String attributeName) When you call this function after a OrderReadHelper instantiation all OrderAttributes related to the orderHeader are load on local cache to optimize database call, after we just filter the cache with attributeName wanted.Gets order backorder quantity.getOrderContactMechs
(String purposeTypeId) Gets order contact mechs.Gets order email string.Gets order grand total.static BigDecimal
getOrderGrandTotal
(List<GenericValue> orderItems, List<GenericValue> adjustments) Gets order grand total.Getter for property orderHeader.static GenericValue
getOrderHeader
(Delegator delegator, String orderId) Gets order header.Gets order header adjustments.getOrderHeaderAdjustments
(String shipGroupSeqId) Gets order header adjustments.static List<GenericValue>
getOrderHeaderAdjustments
(List<GenericValue> adjustments, String shipGroupSeqId) Gets order header adjustments.getOrderHeaderAdjustmentsTax
(String shipGroupSeqId) Gets order header adjustments tax.Gets order header adjustments to show.Return public notes links to this ordergetOrderHeaderNotes
(boolean internalNote) Return notes links to this orderGets order header statuses.static List<GenericValue>
getOrderHeaderStatuses
(List<GenericValue> orderStatuses) Gets order header statuses.Gets order id.getOrderItem
(String orderItemSeqId) Gets order item.static List<GenericValue>
getOrderItemAdjustmentList
(GenericValue orderItem, List<GenericValue> adjustments) Gets order item adjustment list.getOrderItemAdjustments
(GenericValue orderItem) Gets order item adjustments.getOrderItemAdjustmentsTotal
(GenericValue orderItem) Gets order item adjustments total.getOrderItemAdjustmentsTotal
(GenericValue orderItem, boolean includeOther, boolean includeTax, boolean includeShipping) Gets order item adjustments total.static BigDecimal
getOrderItemAdjustmentsTotal
(GenericValue orderItem, List<GenericValue> adjustments, boolean includeOther, boolean includeTax, boolean includeShipping) The passed adjustments can be all adjustments for the order, ie for all line items @param orderItem the order itemstatic BigDecimal
getOrderItemAdjustmentsTotal
(GenericValue orderItem, List<GenericValue> adjustments, boolean includeOther, boolean includeTax, boolean includeShipping, boolean forTax, boolean forShipping) The passed adjustments can be all adjustments for the order, ie for all line items @param orderItem the order itemgetOrderItemAdjustmentTotal
(GenericValue orderItem, GenericValue adjustment) Gets order item adjustment total.Gets order item and ship group assoc.getOrderItemAndShipGroupAssoc
(String shipGroupSeqId) Gets order item and ship group assoc.getOrderItemAttribute
(String orderItemSeqId, String attributeName) When you call this function after a OrderReadHelper instantiation all OrderItemAttributes related to the orderHeader are load on local cache to optimize database call, after we just filter the cache with attributeName and orderItemSeqId wanted.static String
getOrderItemAttribute
(GenericValue orderItem, String attributeName) Gets order item attribute.Retrieve order item attributes link to this order, first on this cache object else call delegator to load the cache from OrderItemAttribute entitystatic BigDecimal
getOrderItemInvoicedQuantity
(GenericValue orderItem) Get the quantity of order items that have been invoiced @param orderItem the order itemgetOrderItemIssuances
(GenericValue orderItem) Gets order item issuances.getOrderItemIssuances
(GenericValue orderItem, String shipmentId) Gets order item issuances.getOrderItemPriceInfos
(GenericValue orderItem) Gets order item price infos.static BigDecimal
getOrderItemQuantity
(GenericValue orderItem) Gets order item quantity.Get the quantity returned per order item.Gets order items.getOrderItemsByCondition
(EntityCondition entityCondition) Fetches the set of order items with the given EntityCondition.getOrderItemShipGroup
(String shipGroupSeqId) Gets order item ship group.getOrderItemShipGroupAssocs
(GenericValue orderItem) Gets order item ship group assocs.static BigDecimal
getOrderItemShipGroupQuantity
(GenericValue shipGroupAssoc) Gets order item ship group quantity.Gets order item ship groups.getOrderItemShipGrpInvResList
(GenericValue orderItem) Gets order item ship grp inv res list.getOrderItemShipping
(GenericValue orderItem) Gets order item shipping.Gets order items sub total.static BigDecimal
getOrderItemsSubTotal
(List<GenericValue> orderItems, List<GenericValue> adjustments) Gets order items sub total.static BigDecimal
getOrderItemsSubTotal
(List<GenericValue> orderItems, List<GenericValue> adjustments, List<GenericValue> workEfforts) Gets order items sub total.getOrderItemStatuses
(GenericValue orderItem) Gets order item statuses.static List<GenericValue>
getOrderItemStatuses
(GenericValue orderItem, List<GenericValue> orderStatuses) Gets order item statuses.Gets order items total.static BigDecimal
getOrderItemsTotal
(List<GenericValue> orderItems, List<GenericValue> adjustments) Gets order items total.getOrderItemSubTotal
(GenericValue orderItem) Gets order item sub total.static BigDecimal
getOrderItemSubTotal
(GenericValue orderItem, List<GenericValue> adjustments) The passed adjustments can be all adjustments for the order, ie for all line items @param orderItem the order itemstatic BigDecimal
getOrderItemSubTotal
(GenericValue orderItem, List<GenericValue> adjustments, boolean forTax, boolean forShipping) The passed adjustments can be all adjustments for the order, ie for all line items @param orderItem the order itemstatic List<GenericValue>
getOrderItemSurveyResponse
(GenericValue orderItem) Gets order item survey response.getOrderItemTax
(GenericValue orderItem) Gets order item tax.getOrderItemTaxByTaxAuthGeoAndPartyForDisplay
(GenericValue orderItem, List<GenericValue> orderAdjustmentsOriginal) Gets order item tax by tax auth geo and party for display.getOrderItemTotal
(GenericValue orderItem) Gets order item total.static BigDecimal
getOrderItemTotal
(GenericValue orderItem, List<GenericValue> adjustments) Gets order item total.Gets order name.Gets order non returned tax and shipping.Gets the amount open on the order that is not covered by the relevant OrderPaymentPreferences.getOrderPaymentPreferenceTotalByType
(String paymentMethodTypeId) Get the total payment preference amount by payment type.getOrderPaymentReceivedTotalByType
(String paymentMethodTypeId) Get the total payment received amount by payment type.Gets order payments.getOrderPayments
(GenericValue orderPaymentPreference) Gets order payments.Gets order payment statuses.static List<GenericValue>
getOrderPaymentStatuses
(List<GenericValue> orderStatuses) Gets order payment statuses.Get a set of productIds in the order.Gets the total return credit for COMPLETED and RECEIVED returns.Get the total quantity of returned items for an order.Gets the total return refunded for COMPLETED and RECEIVED returns.Gets the total return amount (all return types) for COMPLETED and RECEIVED returns.getOrderReturnedTotal
(boolean includeAll) Gets the total returned over all return types.getOrderReturnedTotalByTypeBd
(String returnTypeId, boolean includeAll) Get the returned total by return type (credit, refund, etc.).Gets order return items.Gets order statuses.static List<GenericValue>
getOrderSurveyResponses
(GenericValue orderHeader) Gets order survey responses.getOrderTaxByTaxAuthGeoAndParty
(List<GenericValue> orderAdjustments) Gets order tax by tax auth geo and party.getOrderTaxByTaxAuthGeoAndPartyForDisplay
(List<GenericValue> orderAdjustmentsOriginal) Gets order tax by tax auth geo and party for display.Return the number of days from termDays of first FIN_PAYMENT_TERMGets order terms.Gets order type id.boolean
Gets partially received items.getPartyFromRole
(String roleTypeId) Gets party from role.boolean
getPastEtaOrderItems
(String orderId) Gets past eta order items.Gets payment preferences.Returns party from OrderRole of PLACING_CUSTOMERGets order priorityGets product promo codes entered.Gets product promo use.Returns the ProductStore of this Order or null in case of Exceptionstatic GenericValue
getProductStoreFromOrder
(Delegator delegator, String orderId) Gets product store from order.static GenericValue
getProductStoreFromOrder
(GenericValue orderHeader) Gets product store from order.Gets product store id.static BigDecimal
getQuantityOnOrder
(Delegator delegator, String productId) Gets quantity on order.Returns a Map of paymentMethodId -> amount charged (BigDecimal) based on PaymentGatewayResponse.boolean
Gets rejected order items.static BigDecimal
getReturnAdjustmentTotal
(Delegator delegator, Map<String, Object> condition) Get the total return adjustments for a set of key -> value condition pairs.Gets the total return credited amount with refunds and credits to the billing account figured in @return the returned credit total with billing account bdGets the total return refund amount with refunds and credits to the billing account figured in @return the returned refund total with billing account bdReturns a Map of paymentMethodId -> amount refundedgetShippableItemInfo
(String shipGroupSeqId) Gets shippable item info.Gets shippable quantity.getShippableQuantity
(String shipGroupSeqId) Gets shippable quantity.Gets shippable sizes.getShippableSizes
(String shipGrouSeqId) Gets shippable sizes.getShippableTotal
(String shipGroupSeqId) Gets shippable total.getShippableWeight
(String shipGroupSeqId) Gets shippable weight.Deprecated.getShippingAddress
(String shipGroupSeqId) Gets shipping address.Gets shipping locations.getShippingMethod
(String shipGroupSeqId) Gets shipping method.getShippingMethodCode
(String shipGroupSeqId) Gets shipping method code.Gets shipping total.Returns party from OrderRole of SHIP_TO_CUSTOMERgetStatusString
(Locale locale) Gets status string.Returns party from OrderRole of SUPPLIER_AGENTGets tax total.Gets total order items ordered quantity.Gets total order items quantity.Gets valid digital items.Gets valid order items.getValidOrderItems
(String shipGroupSeqId) Gets valid order items.Gets web site id.static BigDecimal
getWorkEffortRentalLength
(GenericValue workEffort) Gets work effort rental length.static BigDecimal
getWorkEffortRentalQuantity
(GenericValue workEffort) Gets work effort rental quantity.boolean
hasPermission
(Security security, GenericValue userLogin) Checks to see if this user has read permission on this orderstatic boolean
hasPermission
(Security security, GenericValue userLogin, GenericValue orderHeader) Checks to see if this user has read permission on the specified orderboolean
Has physical product items boolean.boolean
Has shipping address boolean.int
Has survey int.static BigDecimal
setScaleByType
(boolean isTax, BigDecimal value) Sets scale by type.boolean
Shipping applies boolean.boolean
Tax applies boolean.
-
Constructor Details
-
OrderReadHelper
protected OrderReadHelper() -
OrderReadHelper
public OrderReadHelper(GenericValue orderHeader, List<GenericValue> adjustments, List<GenericValue> orderItems) Instantiates a new Order read helper.- Parameters:
orderHeader
- the order headeradjustments
- the adjustmentsorderItems
- the order items
-
OrderReadHelper
Instantiates a new Order read helper.- Parameters:
orderHeader
- the order header
-
OrderReadHelper
Instantiates a new Order read helper.- Parameters:
adjustments
- the adjustmentsorderItems
- the order items
-
OrderReadHelper
Instantiates a new Order read helper.- Parameters:
delegator
- the delegatororderId
- the order id
-
-
Method Details
-
getOrderId
Gets order id.- Returns:
- the order id
-
getWebSiteId
Gets web site id.- Returns:
- the web site id
-
getProductStoreId
Gets product store id.- Returns:
- the product store id
-
getProductStore
Returns the ProductStore of this Order or null in case of Exception- Returns:
- the product store
-
getOrderTypeId
Gets order type id.- Returns:
- the order type id
-
getCurrency
Gets currency.- Returns:
- the currency
-
getOrderName
Gets order name.- Returns:
- the order name
-
getExternalId
Gets externalId.- Returns:
- the external id
-
getPriority
Gets order priority- Returns:
- the priority
-
getAdjustments
Gets adjustments.- Returns:
- the adjustments
-
getPaymentPreferences
Gets payment preferences.- Returns:
- the payment preferences
-
getReceivedPaymentTotalsByPaymentMethod
Returns a Map of paymentMethodId -> amount charged (BigDecimal) based on PaymentGatewayResponse.- Returns:
- returns a Map of paymentMethodId -> amount charged (BigDecimal) based on PaymentGatewayResponse.
-
getReturnedTotalsByPaymentMethod
Returns a Map of paymentMethodId -> amount refunded- Returns:
- returns a Map of paymentMethodId -> amount refunded
-
getOrderPayments
Gets order payments.- Returns:
- the order payments
-
getOrderPayments
Gets order payments.- Parameters:
orderPaymentPreference
- the order payment preference- Returns:
- the order payments
-
getOrderStatuses
Gets order statuses.- Returns:
- the order statuses
-
getOrderTerms
Gets order terms.- Returns:
- the order terms
-
getOrderHeaderNotes
Return notes links to this order- Parameters:
internalNote
-- Returns:
- order notes
-
getOrderHeaderNotes
Return public notes links to this order- Returns:
- order public notes
-
getOrderItemAttributes
Retrieve order item attributes link to this order, first on this cache object else call delegator to load the cache from OrderItemAttribute entity- Returns:
- Order item attributes link to this order
-
getOrderTermNetDays
Return the number of days from termDays of first FIN_PAYMENT_TERM- Returns:
- number of days from termDays of first FIN_PAYMENT_TERM
-
getShippingMethod
Gets shipping method.- Parameters:
shipGroupSeqId
- the ship group seq id- Returns:
- the shipping method
-
getShippingMethodCode
Gets shipping method code.- Parameters:
shipGroupSeqId
- the ship group seq id- Returns:
- the shipping method code
-
hasShippingAddress
public boolean hasShippingAddress()Has shipping address boolean.- Returns:
- the boolean
-
hasPhysicalProductItems
Has physical product items boolean.- Returns:
- the boolean
- Throws:
GenericEntityException
- the generic entity exception
-
getOrderItemShipGroup
Gets order item ship group.- Parameters:
shipGroupSeqId
- the ship group seq id- Returns:
- the order item ship group
-
getOrderItemShipGroups
Gets order item ship groups.- Returns:
- the order item ship groups
-
getShippingLocations
Gets shipping locations.- Returns:
- the shipping locations
-
getShippingAddress
Gets shipping address.- Parameters:
shipGroupSeqId
- the ship group seq id- Returns:
- the shipping address
-
getShippingAddress
Deprecated.Gets shipping address.- Returns:
- the shipping address
-
getBillingLocations
Gets billing locations.- Returns:
- the billing locations
-
getBillingAddress
Deprecated.Gets billing address.- Returns:
- the billing address
-
getOrderContactMechs
Gets order contact mechs.- Parameters:
purposeTypeId
- the purpose type id- Returns:
- the order contact mechs
-
getEarliestShipByDate
Gets earliest ship by date.- Returns:
- the earliest ship by date
-
getLatestShipAfterDate
Gets latest ship after date.- Returns:
- the latest ship after date
-
getCurrentStatusString
Gets current status string.- Returns:
- the current status string
-
getStatusString
Gets status string.- Parameters:
locale
- the locale- Returns:
- the status string
-
getBillingAccount
Gets billing account.- Returns:
- the billing account
-
getBillingAccountMaxAmount
Returns the OrderPaymentPreference.maxAmount for the billing account associated with the order, or 0 if there is no billing account or no max amount set- Returns:
- the billing account max amount
-
getBillToParty
Returns party from OrderRole of BILL_TO_CUSTOMER- Returns:
- the bill to party
-
getBillFromParty
Returns party from OrderRole of BILL_FROM_VENDOR- Returns:
- the bill from party
-
getShipToParty
Returns party from OrderRole of SHIP_TO_CUSTOMER- Returns:
- the ship to party
-
getPlacingParty
Returns party from OrderRole of PLACING_CUSTOMER- Returns:
- the placing party
-
getEndUserParty
Returns party from OrderRole of END_USER_CUSTOMER- Returns:
- the end user party
-
getSupplierAgent
Returns party from OrderRole of SUPPLIER_AGENT- Returns:
- the supplier agent
-
getPartyFromRole
Gets party from role.- Parameters:
roleTypeId
- the role type id- Returns:
- the party from role
-
getDistributorId
Gets distributor id.- Returns:
- the distributor id
-
getAffiliateId
Gets affiliate id.- Returns:
- the affiliate id
-
getShippingTotal
Gets shipping total.- Returns:
- the shipping total
-
getHeaderTaxTotal
Gets header tax total.- Returns:
- the header tax total
-
getTaxTotal
Gets tax total.- Returns:
- the tax total
-
getItemFeatureSet
Gets item feature set.- Parameters:
item
- the item- Returns:
- the item feature set
-
getFeatureIdQtyMap
Gets feature id qty map.- Parameters:
shipGroupSeqId
- the ship group seq id- Returns:
- the feature id qty map
-
shippingApplies
public boolean shippingApplies()Shipping applies boolean.- Returns:
- the boolean
-
taxApplies
public boolean taxApplies()Tax applies boolean.- Returns:
- the boolean
-
getShippableTotal
Gets shippable total.- Parameters:
shipGroupSeqId
- the ship group seq id- Returns:
- the shippable total
-
getShippableQuantity
Gets shippable quantity.- Returns:
- the shippable quantity
-
getShippableQuantity
Gets shippable quantity.- Parameters:
shipGroupSeqId
- the ship group seq id- Returns:
- the shippable quantity
-
getShippableWeight
Gets shippable weight.- Parameters:
shipGroupSeqId
- the ship group seq id- Returns:
- the shippable weight
-
getItemWeight
Gets item weight.- Parameters:
item
- the item- Returns:
- the item weight
-
getShippableSizes
Gets shippable sizes.- Returns:
- the shippable sizes
-
getOrderPaymentPreferenceTotalByType
Get the total payment preference amount by payment type. Specify null to get amount for all preference types. TODO: filter by status as well?- Parameters:
paymentMethodTypeId
- the payment method type id- Returns:
- the order payment preference total by type
-
getCreditCardPaymentPreferenceTotal
Gets credit card payment preference total.- Returns:
- the credit card payment preference total
-
getBillingAccountPaymentPreferenceTotal
Gets billing account payment preference total.- Returns:
- the billing account payment preference total
-
getGiftCardPaymentPreferenceTotal
Gets gift card payment preference total.- Returns:
- the gift card payment preference total
-
getOrderPaymentReceivedTotalByType
Get the total payment received amount by payment type. Specify null to get amount over all types. This method works by going through all the PaymentAndApplications for all order Invoices that have status PMNT_RECEIVED.- Parameters:
paymentMethodTypeId
- the payment method type id- Returns:
- the order payment received total by type
-
getItemSize
Gets item size.- Parameters:
item
- the item- Returns:
- the item size
-
getItemPiecesIncluded
Gets item pieces included.- Parameters:
item
- the item- Returns:
- the item pieces included
-
getShippableItemInfo
Gets shippable item info.- Parameters:
shipGroupSeqId
- the ship group seq id- Returns:
- the shippable item info
-
getItemInfoMap
Gets item info map.- Parameters:
item
- the item- Returns:
- the item info map
-
getOrderEmailString
Gets order email string.- Returns:
- the order email string
-
getOrderGrandTotal
Gets order grand total.- Returns:
- the order grand total
-
getOrderOpenAmount
Gets the amount open on the order that is not covered by the relevant OrderPaymentPreferences. This works by adding up the amount allocated to each unprocessed OrderPaymentPreference and the amounts received and refunded as payments for the settled ones.- Returns:
- the order open amount
- Throws:
GenericEntityException
- the generic entity exception
-
getOrderHeaderAdjustments
Gets order header adjustments.- Returns:
- the order header adjustments
-
getOrderHeaderAdjustments
Gets order header adjustments.- Parameters:
shipGroupSeqId
- the ship group seq id- Returns:
- the order header adjustments
-
getOrderHeaderAdjustmentsTax
Gets order header adjustments tax.- Parameters:
shipGroupSeqId
- the ship group seq id- Returns:
- the order header adjustments tax
-
getOrderHeaderAdjustmentsToShow
Gets order header adjustments to show.- Returns:
- the order header adjustments to show
-
getOrderHeaderStatuses
Gets order header statuses.- Returns:
- the order header statuses
-
getOrderAdjustmentsTotal
Gets order adjustments total.- Returns:
- the order adjustments total
-
getOrderAdjustmentTotal
Gets order adjustment total.- Parameters:
adjustment
- the adjustment- Returns:
- the order adjustment total
-
hasSurvey
public int hasSurvey()Has survey int.- Returns:
- the int
-
getOrderItems
Gets order items.- Returns:
- the order items
-
getOrderItemAndShipGroupAssoc
Gets order item and ship group assoc.- Returns:
- the order item and ship group assoc
-
getOrderItemAndShipGroupAssoc
Gets order item and ship group assoc.- Parameters:
shipGroupSeqId
- the ship group seq id- Returns:
- the order item and ship group assoc
-
getValidOrderItems
Gets valid order items.- Returns:
- the valid order items
-
getPastEtaOrderItems
Gets past eta order items.- Parameters:
orderId
- the order id- Returns:
- the past eta order items
-
getRejectedOrderItems
public boolean getRejectedOrderItems()Gets rejected order items.- Returns:
- the rejected order items
-
getPartiallyReceivedItems
public boolean getPartiallyReceivedItems()Gets partially received items.- Returns:
- the partially received items
-
getValidOrderItems
Gets valid order items.- Parameters:
shipGroupSeqId
- the ship group seq id- Returns:
- the valid order items
-
getOrderItem
Gets order item.- Parameters:
orderItemSeqId
- the order item seq id- Returns:
- the order item
-
getValidDigitalItems
Gets valid digital items.- Returns:
- the valid digital items
-
getOrderItemAdjustments
Gets order item adjustments.- Parameters:
orderItem
- the order item- Returns:
- the order item adjustments
-
getCurrentOrderItemWorkEffort
Gets current order item work effort.- Parameters:
orderItem
- the order item- Returns:
- the current order item work effort
-
getCurrentItemStatus
Gets current item status.- Parameters:
orderItem
- the order item- Returns:
- the current item status
-
getOrderItemPriceInfos
Gets order item price infos.- Parameters:
orderItem
- the order item- Returns:
- the order item price infos
-
getOrderItemShipGroupAssocs
Gets order item ship group assocs.- Parameters:
orderItem
- the order item- Returns:
- the order item ship group assocs
-
getOrderItemShipGrpInvResList
Gets order item ship grp inv res list.- Parameters:
orderItem
- the order item- Returns:
- the order item ship grp inv res list
-
getOrderItemIssuances
Gets order item issuances.- Parameters:
orderItem
- the order item- Returns:
- the order item issuances
-
getOrderItemIssuances
Gets order item issuances.- Parameters:
orderItem
- the order itemshipmentId
- the shipment id- Returns:
- the order item issuances
-
getOrderProductIds
Get a set of productIds in the order. @return the order product ids -
getOrderReturnItems
Gets order return items.- Returns:
- the order return items
-
getOrderItemReturnedQuantities
Get the quantity returned per order item. In other words, this method will count the ReturnItems related to each OrderItem.- Returns:
- Map of returned quantities as BigDecimals keyed to the orderItemSeqId
-
getOrderReturnedQuantity
Get the total quantity of returned items for an order. This will count only the ReturnItems that are directly correlated to an OrderItem.- Returns:
- the order returned quantity
-
getOrderReturnedTotalByTypeBd
Get the returned total by return type (credit, refund, etc.). Specify returnTypeId = null to get sum over all return types. Specify includeAll = true to sum up over all return statuses except cancelled. Specify includeAll = false to sum up over ACCEPTED, RECEIVED And COMPLETED returns.- Parameters:
returnTypeId
- the return type idincludeAll
- the include all- Returns:
- the order returned total by type bd
-
getOrderReturnedCreditTotalBd
Gets the total return credit for COMPLETED and RECEIVED returns. @return the order returned credit total bd -
getOrderReturnedRefundTotalBd
Gets the total return refunded for COMPLETED and RECEIVED returns. @return the order returned refund total bd -
getOrderReturnedTotal
Gets the total return amount (all return types) for COMPLETED and RECEIVED returns. @return the order returned total -
getOrderReturnedTotal
Gets the total returned over all return types. Specify true to include all return statuses except cancelled. Specify false to include only COMPLETED and RECEIVED returns.- Parameters:
includeAll
- the include all- Returns:
- the order returned total
-
getOrderNonReturnedTaxAndShipping
Gets order non returned tax and shipping.- Returns:
- the order non returned tax and shipping
-
getBillingAccountReturnedTotalByTypeBd
Gets the total refunded to the order billing account by type. Specify null to get total over all types.- Parameters:
returnTypeId
- the return type id- Returns:
- the billing account returned total by type bd
-
getBillingAccountReturnedCreditTotalBd
Get the total return credited to the order billing accounts @return the billing account returned credit total bd -
getBillingAccountReturnedRefundTotalBd
Get the total return refunded to the order billing accounts @return the billing account returned refund total bd -
getReturnedCreditTotalWithBillingAccountBd
Gets the total return credited amount with refunds and credits to the billing account figured in @return the returned credit total with billing account bd -
getReturnedRefundTotalWithBillingAccountBd
Gets the total return refund amount with refunds and credits to the billing account figured in @return the returned refund total with billing account bd -
getOrderBackorderQuantity
Gets order backorder quantity.- Returns:
- the order backorder quantity
-
getItemPickedQuantityBd
Gets item picked quantity bd.- Parameters:
orderItem
- the order item- Returns:
- the item picked quantity bd
-
getItemShippedQuantity
Gets item shipped quantity.- Parameters:
orderItem
- the order item- Returns:
- the item shipped quantity
-
getItemShipGroupAssocShippedQuantity
public BigDecimal getItemShipGroupAssocShippedQuantity(GenericValue orderItem, String shipGroupSeqId) Gets item ship group assoc shipped quantity.- Parameters:
orderItem
- the order itemshipGroupSeqId
- the ship group seq id- Returns:
- the item ship group assoc shipped quantity
-
getItemReservedQuantity
Gets item reserved quantity.- Parameters:
orderItem
- the order item- Returns:
- the item reserved quantity
-
getItemBackorderedQuantity
Gets item backordered quantity.- Parameters:
orderItem
- the order item- Returns:
- the item backordered quantity
-
getItemPendingShipmentQuantity
Gets item pending shipment quantity.- Parameters:
orderItem
- the order item- Returns:
- the item pending shipment quantity
-
getItemCanceledQuantity
Gets item canceled quantity.- Parameters:
orderItem
- the order item- Returns:
- the item canceled quantity
-
getTotalOrderItemsQuantity
Gets total order items quantity.- Returns:
- the total order items quantity
-
getTotalOrderItemsOrderedQuantity
Gets total order items ordered quantity.- Returns:
- the total order items ordered quantity
-
getOrderItemsSubTotal
Gets order items sub total.- Returns:
- the order items sub total
-
getOrderItemSubTotal
Gets order item sub total.- Parameters:
orderItem
- the order item- Returns:
- the order item sub total
-
getOrderItemsTotal
Gets order items total.- Returns:
- the order items total
-
getOrderItemTotal
Gets order item total.- Parameters:
orderItem
- the order item- Returns:
- the order item total
-
getOrderItemTax
Gets order item tax.- Parameters:
orderItem
- the order item- Returns:
- the order item tax
-
getOrderItemShipping
Gets order item shipping.- Parameters:
orderItem
- the order item- Returns:
- the order item shipping
-
getOrderItemAdjustmentsTotal
public BigDecimal getOrderItemAdjustmentsTotal(GenericValue orderItem, boolean includeOther, boolean includeTax, boolean includeShipping) Gets order item adjustments total.- Parameters:
orderItem
- the order itemincludeOther
- the include otherincludeTax
- the include taxincludeShipping
- the include shipping- Returns:
- the order item adjustments total
-
getOrderItemAdjustmentsTotal
Gets order item adjustments total.- Parameters:
orderItem
- the order item- Returns:
- the order item adjustments total
-
getOrderItemAdjustmentTotal
Gets order item adjustment total.- Parameters:
orderItem
- the order itemadjustment
- the adjustment- Returns:
- the order item adjustment total
-
getAdjustmentType
Gets adjustment type.- Parameters:
adjustment
- the adjustment- Returns:
- the adjustment type
-
getOrderItemStatuses
Gets order item statuses.- Parameters:
orderItem
- the order item- Returns:
- the order item statuses
-
getCurrentItemStatusString
Gets current item status string.- Parameters:
orderItem
- the order item- Returns:
- the current item status string
-
getOrderItemsByCondition
Fetches the set of order items with the given EntityCondition. @param entityCondition the entity condition- Returns:
- the order items by condition
-
getProductPromoCodesEntered
Gets product promo codes entered.- Returns:
- the product promo codes entered
-
getProductPromoUse
Gets product promo use.- Returns:
- the product promo use
-
hasPermission
Checks to see if this user has read permission on this order- Parameters:
security
- the securityuserLogin
- The UserLogin value object to check- Returns:
- boolean True if we have read permission
-
getOrderHeader
Getter for property orderHeader.- Returns:
- Value of property orderHeader.
-
getOrderHeader
Gets order header.- Parameters:
delegator
- the delegatororderId
- the order id- Returns:
- the order header
-
getOrderItemQuantity
Gets order item quantity.- Parameters:
orderItem
- the order item- Returns:
- the order item quantity
-
getOrderItemShipGroupQuantity
Gets order item ship group quantity.- Parameters:
shipGroupAssoc
- the ship group assoc- Returns:
- the order item ship group quantity
-
getProductStoreFromOrder
Gets product store from order.- Parameters:
delegator
- the delegatororderId
- the order id- Returns:
- the product store from order
-
getProductStoreFromOrder
Gets product store from order.- Parameters:
orderHeader
- the order header- Returns:
- the product store from order
-
getOrderGrandTotal
public static BigDecimal getOrderGrandTotal(List<GenericValue> orderItems, List<GenericValue> adjustments) Gets order grand total.- Parameters:
orderItems
- the order itemsadjustments
- the adjustments- Returns:
- the order grand total
-
getOrderHeaderAdjustments
public static List<GenericValue> getOrderHeaderAdjustments(List<GenericValue> adjustments, String shipGroupSeqId) Gets order header adjustments.- Parameters:
adjustments
- the adjustmentsshipGroupSeqId
- the ship group seq id- Returns:
- the order header adjustments
-
getOrderHeaderStatuses
Gets order header statuses.- Parameters:
orderStatuses
- the order statuses- Returns:
- the order header statuses
-
getOrderAdjustmentsTotal
public static BigDecimal getOrderAdjustmentsTotal(List<GenericValue> orderItems, List<GenericValue> adjustments) Gets order adjustments total.- Parameters:
orderItems
- the order itemsadjustments
- the adjustments- Returns:
- the order adjustments total
-
getOrderSurveyResponses
Gets order survey responses.- Parameters:
orderHeader
- the order header- Returns:
- the order survey responses
-
getOrderItemSurveyResponse
Gets order item survey response.- Parameters:
orderItem
- the order item- Returns:
- the order item survey response
-
calcOrderAdjustments
public static BigDecimal calcOrderAdjustments(List<GenericValue> orderHeaderAdjustments, BigDecimal subTotal, boolean includeOther, boolean includeTax, boolean includeShipping) Calc order adjustments big decimal.- Parameters:
orderHeaderAdjustments
- the order header adjustmentssubTotal
- the sub totalincludeOther
- the include otherincludeTax
- the include taxincludeShipping
- the include shipping- Returns:
- the big decimal
-
calcOrderAdjustment
public static BigDecimal calcOrderAdjustment(GenericValue orderAdjustment, BigDecimal orderSubTotal) Calc order adjustment big decimal.- Parameters:
orderAdjustment
- the order adjustmentorderSubTotal
- the order sub total- Returns:
- the big decimal
-
getOrderItemsSubTotal
public static BigDecimal getOrderItemsSubTotal(List<GenericValue> orderItems, List<GenericValue> adjustments) Gets order items sub total.- Parameters:
orderItems
- the order itemsadjustments
- the adjustments- Returns:
- the order items sub total
-
getOrderItemsSubTotal
public static BigDecimal getOrderItemsSubTotal(List<GenericValue> orderItems, List<GenericValue> adjustments, List<GenericValue> workEfforts) Gets order items sub total.- Parameters:
orderItems
- the order itemsadjustments
- the adjustmentsworkEfforts
- the work efforts- Returns:
- the order items sub total
-
getOrderItemSubTotal
public static BigDecimal getOrderItemSubTotal(GenericValue orderItem, List<GenericValue> adjustments) The passed adjustments can be all adjustments for the order, ie for all line items @param orderItem the order item- Parameters:
adjustments
- the adjustments- Returns:
- the order item sub total
-
getOrderItemSubTotal
public static BigDecimal getOrderItemSubTotal(GenericValue orderItem, List<GenericValue> adjustments, boolean forTax, boolean forShipping) The passed adjustments can be all adjustments for the order, ie for all line items @param orderItem the order item- Parameters:
adjustments
- the adjustmentsforTax
- the for taxforShipping
- the for shipping- Returns:
- the order item sub total
-
getOrderItemsTotal
public static BigDecimal getOrderItemsTotal(List<GenericValue> orderItems, List<GenericValue> adjustments) Gets order items total.- Parameters:
orderItems
- the order itemsadjustments
- the adjustments- Returns:
- the order items total
-
getOrderItemTotal
Gets order item total.- Parameters:
orderItem
- the order itemadjustments
- the adjustments- Returns:
- the order item total
-
calcOrderPromoAdjustmentsBd
Calc order promo adjustments bd big decimal.- Parameters:
allOrderAdjustments
- the all order adjustments- Returns:
- the big decimal
-
getWorkEffortRentalLength
Gets work effort rental length.- Parameters:
workEffort
- the work effort- Returns:
- the work effort rental length
-
getWorkEffortRentalQuantity
Gets work effort rental quantity.- Parameters:
workEffort
- the work effort- Returns:
- the work effort rental quantity
-
getAllOrderItemsAdjustmentsTotal
public static BigDecimal getAllOrderItemsAdjustmentsTotal(List<GenericValue> orderItems, List<GenericValue> adjustments, boolean includeOther, boolean includeTax, boolean includeShipping) Gets all order items adjustments total.- Parameters:
orderItems
- the order itemsadjustments
- the adjustmentsincludeOther
- the include otherincludeTax
- the include taxincludeShipping
- the include shipping- Returns:
- the all order items adjustments total
-
getOrderItemAdjustmentsTotal
public static BigDecimal getOrderItemAdjustmentsTotal(GenericValue orderItem, List<GenericValue> adjustments, boolean includeOther, boolean includeTax, boolean includeShipping) The passed adjustments can be all adjustments for the order, ie for all line items @param orderItem the order item- Parameters:
adjustments
- the adjustmentsincludeOther
- the include otherincludeTax
- the include taxincludeShipping
- the include shipping- Returns:
- the order item adjustments total
-
getOrderItemAdjustmentsTotal
public static BigDecimal getOrderItemAdjustmentsTotal(GenericValue orderItem, List<GenericValue> adjustments, boolean includeOther, boolean includeTax, boolean includeShipping, boolean forTax, boolean forShipping) The passed adjustments can be all adjustments for the order, ie for all line items @param orderItem the order item- Parameters:
adjustments
- the adjustmentsincludeOther
- the include otherincludeTax
- the include taxincludeShipping
- the include shippingforTax
- the for taxforShipping
- the for shipping- Returns:
- the order item adjustments total
-
getOrderItemAdjustmentList
public static List<GenericValue> getOrderItemAdjustmentList(GenericValue orderItem, List<GenericValue> adjustments) Gets order item adjustment list.- Parameters:
orderItem
- the order itemadjustments
- the adjustments- Returns:
- the order item adjustment list
-
getOrderItemStatuses
public static List<GenericValue> getOrderItemStatuses(GenericValue orderItem, List<GenericValue> orderStatuses) Gets order item statuses.- Parameters:
orderItem
- the order itemorderStatuses
- the order statuses- Returns:
- the order item statuses
-
calcItemAdjustments
public static BigDecimal calcItemAdjustments(BigDecimal quantity, BigDecimal unitPrice, List<GenericValue> adjustments, boolean includeOther, boolean includeTax, boolean includeShipping, boolean forTax, boolean forShipping) Calc item adjustments big decimal.- Parameters:
quantity
- the quantityunitPrice
- the unit priceadjustments
- the adjustmentsincludeOther
- the include otherincludeTax
- the include taxincludeShipping
- the include shippingforTax
- the for taxforShipping
- the for shipping- Returns:
- the big decimal
-
calcItemAdjustmentsRecurringBd
public static BigDecimal calcItemAdjustmentsRecurringBd(BigDecimal quantity, BigDecimal unitPrice, List<GenericValue> adjustments, boolean includeOther, boolean includeTax, boolean includeShipping, boolean forTax, boolean forShipping) Calc item adjustments recurring bd big decimal.- Parameters:
quantity
- the quantityunitPrice
- the unit priceadjustments
- the adjustmentsincludeOther
- the include otherincludeTax
- the include taxincludeShipping
- the include shippingforTax
- the for taxforShipping
- the for shipping- Returns:
- the big decimal
-
calcItemAdjustment
Calc item adjustment big decimal.- Parameters:
itemAdjustment
- the item adjustmentitem
- the item- Returns:
- the big decimal
-
calcItemAdjustment
public static BigDecimal calcItemAdjustment(GenericValue itemAdjustment, BigDecimal quantity, BigDecimal unitPrice) Calc item adjustment big decimal.- Parameters:
itemAdjustment
- the item adjustmentquantity
- the quantityunitPrice
- the unit price- Returns:
- the big decimal
-
calcItemAdjustmentRecurringBd
public static BigDecimal calcItemAdjustmentRecurringBd(GenericValue itemAdjustment, BigDecimal quantity, BigDecimal unitPrice) Calc item adjustment recurring bd big decimal.- Parameters:
itemAdjustment
- the item adjustmentquantity
- the quantityunitPrice
- the unit price- Returns:
- the big decimal
-
filterOrderAdjustments
public static List<GenericValue> filterOrderAdjustments(List<GenericValue> adjustments, boolean includeOther, boolean includeTax, boolean includeShipping, boolean forTax, boolean forShipping) Filter order adjustments list.- Parameters:
adjustments
- the adjustmentsincludeOther
- the include otherincludeTax
- the include taxincludeShipping
- the include shippingforTax
- the for taxforShipping
- the for shipping- Returns:
- the list
-
getQuantityOnOrder
Gets quantity on order.- Parameters:
delegator
- the delegatorproductId
- the product id- Returns:
- the quantity on order
-
hasPermission
public static boolean hasPermission(Security security, GenericValue userLogin, GenericValue orderHeader) Checks to see if this user has read permission on the specified order- Parameters:
security
- the securityuserLogin
- The UserLogin value object to checkorderHeader
- The OrderHeader for the specified order- Returns:
- boolean True if we have read permission
-
getHelper
Gets helper.- Parameters:
orderHeader
- the order header- Returns:
- the helper
-
getAvailableOrderHeaderAdjustments
Get orderAdjustments that have no corresponding returnAdjustment It also handles the case of partial adjustment amount. Check OFBIZ-11185 for details- Returns:
- return the order adjustments that have no corresponding with return adjustment
-
getReturnAdjustmentTotal
public static BigDecimal getReturnAdjustmentTotal(Delegator delegator, Map<String, Object> condition) Get the total return adjustments for a set of key -> value condition pairs. Done for code efficiency.- Parameters:
delegator
- the delegatorcondition
- a map of the conditions to use- Returns:
- Get the total return adjustments
-
setScaleByType
Sets scale by type.- Parameters:
isTax
- the is taxvalue
- the value- Returns:
- the scale by type
-
getOrderItemInvoicedQuantity
Get the quantity of order items that have been invoiced @param orderItem the order item- Returns:
- the order item invoiced quantity
-
getOrderPaymentStatuses
Gets order payment statuses.- Returns:
- the order payment statuses
-
getOrderPaymentStatuses
Gets order payment statuses.- Parameters:
orderStatuses
- the order statuses- Returns:
- the order payment statuses
-
getOrderItemAttribute
When you call this function after a OrderReadHelper instantiation all OrderItemAttributes related to the orderHeader are load on local cache to optimize database call, after we just filter the cache with attributeName and orderItemSeqId wanted.- Parameters:
orderItemSeqId
- the order item seq idattributeName
- the attribute name- Returns:
- order item attribute
-
getOrderItemAttribute
Gets order item attribute.- Parameters:
orderItem
- the order itemattributeName
- the attribute name- Returns:
- the order item attribute
-
getOrderAttribute
When you call this function after a OrderReadHelper instantiation all OrderAttributes related to the orderHeader are load on local cache to optimize database call, after we just filter the cache with attributeName wanted.- Parameters:
attributeName
- the attribute name- Returns:
- order attribute
-
getOrderTaxByTaxAuthGeoAndParty
public static Map<String,Object> getOrderTaxByTaxAuthGeoAndParty(List<GenericValue> orderAdjustments) Gets order tax by tax auth geo and party.- Parameters:
orderAdjustments
- the order adjustments- Returns:
- the order tax by tax auth geo and party
-
getOrderItemTaxByTaxAuthGeoAndPartyForDisplay
public static Map<String,Object> getOrderItemTaxByTaxAuthGeoAndPartyForDisplay(GenericValue orderItem, List<GenericValue> orderAdjustmentsOriginal) Gets order item tax by tax auth geo and party for display.- Parameters:
orderItem
- the order itemorderAdjustmentsOriginal
- the order adjustments original- Returns:
- the order item tax by tax auth geo and party for display
-
getOrderTaxByTaxAuthGeoAndPartyForDisplay
public static Map<String,Object> getOrderTaxByTaxAuthGeoAndPartyForDisplay(List<GenericValue> orderAdjustmentsOriginal) Gets order tax by tax auth geo and party for display.- Parameters:
orderAdjustmentsOriginal
- the order adjustments original- Returns:
- the order tax by tax auth geo and party for display
-
getBillingAccountBalance
public static BigDecimal getBillingAccountBalance(GenericValue billingAccount) throws GenericEntityException Calculates the "available" balance of a billing account, which is the net balance minus amount of pending (not cancelled, rejected, or received) order payments. When looking at using a billing account for a new order, you should use this method.- Parameters:
billingAccount
- the billing account record- Returns:
- return the "available" balance of a billing account
- Throws:
GenericEntityException
- the generic entity exception
-
getAccountLimit
Returns the accountLimit of the BillingAccount or BigDecimal ZERO if it is null- Parameters:
billingAccount
- the billing account- Returns:
- the account limit
- Throws:
GenericEntityException
- the generic entity exception
-
getShippableSizes
Gets shippable sizes.- Parameters:
shipGrouSeqId
- the ship grou seq id- Returns:
- the shippable sizes
-
getItemReceivedQuantity
Gets item received quantity.- Parameters:
orderItem
- the order item- Returns:
- the item received quantity
-