Class AbstractOrder
- java.lang.Object
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable
- Direct Known Subclasses:
GeneratedCart,GeneratedOrder,GeneratedQuote
public abstract class AbstractOrder extends GeneratedAbstractOrder
This is the general superclass of all order objects. An abstract order keeps all information which is necessary to describe a user - vendor - contract.Mainly an order consists of several entries which represents ordered products of a certain quantity and unit. Further it holds delivery, payment, discount and tax information.
An order does not provide pricing information unless it was calculated explicitly viacalculate(),calculate(Date),recalculate()orrecalculate(Date). Once prices have been set you may also usecalculateTotals(boolean)which does not fetch new prices, taxes or discounts but consolidates all totals according to price relevant changes of this order ( e.g. entry quantities, base prices etc. ). After calculation the order is marked ascalculated. Please note that all values are fixed and do not change automatically upon changes in the price model ( via PriceFactory ). You have to recalculate the order to see these changes.
Since prices, taxes and discounts are retrieved from the installed pricefactory refer to its documentation how to manage prices, taxes and discounts.
Similar refer to the installed payment and delivery mode extension documentation for how to manager payment and delivery prices. the order calculation process fetches payment and delivery prices from them.If you like to bypass the pricefactory and implement you own logic within a special jalo order type you have to override
findDeliveryCosts(),findGlobalDiscounts()andfindPaymentCosts(). Further you have to provide a own jalo type fororder entrieswhich overridesAbstractOrderEntry.findPrice(),AbstractOrderEntry.findTaxes()andAbstractOrderEntry.findDiscounts().- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceAbstractOrder.DELIVERY_STATUSDeprecated.since ages - useDeliveryStatusinsteadstatic interfaceAbstractOrder.EXPORT_STATUSDeprecated.since ages - useExportStatusinsteadstatic interfaceAbstractOrder.ORDER_STATUSDeprecated.since ages - useOrderStatusinsteadstatic interfaceAbstractOrder.PAYMENT_STATUSDeprecated.since ages - usePaymentStatusinstead-
Nested classes/interfaces inherited from class de.hybris.platform.jalo.GenericItem
GenericItem.GenericItemImpl
-
Nested classes/interfaces inherited from class de.hybris.platform.jalo.c2l.LocalizableItem
LocalizableItem.LocalizableItemImpl
-
Nested classes/interfaces inherited from class de.hybris.platform.jalo.ExtensibleItem
ExtensibleItem.ExtensibleItemImpl
-
Nested classes/interfaces inherited from class de.hybris.platform.jalo.Item
Item.AttributeFilter, Item.AttributeMode, Item.CachedGetter, Item.CachedSetter, Item.ItemAttributeMap, Item.ItemConstraint, Item.ItemImpl, Item.JaloCachedComputationException
-
-
Field Summary
Fields Modifier and Type Field Description static intAPPEND_AS_LASTstatic java.lang.StringCFG_TAX_FREE_ENTRIES_SUPPORTstatic java.lang.StringDELIVERY_ADDRESSDeprecated.since ages - useGeneratedAbstractOrder.DELIVERYADDRESSinsteadstatic java.lang.StringDELIVERY_COSTDeprecated.since ages - useGeneratedAbstractOrder.DELIVERYCOSTinsteadstatic java.lang.StringDELIVERY_MODEDeprecated.since ages - useGeneratedAbstractOrder.DELIVERYMODEinsteadstatic java.lang.StringDELIVERY_STATUSDeprecated.since ages - useGeneratedAbstractOrder.DELIVERYSTATUSinsteadstatic java.lang.StringDELIVERY_STATUS_TYPEDeprecated.since ages - useDeliveryStatus#_TYPECODEinsteadstatic java.lang.StringEXPORT_STATUSDeprecated.since ages - useGeneratedAbstractOrder.EXPORTSTATUSinsteadstatic java.lang.StringEXPORT_STATUS_TYPEDeprecated.since ages - useExportStatus#_TYPECODEinsteadstatic java.lang.StringGLOBAL_DISCOUNT_VALUESDeprecated.static java.lang.StringORDER_DISCOUNT_RELATION_NAMEDeprecated.since ages - useDiscountModel#_ORDERDISCOUNTRELATIONinsteadstatic java.lang.StringORDER_STATUS_TYPEDeprecated.since ages - useOrderStatus#_TYPECODEinsteadstatic java.lang.StringPAYMENT_ADDRESSDeprecated.since ages - useGeneratedAbstractOrder.PAYMENTADDRESSinsteadstatic java.lang.StringPAYMENT_COSTDeprecated.since ages - useGeneratedAbstractOrder.PAYMENTCOSTinsteadstatic java.lang.StringPAYMENT_INFODeprecated.since ages - useGeneratedAbstractOrder.PAYMENTINFOinsteadstatic java.lang.StringPAYMENT_MODEDeprecated.since ages - useGeneratedAbstractOrder.PAYMENTMODEinsteadstatic java.lang.StringPAYMENT_STATUSDeprecated.since ages - useGeneratedAbstractOrder.PAYMENTSTATUSinsteadstatic java.lang.StringPAYMENT_STATUS_TYPEDeprecated.since ages - usePaymentStatus#_TYPECODEinsteadstatic java.lang.StringSTATUS_INFODeprecated.since ages - useGeneratedAbstractOrder.STATUSINFOinsteadstatic java.lang.StringTOTALDeprecated.since ages - useGeneratedAbstractOrder.TOTALPRICEinsteadstatic java.lang.StringTOTAL_DISCOUNTSDeprecated.since ages - useGeneratedAbstractOrder.TOTALDISCOUNTSinsteadstatic java.lang.StringTOTAL_TAXDeprecated.since ages - useGeneratedAbstractOrder.TOTALTAXinsteadstatic java.lang.StringTOTAL_TAX_VALUESDeprecated.-
Fields inherited from class de.hybris.platform.jalo.order.GeneratedAbstractOrder
CALCULATED, CODE, CURRENCY, DATE, DEFAULT_INITIAL_ATTRIBUTES, DELIVERYADDRESS, DELIVERYCOST, DELIVERYMODE, DELIVERYSTATUS, DESCRIPTION, DISCOUNTS, DISCOUNTSINCLUDEDELIVERYCOST, DISCOUNTSINCLUDEPAYMENTCOST, ENTRIES, ENTRIESHANDLER, ENTRYGROUPS, EXPIRATIONTIME, EXPORTSTATUS, GLOBALDISCOUNTVALUESINTERNAL, NAME, NET, ORDERDISCOUNTRELATION_MARKMODIFIED, ORDERDISCOUNTRELATION_SRC_ORDERED, ORDERDISCOUNTRELATION_TGT_ORDERED, PAYMENTADDRESS, PAYMENTCOST, PAYMENTINFO, PAYMENTMODE, PAYMENTSTATUS, STATUS, STATUSINFO, SUBTOTAL, TOTALDISCOUNTS, TOTALPRICE, TOTALTAX, TOTALTAXVALUESINTERNAL, USER
-
Fields inherited from class de.hybris.platform.jalo.c2l.LocalizableItem
LANGUAGE_FALLBACK_ENABLED
-
Fields inherited from class de.hybris.platform.jalo.Item
_CREATION_TIME_INTERNAL, _MODIFIED_TIME_INTERNAL, accessorLog, CREATION_TIME, DISABLE_ATTRIBUTE_CHECK, DISABLE_ITEMCHECK_BEFORE_REMOVABLE, EVEN, FEATURE_ACCESSMAP_QUALIFIER, HJMPTS, INITIAL_CREATION_FLAG, isJaloOnly, MODIFIED_TIME, NEGATIVE, NOT_FOUND, OWNER, PK, POSITIVE, SAVE_FROM_SERVICE_LAYER, staticTransientObjects, TYPE
-
Fields inherited from class de.hybris.platform.util.BridgeAbstraction
impl, tenant
-
-
Constructor Summary
Constructors Constructor Description AbstractOrder()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected voidaddAbsoluteEntryTaxValue(long entryQuantity, TaxValue taxValue, java.util.Map<TaxValue,java.util.Map<java.util.Set<TaxValue>,java.lang.Double>> taxValueMap)voidaddAllGlobalDiscountValues(SessionContext ctx, java.util.Collection values)Deprecated.since ages - Use OrderService.addAllGlobalDiscountValues(de.hybris.platform.core.model.order.AbstractOrderModel, List) instead.voidaddAllGlobalDiscountValues(java.util.Collection values)Deprecated.since ages - Use OrderService.addAllGlobalDiscountValues(de.hybris.platform.core.model.order.AbstractOrderModel, List) instead.voidaddAllTotalTaxValues(SessionContext ctx, java.util.Collection values)Deprecated.since ages - Use OrderService.addAllTotalTaxValues(de.hybris.platform.core.model.order.AbstractOrderModel, List) instead.voidaddAllTotalTaxValues(java.util.Collection values)Deprecated.since ages - Use OrderService.addAllTotalTaxValues(de.hybris.platform.core.model.order.AbstractOrderModel, List) instead.voidaddDiscount(Discount discount)Deprecated.since ages - useGeneratedAbstractOrder.addToDiscounts(Discount)voidaddGlobalDiscountValue(SessionContext ctx, DiscountValue discountValue)Deprecated.since ages - Use OrderService.addGlobalDiscountValue(de.hybris.platform.core.model.order.AbstractOrderModel, DiscountValue) instead.voidaddGlobalDiscountValue(DiscountValue discountValue)Deprecated.since ages - Use OrderService.addGlobalDiscountValue(de.hybris.platform.core.model.order.AbstractOrderModel, DiscountValue) instead.AbstractOrderEntryaddNewEntry(Product prod, long qtd, Unit unit)Deprecated.since 4.3, please use suitable OrderService.addNewEntry() methodAbstractOrderEntryaddNewEntry(Product prod, long qtd, Unit unit, boolean addToPresent)Deprecated.since 4.3, please use suitable OrderService.addNewEntry() methodAbstractOrderEntryaddNewEntry(Product prod, long qtd, Unit unit, int position, boolean addToPresent)Deprecated.since 4.3, please use suitable OrderService.addNewEntry() methodAbstractOrderEntryaddNewEntry(ComposedType type, Product prod, long qtd, Unit unit, int position, boolean addToPresent)Deprecated.since 4.3, please use suitable OrderService.addNewEntry() methodprotected voidaddRelativeEntryTaxValue(double entryTotal, TaxValue taxValue, java.util.Set<TaxValue> relativeEntryTaxValues, java.util.Map<TaxValue,java.util.Map<java.util.Set<TaxValue>,java.lang.Double>> taxValueMap)voidaddTotalTaxValue(SessionContext ctx, TaxValue taxValue)Deprecated.since ages - Use OrderService.addTotalTaxValue(de.hybris.platform.core.model.order.AbstractOrderModel, TaxValue) instead.voidaddTotalTaxValue(TaxValue taxValue)Deprecated.since ages - Use OrderService.addTotalTaxValue(de.hybris.platform.core.model.order.AbstractOrderModel, TaxValue) instead.voidcalculate()Deprecated.since ages - Use CalculationService.calculate(de.hybris.platform.core.model.order.AbstractOrderModel) instead.voidcalculate(java.util.Date date)Deprecated.since ages - Use CalculationService#calculate(de.hybris.platform.core.model.order.AbstractOrderModel, Date)protected TaxValuecalculateAbsoluteTotalTaxValue(Currency curr, java.lang.String currencyIso, int digits, boolean net, TaxValue taxValue, double cumulatedEntryQuantities)protected doublecalculateDiscountValues(boolean recalculate)Returns the total discount for this abstract order.protected voidcalculateEntries()callsAbstractOrderEntry.calculate()on all entries of this order and sets this orders subtotal to the sum of the entry totals.protected java.util.Map<TaxValue,java.util.Map<java.util.Set<TaxValue>,java.lang.Double>>calculateSubtotal(boolean recalculate)Calculates this order's subtotal and returns a total tax value map.voidcalculateTotals(boolean recalculate)Deprecated.since ages - Use CalculationService#calculateTotals(de.hybris.platform.core.model.order.AbstractOrderModel, boolean) insteadprotected voidcalculateTotals(boolean recalculate, java.util.Map<TaxValue,java.util.Map<java.util.Set<TaxValue>,java.lang.Double>> taxValueMap)calculates all totals.protected doublecalculateTotalTaxValues(boolean recalculate, int digits, double taxAdjustmentFactor, java.util.Map<TaxValue,java.util.Map<java.util.Set<TaxValue>,java.lang.Double>> taxValueMap)protected java.util.ListconvertDiscountValues(java.util.List dvs)protected java.lang.StringcreateEntryInformation(AbstractOrderEntry newEntry)Deprecated.since 4.3 order entry info is set in prepare interceptor.protected ItemcreateItem(SessionContext ctx, ComposedType type, Item.ItemAttributeMap allAttributes)Has to be implemented for each concrete subtype of item.AddresscreateNewDeliveryAddress()creates a new address which is set as this orders delivery address.AddresscreateNewDeliveryAddress(SessionContext ctx)creates a new address which is set as this orders delivery address.protected abstract AbstractOrderEntrycreateNewEntry(SessionContext ctx, ComposedType entryType, Product product, long quantity, Unit unit, int position)protected intcreateNewEntryNumber(int requested)AddresscreateNewPaymentAddress()creates a new address which is set as this orders payment address.AddresscreateNewPaymentAddress(SessionContext ctx)creates a new address which is set as this orders payment address.booleandiscountsIncludeDeliveryCosts()Deprecated.since ages - useGeneratedAbstractOrder.isDiscountsIncludePaymentCostAsPrimitive()insteadbooleandiscountsIncludePaymentCosts()Deprecated.since ages - useGeneratedAbstractOrder.isDiscountsIncludePaymentCostAsPrimitive()insteadprotected voiddoSetDeliveryAddress(SessionContext ctx, Address newOne)Performs changing of delivery address.protected voiddoSetPaymentAddress(SessionContext ctx, Address newOne)Performs changing of payment address.protected PriceValuefindDeliveryCosts()Called duringcalculate(),calculate(Date),recalculate()andrecalculate(Date)to fetch and set the delivery cost for this order.protected java.util.ListfindGlobalDiscounts()Called duringcalculate(),calculate(Date),recalculate()andrecalculate(Date)to fetch and set global discount values for this order.protected PriceValuefindPaymentCosts()called duringcalculate(),calculate(Date),recalculate()andrecalculate(Date)to fetch and set the payment costs for this order.protected abstract java.lang.StringgetAbstractOrderEntryTypeCode()java.util.ListgetAllEntries()Deprecated.since ages - usegetEntries(SessionContext)protected java.lang.ObjectgetAttributeValue(Item item, java.lang.String qualifer)protected ComposedTypegetCustomEntryType()when overriding abstract order type this defines the corresponding entry typejava.util.DategetDate(SessionContext ctx)The creation date of an order.doublegetDeliveryCosts()The calculated delivery costs of this order.doublegetDeliveryCosts(SessionContext ctx)Deprecated.since ages - useGeneratedAbstractOrder.getDeliveryCostAsPrimitive(SessionContext)insteadjava.util.List<AbstractOrderEntry>getEntries()Generated method - Getter of theAbstractOrder.entriesattribute.java.util.CollectiongetEntries(int startIdx, int endIdx)java.util.List<AbstractOrderEntry>getEntries(SessionContext ctx)Generated method - Getter of theAbstractOrder.entriesattribute.java.util.ListgetEntriesByProduct(Product product)Returns all entries which belong to a specified product.AbstractOrderEntrygetEntry(int index)Deprecated.since ages - Use OrderService.getEntryForNumber(de.hybris.platform.core.model.order.AbstractOrderModel, int) instead.java.util.ListgetGlobalDiscountValues()Deprecated.since ages - Use model getter AbstractOrderModel.getGlobalDiscountValues() instead.java.util.ListgetGlobalDiscountValues(SessionContext ctx)Deprecated.since ages - Use model getter AbstractOrderModel.getGlobalDiscountValues() instead.protected intgetNewEntryNumberForAppending(java.util.List<AbstractOrderEntry> all)protected intgetNextEntryNumber(AbstractOrderEntry forMe)doublegetPaymentCosts()The calculated costs according to the chosen payment mode.doublegetPaymentCosts(SessionContext ctx)Deprecated.since ages - useGeneratedAbstractOrder.getPaymentCost(SessionContext)insteaddoublegetTotal()Deprecated.since ages - useGeneratedAbstractOrder.getTotalPriceAsPrimitive()insteaddoublegetTotal(SessionContext ctx)Deprecated.since ages - useGeneratedAbstractOrder.getTotalPriceAsPrimitive(SessionContext)insteadjava.lang.DoublegetTotalDiscounts()returns the sum of all discounts of this (calculated) order.java.lang.DoublegetTotalTax()The calculated total tax amount of this order.java.util.CollectiongetTotalTaxValues()Deprecated.since ages - Use model getter AbstractOrderModel.getTotalTaxValues() instead.java.util.CollectiongetTotalTaxValues(SessionContext ctx)Deprecated.since ages - Use model getter AbstractOrderModel.getTotalTaxValues() instead.java.lang.BooleanisCalculated()Shows if this order was calculated before.java.lang.BooleanisCalculated(SessionContext ctx)Shows if this order was calculated before.java.lang.BooleanisNet()The gross / net status of this order.protected voidnotifyDiscountsAboutCalculation()protected voidnotifyDiscountsAboutRemoval()voidrecalculate()Deprecated.since ages - Use CalculationService#recalculate(de.hybris.platform.core.model.order.AbstractOrderModel) instead.voidrecalculate(java.util.Date date)Deprecated.since ages - Use CalculationService#recalculate(de.hybris.platform.core.model.order.AbstractOrderModel, java.util.Date) instead.protected voidrecalculateEntries()callsAbstractOrderEntry.recalculate()on all entries of this order and sets this orders subtotal to the sum of the entry totals.voidremove(SessionContext ctx)Removes this item.voidremoveAllEntries()Deprecated.since ages - UseModelService.remove() instead.voidremoveAllGlobalDiscountValues()Deprecated.since ages - Use model setter AbstractOrderModel.setGlobalDiscountValues(List) and ModelService.save() method instead.voidremoveAllGlobalDiscountValues(SessionContext ctx)Deprecated.since ages - Use model setter AbstractOrderModel.setGlobalDiscountValues(List) and ModelService.save() method instead.voidremoveAllTotalTaxValues()Deprecated.since ages - Use model setter AbstractOrderModel.setTotalTaxValues(Collection) and ModelService.save() method instead.voidremoveAllTotalTaxValues(SessionContext ctx)Deprecated.since ages - Use model setter AbstractOrderModel.setTotalTaxValues(Collection) and ModelService.save() method instead.voidremoveDiscount(Discount discount)Deprecated.since ages - useGeneratedAbstractOrder.removeFromDiscounts(Discount)protected voidremoveEntries(SessionContext ctx, java.util.Set<AbstractOrderEntry> entries)Deprecated.since ages - UseModelService.remove() instead.voidremoveEntry(AbstractOrderEntry entry)Deprecated.since ages - UseModelService.remove() instead.voidremoveGlobalDiscountValue(SessionContext ctx, DiscountValue discountValue)Deprecated.since ages - Use OrderService.removeGlobalDiscountValue(de.hybris.platform.core.model.order.AbstractOrderModel, DiscountValue) instead.voidremoveGlobalDiscountValue(DiscountValue discountValue)Deprecated.since ages - Use OrderService.removeGlobalDiscountValue(de.hybris.platform.core.model.order.AbstractOrderModel, DiscountValue) instead.voidremoveTotalTaxValue(SessionContext ctx, TaxValue taxValue)Deprecated.since ages - Use OrderService.removeTotalTaxValue(de.hybris.platform.core.model.order.AbstractOrderModel, TaxValue) instead.voidremoveTotalTaxValue(TaxValue taxValue)Deprecated.since ages - Use OrderService.removeTotalTaxValue(de.hybris.platform.core.model.order.AbstractOrderModel, TaxValue) instead.protected voidresetAdditionalCosts(java.util.Collection<TaxValue> relativeTaxValues)protected java.util.MapresetAllValues()fetches all prices, taxes, discount, payment and delivery costs and sets these fields.protected voidsetAllEntries(SessionContext ctx, java.util.List value)protected voidsetChanged(boolean entriesToo)voidsetCode(SessionContext ctx, java.lang.String code)Sets the order code.voidsetCode(java.lang.String code)Sets the order code.ItemsetComposedType(ComposedType type)Changes this order's composed type and the composed type of its entries provided thatgetCustomEntryType()returns a valid entry class.voidsetCurrency(Currency curr)Changes the currency for all pricing informations of this order.voidsetCurrency(SessionContext ctx, Currency curr)Changes the currency for all pricing informations of this order.voidsetDate(SessionContext ctx, java.util.Date date)Changes creation date of an order.voidsetDate(java.util.Date date)Changes creation date of an order.voidsetDeliveryAddress(SessionContext ctx, Address address)Changes the delivery address.voidsetDeliveryAddress(Address address)Changes the delivery address.voidsetDeliveryCost(SessionContext ctx, java.lang.Double value)Generated method - Setter of theAbstractOrder.deliveryCostattribute.voidsetDeliveryCosts(double deliveryCost)Sets The calculated delivery costs of this order.voidsetDeliveryCosts(SessionContext ctx, double deliveryCost)Deprecated.since ages - useGeneratedAbstractOrder.setDeliveryCost(double)insteadvoidsetDeliveryMode(DeliveryMode mode)Changes the chosen delivery mode for this order.voidsetDeliveryMode(SessionContext ctx, DeliveryMode mode)Changes the chosen delivery mode for this order.voidsetDeliveryStatus(EnumerationValue deliveryStatus)Changes the order delivery status.voidsetDeliveryStatus(SessionContext ctx, EnumerationValue deliveryStatus)Changes the order delivery status.voidsetDiscountsIncludeDeliveryCost(SessionContext ctx, java.lang.Boolean value)Generated method - Setter of theAbstractOrder.discountsIncludeDeliveryCostattribute.voidsetDiscountsIncludeDeliveryCosts(boolean includes)Deprecated.since ages - useGeneratedAbstractOrder.setDiscountsIncludeDeliveryCost(boolean)insteadvoidsetDiscountsIncludePaymentCost(SessionContext ctx, java.lang.Boolean value)Generated method - Setter of theAbstractOrder.discountsIncludePaymentCostattribute.voidsetDiscountsIncludePaymentCosts(boolean includes)Deprecated.since ages - usesetDiscountsIncludePaymentCosts(boolean)insteadvoidsetEntries(SessionContext ctx, java.util.List<AbstractOrderEntry> value)Generated method - Setter of theAbstractOrder.entriesattribute.voidsetEntries(java.util.List<AbstractOrderEntry> value)Generated method - Setter of theAbstractOrder.entriesattribute.voidsetGlobalDiscountValues(SessionContext ctx, java.util.List globalDiscounts)Deprecated.since ages - Use model setter AbstractOrderModel.setGlobalDiscountValues(List) and ModelService.save() method instead.voidsetGlobalDiscountValues(java.util.List globalDiscounts)Deprecated.since ages - Use model setter AbstractOrderModel.setGlobalDiscountValues(List) and ModelService.save() method instead.voidsetNet(boolean net)Changes the gross / net status of this order.voidsetNet(SessionContext ctx, boolean net)Changes the gross / net status of this order.voidsetPaymentAddress(SessionContext ctx, Address adr)Changes the payment address of this order.voidsetPaymentAddress(Address adr)Changes the payment address of this order.voidsetPaymentCost(SessionContext ctx, java.lang.Double value)Generated method - Setter of theAbstractOrder.paymentCostattribute.voidsetPaymentCosts(double paymentCost)Sets the costs of the chosen payment mode.voidsetPaymentCosts(SessionContext ctx, double paymentCost)Deprecated.since ages - useGeneratedAbstractOrder.setPaymentCost(SessionContext, double)insteadvoidsetPaymentMode(PaymentMode mode)Changes the payment mode of this order.voidsetPaymentMode(SessionContext ctx, PaymentMode mode)Changes the payment mode of this order.voidsetPaymentStatus(EnumerationValue paymentStatus)Changes the payment order status.voidsetPaymentStatus(SessionContext ctx, EnumerationValue paymentStatus)Changes the order payment status.voidsetStatus(EnumerationValue status)Changes the order status.voidsetStatus(SessionContext ctx, EnumerationValue status)Changes the order status.voidsetTotal(double total)Sets the calculated total price of this order.voidsetTotal(SessionContext ctx, double price)Deprecated.since ages - useGeneratedAbstractOrder.setTotalPrice(SessionContext, double)insteadvoidsetTotalTaxValues(SessionContext ctx, java.util.Collection totalTaxValues)Deprecated.since ages - Use model setter AbstractOrderModel.setTotalTaxValues(Collection) and ModelService.save() method instead.voidsetTotalTaxValues(java.util.Collection totalTaxValues)Deprecated.since ages - Use model setter AbstractOrderModel.setTotalTaxValues(Collection) and ModelService.save() method instead.voidsetUser(SessionContext ctx, User user)Changes the user which this order belongs to.voidsetUser(User user)Changes the user which this order belongs to.protected voidshuffleEntriesOnInsertNew(java.util.List<AbstractOrderEntry> all, int newEntryNumber)protected LanguagetryToFindFallbackLanguage(JaloSession js)-
Methods inherited from class de.hybris.platform.jalo.order.GeneratedAbstractOrder
addToDiscounts, addToDiscounts, addToEntries, addToEntries, getCode, getCode, getCurrency, getCurrency, getDate, getDefaultAttributeModes, getDeliveryAddress, getDeliveryAddress, getDeliveryCost, getDeliveryCost, getDeliveryCostAsPrimitive, getDeliveryCostAsPrimitive, getDeliveryMode, getDeliveryMode, getDeliveryStatus, getDeliveryStatus, getDescription, getDescription, getDiscounts, getDiscounts, getDiscountsCount, getDiscountsCount, getEntryGroups, getEntryGroups, getExpirationTime, getExpirationTime, getExportStatus, getExportStatus, getGlobalDiscountValuesInternal, getGlobalDiscountValuesInternal, getName, getName, getPaymentAddress, getPaymentAddress, getPaymentCost, getPaymentCost, getPaymentCostAsPrimitive, getPaymentCostAsPrimitive, getPaymentInfo, getPaymentInfo, getPaymentMode, getPaymentMode, getPaymentStatus, getPaymentStatus, getStatus, getStatus, getStatusInfo, getStatusInfo, getSubtotal, getSubtotal, getSubtotalAsPrimitive, getSubtotalAsPrimitive, getTotalDiscounts, getTotalDiscountsAsPrimitive, getTotalDiscountsAsPrimitive, getTotalPrice, getTotalPrice, getTotalPriceAsPrimitive, getTotalPriceAsPrimitive, getTotalTax, getTotalTaxAsPrimitive, getTotalTaxAsPrimitive, getTotalTaxValuesInternal, getTotalTaxValuesInternal, getUser, getUser, isCalculatedAsPrimitive, isCalculatedAsPrimitive, isDiscountsIncludeDeliveryCost, isDiscountsIncludeDeliveryCost, isDiscountsIncludeDeliveryCostAsPrimitive, isDiscountsIncludeDeliveryCostAsPrimitive, isDiscountsIncludePaymentCost, isDiscountsIncludePaymentCost, isDiscountsIncludePaymentCostAsPrimitive, isDiscountsIncludePaymentCostAsPrimitive, isMarkModifiedDisabled, isNet, isNetAsPrimitive, isNetAsPrimitive, removeFromDiscounts, removeFromDiscounts, removeFromEntries, removeFromEntries, setCalculated, setCalculated, setCalculated, setCalculated, setDeliveryCost, setDeliveryCost, setDeliveryCost, setDescription, setDescription, setDiscounts, setDiscounts, setDiscountsIncludeDeliveryCost, setDiscountsIncludeDeliveryCost, setDiscountsIncludeDeliveryCost, setDiscountsIncludePaymentCost, setDiscountsIncludePaymentCost, setDiscountsIncludePaymentCost, setEntryGroups, setEntryGroups, setExpirationTime, setExpirationTime, setExportStatus, setExportStatus, setGlobalDiscountValuesInternal, setGlobalDiscountValuesInternal, setName, setName, setNet, setNet, setPaymentCost, setPaymentCost, setPaymentCost, setPaymentInfo, setPaymentInfo, setStatusInfo, setStatusInfo, setSubtotal, setSubtotal, setSubtotal, setSubtotal, setTotalDiscounts, setTotalDiscounts, setTotalDiscounts, setTotalDiscounts, setTotalPrice, setTotalPrice, setTotalPrice, setTotalPrice, setTotalTax, setTotalTax, setTotalTax, setTotalTax, setTotalTaxValuesInternal, setTotalTaxValuesInternal
-
Methods inherited from class de.hybris.platform.jalo.GenericItem
getImplementation, getInitialProperties, getNonInitialAttributes, getRelatedItems, setRelatedItems
-
Methods inherited from class de.hybris.platform.jalo.c2l.LocalizableItem
getAllLocalizedProperties, getAllLocalizedProperties, getAllLocalizedProperties, getAllLocalizedProperties, getAllValuesSessionContext, getLocalizedProperty, getLocalizedProperty, getLocalizedPropertyInternal, getLocalizedPropertyNames, getLocalizedPropertyNames, hasLanguage, isEmptyValue, isFallbackEnabled, removeLocalizedProperty, removeLocalizedProperty, setAllLocalizedProperties, setAllLocalizedProperties, setLocalizedProperty, setLocalizedProperty
-
Methods inherited from class de.hybris.platform.jalo.ExtensibleItem
createNonClassAccessor, getAllProperties, getAllProperties, getProperty, getProperty, getPropertyNames, getPropertyNames, removeProperty, removeProperty, setAllProperties, setAllProperties, setProperty, setProperty
-
Methods inherited from class de.hybris.platform.jalo.Item
addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addNegativePermission, addPermission, addPositivePermission, assureExtensionsLoaded, changeTypeAfterCreation, checkConstraint, checkItemPermission, checkMandatoryAttribute, checkMandatoryAttribute, checkPermission, checkPermission, checkRemovable, clearPermission, compareTo, ctx, doAfterRemove, doBeforeRemove, equals, getAccessorFor, getAllAttributes, getAllAttributes, getAllAttributes, getAllAttributes, getAllAttributesInternal, getAllLinkedItems, getAndCheckCacheBoundItem, getAttribute, getAttribute, getCacheBoundItem, getComposedType, getComposedTypePK, getCreationTime, getCurrentlyRemovingCount, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItemsCount, getLinkedItemsCount, getLinkedItemsCount, getModificationTime, getNegativePermissions, getOwner, getPermissionMap, getPermissions, getPersistenceVersion, getPK, getPositivePermissions, getRestrictedPrincipals, getSession, getSyncObject, getTenant, getTransientObject, getTransientObjectMap, hashCode, hasRegisteredClassAccessorFor, internal_registerClassAccessorFor, internal_registerNonClassAccessorFor, invalidateLocalCaches, isAlive, isCacheBound, isCurrentlyRemoving, isCurrentlyRemoving, isEmptyRelationValue, isInCreate, isInstanceOf, isItemCheckBeforeRemoveableDisabled, isRelationLocalizationFallbackEnabled, newInstance, notifyExtensionsAfterItemCreation, notifyExtensionsBeforeItemCreation, notifyItemRemoval, notifyManagerAboutItemRemoval, readResolve, registerAccessFor, registerAccessFor, registerJaloInvalidationListeners, remove, removeItemCollection, removeItemCollection, removeLinkedItems, removeLinkedItems, removeLinkedItems, removeLinkedItems, removeLinks, removePartOfItems, removePartOfItems, setAllAttributes, setAllAttributes, setAllAttributesInternal, setAllLinkedItems, setAllLinkedItems, setAllLinkedItems, setAllLinkedItems, setAttribute, setAttribute, setAttributeFromString, setAttributeFromString, setCacheBound, setCreationTime, setImplementation, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setModificationTime, setNonInitialAttributes, setOwner, setPermissionsByMap, setTransientObject, setUseTA, toString, useTA, writeReplace
-
Methods inherited from class de.hybris.platform.util.BridgeAbstraction
setTenant
-
-
-
-
Field Detail
-
CFG_TAX_FREE_ENTRIES_SUPPORT
public static final java.lang.String CFG_TAX_FREE_ENTRIES_SUPPORT
- See Also:
- Constant Field Values
-
APPEND_AS_LAST
public static final int APPEND_AS_LAST
- See Also:
- Constant Field Values
-
DELIVERY_ADDRESS
@Deprecated public static final java.lang.String DELIVERY_ADDRESS
Deprecated.since ages - useGeneratedAbstractOrder.DELIVERYADDRESSinstead- See Also:
- Constant Field Values
-
PAYMENT_ADDRESS
@Deprecated public static final java.lang.String PAYMENT_ADDRESS
Deprecated.since ages - useGeneratedAbstractOrder.PAYMENTADDRESSinstead- See Also:
- Constant Field Values
-
EXPORT_STATUS
@Deprecated public static final java.lang.String EXPORT_STATUS
Deprecated.since ages - useGeneratedAbstractOrder.EXPORTSTATUSinstead- See Also:
- Constant Field Values
-
PAYMENT_MODE
@Deprecated public static final java.lang.String PAYMENT_MODE
Deprecated.since ages - useGeneratedAbstractOrder.PAYMENTMODEinstead- See Also:
- Constant Field Values
-
DELIVERY_MODE
@Deprecated public static final java.lang.String DELIVERY_MODE
Deprecated.since ages - useGeneratedAbstractOrder.DELIVERYMODEinstead- See Also:
- Constant Field Values
-
PAYMENT_INFO
@Deprecated public static final java.lang.String PAYMENT_INFO
Deprecated.since ages - useGeneratedAbstractOrder.PAYMENTINFOinstead- See Also:
- Constant Field Values
-
PAYMENT_STATUS
@Deprecated public static final java.lang.String PAYMENT_STATUS
Deprecated.since ages - useGeneratedAbstractOrder.PAYMENTSTATUSinstead- See Also:
- Constant Field Values
-
DELIVERY_STATUS
@Deprecated public static final java.lang.String DELIVERY_STATUS
Deprecated.since ages - useGeneratedAbstractOrder.DELIVERYSTATUSinstead- See Also:
- Constant Field Values
-
GLOBAL_DISCOUNT_VALUES
@Deprecated public static final java.lang.String GLOBAL_DISCOUNT_VALUES
Deprecated.- See Also:
- Constant Field Values
-
TOTAL_TAX_VALUES
@Deprecated public static final java.lang.String TOTAL_TAX_VALUES
Deprecated.- See Also:
- Constant Field Values
-
TOTAL_TAX
@Deprecated public static final java.lang.String TOTAL_TAX
Deprecated.since ages - useGeneratedAbstractOrder.TOTALTAXinstead- See Also:
- Constant Field Values
-
TOTAL
@Deprecated public static final java.lang.String TOTAL
Deprecated.since ages - useGeneratedAbstractOrder.TOTALPRICEinstead- See Also:
- Constant Field Values
-
DELIVERY_COST
@Deprecated public static final java.lang.String DELIVERY_COST
Deprecated.since ages - useGeneratedAbstractOrder.DELIVERYCOSTinstead- See Also:
- Constant Field Values
-
PAYMENT_COST
@Deprecated public static final java.lang.String PAYMENT_COST
Deprecated.since ages - useGeneratedAbstractOrder.PAYMENTCOSTinstead- See Also:
- Constant Field Values
-
STATUS_INFO
@Deprecated public static final java.lang.String STATUS_INFO
Deprecated.since ages - useGeneratedAbstractOrder.STATUSINFOinstead- See Also:
- Constant Field Values
-
TOTAL_DISCOUNTS
@Deprecated public static final java.lang.String TOTAL_DISCOUNTS
Deprecated.since ages - useGeneratedAbstractOrder.TOTALDISCOUNTSinstead- See Also:
- Constant Field Values
-
ORDER_DISCOUNT_RELATION_NAME
@Deprecated public static final java.lang.String ORDER_DISCOUNT_RELATION_NAME
Deprecated.since ages - useDiscountModel#_ORDERDISCOUNTRELATIONinstead- See Also:
- Constant Field Values
-
ORDER_STATUS_TYPE
@Deprecated public static final java.lang.String ORDER_STATUS_TYPE
Deprecated.since ages - useOrderStatus#_TYPECODEinstead- See Also:
- Constant Field Values
-
PAYMENT_STATUS_TYPE
@Deprecated public static final java.lang.String PAYMENT_STATUS_TYPE
Deprecated.since ages - usePaymentStatus#_TYPECODEinstead- See Also:
- Constant Field Values
-
DELIVERY_STATUS_TYPE
@Deprecated public static final java.lang.String DELIVERY_STATUS_TYPE
Deprecated.since ages - useDeliveryStatus#_TYPECODEinstead- See Also:
- Constant Field Values
-
EXPORT_STATUS_TYPE
@Deprecated public static final java.lang.String EXPORT_STATUS_TYPE
Deprecated.since ages - useExportStatus#_TYPECODEinstead- See Also:
- Constant Field Values
-
-
Method Detail
-
createItem
protected Item createItem(SessionContext ctx, ComposedType type, Item.ItemAttributeMap allAttributes) throws JaloBusinessException
Description copied from class:ItemHas to be implemented for each concrete subtype of item. This method is responsible for creating a new item instance ( by calling managers, ejb homes, etc. ) duringComposedType.newInstance(Map).In case this method uses any of the attribute values during creation it is required to override
Item.getNonInitialAttributes(SessionContext, ItemAttributeMap)too.
Sn example:public static final String MY_ATTRIBUTE = "someAttribute"; ... protected Item createItem(SessionContext ctx, ComposedType type, Map allAttributes ) throws JaloBusinessException { MyManager man = ... return man.createMyItem( (String)allAttributes.get(MY_ATTRIBUTE) ); // here MY_ATTRIBUTE is used for creation, so it must not be set again } protected Map getNonInitialAttributes( SessionContext ctx, Map allAttributes ) { // let superclass remove its own initial attributes Map ret = super.getNonInitialAttributes( ctx, allAttributes ); // remove MY_ATTRIBUTE from all attributes since if has already been set ret.remove(MY_ATTRIBUTE); return ret; }- Overrides:
createItemin classGenericItem- Parameters:
ctx- the current session context which this item is created withintype- the actual item type ( since subtypes may not provide a own jalo class this may be different from the type which this method was implemented for )- Returns:
- the new item instance
- Throws:
JaloBusinessException- indicates an error during creation - any changes will be rollbacked
-
getAbstractOrderEntryTypeCode
protected abstract java.lang.String getAbstractOrderEntryTypeCode()
-
getAllEntries
@Deprecated public java.util.List getAllEntries()
Deprecated.since ages - usegetEntries(SessionContext)All order positions. These are ordered product quantities, described by a number and a unit.
-
getEntries
public java.util.List<AbstractOrderEntry> getEntries()
Description copied from class:GeneratedAbstractOrderGenerated method - Getter of theAbstractOrder.entriesattribute.- Overrides:
getEntriesin classGeneratedAbstractOrder- Returns:
- the entries
-
getEntries
public java.util.List<AbstractOrderEntry> getEntries(SessionContext ctx)
Description copied from class:GeneratedAbstractOrderGenerated method - Getter of theAbstractOrder.entriesattribute.- Overrides:
getEntriesin classGeneratedAbstractOrder- Returns:
- the entries
-
setAllEntries
protected void setAllEntries(SessionContext ctx, java.util.List value)
-
getEntry
@Deprecated public AbstractOrderEntry getEntry(int index) throws JaloItemNotFoundException
Deprecated.since ages - Use OrderService.getEntryForNumber(de.hybris.platform.core.model.order.AbstractOrderModel, int) instead.Returns the order entry at a specified position.- Parameters:
index-- Throws:
JaloItemNotFoundException
-
getEntries
public java.util.Collection getEntries(int startIdx, int endIdx)
-
getEntriesByProduct
public java.util.List getEntriesByProduct(Product product)
Returns all entries which belong to a specified product.- Parameters:
product-
-
createNewEntryNumber
protected int createNewEntryNumber(int requested)
-
shuffleEntriesOnInsertNew
protected void shuffleEntriesOnInsertNew(java.util.List<AbstractOrderEntry> all, int newEntryNumber)
-
getNewEntryNumberForAppending
protected int getNewEntryNumberForAppending(java.util.List<AbstractOrderEntry> all)
-
getNextEntryNumber
protected int getNextEntryNumber(AbstractOrderEntry forMe)
-
addNewEntry
@Deprecated public AbstractOrderEntry addNewEntry(Product prod, long qtd, Unit unit)
Deprecated.since 4.3, please use suitable OrderService.addNewEntry() methodAdds a new entry to this order. A new entry is created for this reason. You can create multiple entries whith the same product: there is no automatic summing-up of similar entries.- Parameters:
prod- - must not be nullqtd-unit- - must not be null- Throws:
java.lang.IllegalArgumentException- if eighter given Product or Unit was null
-
addNewEntry
@Deprecated public AbstractOrderEntry addNewEntry(Product prod, long qtd, Unit unit, boolean addToPresent)
Deprecated.since 4.3, please use suitable OrderService.addNewEntry() methodAdds a new entry to this order. A new entry is created for this reason. You can create multiple entries whith the same product: there is no automatic summing-up of similar entries.- Parameters:
prod- - must not be nullqtd-unit- - must not be nulladdToPresent- if true an existing entry with matching product and unit will get its quantity increased; otherwise a new entry is created- Throws:
java.lang.IllegalArgumentException- if eighter given Product or Unit was null
-
addNewEntry
@Deprecated public AbstractOrderEntry addNewEntry(Product prod, long qtd, Unit unit, int position, boolean addToPresent)
Deprecated.since 4.3, please use suitable OrderService.addNewEntry() methodAdds a new entry to this order. A new entry is created for this reason. You can create multiple entries whith the same product: there is no automatic summing-up of similar entries.- Parameters:
prod- - must not be nullqtd-unit- - must not be nulladdToPresent- if true an existing entry with matching product and unit will get its quantity increased; otherwise a new entry is created- Throws:
java.lang.IllegalArgumentException- if eighter given Product or Unit was null
-
addNewEntry
@Deprecated public AbstractOrderEntry addNewEntry(ComposedType type, Product prod, long qtd, Unit unit, int position, boolean addToPresent)
Deprecated.since 4.3, please use suitable OrderService.addNewEntry() methodAdds a new entry to this order. A new entry is created for this reason. You can create multiple entries whith the same product: there is no automatic summing-up of similar entries.- Parameters:
type- the item type of the new entry (note that the type is not changed if a existing entry is just increased!)prod- - must not be nullqtd-unit- - must not be nulladdToPresent- if true an existing entry with matching product and unit will get its quantity increased; otherwise a new entry is created- Throws:
java.lang.IllegalArgumentException- if eighter given Product or Unit was null
-
createNewEntry
protected abstract AbstractOrderEntry createNewEntry(SessionContext ctx, ComposedType entryType, Product product, long quantity, Unit unit, int position)
-
getCustomEntryType
protected ComposedType getCustomEntryType()
when overriding abstract order type this defines the corresponding entry type- Returns:
- null as default; subtypes may return their corresponding entry type
-
setComposedType
public Item setComposedType(ComposedType type) throws JaloInvalidParameterException
Changes this order's composed type and the composed type of its entries provided thatgetCustomEntryType()returns a valid entry class.- Overrides:
setComposedTypein classItem- Parameters:
type- the new type of the item- Returns:
- the new version of this item - the new type may require a new jalo class type !!!
- Throws:
JaloInvalidParameterException- in case the new type is not compatible with the current type. this happens a) if the type is abstract, b) the new type's class is not compatible with the current class, or c) if the new type has a different deployment (JNDI name, Table) than the current one
-
createEntryInformation
@Deprecated protected java.lang.String createEntryInformation(AbstractOrderEntry newEntry)
Deprecated.since 4.3 order entry info is set in prepare interceptor.Creates the info field text for a newly create entry of this order. This method could be overwritten in subtypes of AbstractOrder but it isnt useful anymore. With an entry in filelocal.properties(orproject.properties) you can define the text and attributes for each itemtype individually.
The entry in the property file is likeorderentry.infofield.your_type = your pattern with this ${attribute_of_your_type}
samples:
orderentry.infofield.product = product "${code}" with name "${name}"generates in the info field the entryproduct "P000010" with name "bett"
orderentry.infofield.shirt = product ${code} in color ${color} and size ${size.code}generates in the info field the entryproduct P000123 in color green and size m
For MyProduct, which is a subtyp from Product, the same pattern as product is used, not the pattern for shirt.
rules:
-orderentry.infofield.xxxxxx<- all in lower case !
- if you want to use an attribute of a type where the type itself is an attribute of a type use all (path)attributes seperated with a dot (.). For example to use the unit iso code in MyVariantTyp use ${myVariantUnitAttributeName.unit.code}
If no pattern is defined, the product code is used in info field. Alternatively, override this method.- Parameters:
newEntry- the newly created (and added) entry of this order- Returns:
- the text for the AbstractOrderEntry.info field
-
getAttributeValue
protected java.lang.Object getAttributeValue(Item item, java.lang.String qualifer) throws JaloSecurityException
- Throws:
JaloSecurityException
-
tryToFindFallbackLanguage
protected Language tryToFindFallbackLanguage(JaloSession js)
-
removeEntry
@Deprecated public void removeEntry(AbstractOrderEntry entry)
Deprecated.since ages - UseModelService.remove() instead. All the remove logic is handled by dedicatedRemoveInterceptors. Removes an entry from this order. Since entries can per definition not exists without a containing order the entry object is permanently deleted, so be careful.- Parameters:
entry-
-
removeEntries
@Deprecated protected void removeEntries(SessionContext ctx, java.util.Set<AbstractOrderEntry> entries)
Deprecated.since ages - UseModelService.remove() instead. All the remove logic is handled by dedicatedRemoveInterceptors.
-
removeAllEntries
@Deprecated public void removeAllEntries()
Deprecated.since ages - UseModelService.remove() instead. All the remove logic is handled by dedicatedRemoveInterceptors. Removes all entries from this order. Since entries can per definition not exists without a containing order they are permanently deleted. Please use this method with care.
-
setCode
public void setCode(java.lang.String code)
Sets the order code. Used for easier picking of orders without dealing with pk's. Besides code has no special meaning so you can map any information in it.- Overrides:
setCodein classGeneratedAbstractOrder- Parameters:
code-
-
setCode
public void setCode(SessionContext ctx, java.lang.String code)
Sets the order code. Used for easier picking of orders without dealing with pk's. Besides code has no special meaning so you can map any information in it.- Overrides:
setCodein classGeneratedAbstractOrder- Parameters:
ctx- can be used for cached access of 'code' value may be outdated!code-
-
setDate
public void setDate(java.util.Date date)
Changes creation date of an order. This has no immediate affects on this orders informations, though a re-calculation might give varying prices, so use with care.- Overrides:
setDatein classGeneratedAbstractOrder- Parameters:
date-
-
getDate
public java.util.Date getDate(SessionContext ctx)
The creation date of an order.- Overrides:
getDatein classGeneratedAbstractOrder- Parameters:
ctx- can be used for cached access of 'date' value may be outdated!- Returns:
- the date
-
setDate
public void setDate(SessionContext ctx, java.util.Date date)
Changes creation date of an order. This has no immediate affects on this orders informations, though a re-calculation might give varying prices, so use with care.- Overrides:
setDatein classGeneratedAbstractOrder- Parameters:
ctx- can be used for cached access of 'date' value may be outdated!date-
-
setUser
public void setUser(User user)
Changes the user which this order belongs to. Please note that this results in a uncalculated order since pricing informations are user - specific and therefore not convertible.- Overrides:
setUserin classGeneratedAbstractOrder- Parameters:
user-
-
setUser
public void setUser(SessionContext ctx, User user)
Changes the user which this order belongs to. Please note that this results in a uncalculated order since pricing informations are user - specific and therefore not convertible.- Overrides:
setUserin classGeneratedAbstractOrder- Parameters:
ctx- can be used for cached access of the user object object may be outdated!user-
-
setCurrency
public void setCurrency(Currency curr)
Changes the currency for all pricing informations of this order. Please not that this result in a uncalculated order since prices are currency - dependant and therefore not convertible.- Overrides:
setCurrencyin classGeneratedAbstractOrder- Parameters:
curr-
-
setCurrency
public void setCurrency(SessionContext ctx, Currency curr)
Changes the currency for all pricing informations of this order. Please not that this result in a uncalculated order since prices are currency - dependant and therefore not convertible.- Overrides:
setCurrencyin classGeneratedAbstractOrder- Parameters:
ctx- can be used for cached access of the currency object object may be outdated!curr-
-
setStatus
public void setStatus(EnumerationValue status)
Changes the order status. Since status has no deeper meaning (from core view) the order remains unchanged.- Overrides:
setStatusin classGeneratedAbstractOrder- Parameters:
status- the status of this order.
-
setStatus
public void setStatus(SessionContext ctx, EnumerationValue status)
Changes the order status. Since status has no deeper meaning (from core view) the order remains unchanged.- Overrides:
setStatusin classGeneratedAbstractOrder- Parameters:
ctx- can be used for cached access of status value may be outdated!status- the status of this order
-
setPaymentStatus
public void setPaymentStatus(EnumerationValue paymentStatus)
Changes the payment order status.- Overrides:
setPaymentStatusin classGeneratedAbstractOrder- Parameters:
paymentStatus- the payment status of this order.
-
setPaymentStatus
public void setPaymentStatus(SessionContext ctx, EnumerationValue paymentStatus)
Changes the order payment status.- Overrides:
setPaymentStatusin classGeneratedAbstractOrderpaymentStatus- the paymentStatus
-
setDeliveryStatus
public void setDeliveryStatus(EnumerationValue deliveryStatus)
Changes the order delivery status.- Overrides:
setDeliveryStatusin classGeneratedAbstractOrder- Parameters:
deliveryStatus- the delivery status of this order.
-
setDeliveryStatus
public void setDeliveryStatus(SessionContext ctx, EnumerationValue deliveryStatus)
Changes the order delivery status.- Overrides:
setDeliveryStatusin classGeneratedAbstractOrderdeliveryStatus- the deliveryStatus
-
isNet
public java.lang.Boolean isNet()
The gross / net status of this order. An order has generally to be seen as 'gross' or 'net'. All calculated prices depend on base prices which are either gross or net (including rounding if prices must be computed to fut gross - net status ).- Overrides:
isNetin classGeneratedAbstractOrder- Returns:
- the net
-
setNet
public void setNet(boolean net)
Changes the gross / net status of this order. Please note that this result in an uncalculated order, since prices also depend on gross / net status. This is because of the fact that prices may be just kept in one form (e.g. 'net') and must be converted (and of course rounded to the currencies correct digits) if the other one is requested (e.g. 'gross').- Overrides:
setNetin classGeneratedAbstractOrder- Parameters:
net-
-
setNet
public void setNet(SessionContext ctx, boolean net)
Changes the gross / net status of this order. Please note that this result in an uncalculated order, since prices also depend on gross / net status. This is because of the fact that prices may be just kept in one form (e.g. 'net') and muste be converted (and of course rounded to the currencies correct digits) if the other one is requested (e.g. 'gross').- Overrides:
setNetin classGeneratedAbstractOrder- Parameters:
ctx- can be used for cached access of net status value may be outdated!net-
-
setDeliveryMode
public void setDeliveryMode(DeliveryMode mode)
Changes the chosen delivery mode for this order. Please note that this un-calculates this order, though all entries keep their calculation status.- Overrides:
setDeliveryModein classGeneratedAbstractOrder- Parameters:
mode-
-
setDeliveryMode
public void setDeliveryMode(SessionContext ctx, DeliveryMode mode)
Changes the chosen delivery mode for this order. Please note that this un-calculates this order, though all entries keep their calculation status.- Overrides:
setDeliveryModein classGeneratedAbstractOrder- Parameters:
ctx- can be used for cached access of delivery mode object object may be outdated!mode-
-
setDeliveryAddress
public void setDeliveryAddress(Address address)
Changes the delivery address. This does not cause any other changes in the order.- Overrides:
setDeliveryAddressin classGeneratedAbstractOrder- Parameters:
address-
-
createNewDeliveryAddress
public Address createNewDeliveryAddress()
creates a new address which is set as this orders delivery address.
-
createNewDeliveryAddress
public Address createNewDeliveryAddress(SessionContext ctx)
creates a new address which is set as this orders delivery address.
-
setDeliveryAddress
public void setDeliveryAddress(SessionContext ctx, Address address)
Changes the delivery address. This does not cause any other changes in the order.- Overrides:
setDeliveryAddressin classGeneratedAbstractOrder- Parameters:
ctx- can be used for cached access of address object object may be outdated!address-
-
doSetDeliveryAddress
protected void doSetDeliveryAddress(SessionContext ctx, Address newOne)
Performs changing of delivery address. In case the current address is a duplicate it will be removed.
-
getDeliveryCosts
public double getDeliveryCosts()
The calculated delivery costs of this order. Only valid ifisCalculated()returnstrueand/or it was set by your own using the methodsetDeliveryCosts(double).
-
setDeliveryCosts
public void setDeliveryCosts(double deliveryCost)
Sets The calculated delivery costs of this order.- Parameters:
deliveryCost-
-
getDeliveryCosts
@Deprecated public double getDeliveryCosts(SessionContext ctx)
Deprecated.since ages - useGeneratedAbstractOrder.getDeliveryCostAsPrimitive(SessionContext)insteadThe calculated delivery costs of this order. Only valid ifisCalculated()returnstrueand/or it was set by your own using the methodsetDeliveryCosts(SessionContext, double).
-
setDeliveryCosts
@Deprecated public void setDeliveryCosts(SessionContext ctx, double deliveryCost)
Deprecated.since ages - useGeneratedAbstractOrder.setDeliveryCost(double)insteadSets The calculated delivery costs of this order.- Parameters:
ctx-deliveryCost-
-
setDeliveryCost
public void setDeliveryCost(SessionContext ctx, java.lang.Double value)
Description copied from class:GeneratedAbstractOrderGenerated method - Setter of theAbstractOrder.deliveryCostattribute.- Overrides:
setDeliveryCostin classGeneratedAbstractOrdervalue- the deliveryCost
-
setPaymentMode
public void setPaymentMode(PaymentMode mode)
Changes the payment mode of this order. Please note that this results in an uncalculated order, though all entries keep their calculation status.- Overrides:
setPaymentModein classGeneratedAbstractOrder- Parameters:
mode-
-
setPaymentMode
public void setPaymentMode(SessionContext ctx, PaymentMode mode)
Changes the payment mode of this order. Please note that this results in an uncalculated order, though all entries keep their calculation status.- Overrides:
setPaymentModein classGeneratedAbstractOrder- Parameters:
ctx- can be used for cached access object may be outdated!mode-
-
setPaymentAddress
public void setPaymentAddress(Address adr)
Changes the payment address of this order. This does not cause any other changes in the order.- Overrides:
setPaymentAddressin classGeneratedAbstractOrder- Parameters:
adr-
-
createNewPaymentAddress
public Address createNewPaymentAddress()
creates a new address which is set as this orders payment address.
-
createNewPaymentAddress
public Address createNewPaymentAddress(SessionContext ctx)
creates a new address which is set as this orders payment address.
-
setPaymentAddress
public void setPaymentAddress(SessionContext ctx, Address adr)
Changes the payment address of this order. This does not cause any other changes in the order.- Overrides:
setPaymentAddressin classGeneratedAbstractOrder- Parameters:
ctx- can be used for cached access object may be outdated!adr-
-
doSetPaymentAddress
protected void doSetPaymentAddress(SessionContext ctx, Address newOne)
Performs changing of payment address. In case the current address is a duplicate it will be removed.
-
getPaymentCosts
public double getPaymentCosts()
The calculated costs according to the chosen payment mode.
-
setPaymentCosts
public void setPaymentCosts(double paymentCost)
Sets the costs of the chosen payment mode.- Parameters:
paymentCost-
-
getPaymentCosts
@Deprecated public double getPaymentCosts(SessionContext ctx)
Deprecated.since ages - useGeneratedAbstractOrder.getPaymentCost(SessionContext)insteadThe calculated costs according to the chosen payment mode.
-
setPaymentCosts
@Deprecated public void setPaymentCosts(SessionContext ctx, double paymentCost)
Deprecated.since ages - useGeneratedAbstractOrder.setPaymentCost(SessionContext, double)insteadSets the costs of the chosen payment mode.- Parameters:
ctx-paymentCost-
-
setPaymentCost
public void setPaymentCost(SessionContext ctx, java.lang.Double value)
Description copied from class:GeneratedAbstractOrderGenerated method - Setter of theAbstractOrder.paymentCostattribute.- Overrides:
setPaymentCostin classGeneratedAbstractOrdervalue- the paymentCost
-
getTotalTax
public java.lang.Double getTotalTax()
The calculated total tax amount of this order. This is the sum of all taxes accessible viagetTotalTaxValues().- Overrides:
getTotalTaxin classGeneratedAbstractOrder- Returns:
- the totalTax
-
getTotal
@Deprecated public double getTotal()
Deprecated.since ages - useGeneratedAbstractOrder.getTotalPriceAsPrimitive()insteadThe calculated total price of this order. Depending on gross / net status this may include taxes or not.
-
setTotal
public void setTotal(double total)
Sets the calculated total price of this order. please note that this field is overwritten each timecalculate(),calculate(Date),recalculate(),recalculate(Date)orcalculateTotals(boolean)is called.- Parameters:
total-
-
getTotal
@Deprecated public double getTotal(SessionContext ctx)
Deprecated.since ages - useGeneratedAbstractOrder.getTotalPriceAsPrimitive(SessionContext)insteadThe calculated total price of this order. Depending on gross / net status this may include taxes or not.
-
setTotal
@Deprecated public void setTotal(SessionContext ctx, double price)
Deprecated.since ages - useGeneratedAbstractOrder.setTotalPrice(SessionContext, double)insteadSets the calculated total price of this order. please note that this field is overwritten each timecalculate(),calculate(Date),recalculate(),recalculate(Date)orcalculateTotals(boolean)is called.- Parameters:
ctx-price-
-
addTotalTaxValue
@Deprecated public void addTotalTaxValue(TaxValue taxValue)
Deprecated.since ages - Use OrderService.addTotalTaxValue(de.hybris.platform.core.model.order.AbstractOrderModel, TaxValue) instead.Adds a tax value into this order. please note that this field is overwritten each timecalculate(),calculate(Date),recalculate(),recalculate(Date)orcalculateTotals(boolean)is called.- Parameters:
taxValue-
-
addAllTotalTaxValues
@Deprecated public void addAllTotalTaxValues(java.util.Collection values)
Deprecated.since ages - Use OrderService.addAllTotalTaxValues(de.hybris.platform.core.model.order.AbstractOrderModel, List) instead.Adds a collection of tax values into this order. please note that this field is overwritten each timecalculate(),calculate(Date),recalculate(),recalculate(Date)orcalculateTotals(boolean)is called.- Parameters:
values-
-
removeTotalTaxValue
@Deprecated public void removeTotalTaxValue(TaxValue taxValue)
Deprecated.since ages - Use OrderService.removeTotalTaxValue(de.hybris.platform.core.model.order.AbstractOrderModel, TaxValue) instead.Removes a tax value of this order. please note that this field is overwritten each timecalculate(),calculate(Date),recalculate(),recalculate(Date)orcalculateTotals(boolean)is called.- Parameters:
taxValue-
-
removeAllTotalTaxValues
@Deprecated public void removeAllTotalTaxValues()
Deprecated.since ages - Use model setter AbstractOrderModel.setTotalTaxValues(Collection) and ModelService.save() method instead.Removes all tax values of this order. please note that this field is overwritten each timecalculate(),calculate(Date),recalculate(),recalculate(Date)orcalculateTotals(boolean)is called.
-
getTotalTaxValues
@Deprecated public java.util.Collection getTotalTaxValues()
Deprecated.since ages - Use model getter AbstractOrderModel.getTotalTaxValues() instead.Returns all tax values ( seeTaxValue) of this order. These values represent the grouped taxes of all entries.
-
getTotalTaxValues
@Deprecated public java.util.Collection getTotalTaxValues(SessionContext ctx)
Deprecated.since ages - Use model getter AbstractOrderModel.getTotalTaxValues() instead.Returns all tax values ( seeTaxValue) of this order. These values represent the grouped taxes of all entries.
-
addTotalTaxValue
@Deprecated public void addTotalTaxValue(SessionContext ctx, TaxValue taxValue)
Deprecated.since ages - Use OrderService.addTotalTaxValue(de.hybris.platform.core.model.order.AbstractOrderModel, TaxValue) instead.Adds a tax value to this order. please note that this field is overwritten each timecalculate(),calculate(Date),recalculate(),recalculate(Date)orcalculateTotals(boolean)is called.- Parameters:
taxValue-
-
addAllTotalTaxValues
@Deprecated public void addAllTotalTaxValues(SessionContext ctx, java.util.Collection values)
Deprecated.since ages - Use OrderService.addAllTotalTaxValues(de.hybris.platform.core.model.order.AbstractOrderModel, List) instead.Adds a collection of tax values into this order. please note that this field is overwritten each timecalculate(),calculate(Date),recalculate(),recalculate(Date)orcalculateTotals(boolean)is called.- Parameters:
values-
-
removeTotalTaxValue
@Deprecated public void removeTotalTaxValue(SessionContext ctx, TaxValue taxValue)
Deprecated.since ages - Use OrderService.removeTotalTaxValue(de.hybris.platform.core.model.order.AbstractOrderModel, TaxValue) instead.Removes a tax value of this order. please note that this field is overwritten each timecalculate(),calculate(Date),recalculate(),recalculate(Date)orcalculateTotals(boolean)is called.- Parameters:
taxValue-
-
removeAllTotalTaxValues
@Deprecated public void removeAllTotalTaxValues(SessionContext ctx)
Deprecated.since ages - Use model setter AbstractOrderModel.setTotalTaxValues(Collection) and ModelService.save() method instead.Removes all tax values of this order. please note that this field is overwritten each timecalculate(),calculate(Date),recalculate(),recalculate(Date)orcalculateTotals(boolean)is called.
-
setTotalTaxValues
@Deprecated public void setTotalTaxValues(java.util.Collection totalTaxValues)
Deprecated.since ages - Use model setter AbstractOrderModel.setTotalTaxValues(Collection) and ModelService.save() method instead.
-
setTotalTaxValues
@Deprecated public void setTotalTaxValues(SessionContext ctx, java.util.Collection totalTaxValues)
Deprecated.since ages - Use model setter AbstractOrderModel.setTotalTaxValues(Collection) and ModelService.save() method instead.
-
addGlobalDiscountValue
@Deprecated public void addGlobalDiscountValue(DiscountValue discountValue)
Deprecated.since ages - Use OrderService.addGlobalDiscountValue(de.hybris.platform.core.model.order.AbstractOrderModel, DiscountValue) instead.Adds a global discount value into this order.- Parameters:
discountValue-
-
addAllGlobalDiscountValues
@Deprecated public void addAllGlobalDiscountValues(java.util.Collection values)
Deprecated.since ages - Use OrderService.addAllGlobalDiscountValues(de.hybris.platform.core.model.order.AbstractOrderModel, List) instead.Adds a collection of global discount values into this order.- Parameters:
values-
-
removeGlobalDiscountValue
@Deprecated public void removeGlobalDiscountValue(DiscountValue discountValue)
Deprecated.since ages - Use OrderService.removeGlobalDiscountValue(de.hybris.platform.core.model.order.AbstractOrderModel, DiscountValue) instead.Removes a global discount value of this order.- Parameters:
discountValue-
-
removeAllGlobalDiscountValues
@Deprecated public void removeAllGlobalDiscountValues()
Deprecated.since ages - Use model setter AbstractOrderModel.setGlobalDiscountValues(List) and ModelService.save() method instead.Removes all global discount values of this order.
-
getGlobalDiscountValues
@Deprecated public java.util.List getGlobalDiscountValues()
Deprecated.since ages - Use model getter AbstractOrderModel.getGlobalDiscountValues() instead.Returns a list of all global discount values (this are discount which are applied to on order level instead of entry level). Since this might include absolute discounts the order is important, so we chose a List.
-
getGlobalDiscountValues
@Deprecated public java.util.List getGlobalDiscountValues(SessionContext ctx)
Deprecated.since ages - Use model getter AbstractOrderModel.getGlobalDiscountValues() instead.Returns a list of all global discount values (this are discount which are applied to on order level instead of entry level). Since this might include absolute discounts the order is important, so we chose a List.
-
addGlobalDiscountValue
@Deprecated public void addGlobalDiscountValue(SessionContext ctx, DiscountValue discountValue)
Deprecated.since ages - Use OrderService.addGlobalDiscountValue(de.hybris.platform.core.model.order.AbstractOrderModel, DiscountValue) instead.Adds a global discount value to this order.- Parameters:
discountValue-
-
addAllGlobalDiscountValues
@Deprecated public void addAllGlobalDiscountValues(SessionContext ctx, java.util.Collection values)
Deprecated.since ages - Use OrderService.addAllGlobalDiscountValues(de.hybris.platform.core.model.order.AbstractOrderModel, List) instead.Adds a collection of global discount values into this order.- Parameters:
values-
-
removeGlobalDiscountValue
@Deprecated public void removeGlobalDiscountValue(SessionContext ctx, DiscountValue discountValue)
Deprecated.since ages - Use OrderService.removeGlobalDiscountValue(de.hybris.platform.core.model.order.AbstractOrderModel, DiscountValue) instead.Removes a global discount value of this order.- Parameters:
discountValue-
-
removeAllGlobalDiscountValues
@Deprecated public void removeAllGlobalDiscountValues(SessionContext ctx)
Deprecated.since ages - Use model setter AbstractOrderModel.setGlobalDiscountValues(List) and ModelService.save() method instead.Removes all global discount values of this order.
-
setGlobalDiscountValues
@Deprecated public void setGlobalDiscountValues(java.util.List globalDiscounts)
Deprecated.since ages - Use model setter AbstractOrderModel.setGlobalDiscountValues(List) and ModelService.save() method instead.
-
setGlobalDiscountValues
@Deprecated public void setGlobalDiscountValues(SessionContext ctx, java.util.List globalDiscounts)
Deprecated.since ages - Use model setter AbstractOrderModel.setGlobalDiscountValues(List) and ModelService.save() method instead.
-
isCalculated
public java.lang.Boolean isCalculated()
Shows if this order was calculated before. All calculated fields are only valid if this metho returnstrue.- Overrides:
isCalculatedin classGeneratedAbstractOrder- Returns:
- the calculated
- See Also:
calculate(),calculate(Date),recalculate(),recalculate(Date),calculateTotals(boolean)
-
isCalculated
public java.lang.Boolean isCalculated(SessionContext ctx)
Shows if this order was calculated before. All calculated fields are only valid if this metho returnstrue.- Overrides:
isCalculatedin classGeneratedAbstractOrder- Returns:
- the calculated
- See Also:
calculate(),calculate(Date),recalculate(),recalculate(Date),calculateTotals(boolean)
-
discountsIncludePaymentCosts
@Deprecated public boolean discountsIncludePaymentCosts()
Deprecated.since ages - useGeneratedAbstractOrder.isDiscountsIncludePaymentCostAsPrimitive()insteadtells whether payment costs should be included in discount calculation or not. in other words: if this field is true payment costs are changed the same way as product costs if discount values are set at this order.
-
setDiscountsIncludePaymentCosts
@Deprecated public void setDiscountsIncludePaymentCosts(boolean includes)
Deprecated.since ages - usesetDiscountsIncludePaymentCosts(boolean)insteadchanges whether payment costs should be included in discount calculation or not. in other words: if this field is true payment costs are changed the same way as product costs if discount values are set at this order.
-
setDiscountsIncludePaymentCost
public void setDiscountsIncludePaymentCost(SessionContext ctx, java.lang.Boolean value)
Description copied from class:GeneratedAbstractOrderGenerated method - Setter of theAbstractOrder.discountsIncludePaymentCostattribute.- Overrides:
setDiscountsIncludePaymentCostin classGeneratedAbstractOrdervalue- the discountsIncludePaymentCost - Tells whether payment costs should be included in discount calculation or not. If this field is true payment costs are changed the same way as product costs if discount values are set at this order.
-
discountsIncludeDeliveryCosts
@Deprecated public boolean discountsIncludeDeliveryCosts()
Deprecated.since ages - useGeneratedAbstractOrder.isDiscountsIncludePaymentCostAsPrimitive()insteadtells whether delivery costs should be included in discount calculation or not. in other words: if this field is true delivery costs are changed the same way as product costs if discount values are set at this order.
-
setDiscountsIncludeDeliveryCosts
@Deprecated public void setDiscountsIncludeDeliveryCosts(boolean includes)
Deprecated.since ages - useGeneratedAbstractOrder.setDiscountsIncludeDeliveryCost(boolean)insteadchanges whether delivery costs should be included in discount calculation or not. in other words: if this field is true delivery costs are changed the same way as product costs if discount values are set at this order.
-
setDiscountsIncludeDeliveryCost
public void setDiscountsIncludeDeliveryCost(SessionContext ctx, java.lang.Boolean value)
Description copied from class:GeneratedAbstractOrderGenerated method - Setter of theAbstractOrder.discountsIncludeDeliveryCostattribute.- Overrides:
setDiscountsIncludeDeliveryCostin classGeneratedAbstractOrdervalue- the discountsIncludeDeliveryCost - Tells whether delivery costs should be included in discount calculation or not. If this field is true delivery costs are changed the same way as product costs if discount values are set at this order.
-
calculateEntries
protected void calculateEntries() throws JaloPriceFactoryExceptioncallsAbstractOrderEntry.calculate()on all entries of this order and sets this orders subtotal to the sum of the entry totals. this is called at start ofcalculate().- Throws:
JaloPriceFactoryException- if a pricefactory error ocurred
-
recalculateEntries
protected void recalculateEntries() throws JaloPriceFactoryExceptioncallsAbstractOrderEntry.recalculate()on all entries of this order and sets this orders subtotal to the sum of the entry totals. this is called at start ofrecalculate().- Throws:
JaloPriceFactoryException- if a pricefactory error ocurred
-
findPaymentCosts
protected PriceValue findPaymentCosts() throws JaloPriceFactoryException
called duringcalculate(),calculate(Date),recalculate()andrecalculate(Date)to fetch and set the payment costs for this order.as default this method calls
PaymentMode.getCost(AbstractOrder)when a payment mode was set. you may override this method to implement different behavior. please note that at this time no order total have been set ( except the order total which holds the entry total sum )so dont rely on these values.- Returns:
- the payment costs of this abstract order
- Throws:
JaloPriceFactoryException
-
findDeliveryCosts
protected PriceValue findDeliveryCosts() throws JaloPriceFactoryException
Called duringcalculate(),calculate(Date),recalculate()andrecalculate(Date)to fetch and set the delivery cost for this order.As default this method calls
DefaultDeliveryCostsStrategy.findDeliveryCosts(de.hybris.platform.jalo.SessionContext, de.hybris.platform.jalo.order.AbstractOrder)when a delivery mode was set. You may override this method to implement different behavior. Please note that at this time no order total have been set (Except the order total which holds the entry total sum) so dont rely on these values. You may replace this strtegy by configuirng your spring.xml accordingly See: Configuration: core-spring.xmlbean id="core.orderManager" class="de.hybris.platform.jalo.order.OrderManager" scope="tenant"> <property name="deliveryCostsStrategy" ref="core.deliverycostsstrategy.default"/> /bean>
- Returns:
- the delivery costs of this abstract order
- Throws:
JaloPriceFactoryException
-
findGlobalDiscounts
protected java.util.List findGlobalDiscounts() throws JaloPriceFactoryExceptionCalled duringcalculate(),calculate(Date),recalculate()andrecalculate(Date)to fetch and set global discount values for this order.As default this method calls
AbstractPriceFactory.getDiscountValues(AbstractOrder). you may override this method to implement different behavior. please note that at this time no order total have been set ( except the order total which holds the entry total sum )so dont rely on these values.- Returns:
- a list containing all global discounts which are applied to this abstract order
- Throws:
JaloPriceFactoryException
-
calculateTotals
@Deprecated public void calculateTotals(boolean recalculate) throws JaloPriceFactoryExceptionDeprecated.since ages - Use CalculationService#calculateTotals(de.hybris.platform.core.model.order.AbstractOrderModel, boolean) instead(re)calculates all totals. this does not trigger price, tax and discount calculation but takes all currently set price, tax and discount values as base.- Parameters:
recalculate- forces setting total even if order is marked as calculated- Throws:
JaloPriceFactoryException
-
calculateTotals
protected void calculateTotals(boolean recalculate, java.util.Map<TaxValue,java.util.Map<java.util.Set<TaxValue>,java.lang.Double>> taxValueMap) throws JaloPriceFactoryExceptioncalculates all totals. this does not trigger price, tax and discount calculation but takes all currently set price, tax and discount values as base. this method requires the correct subtotal to be set before and the correct tax value map.- Parameters:
recalculate- if false calculation is done only if the calculated flag is not settaxValueMap- the map { tax value -> Double( sum of all entry totals for this tax ) } obtainable viacalculateSubtotal(boolean)- Throws:
JaloPriceFactoryException
-
getTotalDiscounts
public java.lang.Double getTotalDiscounts()
returns the sum of all discounts of this (calculated) order.- Overrides:
getTotalDiscountsin classGeneratedAbstractOrder- Returns:
- the totalDiscounts
-
calculateSubtotal
protected java.util.Map<TaxValue,java.util.Map<java.util.Set<TaxValue>,java.lang.Double>> calculateSubtotal(boolean recalculate)
Calculates this order's subtotal and returns a total tax value map.The map groups entry totals per applied tax values. This is necessary to support multiple (relative) taxes per entry:
One example
entry 1: base price = 10 EUR, tax values = [ VAT_FULL 19%, CUSTOM 2% ] entry 2: base price = 20 EUR, tax values = [ VAT_FULL 19% ] entry 3: base price = 30 EUR, tax values = [ VAT_HALF 7% ] ==> { VAT_FULL 19% -> { ( VAT_FULL 19% , CUSTOM 2% ) -> 10 EUR ( VAT_FULL 19% ) -> 20 EUR } VAT_HALF 7% -> { ( VAT_HALF 7% ) -> 30 EUR } CUSTOM 2% -> { ( VAT_FULL 19% , CUSTOM 2% ) -> 10 EUR } }- Parameters:
recalculate-- Returns:
- a map holding { TaxValue -> Double( sum of entries with this tax value ) }, means these are the total tax values mapped to the total price they apply to
-
addRelativeEntryTaxValue
protected void addRelativeEntryTaxValue(double entryTotal, TaxValue taxValue, java.util.Set<TaxValue> relativeEntryTaxValues, java.util.Map<TaxValue,java.util.Map<java.util.Set<TaxValue>,java.lang.Double>> taxValueMap)
-
addAbsoluteEntryTaxValue
protected void addAbsoluteEntryTaxValue(long entryQuantity, TaxValue taxValue, java.util.Map<TaxValue,java.util.Map<java.util.Set<TaxValue>,java.lang.Double>> taxValueMap)
-
calculateDiscountValues
protected double calculateDiscountValues(boolean recalculate)
Returns the total discount for this abstract order.- Parameters:
recalculate-trueforces a recalculation- Returns:
- totalDiscounts
-
convertDiscountValues
protected java.util.List convertDiscountValues(java.util.List dvs)
-
calculateTotalTaxValues
protected double calculateTotalTaxValues(boolean recalculate, int digits, double taxAdjustmentFactor, java.util.Map<TaxValue,java.util.Map<java.util.Set<TaxValue>,java.lang.Double>> taxValueMap)- Parameters:
recalculate-digits-taxAdjustmentFactor-taxValueMap-- Returns:
- total taxes
-
calculateAbsoluteTotalTaxValue
protected TaxValue calculateAbsoluteTotalTaxValue(Currency curr, java.lang.String currencyIso, int digits, boolean net, TaxValue taxValue, double cumulatedEntryQuantities)
-
calculate
@Deprecated public void calculate() throws JaloPriceFactoryExceptionDeprecated.since ages - Use CalculationService.calculate(de.hybris.platform.core.model.order.AbstractOrderModel) instead.Calculates the whole order and all its entries unless they're already calculated and the order has not been modified.So this method will fetch prices, taxes and discounts for uncalculated or modified entries only - all other will remain unchanged. If at least one entry has been calculated or the order itself has been modified the totals will be calculated as well.
if you merely like to adjust totals while keeping prices, taxes and discounts you should call
calculateTotals(boolean)instead (e.g. if just a quantity has changed or prices have been imported and cannot be found via price factory ).- Throws:
JaloPriceFactoryException- if a pricefactory error occured
-
notifyDiscountsAboutCalculation
protected void notifyDiscountsAboutCalculation()
-
notifyDiscountsAboutRemoval
protected void notifyDiscountsAboutRemoval()
-
resetAllValues
protected java.util.Map resetAllValues() throws JaloPriceFactoryExceptionfetches all prices, taxes, discount, payment and delivery costs and sets these fields. this method does not reset any entry values!- Returns:
- the tax value map obtainable via
calculateSubtotal(boolean)- use this for further tax calculation instead of callingcalculateSubtotal(boolean)multiple times - Throws:
JaloPriceFactoryException
-
resetAdditionalCosts
protected void resetAdditionalCosts(java.util.Collection<TaxValue> relativeTaxValues) throws JaloPriceFactoryException
- Throws:
JaloPriceFactoryException
-
calculate
@Deprecated public void calculate(java.util.Date date) throws JaloPriceFactoryExceptionDeprecated.since ages - Use CalculationService#calculate(de.hybris.platform.core.model.order.AbstractOrderModel, Date)Calculates the whole order and all its entries unless they're already calculated and the order has not been modified.So this method will fetch prices, taxes and discounts for uncalculated or modified entries only - all other will remain unchanged. If at least one entry has been calculated or the order itself has been modified the totals will be calculated as well.
if you merely like to adjust totals while keeping prices, taxes and discounts you should call
calculateTotals(boolean)instead (e.g. if just a quantity has changed or prices have been imported and cannot be found via price factory ).- Parameters:
date- assumes a given date to perform calculations for - be careful with that since this method will calculate modified or uncalculated entries only, so the given date may not apply to all entries!- Throws:
JaloPriceFactoryException- if a pricefactory error occured
-
recalculate
@Deprecated public void recalculate() throws JaloPriceFactoryExceptionDeprecated.since ages - Use CalculationService#recalculate(de.hybris.platform.core.model.order.AbstractOrderModel) instead.recalculates the whole order and all its entries. this includes finding prices, taxes, discounts, payment and delivery costs by calling the currently installed price factory.if you merely like to adjust totals while keeping prices, taxes and discounts you should call
calculateTotals(boolean)instead (e.g. if just a quantity has changed or prices have been imported and cannot be found via price factory ).- Throws:
JaloPriceFactoryException- if a pricefactory error occured
-
recalculate
@Deprecated public void recalculate(java.util.Date date) throws JaloPriceFactoryExceptionDeprecated.since ages - Use CalculationService#recalculate(de.hybris.platform.core.model.order.AbstractOrderModel, java.util.Date) instead.recalculates the whole order and all its entries. this includes finding prices, taxes, discounts, payment and delivery costs by calling the currently installed price factory.if you merely like to adjust totals while keeping prices, taxes and discounts you should call
calculateTotals(boolean)instead (e.g. if just a quantity has changed or prices have been imported and cannot be found via price factory ).- Parameters:
date- the date to calculate prices for- Throws:
JaloPriceFactoryException- if a pricefactory error occured
-
addDiscount
@Deprecated public void addDiscount(Discount discount)
Deprecated.since ages - useGeneratedAbstractOrder.addToDiscounts(Discount)Assigns a discount to this order. These discounts are involved in order (re)calculation by fetching avalueviaDiscount.getDiscountValue(AbstractOrder). Unlike all calculated values the discount collection is not cleared by (re)calculation !- Parameters:
discount- the discount to assign
-
removeDiscount
@Deprecated public void removeDiscount(Discount discount)
Deprecated.since ages - useGeneratedAbstractOrder.removeFromDiscounts(Discount)Unassigns a discount from this order. These discounts are involved in order (re)calculation by fetching avalueviaDiscount.getDiscountValue(AbstractOrder). Unlike all calculated values the discount collection is not cleared by (re)calculation !- Parameters:
discount- the discount to unassign
-
setChanged
protected void setChanged(boolean entriesToo)
-
remove
public void remove(SessionContext ctx) throws ConsistencyCheckException
Description copied from class:ItemRemoves this item.This method is using the following attributes of the given SessionContext:
CacheUsage Language StagingMethod n/a (this is a setter method) no, language doesn't matter for removal yes if called on a StageableItem, no otherwise
- Overrides:
removein classItem- Parameters:
ctx- A SessionContext object- Throws:
ConsistencyCheckException- if this item could not be removed for some reason
-
setEntries
public void setEntries(java.util.List<AbstractOrderEntry> value)
Description copied from class:GeneratedAbstractOrderGenerated method - Setter of theAbstractOrder.entriesattribute.- Overrides:
setEntriesin classGeneratedAbstractOrder- Parameters:
value- the entries
-
setEntries
public void setEntries(SessionContext ctx, java.util.List<AbstractOrderEntry> value)
Description copied from class:GeneratedAbstractOrderGenerated method - Setter of theAbstractOrder.entriesattribute.- Overrides:
setEntriesin classGeneratedAbstractOrdervalue- the entries
-
-