Package org.apache.ofbiz.order.order
Class OrderReadHelper
- java.lang.Object
-
- org.apache.ofbiz.order.order.OrderReadHelper
-
public class OrderReadHelper extends java.lang.Object
Utility class for easily extracting important information from ordersNOTE: 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.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<GenericValue>
adjustments
static java.lang.String
module
protected GenericValue
orderHeader
protected java.util.List<GenericValue>
orderItemAndShipGrp
protected java.util.List<GenericValue>
orderItemIssuances
protected java.util.List<GenericValue>
orderItemPriceInfos
protected java.util.List<GenericValue>
orderItems
protected java.util.List<GenericValue>
orderItemShipGrpInvResList
protected java.util.List<GenericValue>
orderReturnItems
protected java.util.List<GenericValue>
orderStatuses
protected java.util.List<GenericValue>
paymentPrefs
static java.math.BigDecimal
percentage
static java.math.RoundingMode
rounding
static int
scale
static int
taxCalcScale
static int
taxFinalScale
static java.math.RoundingMode
taxRounding
protected java.math.BigDecimal
totalPrice
static java.math.BigDecimal
ZERO
-
Constructor Summary
Constructors Modifier Constructor Description protected
OrderReadHelper()
OrderReadHelper(java.util.List<GenericValue> adjustments, java.util.List<GenericValue> orderItems)
OrderReadHelper(Delegator delegator, java.lang.String orderId)
OrderReadHelper(GenericValue orderHeader)
OrderReadHelper(GenericValue orderHeader, java.util.List<GenericValue> adjustments, java.util.List<GenericValue> orderItems)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static java.math.BigDecimal
calcItemAdjustment(GenericValue itemAdjustment, java.math.BigDecimal quantity, java.math.BigDecimal unitPrice)
static java.math.BigDecimal
calcItemAdjustment(GenericValue itemAdjustment, GenericValue item)
static java.math.BigDecimal
calcItemAdjustmentRecurringBd(GenericValue itemAdjustment, java.math.BigDecimal quantity, java.math.BigDecimal unitPrice)
static java.math.BigDecimal
calcItemAdjustments(java.math.BigDecimal quantity, java.math.BigDecimal unitPrice, java.util.List<GenericValue> adjustments, boolean includeOther, boolean includeTax, boolean includeShipping, boolean forTax, boolean forShipping)
static java.math.BigDecimal
calcItemAdjustmentsRecurringBd(java.math.BigDecimal quantity, java.math.BigDecimal unitPrice, java.util.List<GenericValue> adjustments, boolean includeOther, boolean includeTax, boolean includeShipping, boolean forTax, boolean forShipping)
static java.math.BigDecimal
calcOrderAdjustment(GenericValue orderAdjustment, java.math.BigDecimal orderSubTotal)
static java.math.BigDecimal
calcOrderAdjustments(java.util.List<GenericValue> orderHeaderAdjustments, java.math.BigDecimal subTotal, boolean includeOther, boolean includeTax, boolean includeShipping)
static java.math.BigDecimal
calcOrderPromoAdjustmentsBd(java.util.List<GenericValue> allOrderAdjustments)
static java.util.List<GenericValue>
filterOrderAdjustments(java.util.List<GenericValue> adjustments, boolean includeOther, boolean includeTax, boolean includeShipping, boolean forTax, boolean forShipping)
static java.math.BigDecimal
getAccountLimit(GenericValue billingAccount)
Returns the accountLimit of the BillingAccount or BigDecimal ZERO if it is nulljava.util.List<GenericValue>
getAdjustments()
java.lang.String
getAdjustmentType(GenericValue adjustment)
java.lang.String
getAffiliateId()
static java.math.BigDecimal
getAllOrderItemsAdjustmentsTotal(java.util.List<GenericValue> orderItems, java.util.List<GenericValue> adjustments, boolean includeOther, boolean includeTax, boolean includeShipping)
java.util.List<GenericValue>
getAvailableOrderHeaderAdjustments()
Get orderAdjustments that have no corresponding returnAdjustmentGenericValue
getBillFromParty()
Returns party from OrderRole of BILL_FROM_VENDORGenericValue
getBillingAccount()
static java.math.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.java.math.BigDecimal
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 setjava.math.BigDecimal
getBillingAccountPaymentPreferenceTotal()
java.math.BigDecimal
getBillingAccountReturnedCreditTotalBd()
Get the total return credited to the order billing accountsjava.math.BigDecimal
getBillingAccountReturnedRefundTotalBd()
Get the total return refunded to the order billing accountsjava.math.BigDecimal
getBillingAccountReturnedTotalByTypeBd(java.lang.String returnTypeId)
Gets the total refunded to the order billing account by type.GenericValue
getBillingAddress()
Deprecated.java.util.List<GenericValue>
getBillingLocations()
GenericValue
getBillToParty()
Returns party from OrderRole of BILL_TO_CUSTOMERjava.math.BigDecimal
getCreditCardPaymentPreferenceTotal()
java.lang.String
getCurrency()
java.lang.String
getCurrentItemStatus(GenericValue orderItem)
java.lang.String
getCurrentItemStatusString(GenericValue orderItem)
java.lang.String
getCurrentOrderItemWorkEffort(GenericValue orderItem)
java.lang.String
getCurrentStatusString()
java.lang.String
getDistributorId()
java.sql.Timestamp
getEarliestShipByDate()
GenericValue
getEndUserParty()
Returns party from OrderRole of END_USER_CUSTOMERjava.util.Map<java.lang.String,java.math.BigDecimal>
getFeatureIdQtyMap(java.lang.String shipGroupSeqId)
java.math.BigDecimal
getGiftCardPaymentPreferenceTotal()
java.math.BigDecimal
getHeaderTaxTotal()
static OrderReadHelper
getHelper(GenericValue orderHeader)
java.math.BigDecimal
getItemBackorderedQuantity(GenericValue orderItem)
java.math.BigDecimal
getItemCanceledQuantity(GenericValue orderItem)
java.util.Set<java.lang.String>
getItemFeatureSet(GenericValue item)
java.util.Map<java.lang.String,java.lang.Object>
getItemInfoMap(GenericValue item)
java.math.BigDecimal
getItemPendingShipmentQuantity(GenericValue orderItem)
java.math.BigDecimal
getItemPickedQuantityBd(GenericValue orderItem)
long
getItemPiecesIncluded(GenericValue item)
java.math.BigDecimal
getItemReceivedQuantity(GenericValue orderItem)
java.math.BigDecimal
getItemReservedQuantity(GenericValue orderItem)
java.math.BigDecimal
getItemShipGroupAssocShippedQuantity(GenericValue orderItem, java.lang.String shipGroupSeqId)
java.math.BigDecimal
getItemShippedQuantity(GenericValue orderItem)
java.math.BigDecimal
getItemSize(GenericValue item)
java.math.BigDecimal
getItemWeight(GenericValue item)
java.sql.Timestamp
getLatestShipAfterDate()
java.math.BigDecimal
getOrderAdjustmentsTotal()
static java.math.BigDecimal
getOrderAdjustmentsTotal(java.util.List<GenericValue> orderItems, java.util.List<GenericValue> adjustments)
java.math.BigDecimal
getOrderAdjustmentTotal(GenericValue adjustment)
java.lang.String
getOrderAttribute(java.lang.String attributeName)
java.math.BigDecimal
getOrderBackorderQuantity()
java.util.List<GenericValue>
getOrderContactMechs(java.lang.String purposeTypeId)
java.lang.String
getOrderEmailString()
java.math.BigDecimal
getOrderGrandTotal()
static java.math.BigDecimal
getOrderGrandTotal(java.util.List<GenericValue> orderItems, java.util.List<GenericValue> adjustments)
GenericValue
getOrderHeader()
Getter for property orderHeader.static GenericValue
getOrderHeader(Delegator delegator, java.lang.String orderId)
java.util.List<GenericValue>
getOrderHeaderAdjustments()
java.util.List<GenericValue>
getOrderHeaderAdjustments(java.lang.String shipGroupSeqId)
static java.util.List<GenericValue>
getOrderHeaderAdjustments(java.util.List<GenericValue> adjustments, java.lang.String shipGroupSeqId)
java.util.List<GenericValue>
getOrderHeaderAdjustmentsTax(java.lang.String shipGroupSeqId)
java.util.List<GenericValue>
getOrderHeaderAdjustmentsToShow()
java.util.List<GenericValue>
getOrderHeaderStatuses()
static java.util.List<GenericValue>
getOrderHeaderStatuses(java.util.List<GenericValue> orderStatuses)
java.lang.String
getOrderId()
GenericValue
getOrderItem(java.lang.String orderItemSeqId)
static java.util.List<GenericValue>
getOrderItemAdjustmentList(GenericValue orderItem, java.util.List<GenericValue> adjustments)
java.util.List<GenericValue>
getOrderItemAdjustments(GenericValue orderItem)
java.math.BigDecimal
getOrderItemAdjustmentsTotal(GenericValue orderItem)
java.math.BigDecimal
getOrderItemAdjustmentsTotal(GenericValue orderItem, boolean includeOther, boolean includeTax, boolean includeShipping)
static java.math.BigDecimal
getOrderItemAdjustmentsTotal(GenericValue orderItem, java.util.List<GenericValue> adjustments, boolean includeOther, boolean includeTax, boolean includeShipping)
The passed adjustments can be all adjustments for the order, ie for all line itemsstatic java.math.BigDecimal
getOrderItemAdjustmentsTotal(GenericValue orderItem, java.util.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 itemsjava.math.BigDecimal
getOrderItemAdjustmentTotal(GenericValue orderItem, GenericValue adjustment)
java.util.List<GenericValue>
getOrderItemAndShipGroupAssoc()
java.util.List<GenericValue>
getOrderItemAndShipGroupAssoc(java.lang.String shipGroupSeqId)
static java.lang.String
getOrderItemAttribute(GenericValue orderItem, java.lang.String attributeName)
static java.math.BigDecimal
getOrderItemInvoicedQuantity(GenericValue orderItem)
Get the quantity of order items that have been invoicedjava.util.List<GenericValue>
getOrderItemIssuances(GenericValue orderItem)
java.util.List<GenericValue>
getOrderItemIssuances(GenericValue orderItem, java.lang.String shipmentId)
java.util.List<GenericValue>
getOrderItemPriceInfos(GenericValue orderItem)
static java.math.BigDecimal
getOrderItemQuantity(GenericValue orderItem)
java.util.Map<java.lang.String,java.math.BigDecimal>
getOrderItemReturnedQuantities()
Get the quantity returned per order item.java.util.List<GenericValue>
getOrderItems()
java.util.List<GenericValue>
getOrderItemsByCondition(EntityCondition entityCondition)
Fetches the set of order items with the given EntityCondition.GenericValue
getOrderItemShipGroup(java.lang.String shipGroupSeqId)
java.util.List<GenericValue>
getOrderItemShipGroupAssocs(GenericValue orderItem)
static java.math.BigDecimal
getOrderItemShipGroupQuantity(GenericValue shipGroupAssoc)
java.util.List<GenericValue>
getOrderItemShipGroups()
java.util.List<GenericValue>
getOrderItemShipGrpInvResList(GenericValue orderItem)
java.math.BigDecimal
getOrderItemShipping(GenericValue orderItem)
java.math.BigDecimal
getOrderItemsSubTotal()
static java.math.BigDecimal
getOrderItemsSubTotal(java.util.List<GenericValue> orderItems, java.util.List<GenericValue> adjustments)
static java.math.BigDecimal
getOrderItemsSubTotal(java.util.List<GenericValue> orderItems, java.util.List<GenericValue> adjustments, java.util.List<GenericValue> workEfforts)
java.util.List<GenericValue>
getOrderItemStatuses(GenericValue orderItem)
static java.util.List<GenericValue>
getOrderItemStatuses(GenericValue orderItem, java.util.List<GenericValue> orderStatuses)
java.math.BigDecimal
getOrderItemsTotal()
static java.math.BigDecimal
getOrderItemsTotal(java.util.List<GenericValue> orderItems, java.util.List<GenericValue> adjustments)
java.math.BigDecimal
getOrderItemSubTotal(GenericValue orderItem)
static java.math.BigDecimal
getOrderItemSubTotal(GenericValue orderItem, java.util.List<GenericValue> adjustments)
The passed adjustments can be all adjustments for the order, ie for all line itemsstatic java.math.BigDecimal
getOrderItemSubTotal(GenericValue orderItem, java.util.List<GenericValue> adjustments, boolean forTax, boolean forShipping)
The passed adjustments can be all adjustments for the order, ie for all line itemsstatic java.util.List<GenericValue>
getOrderItemSurveyResponse(GenericValue orderItem)
java.math.BigDecimal
getOrderItemTax(GenericValue orderItem)
static java.util.Map<java.lang.String,java.lang.Object>
getOrderItemTaxByTaxAuthGeoAndPartyForDisplay(GenericValue orderItem, java.util.List<GenericValue> orderAdjustmentsOriginal)
java.math.BigDecimal
getOrderItemTotal(GenericValue orderItem)
static java.math.BigDecimal
getOrderItemTotal(GenericValue orderItem, java.util.List<GenericValue> adjustments)
java.lang.String
getOrderName()
java.math.BigDecimal
getOrderNonReturnedTaxAndShipping()
java.math.BigDecimal
getOrderOpenAmount()
Gets the amount open on the order that is not covered by the relevant OrderPaymentPreferences.java.math.BigDecimal
getOrderPaymentPreferenceTotalByType(java.lang.String paymentMethodTypeId)
Get the total payment preference amount by payment type.java.math.BigDecimal
getOrderPaymentReceivedTotalByType(java.lang.String paymentMethodTypeId)
Get the total payment received amount by payment type.java.util.List<GenericValue>
getOrderPayments()
java.util.List<GenericValue>
getOrderPayments(GenericValue orderPaymentPreference)
java.util.List<GenericValue>
getOrderPaymentStatuses()
static java.util.List<GenericValue>
getOrderPaymentStatuses(java.util.List<GenericValue> orderStatuses)
java.util.Collection<java.lang.String>
getOrderProductIds()
Get a set of productIds in the order.java.math.BigDecimal
getOrderReturnedCreditTotalBd()
Gets the total return credit for COMPLETED and RECEIVED returns.java.math.BigDecimal
getOrderReturnedQuantity()
Get the total quantity of returned items for an order.java.math.BigDecimal
getOrderReturnedRefundTotalBd()
Gets the total return refunded for COMPLETED and RECEIVED returns.java.math.BigDecimal
getOrderReturnedTotal()
Gets the total return amount (all return types) for COMPLETED and RECEIVED returns.java.math.BigDecimal
getOrderReturnedTotal(boolean includeAll)
Gets the total returned over all return types.java.math.BigDecimal
getOrderReturnedTotalByTypeBd(java.lang.String returnTypeId, boolean includeAll)
Get the returned total by return type (credit, refund, etc.).java.util.List<GenericValue>
getOrderReturnItems()
java.util.List<GenericValue>
getOrderStatuses()
static java.util.List<GenericValue>
getOrderSurveyResponses(GenericValue orderHeader)
static java.util.Map<java.lang.String,java.lang.Object>
getOrderTaxByTaxAuthGeoAndParty(java.util.List<GenericValue> orderAdjustments)
static java.util.Map<java.lang.String,java.lang.Object>
getOrderTaxByTaxAuthGeoAndPartyForDisplay(java.util.List<GenericValue> orderAdjustmentsOriginal)
java.lang.Long
getOrderTermNetDays()
Return the number of days from termDays of first FIN_PAYMENT_TERMjava.util.List<GenericValue>
getOrderTerms()
java.lang.String
getOrderTypeId()
boolean
getPartiallyReceivedItems()
GenericValue
getPartyFromRole(java.lang.String roleTypeId)
boolean
getPastEtaOrderItems(java.lang.String orderId)
java.util.List<GenericValue>
getPaymentPreferences()
GenericValue
getPlacingParty()
Returns party from OrderRole of PLACING_CUSTOMERjava.util.Set<java.lang.String>
getProductPromoCodesEntered()
java.util.List<GenericValue>
getProductPromoUse()
GenericValue
getProductStore()
Returns the ProductStore of this Order or null in case of Exceptionstatic GenericValue
getProductStoreFromOrder(Delegator delegator, java.lang.String orderId)
static GenericValue
getProductStoreFromOrder(GenericValue orderHeader)
java.lang.String
getProductStoreId()
static java.math.BigDecimal
getQuantityOnOrder(Delegator delegator, java.lang.String productId)
java.util.Map<java.lang.String,java.math.BigDecimal>
getReceivedPaymentTotalsByPaymentMethod()
Returns a Map of paymentMethodId -> amount charged (BigDecimal) based on PaymentGatewayResponse.boolean
getRejectedOrderItems()
static java.math.BigDecimal
getReturnAdjustmentTotal(Delegator delegator, java.util.Map<java.lang.String,java.lang.Object> condition)
Get the total return adjustments for a set of key -> value condition pairs.java.math.BigDecimal
getReturnedCreditTotalWithBillingAccountBd()
Gets the total return credited amount with refunds and credits to the billing account figured injava.math.BigDecimal
getReturnedRefundTotalWithBillingAccountBd()
Gets the total return refund amount with refunds and credits to the billing account figured injava.util.Map<java.lang.String,java.math.BigDecimal>
getReturnedTotalsByPaymentMethod()
Returns a Map of paymentMethodId -> amount refundedjava.util.List<java.util.Map<java.lang.String,java.lang.Object>>
getShippableItemInfo(java.lang.String shipGroupSeqId)
java.math.BigDecimal
getShippableQuantity()
java.math.BigDecimal
getShippableQuantity(java.lang.String shipGroupSeqId)
java.util.List<java.math.BigDecimal>
getShippableSizes()
java.util.List<java.math.BigDecimal>
getShippableSizes(java.lang.String shipGrouSeqId)
java.math.BigDecimal
getShippableTotal(java.lang.String shipGroupSeqId)
java.math.BigDecimal
getShippableWeight(java.lang.String shipGroupSeqId)
GenericValue
getShippingAddress()
Deprecated.GenericValue
getShippingAddress(java.lang.String shipGroupSeqId)
java.util.List<GenericValue>
getShippingLocations()
java.lang.String
getShippingMethod(java.lang.String shipGroupSeqId)
java.lang.String
getShippingMethodCode(java.lang.String shipGroupSeqId)
java.math.BigDecimal
getShippingTotal()
GenericValue
getShipToParty()
Returns party from OrderRole of SHIP_TO_CUSTOMERjava.lang.String
getStatusString(java.util.Locale locale)
GenericValue
getSupplierAgent()
Returns party from OrderRole of SUPPLIER_AGENTjava.math.BigDecimal
getTaxTotal()
java.math.BigDecimal
getTotalOrderItemsOrderedQuantity()
java.math.BigDecimal
getTotalOrderItemsQuantity()
java.util.List<GenericValue>
getValidDigitalItems()
java.util.List<GenericValue>
getValidOrderItems()
java.util.List<GenericValue>
getValidOrderItems(java.lang.String shipGroupSeqId)
java.lang.String
getWebSiteId()
static java.math.BigDecimal
getWorkEffortRentalLength(GenericValue workEffort)
static java.math.BigDecimal
getWorkEffortRentalQuantity(GenericValue workEffort)
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
hasPhysicalProductItems()
boolean
hasShippingAddress()
int
hasSurvey()
static java.math.BigDecimal
setScaleByType(boolean isTax, java.math.BigDecimal value)
boolean
shippingApplies()
boolean
taxApplies()
-
-
-
Field Detail
-
module
public static final java.lang.String module
-
scale
public static final int scale
-
rounding
public static final java.math.RoundingMode rounding
-
taxCalcScale
public static final int taxCalcScale
-
taxFinalScale
public static final int taxFinalScale
-
taxRounding
public static final java.math.RoundingMode taxRounding
-
ZERO
public static final java.math.BigDecimal ZERO
-
percentage
public static final java.math.BigDecimal percentage
-
orderHeader
protected GenericValue orderHeader
-
orderItemAndShipGrp
protected java.util.List<GenericValue> orderItemAndShipGrp
-
orderItems
protected java.util.List<GenericValue> orderItems
-
adjustments
protected java.util.List<GenericValue> adjustments
-
paymentPrefs
protected java.util.List<GenericValue> paymentPrefs
-
orderStatuses
protected java.util.List<GenericValue> orderStatuses
-
orderItemPriceInfos
protected java.util.List<GenericValue> orderItemPriceInfos
-
orderItemShipGrpInvResList
protected java.util.List<GenericValue> orderItemShipGrpInvResList
-
orderItemIssuances
protected java.util.List<GenericValue> orderItemIssuances
-
orderReturnItems
protected java.util.List<GenericValue> orderReturnItems
-
totalPrice
protected java.math.BigDecimal totalPrice
-
-
Constructor Detail
-
OrderReadHelper
protected OrderReadHelper()
-
OrderReadHelper
public OrderReadHelper(GenericValue orderHeader, java.util.List<GenericValue> adjustments, java.util.List<GenericValue> orderItems)
-
OrderReadHelper
public OrderReadHelper(GenericValue orderHeader)
-
OrderReadHelper
public OrderReadHelper(java.util.List<GenericValue> adjustments, java.util.List<GenericValue> orderItems)
-
OrderReadHelper
public OrderReadHelper(Delegator delegator, java.lang.String orderId)
-
-
Method Detail
-
getOrderId
public java.lang.String getOrderId()
-
getWebSiteId
public java.lang.String getWebSiteId()
-
getProductStoreId
public java.lang.String getProductStoreId()
-
getProductStore
public GenericValue getProductStore()
Returns the ProductStore of this Order or null in case of Exception
-
getOrderTypeId
public java.lang.String getOrderTypeId()
-
getCurrency
public java.lang.String getCurrency()
-
getOrderName
public java.lang.String getOrderName()
-
getAdjustments
public java.util.List<GenericValue> getAdjustments()
-
getPaymentPreferences
public java.util.List<GenericValue> getPaymentPreferences()
-
getReceivedPaymentTotalsByPaymentMethod
public java.util.Map<java.lang.String,java.math.BigDecimal> 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
public java.util.Map<java.lang.String,java.math.BigDecimal> getReturnedTotalsByPaymentMethod()
Returns a Map of paymentMethodId -> amount refunded- Returns:
- returns a Map of paymentMethodId -> amount refunded
-
getOrderPayments
public java.util.List<GenericValue> getOrderPayments()
-
getOrderPayments
public java.util.List<GenericValue> getOrderPayments(GenericValue orderPaymentPreference)
-
getOrderStatuses
public java.util.List<GenericValue> getOrderStatuses()
-
getOrderTerms
public java.util.List<GenericValue> getOrderTerms()
-
getOrderTermNetDays
public java.lang.Long 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
public java.lang.String getShippingMethod(java.lang.String shipGroupSeqId)
-
getShippingMethodCode
public java.lang.String getShippingMethodCode(java.lang.String shipGroupSeqId)
-
hasShippingAddress
public boolean hasShippingAddress()
-
hasPhysicalProductItems
public boolean hasPhysicalProductItems() throws GenericEntityException
- Throws:
GenericEntityException
-
getOrderItemShipGroup
public GenericValue getOrderItemShipGroup(java.lang.String shipGroupSeqId)
-
getOrderItemShipGroups
public java.util.List<GenericValue> getOrderItemShipGroups()
-
getShippingLocations
public java.util.List<GenericValue> getShippingLocations()
-
getShippingAddress
public GenericValue getShippingAddress(java.lang.String shipGroupSeqId)
-
getShippingAddress
@Deprecated public GenericValue getShippingAddress()
Deprecated.
-
getBillingLocations
public java.util.List<GenericValue> getBillingLocations()
-
getBillingAddress
@Deprecated public GenericValue getBillingAddress()
Deprecated.
-
getOrderContactMechs
public java.util.List<GenericValue> getOrderContactMechs(java.lang.String purposeTypeId)
-
getEarliestShipByDate
public java.sql.Timestamp getEarliestShipByDate()
-
getLatestShipAfterDate
public java.sql.Timestamp getLatestShipAfterDate()
-
getCurrentStatusString
public java.lang.String getCurrentStatusString()
-
getStatusString
public java.lang.String getStatusString(java.util.Locale locale)
-
getBillingAccount
public GenericValue getBillingAccount()
-
getBillingAccountMaxAmount
public java.math.BigDecimal 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
-
getBillToParty
public GenericValue getBillToParty()
Returns party from OrderRole of BILL_TO_CUSTOMER
-
getBillFromParty
public GenericValue getBillFromParty()
Returns party from OrderRole of BILL_FROM_VENDOR
-
getShipToParty
public GenericValue getShipToParty()
Returns party from OrderRole of SHIP_TO_CUSTOMER
-
getPlacingParty
public GenericValue getPlacingParty()
Returns party from OrderRole of PLACING_CUSTOMER
-
getEndUserParty
public GenericValue getEndUserParty()
Returns party from OrderRole of END_USER_CUSTOMER
-
getSupplierAgent
public GenericValue getSupplierAgent()
Returns party from OrderRole of SUPPLIER_AGENT
-
getPartyFromRole
public GenericValue getPartyFromRole(java.lang.String roleTypeId)
-
getDistributorId
public java.lang.String getDistributorId()
-
getAffiliateId
public java.lang.String getAffiliateId()
-
getShippingTotal
public java.math.BigDecimal getShippingTotal()
-
getHeaderTaxTotal
public java.math.BigDecimal getHeaderTaxTotal()
-
getTaxTotal
public java.math.BigDecimal getTaxTotal()
-
getItemFeatureSet
public java.util.Set<java.lang.String> getItemFeatureSet(GenericValue item)
-
getFeatureIdQtyMap
public java.util.Map<java.lang.String,java.math.BigDecimal> getFeatureIdQtyMap(java.lang.String shipGroupSeqId)
-
shippingApplies
public boolean shippingApplies()
-
taxApplies
public boolean taxApplies()
-
getShippableTotal
public java.math.BigDecimal getShippableTotal(java.lang.String shipGroupSeqId)
-
getShippableQuantity
public java.math.BigDecimal getShippableQuantity()
-
getShippableQuantity
public java.math.BigDecimal getShippableQuantity(java.lang.String shipGroupSeqId)
-
getShippableWeight
public java.math.BigDecimal getShippableWeight(java.lang.String shipGroupSeqId)
-
getItemWeight
public java.math.BigDecimal getItemWeight(GenericValue item)
-
getShippableSizes
public java.util.List<java.math.BigDecimal> getShippableSizes()
-
getOrderPaymentPreferenceTotalByType
public java.math.BigDecimal getOrderPaymentPreferenceTotalByType(java.lang.String paymentMethodTypeId)
Get the total payment preference amount by payment type. Specify null to get amount for all preference types. TODO: filter by status as well?
-
getCreditCardPaymentPreferenceTotal
public java.math.BigDecimal getCreditCardPaymentPreferenceTotal()
-
getBillingAccountPaymentPreferenceTotal
public java.math.BigDecimal getBillingAccountPaymentPreferenceTotal()
-
getGiftCardPaymentPreferenceTotal
public java.math.BigDecimal getGiftCardPaymentPreferenceTotal()
-
getOrderPaymentReceivedTotalByType
public java.math.BigDecimal getOrderPaymentReceivedTotalByType(java.lang.String paymentMethodTypeId)
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.
-
getItemSize
public java.math.BigDecimal getItemSize(GenericValue item)
-
getItemPiecesIncluded
public long getItemPiecesIncluded(GenericValue item)
-
getShippableItemInfo
public java.util.List<java.util.Map<java.lang.String,java.lang.Object>> getShippableItemInfo(java.lang.String shipGroupSeqId)
-
getItemInfoMap
public java.util.Map<java.lang.String,java.lang.Object> getItemInfoMap(GenericValue item)
-
getOrderEmailString
public java.lang.String getOrderEmailString()
-
getOrderGrandTotal
public java.math.BigDecimal getOrderGrandTotal()
-
getOrderOpenAmount
public java.math.BigDecimal getOrderOpenAmount() throws GenericEntityException
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.- Throws:
GenericEntityException
-
getOrderHeaderAdjustments
public java.util.List<GenericValue> getOrderHeaderAdjustments()
-
getOrderHeaderAdjustments
public java.util.List<GenericValue> getOrderHeaderAdjustments(java.lang.String shipGroupSeqId)
-
getOrderHeaderAdjustmentsTax
public java.util.List<GenericValue> getOrderHeaderAdjustmentsTax(java.lang.String shipGroupSeqId)
-
getOrderHeaderAdjustmentsToShow
public java.util.List<GenericValue> getOrderHeaderAdjustmentsToShow()
-
getOrderHeaderStatuses
public java.util.List<GenericValue> getOrderHeaderStatuses()
-
getOrderAdjustmentsTotal
public java.math.BigDecimal getOrderAdjustmentsTotal()
-
getOrderAdjustmentTotal
public java.math.BigDecimal getOrderAdjustmentTotal(GenericValue adjustment)
-
hasSurvey
public int hasSurvey()
-
getOrderItems
public java.util.List<GenericValue> getOrderItems()
-
getOrderItemAndShipGroupAssoc
public java.util.List<GenericValue> getOrderItemAndShipGroupAssoc()
-
getOrderItemAndShipGroupAssoc
public java.util.List<GenericValue> getOrderItemAndShipGroupAssoc(java.lang.String shipGroupSeqId)
-
getValidOrderItems
public java.util.List<GenericValue> getValidOrderItems()
-
getPastEtaOrderItems
public boolean getPastEtaOrderItems(java.lang.String orderId)
-
getRejectedOrderItems
public boolean getRejectedOrderItems()
-
getPartiallyReceivedItems
public boolean getPartiallyReceivedItems()
-
getValidOrderItems
public java.util.List<GenericValue> getValidOrderItems(java.lang.String shipGroupSeqId)
-
getOrderItem
public GenericValue getOrderItem(java.lang.String orderItemSeqId)
-
getValidDigitalItems
public java.util.List<GenericValue> getValidDigitalItems()
-
getOrderItemAdjustments
public java.util.List<GenericValue> getOrderItemAdjustments(GenericValue orderItem)
-
getCurrentOrderItemWorkEffort
public java.lang.String getCurrentOrderItemWorkEffort(GenericValue orderItem)
-
getCurrentItemStatus
public java.lang.String getCurrentItemStatus(GenericValue orderItem)
-
getOrderItemPriceInfos
public java.util.List<GenericValue> getOrderItemPriceInfos(GenericValue orderItem)
-
getOrderItemShipGroupAssocs
public java.util.List<GenericValue> getOrderItemShipGroupAssocs(GenericValue orderItem)
-
getOrderItemShipGrpInvResList
public java.util.List<GenericValue> getOrderItemShipGrpInvResList(GenericValue orderItem)
-
getOrderItemIssuances
public java.util.List<GenericValue> getOrderItemIssuances(GenericValue orderItem)
-
getOrderItemIssuances
public java.util.List<GenericValue> getOrderItemIssuances(GenericValue orderItem, java.lang.String shipmentId)
-
getOrderProductIds
public java.util.Collection<java.lang.String> getOrderProductIds()
Get a set of productIds in the order.
-
getOrderReturnItems
public java.util.List<GenericValue> getOrderReturnItems()
-
getOrderItemReturnedQuantities
public java.util.Map<java.lang.String,java.math.BigDecimal> 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
public java.math.BigDecimal getOrderReturnedQuantity()
Get the total quantity of returned items for an order. This will count only the ReturnItems that are directly correlated to an OrderItem.
-
getOrderReturnedTotalByTypeBd
public java.math.BigDecimal getOrderReturnedTotalByTypeBd(java.lang.String returnTypeId, boolean includeAll)
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.
-
getOrderReturnedCreditTotalBd
public java.math.BigDecimal getOrderReturnedCreditTotalBd()
Gets the total return credit for COMPLETED and RECEIVED returns.
-
getOrderReturnedRefundTotalBd
public java.math.BigDecimal getOrderReturnedRefundTotalBd()
Gets the total return refunded for COMPLETED and RECEIVED returns.
-
getOrderReturnedTotal
public java.math.BigDecimal getOrderReturnedTotal()
Gets the total return amount (all return types) for COMPLETED and RECEIVED returns.
-
getOrderReturnedTotal
public java.math.BigDecimal getOrderReturnedTotal(boolean includeAll)
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.
-
getOrderNonReturnedTaxAndShipping
public java.math.BigDecimal getOrderNonReturnedTaxAndShipping()
-
getBillingAccountReturnedTotalByTypeBd
public java.math.BigDecimal getBillingAccountReturnedTotalByTypeBd(java.lang.String returnTypeId)
Gets the total refunded to the order billing account by type. Specify null to get total over all types.
-
getBillingAccountReturnedCreditTotalBd
public java.math.BigDecimal getBillingAccountReturnedCreditTotalBd()
Get the total return credited to the order billing accounts
-
getBillingAccountReturnedRefundTotalBd
public java.math.BigDecimal getBillingAccountReturnedRefundTotalBd()
Get the total return refunded to the order billing accounts
-
getReturnedCreditTotalWithBillingAccountBd
public java.math.BigDecimal getReturnedCreditTotalWithBillingAccountBd()
Gets the total return credited amount with refunds and credits to the billing account figured in
-
getReturnedRefundTotalWithBillingAccountBd
public java.math.BigDecimal getReturnedRefundTotalWithBillingAccountBd()
Gets the total return refund amount with refunds and credits to the billing account figured in
-
getOrderBackorderQuantity
public java.math.BigDecimal getOrderBackorderQuantity()
-
getItemPickedQuantityBd
public java.math.BigDecimal getItemPickedQuantityBd(GenericValue orderItem)
-
getItemShippedQuantity
public java.math.BigDecimal getItemShippedQuantity(GenericValue orderItem)
-
getItemShipGroupAssocShippedQuantity
public java.math.BigDecimal getItemShipGroupAssocShippedQuantity(GenericValue orderItem, java.lang.String shipGroupSeqId)
-
getItemReservedQuantity
public java.math.BigDecimal getItemReservedQuantity(GenericValue orderItem)
-
getItemBackorderedQuantity
public java.math.BigDecimal getItemBackorderedQuantity(GenericValue orderItem)
-
getItemPendingShipmentQuantity
public java.math.BigDecimal getItemPendingShipmentQuantity(GenericValue orderItem)
-
getItemCanceledQuantity
public java.math.BigDecimal getItemCanceledQuantity(GenericValue orderItem)
-
getTotalOrderItemsQuantity
public java.math.BigDecimal getTotalOrderItemsQuantity()
-
getTotalOrderItemsOrderedQuantity
public java.math.BigDecimal getTotalOrderItemsOrderedQuantity()
-
getOrderItemsSubTotal
public java.math.BigDecimal getOrderItemsSubTotal()
-
getOrderItemSubTotal
public java.math.BigDecimal getOrderItemSubTotal(GenericValue orderItem)
-
getOrderItemsTotal
public java.math.BigDecimal getOrderItemsTotal()
-
getOrderItemTotal
public java.math.BigDecimal getOrderItemTotal(GenericValue orderItem)
-
getOrderItemTax
public java.math.BigDecimal getOrderItemTax(GenericValue orderItem)
-
getOrderItemShipping
public java.math.BigDecimal getOrderItemShipping(GenericValue orderItem)
-
getOrderItemAdjustmentsTotal
public java.math.BigDecimal getOrderItemAdjustmentsTotal(GenericValue orderItem, boolean includeOther, boolean includeTax, boolean includeShipping)
-
getOrderItemAdjustmentsTotal
public java.math.BigDecimal getOrderItemAdjustmentsTotal(GenericValue orderItem)
-
getOrderItemAdjustmentTotal
public java.math.BigDecimal getOrderItemAdjustmentTotal(GenericValue orderItem, GenericValue adjustment)
-
getAdjustmentType
public java.lang.String getAdjustmentType(GenericValue adjustment)
-
getOrderItemStatuses
public java.util.List<GenericValue> getOrderItemStatuses(GenericValue orderItem)
-
getCurrentItemStatusString
public java.lang.String getCurrentItemStatusString(GenericValue orderItem)
-
getOrderItemsByCondition
public java.util.List<GenericValue> getOrderItemsByCondition(EntityCondition entityCondition)
Fetches the set of order items with the given EntityCondition.
-
getProductPromoCodesEntered
public java.util.Set<java.lang.String> getProductPromoCodesEntered()
-
getProductPromoUse
public java.util.List<GenericValue> getProductPromoUse()
-
hasPermission
public boolean hasPermission(Security security, GenericValue userLogin)
Checks to see if this user has read permission on this order- Parameters:
userLogin
- The UserLogin value object to check- Returns:
- boolean True if we have read permission
-
getOrderHeader
public GenericValue getOrderHeader()
Getter for property orderHeader.- Returns:
- Value of property orderHeader.
-
getOrderHeader
public static GenericValue getOrderHeader(Delegator delegator, java.lang.String orderId)
-
getOrderItemQuantity
public static java.math.BigDecimal getOrderItemQuantity(GenericValue orderItem)
-
getOrderItemShipGroupQuantity
public static java.math.BigDecimal getOrderItemShipGroupQuantity(GenericValue shipGroupAssoc)
-
getProductStoreFromOrder
public static GenericValue getProductStoreFromOrder(Delegator delegator, java.lang.String orderId)
-
getProductStoreFromOrder
public static GenericValue getProductStoreFromOrder(GenericValue orderHeader)
-
getOrderGrandTotal
public static java.math.BigDecimal getOrderGrandTotal(java.util.List<GenericValue> orderItems, java.util.List<GenericValue> adjustments)
-
getOrderHeaderAdjustments
public static java.util.List<GenericValue> getOrderHeaderAdjustments(java.util.List<GenericValue> adjustments, java.lang.String shipGroupSeqId)
-
getOrderHeaderStatuses
public static java.util.List<GenericValue> getOrderHeaderStatuses(java.util.List<GenericValue> orderStatuses)
-
getOrderAdjustmentsTotal
public static java.math.BigDecimal getOrderAdjustmentsTotal(java.util.List<GenericValue> orderItems, java.util.List<GenericValue> adjustments)
-
getOrderSurveyResponses
public static java.util.List<GenericValue> getOrderSurveyResponses(GenericValue orderHeader)
-
getOrderItemSurveyResponse
public static java.util.List<GenericValue> getOrderItemSurveyResponse(GenericValue orderItem)
-
calcOrderAdjustments
public static java.math.BigDecimal calcOrderAdjustments(java.util.List<GenericValue> orderHeaderAdjustments, java.math.BigDecimal subTotal, boolean includeOther, boolean includeTax, boolean includeShipping)
-
calcOrderAdjustment
public static java.math.BigDecimal calcOrderAdjustment(GenericValue orderAdjustment, java.math.BigDecimal orderSubTotal)
-
getOrderItemsSubTotal
public static java.math.BigDecimal getOrderItemsSubTotal(java.util.List<GenericValue> orderItems, java.util.List<GenericValue> adjustments)
-
getOrderItemsSubTotal
public static java.math.BigDecimal getOrderItemsSubTotal(java.util.List<GenericValue> orderItems, java.util.List<GenericValue> adjustments, java.util.List<GenericValue> workEfforts)
-
getOrderItemSubTotal
public static java.math.BigDecimal getOrderItemSubTotal(GenericValue orderItem, java.util.List<GenericValue> adjustments)
The passed adjustments can be all adjustments for the order, ie for all line items
-
getOrderItemSubTotal
public static java.math.BigDecimal getOrderItemSubTotal(GenericValue orderItem, java.util.List<GenericValue> adjustments, boolean forTax, boolean forShipping)
The passed adjustments can be all adjustments for the order, ie for all line items
-
getOrderItemsTotal
public static java.math.BigDecimal getOrderItemsTotal(java.util.List<GenericValue> orderItems, java.util.List<GenericValue> adjustments)
-
getOrderItemTotal
public static java.math.BigDecimal getOrderItemTotal(GenericValue orderItem, java.util.List<GenericValue> adjustments)
-
calcOrderPromoAdjustmentsBd
public static java.math.BigDecimal calcOrderPromoAdjustmentsBd(java.util.List<GenericValue> allOrderAdjustments)
-
getWorkEffortRentalLength
public static java.math.BigDecimal getWorkEffortRentalLength(GenericValue workEffort)
-
getWorkEffortRentalQuantity
public static java.math.BigDecimal getWorkEffortRentalQuantity(GenericValue workEffort)
-
getAllOrderItemsAdjustmentsTotal
public static java.math.BigDecimal getAllOrderItemsAdjustmentsTotal(java.util.List<GenericValue> orderItems, java.util.List<GenericValue> adjustments, boolean includeOther, boolean includeTax, boolean includeShipping)
-
getOrderItemAdjustmentsTotal
public static java.math.BigDecimal getOrderItemAdjustmentsTotal(GenericValue orderItem, java.util.List<GenericValue> adjustments, boolean includeOther, boolean includeTax, boolean includeShipping)
The passed adjustments can be all adjustments for the order, ie for all line items
-
getOrderItemAdjustmentsTotal
public static java.math.BigDecimal getOrderItemAdjustmentsTotal(GenericValue orderItem, java.util.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
-
getOrderItemAdjustmentList
public static java.util.List<GenericValue> getOrderItemAdjustmentList(GenericValue orderItem, java.util.List<GenericValue> adjustments)
-
getOrderItemStatuses
public static java.util.List<GenericValue> getOrderItemStatuses(GenericValue orderItem, java.util.List<GenericValue> orderStatuses)
-
calcItemAdjustments
public static java.math.BigDecimal calcItemAdjustments(java.math.BigDecimal quantity, java.math.BigDecimal unitPrice, java.util.List<GenericValue> adjustments, boolean includeOther, boolean includeTax, boolean includeShipping, boolean forTax, boolean forShipping)
-
calcItemAdjustmentsRecurringBd
public static java.math.BigDecimal calcItemAdjustmentsRecurringBd(java.math.BigDecimal quantity, java.math.BigDecimal unitPrice, java.util.List<GenericValue> adjustments, boolean includeOther, boolean includeTax, boolean includeShipping, boolean forTax, boolean forShipping)
-
calcItemAdjustment
public static java.math.BigDecimal calcItemAdjustment(GenericValue itemAdjustment, GenericValue item)
-
calcItemAdjustment
public static java.math.BigDecimal calcItemAdjustment(GenericValue itemAdjustment, java.math.BigDecimal quantity, java.math.BigDecimal unitPrice)
-
calcItemAdjustmentRecurringBd
public static java.math.BigDecimal calcItemAdjustmentRecurringBd(GenericValue itemAdjustment, java.math.BigDecimal quantity, java.math.BigDecimal unitPrice)
-
filterOrderAdjustments
public static java.util.List<GenericValue> filterOrderAdjustments(java.util.List<GenericValue> adjustments, boolean includeOther, boolean includeTax, boolean includeShipping, boolean forTax, boolean forShipping)
-
getQuantityOnOrder
public static java.math.BigDecimal getQuantityOnOrder(Delegator delegator, java.lang.String productId)
-
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:
userLogin
- The UserLogin value object to checkorderHeader
- The OrderHeader for the specified order- Returns:
- boolean True if we have read permission
-
getHelper
public static OrderReadHelper getHelper(GenericValue orderHeader)
-
getAvailableOrderHeaderAdjustments
public java.util.List<GenericValue> getAvailableOrderHeaderAdjustments()
Get orderAdjustments that have no corresponding returnAdjustment- Returns:
- return the order adjustments that have no corresponding with return adjustment
-
getReturnAdjustmentTotal
public static java.math.BigDecimal getReturnAdjustmentTotal(Delegator delegator, java.util.Map<java.lang.String,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
- a map of the conditions to use- Returns:
- Get the total return adjustments
-
setScaleByType
public static java.math.BigDecimal setScaleByType(boolean isTax, java.math.BigDecimal value)
-
getOrderItemInvoicedQuantity
public static java.math.BigDecimal getOrderItemInvoicedQuantity(GenericValue orderItem)
Get the quantity of order items that have been invoiced
-
getOrderPaymentStatuses
public java.util.List<GenericValue> getOrderPaymentStatuses()
-
getOrderPaymentStatuses
public static java.util.List<GenericValue> getOrderPaymentStatuses(java.util.List<GenericValue> orderStatuses)
-
getOrderItemAttribute
public static java.lang.String getOrderItemAttribute(GenericValue orderItem, java.lang.String attributeName)
-
getOrderAttribute
public java.lang.String getOrderAttribute(java.lang.String attributeName)
-
getOrderTaxByTaxAuthGeoAndParty
public static java.util.Map<java.lang.String,java.lang.Object> getOrderTaxByTaxAuthGeoAndParty(java.util.List<GenericValue> orderAdjustments)
-
getOrderItemTaxByTaxAuthGeoAndPartyForDisplay
public static java.util.Map<java.lang.String,java.lang.Object> getOrderItemTaxByTaxAuthGeoAndPartyForDisplay(GenericValue orderItem, java.util.List<GenericValue> orderAdjustmentsOriginal)
-
getOrderTaxByTaxAuthGeoAndPartyForDisplay
public static java.util.Map<java.lang.String,java.lang.Object> getOrderTaxByTaxAuthGeoAndPartyForDisplay(java.util.List<GenericValue> orderAdjustmentsOriginal)
-
getBillingAccountBalance
public static java.math.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
-
getAccountLimit
public static java.math.BigDecimal getAccountLimit(GenericValue billingAccount) throws GenericEntityException
Returns the accountLimit of the BillingAccount or BigDecimal ZERO if it is null- Parameters:
billingAccount
-- Throws:
GenericEntityException
-
getShippableSizes
public java.util.List<java.math.BigDecimal> getShippableSizes(java.lang.String shipGrouSeqId)
-
getItemReceivedQuantity
public java.math.BigDecimal getItemReceivedQuantity(GenericValue orderItem)
-
-