Class NullOrderImpl
- All Implemented Interfaces:
Serializable,org.broadleafcommerce.common.copy.MultiTenantCloneable<Order>,Order
- Author:
- apazzolini
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAddedOfferCode(OfferCode offerCode) voidaddOfferCode(OfferCode addedOfferCode) voidaddOrderItem(OrderItem orderItem) voidAssigns a final price to all the order itemsorg.broadleafcommerce.common.money.MoneyReturns the sum of the item totals.booleancontainsSku(Sku sku) Checks the DiscreteOrderItems in the cart and returns whether or not the given SKU was found.<G extends Order>
org.broadleafcommerce.common.copy.CreateResponse<G>createOrRetrieveCopyInstance(org.broadleafcommerce.common.copy.MultiTenantCopyContext context) booleanUpdates the averagePriceField for all order items.Returns a List of Adjustment originating from FUTURE_CREDIT Offers.org.broadleafcommerce.common.audit.AuditableGets the auditable associated with this Order instance which tracks changes made to this Order (creation/update)This method returns null from the default implementation.org.broadleafcommerce.common.currency.domain.BroadleafCurrencyThe currency that theOrderis priced in.org.broadleafcommerce.profile.core.domain.CustomerGets theCustomerfor thisOrder.org.broadleafcommerce.common.money.MoneyGets theFulfillmentGroups associated with thisOrder.org.broadleafcommerce.common.money.MoneyReturns the discount value of the applied future credit fulfillment offers for this order.org.broadleafcommerce.common.money.MoneyReturns the discount value of the applied future credit item offers for this order.Returns a List of OrderAdjustment originating from FUTURE_CREDIT Offers.org.broadleafcommerce.common.money.MoneyReturns the discount value of the applied future credit order offers originating.booleanReturns true if this item has order adjustments.getId()org.broadleafcommerce.common.money.MoneyReturns the discount value of all the applied item offers for this order.intThis method returns the total number of items in this order.org.broadleafcommerce.common.locale.domain.LocalegetName()Gets the name of the order, mainly in order to support wishlists.Returns a unmodifiable List of OrderAdjustment.org.broadleafcommerce.common.money.MoneyReturns the discount value of all the applied order offers.A list of arbitrary attributes added to this order.The unique number associated with thisOrder.Gets all theOrderPayments associated with thisOrder.Gets the status of the Order.Gets the date that thisOrderwas submitted.org.broadleafcommerce.common.money.MoneyReturns the subtotal price for the order.org.broadleafcommerce.common.money.MoneygetTotal()The grand total of thisOrderwhich includes all shipping costs and taxes, as well as any adjustments from promotions.org.broadleafcommerce.common.money.MoneyReturns the total discount value for all applied item and order offers in the order.org.broadleafcommerce.common.money.MoneyThis is getTotal() minus the sum of all theOrderPaymentalready applied to this order.org.broadleafcommerce.common.money.MoneyGets the total fulfillment costs that should be charged for thisOrder.org.broadleafcommerce.common.money.MoneyReturns the total discount value for applied item, order, and fulfillment offers in the order originating from FUTURE_CREDIT Offers.org.broadleafcommerce.common.money.Moneyorg.broadleafcommerce.common.money.MoneyGets the total tax for this order, which is the sum of the taxes on all fulfillment groups.booleanhasCategoryItem(String categoryName) Determines if thisOrderhas an item in the given category.voidsetAdditionalOfferInformation(Map<Offer, OfferInfo> additionalOfferInformation) voidsetAuditable(org.broadleafcommerce.common.audit.Auditable auditable) voidsetCandidateOrderOffers(List<CandidateOrderOffer> candidateOrderOffers) voidsetCurrency(org.broadleafcommerce.common.currency.domain.BroadleafCurrency currency) Set the currency that theOrderis priced in.voidsetCustomer(org.broadleafcommerce.profile.core.domain.Customer customer) Sets the associatedCustomerfor this Order.voidsetEmailAddress(String emailAddress) voidsetFulfillmentGroups(List<FulfillmentGroup> fulfillmentGroups) voidvoidsetLocale(org.broadleafcommerce.common.locale.domain.Locale locale) voidSets the name of the order in the context of a wishlist.voidsetOrderAttributes(Map<String, OrderAttribute> orderAttributes) Sets the map of order attributes.voidsetOrderItems(List<OrderItem> orderItems) voidsetOrderMessages(List<ActivityMessageDTO> orderMessages) voidsetOrderNumber(String orderNumber) Set the unique order number for thisOrdervoidsetPayments(List<OrderPayment> paymentInfos) Sets the various payment types associated with thisOrdervoidsetStatus(OrderStatus status) Sets the status of the OrdervoidsetSubmitDate(Date submitDate) Set the date that thisOrderwas submitted.voidsetSubTotal(org.broadleafcommerce.common.money.Money subTotal) Sets the subtotal price for the order.voidsetTaxOverride(Boolean taxOverride) Sets whether or not to override the tax calculationvoidsetTotal(org.broadleafcommerce.common.money.Money orderTotal) Used inTotalActivityto set the grand total of thisOrder.voidsetTotalFulfillmentCharges(org.broadleafcommerce.common.money.Money totalFulfillmentCharges) Set the total fulfillment cost of thisOrder.voidsetTotalShipping(org.broadleafcommerce.common.money.Money totalShipping) voidsetTotalTax(org.broadleafcommerce.common.money.Money totalTax) Sets the total tax of this order, which is the sum of the taxes on all fulfillment groups.boolean
-
Constructor Details
-
NullOrderImpl
public NullOrderImpl()
-
-
Method Details
-
getId
-
setId
-
getName
Description copied from interface:OrderGets the name of the order, mainly in order to support wishlists. -
setName
Description copied from interface:OrderSets the name of the order in the context of a wishlist. In this fashion, aCustomercan have multiple wishlists like "Christmas" or "Gaming Computer" etc. -
getAuditable
public org.broadleafcommerce.common.audit.Auditable getAuditable()Description copied from interface:OrderGets the auditable associated with this Order instance which tracks changes made to this Order (creation/update)- Specified by:
getAuditablein interfaceOrder- Returns:
-
setAuditable
public void setAuditable(org.broadleafcommerce.common.audit.Auditable auditable) - Specified by:
setAuditablein interfaceOrder
-
getSubTotal
public org.broadleafcommerce.common.money.Money getSubTotal()Description copied from interface:OrderReturns the subtotal price for the order. The subtotal price is the price of all order items with item offers applied. The subtotal does not take into account the order promotions, shipping costs or any taxes that apply to this order.- Specified by:
getSubTotalin interfaceOrder- Returns:
- the total item price with offers applied
-
setSubTotal
public void setSubTotal(org.broadleafcommerce.common.money.Money subTotal) Description copied from interface:OrderSets the subtotal price for the order. The subtotal price is the price of all order items with item offers applied. The subtotal does not take into account the order offers or any taxes that apply to this order.- Specified by:
setSubTotalin interfaceOrder
-
assignOrderItemsFinalPrice
public void assignOrderItemsFinalPrice()Description copied from interface:OrderAssigns a final price to all the order items- Specified by:
assignOrderItemsFinalPricein interfaceOrder
-
getTotal
public org.broadleafcommerce.common.money.Money getTotal()Description copied from interface:OrderThe grand total of thisOrderwhich includes all shipping costs and taxes, as well as any adjustments from promotions. -
setTotal
public void setTotal(org.broadleafcommerce.common.money.Money orderTotal) Description copied from interface:OrderUsed inTotalActivityto set the grand total of thisOrder. This includes the prices of all of theOrderItems as well as any taxes, fees, shipping and adjustments for all 3. -
getTotalAfterAppliedPayments
public org.broadleafcommerce.common.money.Money getTotalAfterAppliedPayments()Description copied from interface:OrderThis is getTotal() minus the sum of all theOrderPaymentalready applied to this order. An applied payment can be of any type that does NOT have to be the final payment on the order. In this implementation, THIRD_PARTY_ACCOUNT and CREDIT_CARD type payments must be sent to the gateway as the last step in the checkout process and will NOT be considered an applied payment. Since, these types have to be the last payment applied,AdjustOrderPaymentsActivitywill adjust the value of the payment based on what has already been applied to the order.For example, Gift Cards and Account Credit can be applied BEFORE a final payment (e.g. most Credit Card Gateways) is applied. This
OrderPaymentdoes not necessarily have to be confirmed (i.e. captured), as it will happen on callback of the final payment and will be captured in the checkout workflow.This method is used in cases where you need to determine the final amount to send to the gateways of what is left on the order minus what has already been applied.
- Specified by:
getTotalAfterAppliedPaymentsin interfaceOrder- Returns:
- the total price minus any payments that have been applied to this order already.
-
getCustomer
public org.broadleafcommerce.profile.core.domain.Customer getCustomer()Description copied from interface:OrderGets theCustomerfor thisOrder.- Specified by:
getCustomerin interfaceOrder- Returns:
-
setCustomer
public void setCustomer(org.broadleafcommerce.profile.core.domain.Customer customer) Description copied from interface:OrderSets the associatedCustomerfor this Order.- Specified by:
setCustomerin interfaceOrder
-
getStatus
Description copied from interface:OrderGets the status of the Order. -
setStatus
Description copied from interface:OrderSets the status of the Order -
getOrderItems
Description copied from interface:Order- Specified by:
getOrderItemsin interfaceOrder- Returns:
-
setOrderItems
- Specified by:
setOrderItemsin interfaceOrder
-
addOrderItem
Description copied from interface:Order- Specified by:
addOrderItemin interfaceOrder- Parameters:
orderItem- theOrderItemto add to thisOrder
-
getFulfillmentGroups
Description copied from interface:OrderGets theFulfillmentGroups associated with thisOrder. AnOrdercan have manyFulfillmentGroups associated with it in order to support multi-address (and multi-type) shipping.- Specified by:
getFulfillmentGroupsin interfaceOrder- Returns:
- the
FulfillmentGroups associated with thisOrder
-
setFulfillmentGroups
- Specified by:
setFulfillmentGroupsin interfaceOrder
-
getCandidateOrderOffers
Description copied from interface:Order- Specified by:
getCandidateOrderOffersin interfaceOrder- Returns:
-
setCandidateOrderOffers
Description copied from interface:Order- Specified by:
setCandidateOrderOffersin interfaceOrder
-
getSubmitDate
Description copied from interface:OrderGets the date that thisOrderwas submitted. Note that if this date is non-null, then the following should also be true:Order.getStatus()should returnOrderStatus.SUBMITTEDOrder.getOrderNumber()should return a non-null value
- Specified by:
getSubmitDatein interfaceOrder- Returns:
-
setSubmitDate
Description copied from interface:OrderSet the date that thisOrderwas submitted. Used in the blCheckoutWorkflow as the last step after everything else has been completed (payments charged, integration systems notified, etc).- Specified by:
setSubmitDatein interfaceOrder- Parameters:
submitDate- the date that thisOrderwas submitted.
-
getTotalTax
public org.broadleafcommerce.common.money.Money getTotalTax()Description copied from interface:OrderGets the total tax for this order, which is the sum of the taxes on all fulfillment groups. This total is calculated in the TotalActivity stage of the pricing workflow.- Specified by:
getTotalTaxin interfaceOrder- Returns:
- the total tax for the order
-
setTotalTax
public void setTotalTax(org.broadleafcommerce.common.money.Money totalTax) Description copied from interface:OrderSets the total tax of this order, which is the sum of the taxes on all fulfillment groups. This total should only be set during the TotalActivity stage of the pricing workflow.- Specified by:
setTotalTaxin interfaceOrder- Parameters:
totalTax- the total tax for this order
-
getTotalShipping
public org.broadleafcommerce.common.money.Money getTotalShipping()- Specified by:
getTotalShippingin interfaceOrder
-
setTotalShipping
public void setTotalShipping(org.broadleafcommerce.common.money.Money totalShipping) - Specified by:
setTotalShippingin interfaceOrder
-
getPayments
Description copied from interface:OrderGets all theOrderPayments associated with thisOrder. AnOrdercan have manyOrderPayments associated with it to support things like paying with multiple cards or perhaps paying some of thisOrderwith a gift card and some with a credit card.- Specified by:
getPaymentsin interfaceOrder- Returns:
- the
OrderPayments associated with thisOrder.
-
setPayments
Description copied from interface:OrderSets the various payment types associated with thisOrder- Specified by:
setPaymentsin interfaceOrder
-
hasCategoryItem
Description copied from interface:OrderDetermines if thisOrderhas an item in the given category.- Specified by:
hasCategoryItemin interfaceOrder- Parameters:
categoryName- theCategory.getName()to check- Returns:
- true if at least one
OrderItemis in the given category, false otherwise.
-
getOrderAdjustments
Description copied from interface:OrderReturns a unmodifiable List of OrderAdjustment. To modify the List of OrderAdjustment, please use the addOrderAdjustments or removeAllOrderAdjustments methods.- Specified by:
getOrderAdjustmentsin interfaceOrder- Returns:
- a unmodifiable List of OrderItemAdjustment
-
getFutureCreditOrderAdjustments
Description copied from interface:OrderReturns a List of OrderAdjustment originating from FUTURE_CREDIT Offers.See
Offer.getAdjustmentType()for more info on future credit- Specified by:
getFutureCreditOrderAdjustmentsin interfaceOrder- Returns:
- a List of OrderItemAdjustment
-
getAllFutureCreditAdjustments
Description copied from interface:OrderReturns a List of Adjustment originating from FUTURE_CREDIT Offers. This is obtained from the Order, OrderItem, and FulfillmentGroup levels.See
Offer.getAdjustmentType()for more info on future credit- Specified by:
getAllFutureCreditAdjustmentsin interfaceOrder- Returns:
- a List of OrderItemAdjustment
-
getDiscreteOrderItems
Description copied from interface:OrderReturns all of theOrderItems in thisOrderthat are an instanceofDiscreteOrderItem. This will also go into eachBundleOrderItem(if there are any) and return all of theBundleOrderItem.getDiscreteOrderItems()from each of those as well.- Specified by:
getDiscreteOrderItemsin interfaceOrder- Returns:
-
getNonDiscreteOrderItems
Description copied from interface:OrderReturns all of theOrderItems in thisOrderthat are an instanceofOrderItemImpl. This will return all of the order items that do not have any reference to a product or sku- Specified by:
getNonDiscreteOrderItemsin interfaceOrder- Returns:
-
containsSku
Description copied from interface:OrderChecks the DiscreteOrderItems in the cart and returns whether or not the given SKU was found. The equality of the SKUs is based on the .equals() method in SkuImpl. This includes checking theDiscreteOrderItems from {linkBundleOrderItem.getDiscreteOrderItems()- Specified by:
containsSkuin interfaceOrder- Parameters:
sku- The sku to check for- Returns:
- whether or not the given SKU exists in the cart
-
getAddedOfferCodes
- Specified by:
getAddedOfferCodesin interfaceOrder
-
getFulfillmentStatus
- Specified by:
getFulfillmentStatusin interfaceOrder
-
getOrderNumber
Description copied from interface:OrderThe unique number associated with thisOrder. Generally preferred to use instead of just usingOrder.getId()since that exposes unwanted information about your database.- Specified by:
getOrderNumberin interfaceOrder- Returns:
- the unique order number for this
Order
-
setOrderNumber
Description copied from interface:OrderSet the unique order number for thisOrder- Specified by:
setOrderNumberin interfaceOrder
-
getEmailAddress
- Specified by:
getEmailAddressin interfaceOrder
-
setEmailAddress
- Specified by:
setEmailAddressin interfaceOrder
-
getAdditionalOfferInformation
- Specified by:
getAdditionalOfferInformationin interfaceOrder
-
setAdditionalOfferInformation
- Specified by:
setAdditionalOfferInformationin interfaceOrder
-
getItemAdjustmentsValue
public org.broadleafcommerce.common.money.Money getItemAdjustmentsValue()Description copied from interface:OrderReturns the discount value of all the applied item offers for this order. This value is already deducted from the order subTotal.- Specified by:
getItemAdjustmentsValuein interfaceOrder- Returns:
- the discount value of all the applied item offers for this order
-
getFutureCreditItemAdjustmentsValue
public org.broadleafcommerce.common.money.Money getFutureCreditItemAdjustmentsValue()Description copied from interface:OrderReturns the discount value of the applied future credit item offers for this order.See
Offer.getAdjustmentType()for more info on future credit- Specified by:
getFutureCreditItemAdjustmentsValuein interfaceOrder- Returns:
- the discount value of the applied item offers for this order
-
getFutureCreditFulfillmentGroupAdjustmentsValue
public org.broadleafcommerce.common.money.Money getFutureCreditFulfillmentGroupAdjustmentsValue()Description copied from interface:OrderReturns the discount value of the applied future credit fulfillment offers for this order.See
Offer.getAdjustmentType()for more info on future credit- Specified by:
getFutureCreditFulfillmentGroupAdjustmentsValuein interfaceOrder- Returns:
- the discount value of the applied future credit fulfillment offers for this order.
-
getOrderAdjustmentsValue
public org.broadleafcommerce.common.money.Money getOrderAdjustmentsValue()Description copied from interface:OrderReturns the discount value of all the applied order offers. The value returned from this method should be subtracted from the getSubTotal() to get the order price with all item and order offers applied.- Specified by:
getOrderAdjustmentsValuein interfaceOrder- Returns:
- the discount value of all applied order offers.
-
getFutureCreditOrderAdjustmentsValue
public org.broadleafcommerce.common.money.Money getFutureCreditOrderAdjustmentsValue()Description copied from interface:OrderReturns the discount value of the applied future credit order offers originating.See
Offer.getAdjustmentType()for more info on future credit- Specified by:
getFutureCreditOrderAdjustmentsValuein interfaceOrder- Returns:
- the discount value of applied order offers.
-
getTotalAdjustmentsValue
public org.broadleafcommerce.common.money.Money getTotalAdjustmentsValue()Description copied from interface:OrderReturns the total discount value for all applied item and order offers in the order. The return value should not be used with getSubTotal() to calculate the final price, since getSubTotal() already takes into account the applied item offers.- Specified by:
getTotalAdjustmentsValuein interfaceOrder- Returns:
- the total discount of all applied item and order offers
-
getTotalFutureCreditAdjustmentsValue
public org.broadleafcommerce.common.money.Money getTotalFutureCreditAdjustmentsValue()Description copied from interface:OrderReturns the total discount value for applied item, order, and fulfillment offers in the order originating from FUTURE_CREDIT Offers. This should be used to credit the customer after the order has been placed.See
Offer.getAdjustmentType()for more info on future credit- Specified by:
getTotalFutureCreditAdjustmentsValuein interfaceOrder- Returns:
- the total discount of applied item, order, and fulfillment offers
-
updatePrices
public boolean updatePrices()Description copied from interface:Order- Specified by:
updatePricesin interfaceOrder- Returns:
- true if at least 1
OrderItemreturned true fromOrderItem#updatePrices, false otherwise.
-
getFulfillmentGroupAdjustmentsValue
public org.broadleafcommerce.common.money.Money getFulfillmentGroupAdjustmentsValue()- Specified by:
getFulfillmentGroupAdjustmentsValuein interfaceOrder
-
addOfferCode
- Specified by:
addOfferCodein interfaceOrder
-
addAddedOfferCode
- Specified by:
addAddedOfferCodein interfaceOrder
-
getOrderAttributes
Description copied from interface:OrderA list of arbitrary attributes added to this order.- Specified by:
getOrderAttributesin interfaceOrder
-
setOrderAttributes
Description copied from interface:OrderSets the map of order attributes.- Specified by:
setOrderAttributesin interfaceOrder
-
getItemCount
public int getItemCount()Description copied from interface:OrderThis method returns the total number of items in this order. It iterates through all of the discrete order items and sums up the quantity. This method is useful for display to the customer the current number of "physical" items in the cart- Specified by:
getItemCountin interfaceOrder- Returns:
- the number of items in the order
-
getCurrency
public org.broadleafcommerce.common.currency.domain.BroadleafCurrency getCurrency()Description copied from interface:OrderThe currency that theOrderis priced in. Note that this is only onOrdersince all of the other entities that are related (likeFulfillmentGroupandOrderItemhave a link back to here. This also has the side effect that anOrdercan only be priced in a single currency.- Specified by:
getCurrencyin interfaceOrder- Returns:
-
setCurrency
public void setCurrency(org.broadleafcommerce.common.currency.domain.BroadleafCurrency currency) Description copied from interface:OrderSet the currency that theOrderis priced in.- Specified by:
setCurrencyin interfaceOrder
-
getLocale
public org.broadleafcommerce.common.locale.domain.Locale getLocale() -
setLocale
public void setLocale(org.broadleafcommerce.common.locale.domain.Locale locale) -
calculateSubTotal
public org.broadleafcommerce.common.money.Money calculateSubTotal()Description copied from interface:OrderReturns the sum of the item totals.- Specified by:
calculateSubTotalin interfaceOrder- Returns:
-
getTotalFulfillmentCharges
public org.broadleafcommerce.common.money.Money getTotalFulfillmentCharges()Description copied from interface:OrderGets the total fulfillment costs that should be charged for thisOrder. This value should be equivalent to the summation ofFulfillmentGroup.getTotal()for eachFulfillmentGroupassociated with thisOrder- Specified by:
getTotalFulfillmentChargesin interfaceOrder- Returns:
- the total fulfillment cost of this
Order
-
setTotalFulfillmentCharges
public void setTotalFulfillmentCharges(org.broadleafcommerce.common.money.Money totalFulfillmentCharges) Description copied from interface:OrderSet the total fulfillment cost of thisOrder. Used in theFulfillmentGroupPricingActivityafter the cost of eachFulfillmentGrouphas been calculated.- Specified by:
setTotalFulfillmentChargesin interfaceOrder
-
finalizeItemPrices
public boolean finalizeItemPrices()Description copied from interface:OrderUpdates the averagePriceField for all order items.- Specified by:
finalizeItemPricesin interfaceOrder- Returns:
-
getHasOrderAdjustments
public boolean getHasOrderAdjustments()Description copied from interface:OrderReturns true if this item has order adjustments.- Specified by:
getHasOrderAdjustmentsin interfaceOrder- Returns:
-
getOrderMessages
- Specified by:
getOrderMessagesin interfaceOrder
-
setOrderMessages
- Specified by:
setOrderMessagesin interfaceOrder
-
getTaxOverride
- Specified by:
getTaxOverridein interfaceOrder- Returns:
- whether or not to override the tax calculation
-
setTaxOverride
Description copied from interface:OrderSets whether or not to override the tax calculation- Specified by:
setTaxOverridein interfaceOrder
-
createOrRetrieveCopyInstance
public <G extends Order> org.broadleafcommerce.common.copy.CreateResponse<G> createOrRetrieveCopyInstance(org.broadleafcommerce.common.copy.MultiTenantCopyContext context) throws CloneNotSupportedException - Specified by:
createOrRetrieveCopyInstancein interfaceorg.broadleafcommerce.common.copy.MultiTenantCloneable<Order>- Throws:
CloneNotSupportedException
-
getBroadleafAccountId
Description copied from interface:OrderThis method returns null from the default implementation. The Broadleaf Account module weaves in an implementation that returns the account id associated with the order.This method is used by the Broadleaf Offer engine to allow offers to be restricted so that a given account can only use the offer a max number of times.
- Specified by:
getBroadleafAccountIdin interfaceOrder
-
hasValidationErrors
- Specified by:
hasValidationErrorsin interfaceOrder
-