org.broadleafcommerce.core.order.domain
Class OrderImpl

java.lang.Object
  extended by org.broadleafcommerce.core.order.domain.OrderImpl
All Implemented Interfaces:
java.io.Serializable, Order

@Entity
public class OrderImpl
extends java.lang.Object
implements Order

See Also:
Serialized Form

Field Summary
protected  java.util.List<OfferCode> addedOfferCodes
           
protected  java.util.Map<Offer,OfferInfo> additionalOfferInformation
           
protected  java.math.BigDecimal adjustmentPrice
           
protected  Auditable auditable
           
protected  java.util.List<CandidateOrderOffer> candidateOrderOffers
           
protected  java.math.BigDecimal cityTax
           
protected  java.math.BigDecimal countryTax
           
protected  java.math.BigDecimal countyTax
           
protected  Customer customer
           
protected  java.math.BigDecimal districtTax
           
protected  java.lang.String emailAddress
           
protected  java.util.List<FulfillmentGroup> fulfillmentGroups
           
protected  boolean hasOrderAdjustments
           
protected  java.lang.Long id
           
protected  boolean markedForOffer
          Deprecated. 
protected  java.lang.String name
           
protected  boolean notCombinableOfferApplied
           
protected  boolean notCombinableOfferAppliedAtAnyLevel
           
protected  java.util.List<OrderAdjustment> orderAdjustments
           
protected  java.util.List<OrderItem> orderItems
           
protected  java.util.List<PaymentInfo> paymentInfos
           
protected  java.util.List<OrderItemSplitContainer> splitItems
           
protected  java.math.BigDecimal stateTax
           
protected  java.lang.String status
           
protected  java.util.Date submitDate
           
protected  java.math.BigDecimal subTotal
           
protected  java.math.BigDecimal total
           
protected  boolean totalitarianOfferApplied
           
protected  java.math.BigDecimal totalShipping
           
protected  java.math.BigDecimal totalTax
           
 
Constructor Summary
OrderImpl()
           
 
Method Summary
 void addAddedOfferCode(OfferCode addedOfferCode)
           
 void addCandidateOrderOffer(CandidateOrderOffer candidateOrderOffer)
           
 void addOrderAdjustments(OrderAdjustment orderAdjustment)
          Adds the adjustment to the order's adjustment list and discounts the order's adjustment price by the value of the adjustment.
 void addOrderItem(OrderItem orderItem)
           
 void assignOrderItemsFinalPrice()
          Assigns a final price to all the order items
 Money calculateOrderItemsCurrentPrice()
           
 Money calculateOrderItemsFinalPrice(boolean includeNonTaxableItems)
           
 Money calculateOrderItemsPriceWithoutAdjustments()
           
 boolean containsNotStackableFulfillmentGroupOffer()
           
 boolean containsNotStackableOrderOffer()
           
 boolean equals(java.lang.Object obj)
           
 java.util.List<OfferCode> getAddedOfferCodes()
           
 java.util.Map<Offer,OfferInfo> getAdditionalOfferInformation()
           
 Money getAdjustmentPrice()
          Returns the price of the order with the order offers applied (item offers are not applied).
 Auditable getAuditable()
           
 java.util.List<CandidateOrderOffer> getCandidateOrderOffers()
           
 Money getCityTax()
           
 Money getCountryTax()
           
 Money getCountyTax()
           
 Customer getCustomer()
           
 java.util.List<DiscreteOrderItem> getDiscountableDiscreteOrderItems()
           
 java.util.List<DiscreteOrderItem> getDiscreteOrderItems()
           
 Money getDistrictTax()
           
 java.lang.String getEmailAddress()
           
 java.util.List<FulfillmentGroup> getFulfillmentGroups()
           
 java.lang.String getFulfillmentStatus()
           
 java.lang.Long getId()
           
 Money getItemAdjustmentsValue()
          Returns the discount value of all the applied item offers for this order.
 java.lang.String getName()
           
 java.util.List<OrderAdjustment> getOrderAdjustments()
          Returns a unmodifiable List of OrderAdjustment.
 Money getOrderAdjustmentsValue()
          Returns the discount value of all the applied order offers.
 java.util.List<OrderItem> getOrderItems()
           
 java.lang.String getOrderNumber()
           
 java.util.List<PaymentInfo> getPaymentInfos()
           
 Money getRemainingTotal()
           
 java.util.List<OrderItemSplitContainer> getSplitItems()
           
 Money getStateTax()
           
 OrderStatus getStatus()
           
 java.util.Date getSubmitDate()
           
 Money getSubTotal()
          Returns the subtotal price for the order.
 Money getTotal()
           
 Money getTotalAdjustmentsValue()
          Returns the total discount value for all applied item and order offers in the order.
 Money getTotalShipping()
           
 Money getTotalTax()
           
 boolean hasCategoryItem(java.lang.String categoryName)
           
 int hashCode()
           
 boolean isHasOrderAdjustments()
           
 boolean isMarkedForOffer()
          Deprecated. 
 boolean isNotCombinableOfferApplied()
           
 boolean isNotCombinableOfferAppliedAtAnyLevel()
           
 boolean isTotalitarianOfferApplied()
           
 void removeAllAddedOfferCodes()
           
 void removeAllAdjustments()
          Removes all order, order item, and fulfillment adjustments from the order and resets the adjustment price.
 void removeAllCandidateFulfillmentGroupOffers()
           
 void removeAllCandidateOffers()
           
 void removeAllCandidateOrderOffers()
           
 void removeAllFulfillmentAdjustments()
           
 void removeAllItemAdjustments()
          Removes all adjustments from the order's order items and resets the adjustment price for each item.
 void removeAllOrderAdjustments()
          Removes all order adjustments from the order and resets the adjustment price.
 void resetTotalitarianOfferApplied()
           
 java.util.List<OrderItem> searchSplitItems(OrderItem key)
           
 void setAdditionalOfferInformation(java.util.Map<Offer,OfferInfo> additionalOfferInformation)
           
 void setAdjustmentPrice(Money adjustmentPrice)
           
 void setAuditable(Auditable auditable)
           
 void setCandidateOrderOffers(java.util.List<CandidateOrderOffer> candidateOrderOffers)
           
 void setCityTax(Money cityTax)
           
 void setCountryTax(Money countryTax)
           
 void setCountyTax(Money countyTax)
           
 void setCustomer(Customer customer)
           
 void setDistrictTax(Money districtTax)
           
 void setEmailAddress(java.lang.String emailAddress)
           
 void setFulfillmentGroups(java.util.List<FulfillmentGroup> fulfillmentGroups)
           
 void setId(java.lang.Long id)
           
 void setMarkedForOffer(boolean markedForOffer)
          Deprecated. 
 void setName(java.lang.String name)
           
 void setNotCombinableOfferAppliedAtAnyLevel(boolean notCombinableOfferAppliedAtAnyLevel)
           
protected  void setOrderAdjustments(java.util.List<OrderAdjustment> orderAdjustments)
           
 void setOrderItems(java.util.List<OrderItem> orderItems)
           
 void setOrderNumber(java.lang.String orderNumber)
           
 void setPaymentInfos(java.util.List<PaymentInfo> paymentInfos)
           
 void setSplitItems(java.util.List<OrderItemSplitContainer> splitItems)
           
 void setStateTax(Money stateTax)
           
 void setStatus(OrderStatus status)
           
 void setSubmitDate(java.util.Date submitDate)
           
 void setSubTotal(Money subTotal)
          Sets the subtotal price for the order.
 void setTotal(Money orderTotal)
           
 void setTotalitarianOfferApplied(boolean totalitarianOfferApplied)
           
 void setTotalShipping(Money totalShipping)
           
 void setTotalTax(Money totalTax)
           
 boolean updatePrices()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

id

protected java.lang.Long id

auditable

protected Auditable auditable

name

protected java.lang.String name

customer

protected Customer customer

status

protected java.lang.String status

cityTax

protected java.math.BigDecimal cityTax

countyTax

protected java.math.BigDecimal countyTax

stateTax

protected java.math.BigDecimal stateTax

districtTax

protected java.math.BigDecimal districtTax

countryTax

protected java.math.BigDecimal countryTax

totalTax

protected java.math.BigDecimal totalTax

totalShipping

protected java.math.BigDecimal totalShipping

subTotal

protected java.math.BigDecimal subTotal

total

protected java.math.BigDecimal total

submitDate

protected java.util.Date submitDate

emailAddress

protected java.lang.String emailAddress

adjustmentPrice

protected java.math.BigDecimal adjustmentPrice

orderItems

protected java.util.List<OrderItem> orderItems

fulfillmentGroups

protected java.util.List<FulfillmentGroup> fulfillmentGroups

orderAdjustments

protected java.util.List<OrderAdjustment> orderAdjustments

addedOfferCodes

protected java.util.List<OfferCode> addedOfferCodes

candidateOrderOffers

protected java.util.List<CandidateOrderOffer> candidateOrderOffers

paymentInfos

protected java.util.List<PaymentInfo> paymentInfos

additionalOfferInformation

protected java.util.Map<Offer,OfferInfo> additionalOfferInformation

totalitarianOfferApplied

protected boolean totalitarianOfferApplied

notCombinableOfferAppliedAtAnyLevel

protected boolean notCombinableOfferAppliedAtAnyLevel

markedForOffer

@Deprecated
protected boolean markedForOffer
Deprecated. 

notCombinableOfferApplied

protected boolean notCombinableOfferApplied

hasOrderAdjustments

protected boolean hasOrderAdjustments

splitItems

protected java.util.List<OrderItemSplitContainer> splitItems
Constructor Detail

OrderImpl

public OrderImpl()
Method Detail

getId

public java.lang.Long getId()
Specified by:
getId in interface Order

setId

public void setId(java.lang.Long id)
Specified by:
setId in interface Order

getAuditable

public Auditable getAuditable()
Specified by:
getAuditable in interface Order

setAuditable

public void setAuditable(Auditable auditable)
Specified by:
setAuditable in interface Order

getSubTotal

public Money getSubTotal()
Description copied from interface: Order
Returns 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.

Specified by:
getSubTotal in interface Order
Returns:
the total item price with offers applied

setSubTotal

public void setSubTotal(Money subTotal)
Description copied from interface: Order
Sets 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.

Specified by:
setSubTotal in interface Order

calculateOrderItemsCurrentPrice

public Money calculateOrderItemsCurrentPrice()
Specified by:
calculateOrderItemsCurrentPrice in interface Order

calculateOrderItemsFinalPrice

public Money calculateOrderItemsFinalPrice(boolean includeNonTaxableItems)
Specified by:
calculateOrderItemsFinalPrice in interface Order

calculateOrderItemsPriceWithoutAdjustments

public Money calculateOrderItemsPriceWithoutAdjustments()
Specified by:
calculateOrderItemsPriceWithoutAdjustments in interface Order

assignOrderItemsFinalPrice

public void assignOrderItemsFinalPrice()
Assigns a final price to all the order items

Specified by:
assignOrderItemsFinalPrice in interface Order

getTotal

public Money getTotal()
Specified by:
getTotal in interface Order

setTotal

public void setTotal(Money orderTotal)
Specified by:
setTotal in interface Order

getRemainingTotal

public Money getRemainingTotal()
Specified by:
getRemainingTotal in interface Order

getSubmitDate

public java.util.Date getSubmitDate()
Specified by:
getSubmitDate in interface Order

setSubmitDate

public void setSubmitDate(java.util.Date submitDate)
Specified by:
setSubmitDate in interface Order

getCustomer

public Customer getCustomer()
Specified by:
getCustomer in interface Order

setCustomer

public void setCustomer(Customer customer)
Specified by:
setCustomer in interface Order

getStatus

public OrderStatus getStatus()
Specified by:
getStatus in interface Order

setStatus

public void setStatus(OrderStatus status)
Specified by:
setStatus in interface Order

getOrderItems

public java.util.List<OrderItem> getOrderItems()
Specified by:
getOrderItems in interface Order

setOrderItems

public void setOrderItems(java.util.List<OrderItem> orderItems)
Specified by:
setOrderItems in interface Order

addOrderItem

public void addOrderItem(OrderItem orderItem)
Specified by:
addOrderItem in interface Order

getFulfillmentGroups

public java.util.List<FulfillmentGroup> getFulfillmentGroups()
Specified by:
getFulfillmentGroups in interface Order

setFulfillmentGroups

public void setFulfillmentGroups(java.util.List<FulfillmentGroup> fulfillmentGroups)
Specified by:
setFulfillmentGroups in interface Order

setCandidateOrderOffers

public void setCandidateOrderOffers(java.util.List<CandidateOrderOffer> candidateOrderOffers)
Specified by:
setCandidateOrderOffers in interface Order

addCandidateOrderOffer

public void addCandidateOrderOffer(CandidateOrderOffer candidateOrderOffer)
Specified by:
addCandidateOrderOffer in interface Order

getCandidateOrderOffers

public java.util.List<CandidateOrderOffer> getCandidateOrderOffers()
Specified by:
getCandidateOrderOffers in interface Order

removeAllCandidateOffers

public void removeAllCandidateOffers()
Specified by:
removeAllCandidateOffers in interface Order

removeAllCandidateFulfillmentGroupOffers

public void removeAllCandidateFulfillmentGroupOffers()
Specified by:
removeAllCandidateFulfillmentGroupOffers in interface Order

removeAllCandidateOrderOffers

public void removeAllCandidateOrderOffers()
Specified by:
removeAllCandidateOrderOffers in interface Order

isMarkedForOffer

@Deprecated
public boolean isMarkedForOffer()
Deprecated. 


setMarkedForOffer

@Deprecated
public void setMarkedForOffer(boolean markedForOffer)
Deprecated. 

Specified by:
setMarkedForOffer in interface Order

getName

public java.lang.String getName()
Specified by:
getName in interface Order

setName

public void setName(java.lang.String name)
Specified by:
setName in interface Order

getCityTax

public Money getCityTax()
Specified by:
getCityTax in interface Order

setCityTax

public void setCityTax(Money cityTax)
Specified by:
setCityTax in interface Order

getCountyTax

public Money getCountyTax()
Specified by:
getCountyTax in interface Order

setCountyTax

public void setCountyTax(Money countyTax)
Specified by:
setCountyTax in interface Order

getStateTax

public Money getStateTax()
Specified by:
getStateTax in interface Order

setStateTax

public void setStateTax(Money stateTax)
Specified by:
setStateTax in interface Order

getDistrictTax

public Money getDistrictTax()
Specified by:
getDistrictTax in interface Order

setDistrictTax

public void setDistrictTax(Money districtTax)
Specified by:
setDistrictTax in interface Order

getCountryTax

public Money getCountryTax()
Specified by:
getCountryTax in interface Order

setCountryTax

public void setCountryTax(Money countryTax)
Specified by:
setCountryTax in interface Order

getTotalTax

public Money getTotalTax()
Specified by:
getTotalTax in interface Order

setTotalTax

public void setTotalTax(Money totalTax)
Specified by:
setTotalTax in interface Order

getTotalShipping

public Money getTotalShipping()
Specified by:
getTotalShipping in interface Order

setTotalShipping

public void setTotalShipping(Money totalShipping)
Specified by:
setTotalShipping in interface Order

getPaymentInfos

public java.util.List<PaymentInfo> getPaymentInfos()
Specified by:
getPaymentInfos in interface Order

setPaymentInfos

public void setPaymentInfos(java.util.List<PaymentInfo> paymentInfos)
Specified by:
setPaymentInfos in interface Order

hasCategoryItem

public boolean hasCategoryItem(java.lang.String categoryName)
Specified by:
hasCategoryItem in interface Order

getOrderAdjustments

public java.util.List<OrderAdjustment> getOrderAdjustments()
Description copied from interface: Order
Returns a unmodifiable List of OrderAdjustment. To modify the List of OrderAdjustment, please use the addOrderAdjustments or removeAllOrderAdjustments methods.

Specified by:
getOrderAdjustments in interface Order
Returns:
a unmodifiable List of OrderItemAdjustment

addOrderAdjustments

public void addOrderAdjustments(OrderAdjustment orderAdjustment)
Description copied from interface: Order
Adds the adjustment to the order's adjustment list and discounts the order's adjustment price by the value of the adjustment.

Specified by:
addOrderAdjustments in interface Order

resetTotalitarianOfferApplied

public void resetTotalitarianOfferApplied()
Specified by:
resetTotalitarianOfferApplied in interface Order

removeAllAdjustments

public void removeAllAdjustments()
Description copied from interface: Order
Removes all order, order item, and fulfillment adjustments from the order and resets the adjustment price.

Specified by:
removeAllAdjustments in interface Order

removeAllOrderAdjustments

public void removeAllOrderAdjustments()
Description copied from interface: Order
Removes all order adjustments from the order and resets the adjustment price. This method does not remove order item or fulfillment adjustments from the order.

Specified by:
removeAllOrderAdjustments in interface Order

removeAllItemAdjustments

public void removeAllItemAdjustments()
Description copied from interface: Order
Removes all adjustments from the order's order items and resets the adjustment price for each item. This method does not remove order or fulfillment adjustments from the order.

Specified by:
removeAllItemAdjustments in interface Order

removeAllFulfillmentAdjustments

public void removeAllFulfillmentAdjustments()
Specified by:
removeAllFulfillmentAdjustments in interface Order

setOrderAdjustments

protected void setOrderAdjustments(java.util.List<OrderAdjustment> orderAdjustments)

getAdjustmentPrice

public Money getAdjustmentPrice()
Description copied from interface: Order
Returns the price of the order with the order offers applied (item offers are not applied).

Specified by:
getAdjustmentPrice in interface Order
Returns:
the order price with the order offers applied (item offers are not applied)

setAdjustmentPrice

public void setAdjustmentPrice(Money adjustmentPrice)
Specified by:
setAdjustmentPrice in interface Order

containsNotStackableOrderOffer

public boolean containsNotStackableOrderOffer()
Specified by:
containsNotStackableOrderOffer in interface Order

containsNotStackableFulfillmentGroupOffer

public boolean containsNotStackableFulfillmentGroupOffer()
Specified by:
containsNotStackableFulfillmentGroupOffer in interface Order

getDiscreteOrderItems

public java.util.List<DiscreteOrderItem> getDiscreteOrderItems()
Specified by:
getDiscreteOrderItems in interface Order

getDiscountableDiscreteOrderItems

public java.util.List<DiscreteOrderItem> getDiscountableDiscreteOrderItems()
Specified by:
getDiscountableDiscreteOrderItems in interface Order

getAddedOfferCodes

public java.util.List<OfferCode> getAddedOfferCodes()
Specified by:
getAddedOfferCodes in interface Order

addAddedOfferCode

public void addAddedOfferCode(OfferCode addedOfferCode)
Specified by:
addAddedOfferCode in interface Order

removeAllAddedOfferCodes

public void removeAllAddedOfferCodes()
Specified by:
removeAllAddedOfferCodes in interface Order

getOrderNumber

public java.lang.String getOrderNumber()
Specified by:
getOrderNumber in interface Order

setOrderNumber

public void setOrderNumber(java.lang.String orderNumber)
Specified by:
setOrderNumber in interface Order

getFulfillmentStatus

public java.lang.String getFulfillmentStatus()
Specified by:
getFulfillmentStatus in interface Order

getEmailAddress

public java.lang.String getEmailAddress()
Specified by:
getEmailAddress in interface Order

setEmailAddress

public void setEmailAddress(java.lang.String emailAddress)
Specified by:
setEmailAddress in interface Order

getAdditionalOfferInformation

public java.util.Map<Offer,OfferInfo> getAdditionalOfferInformation()
Specified by:
getAdditionalOfferInformation in interface Order

setAdditionalOfferInformation

public void setAdditionalOfferInformation(java.util.Map<Offer,OfferInfo> additionalOfferInformation)
Specified by:
setAdditionalOfferInformation in interface Order

getItemAdjustmentsValue

public Money getItemAdjustmentsValue()
Description copied from interface: Order
Returns the discount value of all the applied item offers for this order. The value is already deducted from the order subTotal.

Specified by:
getItemAdjustmentsValue in interface Order
Returns:
the discount value of all the applied item offers for this order

getOrderAdjustmentsValue

public Money getOrderAdjustmentsValue()
Description copied from interface: Order
Returns 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:
getOrderAdjustmentsValue in interface Order
Returns:
the discount value of all applied order offers.

getTotalAdjustmentsValue

public Money getTotalAdjustmentsValue()
Description copied from interface: Order
Returns 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:
getTotalAdjustmentsValue in interface Order
Returns:
the total discount of all applied item and order offers

isNotCombinableOfferApplied

public boolean isNotCombinableOfferApplied()
Specified by:
isNotCombinableOfferApplied in interface Order

isHasOrderAdjustments

public boolean isHasOrderAdjustments()
Specified by:
isHasOrderAdjustments in interface Order

updatePrices

public boolean updatePrices()
Specified by:
updatePrices in interface Order

isTotalitarianOfferApplied

public boolean isTotalitarianOfferApplied()
Specified by:
isTotalitarianOfferApplied in interface Order

setTotalitarianOfferApplied

public void setTotalitarianOfferApplied(boolean totalitarianOfferApplied)
Specified by:
setTotalitarianOfferApplied in interface Order

isNotCombinableOfferAppliedAtAnyLevel

public boolean isNotCombinableOfferAppliedAtAnyLevel()
Specified by:
isNotCombinableOfferAppliedAtAnyLevel in interface Order

setNotCombinableOfferAppliedAtAnyLevel

public void setNotCombinableOfferAppliedAtAnyLevel(boolean notCombinableOfferAppliedAtAnyLevel)
Specified by:
setNotCombinableOfferAppliedAtAnyLevel in interface Order

getSplitItems

public java.util.List<OrderItemSplitContainer> getSplitItems()
Specified by:
getSplitItems in interface Order

setSplitItems

public void setSplitItems(java.util.List<OrderItemSplitContainer> splitItems)
Specified by:
setSplitItems in interface Order

searchSplitItems

public java.util.List<OrderItem> searchSplitItems(OrderItem key)
Specified by:
searchSplitItems in interface Order

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object


Copyright © 2011. All Rights Reserved.