Class AbstractOrder
- All Implemented Interfaces:
Serializable,Comparable
- Direct Known Subclasses:
GeneratedCart,GeneratedOrder,GeneratedQuote
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 via calculate(),
calculate(Date), recalculate() or recalculate(Date). Once prices have been set you may
also use calculateTotals(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 as calculated. 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() and findPaymentCosts(). Further you
have to provide a own jalo type for order entries which
overrides AbstractOrderEntry.findPrice(),
AbstractOrderEntry.findTaxes() and
AbstractOrderEntry.findDiscounts().
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceDeprecated.static interfaceDeprecated.since ages - useExportStatusinsteadstatic interfaceDeprecated.since ages - useOrderStatusinsteadstatic interfaceDeprecated.since ages - usePaymentStatusinsteadNested classes/interfaces inherited from class de.hybris.platform.jalo.GenericItem
GenericItem.GenericItemImplNested classes/interfaces inherited from class de.hybris.platform.jalo.c2l.LocalizableItem
LocalizableItem.LocalizableItemImplNested classes/interfaces inherited from class de.hybris.platform.jalo.ExtensibleItem
ExtensibleItem.ExtensibleItemImplNested 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
FieldsModifier and TypeFieldDescriptionstatic final intstatic final Stringstatic final StringDeprecated.since ages - useGeneratedAbstractOrder.DELIVERYADDRESSinsteadstatic final StringDeprecated.since ages - useGeneratedAbstractOrder.DELIVERYCOSTinsteadstatic final StringDeprecated.since ages - useGeneratedAbstractOrder.DELIVERYMODEinsteadstatic final StringDeprecated.since ages - useGeneratedAbstractOrder.DELIVERYSTATUSinsteadstatic final StringDeprecated.since ages - useDeliveryStatus#_TYPECODEinsteadstatic final StringDeprecated.since ages - useGeneratedAbstractOrder.EXPORTSTATUSinsteadstatic final StringDeprecated.since ages - useExportStatus#_TYPECODEinsteadstatic final StringDeprecated.static final StringDeprecated.since ages - useDiscountModel#_ORDERDISCOUNTRELATIONinsteadstatic final StringDeprecated.since ages - useOrderStatus#_TYPECODEinsteadstatic final StringDeprecated.since ages - useGeneratedAbstractOrder.PAYMENTADDRESSinsteadstatic final StringDeprecated.since ages - useGeneratedAbstractOrder.PAYMENTCOSTinsteadstatic final StringDeprecated.since ages - useGeneratedAbstractOrder.PAYMENTINFOinsteadstatic final StringDeprecated.since ages - useGeneratedAbstractOrder.PAYMENTMODEinsteadstatic final StringDeprecated.since ages - useGeneratedAbstractOrder.PAYMENTSTATUSinsteadstatic final StringDeprecated.since ages - usePaymentStatus#_TYPECODEinsteadstatic final StringDeprecated.since ages - useGeneratedAbstractOrder.STATUSINFOinsteadstatic final StringDeprecated.since ages - useGeneratedAbstractOrder.TOTALPRICEinsteadstatic final StringDeprecated.since ages - useGeneratedAbstractOrder.TOTALDISCOUNTSinsteadstatic final StringDeprecated.since ages - useGeneratedAbstractOrder.TOTALTAXinsteadstatic final StringDeprecated.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, USERFields inherited from class de.hybris.platform.jalo.c2l.LocalizableItem
LANGUAGE_FALLBACK_ENABLEDFields 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, TYPEFields inherited from class de.hybris.platform.util.BridgeAbstraction
impl, tenant -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddAbsoluteEntryTaxValue(long entryQuantity, TaxValue taxValue, Map<TaxValue, Map<Set<TaxValue>, Double>> taxValueMap) voidaddAllGlobalDiscountValues(SessionContext ctx, Collection values) Deprecated.since ages - Use OrderService.addAllGlobalDiscountValues(de.hybris.platform.core.model.order.AbstractOrderModel, List) instead.voidaddAllGlobalDiscountValues(Collection values) Deprecated.since ages - Use OrderService.addAllGlobalDiscountValues(de.hybris.platform.core.model.order.AbstractOrderModel, List) instead.voidaddAllTotalTaxValues(SessionContext ctx, Collection values) Deprecated.since ages - Use OrderService.addAllTotalTaxValues(de.hybris.platform.core.model.order.AbstractOrderModel, List) instead.voidaddAllTotalTaxValues(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.addNewEntry(Product prod, long qtd, Unit unit) Deprecated.since 4.3, please use suitable OrderService.addNewEntry() methodaddNewEntry(Product prod, long qtd, Unit unit, boolean addToPresent) Deprecated.since 4.3, please use suitable OrderService.addNewEntry() methodaddNewEntry(Product prod, long qtd, Unit unit, int position, boolean addToPresent) Deprecated.since 4.3, please use suitable OrderService.addNewEntry() methodaddNewEntry(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, Set<TaxValue> relativeEntryTaxValues, Map<TaxValue, Map<Set<TaxValue>, 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.voidDeprecated.since ages - Use CalculationService.calculate(de.hybris.platform.core.model.order.AbstractOrderModel) instead.voidDeprecated.since ages - Use CalculationService#calculate(de.hybris.platform.core.model.order.AbstractOrderModel, Date)protected TaxValuecalculateAbsoluteTotalTaxValue(Currency curr, String currencyIso, int digits, boolean net, TaxValue taxValue, double cumulatedEntryQuantities) protected doublecalculateDiscountValues(boolean recalculate) Returns the total discount for this abstract order.protected voidcallsAbstractOrderEntry.calculate()on all entries of this order and sets this orders subtotal to the sum of the entry totals.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 voidcalculates all totals.protected doublecalculateTotalTaxValues(boolean recalculate, int digits, double taxAdjustmentFactor, Map<TaxValue, Map<Set<TaxValue>, Double>> taxValueMap) protected Listprotected 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.creates a new address which is set as this orders delivery address.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) creates a new address which is set as this orders payment address.creates a new address which is set as this orders payment address.booleanDeprecated.since ages - useGeneratedAbstractOrder.isDiscountsIncludePaymentCostAsPrimitive()insteadbooleanDeprecated.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 PriceValueCalled duringcalculate(),calculate(Date),recalculate()andrecalculate(Date)to fetch and set the delivery cost for this order.protected ListCalled duringcalculate(),calculate(Date),recalculate()andrecalculate(Date)to fetch and set global discount values for this order.protected PriceValuecalled duringcalculate(),calculate(Date),recalculate()andrecalculate(Date)to fetch and set the payment costs for this order.protected abstract StringDeprecated.since ages - usegetEntries(SessionContext)protected ObjectgetAttributeValue(Item item, String qualifer) protected ComposedTypewhen overriding abstract order type this defines the corresponding entry typegetDate(SessionContext ctx) The creation date of an order.doubleThe calculated delivery costs of this order.doubleDeprecated.since ages - useGeneratedAbstractOrder.getDeliveryCostAsPrimitive(SessionContext)insteadGenerated method - Getter of theAbstractOrder.entriesattribute.getEntries(int startIdx, int endIdx) getEntries(SessionContext ctx) Generated method - Getter of theAbstractOrder.entriesattribute.getEntriesByProduct(Product product) Returns all entries which belong to a specified product.getEntry(int index) Deprecated.since ages - Use OrderService.getEntryForNumber(de.hybris.platform.core.model.order.AbstractOrderModel, int) instead.Deprecated.since ages - Use model getter AbstractOrderModel.getGlobalDiscountValues() instead.Deprecated.since ages - Use model getter AbstractOrderModel.getGlobalDiscountValues() instead.protected intprotected intdoubleThe calculated costs according to the chosen payment mode.doubleDeprecated.since ages - useGeneratedAbstractOrder.getPaymentCost(SessionContext)insteaddoublegetTotal()Deprecated.since ages - useGeneratedAbstractOrder.getTotalPriceAsPrimitive()insteaddoublegetTotal(SessionContext ctx) Deprecated.since ages - useGeneratedAbstractOrder.getTotalPriceAsPrimitive(SessionContext)insteadreturns the sum of all discounts of this (calculated) order.The calculated total tax amount of this order.Deprecated.since ages - Use model getter AbstractOrderModel.getTotalTaxValues() instead.Deprecated.since ages - Use model getter AbstractOrderModel.getTotalTaxValues() instead.Shows if this order was calculated before.Shows if this order was calculated before.isNet()The gross / net status of this order.protected voidprotected voidvoidDeprecated.since ages - Use CalculationService#recalculate(de.hybris.platform.core.model.order.AbstractOrderModel) instead.voidrecalculate(Date date) Deprecated.since ages - Use CalculationService#recalculate(de.hybris.platform.core.model.order.AbstractOrderModel, java.util.Date) instead.protected voidcallsAbstractOrderEntry.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.voidDeprecated.since ages - UseModelService.remove() instead.voidDeprecated.since ages - Use model setter AbstractOrderModel.setGlobalDiscountValues(List) and ModelService.save() method instead.voidDeprecated.since ages - Use model setter AbstractOrderModel.setGlobalDiscountValues(List) and ModelService.save() method instead.voidDeprecated.since ages - Use model setter AbstractOrderModel.setTotalTaxValues(Collection) and ModelService.save() method instead.voidDeprecated.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, 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(Collection<TaxValue> relativeTaxValues) protected Mapfetches all prices, taxes, discount, payment and delivery costs and sets these fields.protected voidsetAllEntries(SessionContext ctx, List value) protected voidsetChanged(boolean entriesToo) voidsetCode(SessionContext ctx, String code) Sets the order code.voidSets the order code.setComposedType(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, Date date) Changes creation date of an order.voidChanges creation date of an order.voidsetDeliveryAddress(SessionContext ctx, Address address) Changes the delivery address.voidsetDeliveryAddress(Address address) Changes the delivery address.voidsetDeliveryCost(SessionContext ctx, 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, Boolean value) Generated method - Setter of theAbstractOrder.discountsIncludeDeliveryCostattribute.voidsetDiscountsIncludeDeliveryCosts(boolean includes) Deprecated.since ages - useGeneratedAbstractOrder.setDiscountsIncludeDeliveryCost(boolean)insteadvoidsetDiscountsIncludePaymentCost(SessionContext ctx, Boolean value) Generated method - Setter of theAbstractOrder.discountsIncludePaymentCostattribute.voidsetDiscountsIncludePaymentCosts(boolean includes) Deprecated.since ages - usesetDiscountsIncludePaymentCosts(boolean)insteadvoidsetEntries(SessionContext ctx, List<AbstractOrderEntry> value) Generated method - Setter of theAbstractOrder.entriesattribute.voidsetEntries(List<AbstractOrderEntry> value) Generated method - Setter of theAbstractOrder.entriesattribute.voidsetGlobalDiscountValues(SessionContext ctx, List globalDiscounts) Deprecated.since ages - Use model setter AbstractOrderModel.setGlobalDiscountValues(List) and ModelService.save() method instead.voidsetGlobalDiscountValues(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, 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, Collection totalTaxValues) Deprecated.since ages - Use model setter AbstractOrderModel.setTotalTaxValues(Collection) and ModelService.save() method instead.voidsetTotalTaxValues(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.voidChanges the user which this order belongs to.protected voidshuffleEntriesOnInsertNew(List<AbstractOrderEntry> all, int newEntryNumber) protected LanguageMethods 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, setTotalTaxValuesInternalMethods inherited from class de.hybris.platform.jalo.GenericItem
getImplementation, getInitialProperties, getNonInitialAttributes, getRelatedItems, getRelatedItems, setRelatedItemsMethods 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, setLocalizedPropertyMethods inherited from class de.hybris.platform.jalo.ExtensibleItem
createNonClassAccessor, getAllProperties, getAllProperties, getProperty, getProperty, getPropertyNames, getPropertyNames, removeProperty, removeProperty, setAllProperties, setAllProperties, setProperty, setPropertyMethods 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, getPartOfRemovedSessionMarker, 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, suppressRelation, toString, useTA, writeReplaceMethods inherited from class de.hybris.platform.util.BridgeAbstraction
setTenant
-
Field Details
-
CFG_TAX_FREE_ENTRIES_SUPPORT
- See Also:
-
APPEND_AS_LAST
public static final int APPEND_AS_LAST- See Also:
-
DELIVERY_ADDRESS
Deprecated.since ages - useGeneratedAbstractOrder.DELIVERYADDRESSinstead- See Also:
-
PAYMENT_ADDRESS
Deprecated.since ages - useGeneratedAbstractOrder.PAYMENTADDRESSinstead- See Also:
-
EXPORT_STATUS
Deprecated.since ages - useGeneratedAbstractOrder.EXPORTSTATUSinstead- See Also:
-
PAYMENT_MODE
Deprecated.since ages - useGeneratedAbstractOrder.PAYMENTMODEinstead- See Also:
-
DELIVERY_MODE
Deprecated.since ages - useGeneratedAbstractOrder.DELIVERYMODEinstead- See Also:
-
PAYMENT_INFO
Deprecated.since ages - useGeneratedAbstractOrder.PAYMENTINFOinstead- See Also:
-
PAYMENT_STATUS
Deprecated.since ages - useGeneratedAbstractOrder.PAYMENTSTATUSinstead- See Also:
-
DELIVERY_STATUS
Deprecated.since ages - useGeneratedAbstractOrder.DELIVERYSTATUSinstead- See Also:
-
GLOBAL_DISCOUNT_VALUES
Deprecated.- See Also:
-
TOTAL_TAX_VALUES
Deprecated.- See Also:
-
TOTAL_TAX
Deprecated.since ages - useGeneratedAbstractOrder.TOTALTAXinstead- See Also:
-
TOTAL
Deprecated.since ages - useGeneratedAbstractOrder.TOTALPRICEinstead- See Also:
-
DELIVERY_COST
Deprecated.since ages - useGeneratedAbstractOrder.DELIVERYCOSTinstead- See Also:
-
PAYMENT_COST
Deprecated.since ages - useGeneratedAbstractOrder.PAYMENTCOSTinstead- See Also:
-
STATUS_INFO
Deprecated.since ages - useGeneratedAbstractOrder.STATUSINFOinstead- See Also:
-
TOTAL_DISCOUNTS
Deprecated.since ages - useGeneratedAbstractOrder.TOTALDISCOUNTSinstead- See Also:
-
ORDER_DISCOUNT_RELATION_NAME
Deprecated.since ages - useDiscountModel#_ORDERDISCOUNTRELATIONinstead- See Also:
-
ORDER_STATUS_TYPE
Deprecated.since ages - useOrderStatus#_TYPECODEinstead- See Also:
-
PAYMENT_STATUS_TYPE
Deprecated.since ages - usePaymentStatus#_TYPECODEinstead- See Also:
-
DELIVERY_STATUS_TYPE
Deprecated.since ages - useDeliveryStatus#_TYPECODEinstead- See Also:
-
EXPORT_STATUS_TYPE
Deprecated.since ages - useExportStatus#_TYPECODEinstead- See Also:
-
-
Constructor Details
-
AbstractOrder
public AbstractOrder()
-
-
Method Details
-
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
-
getAllEntries
Deprecated.since ages - usegetEntries(SessionContext)All order positions. These are ordered product quantities, described by a number and a unit. -
getEntries
Description copied from class:GeneratedAbstractOrderGenerated method - Getter of theAbstractOrder.entriesattribute.- Overrides:
getEntriesin classGeneratedAbstractOrder- Returns:
- the entries
-
getEntries
Description copied from class:GeneratedAbstractOrderGenerated method - Getter of theAbstractOrder.entriesattribute.- Overrides:
getEntriesin classGeneratedAbstractOrder- Returns:
- the entries
-
setAllEntries
-
getEntry
@Deprecated(since="ages", forRemoval=false) 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
-
getEntriesByProduct
Returns all entries which belong to a specified product.- Parameters:
product-
-
createNewEntryNumber
protected int createNewEntryNumber(int requested) -
shuffleEntriesOnInsertNew
-
getNewEntryNumberForAppending
-
getNextEntryNumber
-
addNewEntry
@Deprecated(since="4.3", forRemoval=false) 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:
IllegalArgumentException- if eighter given Product or Unit was null
-
addNewEntry
@Deprecated(since="4.3", forRemoval=false) 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:
IllegalArgumentException- if eighter given Product or Unit was null
-
addNewEntry
@Deprecated(since="4.3", forRemoval=false) 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:
IllegalArgumentException- if eighter given Product or Unit was null
-
addNewEntry
@Deprecated(since="4.3", forRemoval=false) 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:
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
when overriding abstract order type this defines the corresponding entry type- Returns:
- null as default; subtypes may return their corresponding entry type
-
setComposedType
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(since="4.3", forRemoval=false) protected 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
- Throws:
JaloSecurityException
-
tryToFindFallbackLanguage
-
removeEntry
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(since="ages", forRemoval=false) protected void removeEntries(SessionContext ctx, Set<AbstractOrderEntry> entries) Deprecated.since ages - UseModelService.remove() instead. All the remove logic is handled by dedicatedRemoveInterceptors. -
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
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
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
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
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
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
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
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
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
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
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
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
Changes the payment order status.- Overrides:
setPaymentStatusin classGeneratedAbstractOrder- Parameters:
paymentStatus- the payment status of this order.
-
setPaymentStatus
Changes the order payment status.- Overrides:
setPaymentStatusin classGeneratedAbstractOrderpaymentStatus- the paymentStatus
-
setDeliveryStatus
Changes the order delivery status.- Overrides:
setDeliveryStatusin classGeneratedAbstractOrder- Parameters:
deliveryStatus- the delivery status of this order.
-
setDeliveryStatus
Changes the order delivery status.- Overrides:
setDeliveryStatusin classGeneratedAbstractOrderdeliveryStatus- the deliveryStatus
-
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
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
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
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
Changes the delivery address. This does not cause any other changes in the order.- Overrides:
setDeliveryAddressin classGeneratedAbstractOrder- Parameters:
address-
-
createNewDeliveryAddress
creates a new address which is set as this orders delivery address. -
createNewDeliveryAddress
creates a new address which is set as this orders delivery address. -
setDeliveryAddress
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
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.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(since="ages", forRemoval=false) 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
Description copied from class:GeneratedAbstractOrderGenerated method - Setter of theAbstractOrder.deliveryCostattribute.- Overrides:
setDeliveryCostin classGeneratedAbstractOrdervalue- the deliveryCost
-
setPaymentMode
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
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
Changes the payment address of this order. This does not cause any other changes in the order.- Overrides:
setPaymentAddressin classGeneratedAbstractOrder- Parameters:
adr-
-
createNewPaymentAddress
creates a new address which is set as this orders payment address. -
createNewPaymentAddress
creates a new address which is set as this orders payment address. -
setPaymentAddress
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
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.since ages - useGeneratedAbstractOrder.getPaymentCost(SessionContext)insteadThe calculated costs according to the chosen payment mode. -
setPaymentCosts
@Deprecated(since="ages", forRemoval=false) 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
Description copied from class:GeneratedAbstractOrderGenerated method - Setter of theAbstractOrder.paymentCostattribute.- Overrides:
setPaymentCostin classGeneratedAbstractOrdervalue- the paymentCost
-
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.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.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.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.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.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.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.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.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.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(since="ages", forRemoval=false) 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(since="ages", forRemoval=false) public void addAllTotalTaxValues(SessionContext ctx, 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(since="ages", forRemoval=false) 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.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(since="ages", forRemoval=false) public void setTotalTaxValues(Collection totalTaxValues) Deprecated.since ages - Use model setter AbstractOrderModel.setTotalTaxValues(Collection) and ModelService.save() method instead. -
setTotalTaxValues
@Deprecated(since="ages", forRemoval=false) public void setTotalTaxValues(SessionContext ctx, Collection totalTaxValues) Deprecated.since ages - Use model setter AbstractOrderModel.setTotalTaxValues(Collection) and ModelService.save() method instead. -
addGlobalDiscountValue
@Deprecated(since="ages", forRemoval=false) 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(since="ages", forRemoval=false) public void addAllGlobalDiscountValues(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(since="ages", forRemoval=false) 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.since ages - Use model setter AbstractOrderModel.setGlobalDiscountValues(List) and ModelService.save() method instead.Removes all global discount values of this order. -
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.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(since="ages", forRemoval=false) 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(since="ages", forRemoval=false) public void addAllGlobalDiscountValues(SessionContext ctx, 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(since="ages", forRemoval=false) 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(since="ages", forRemoval=false) 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(since="ages", forRemoval=false) public void setGlobalDiscountValues(List globalDiscounts) Deprecated.since ages - Use model setter AbstractOrderModel.setGlobalDiscountValues(List) and ModelService.save() method instead. -
setGlobalDiscountValues
@Deprecated(since="ages", forRemoval=false) public void setGlobalDiscountValues(SessionContext ctx, List globalDiscounts) Deprecated.since ages - Use model setter AbstractOrderModel.setGlobalDiscountValues(List) and ModelService.save() method instead. -
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:
-
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:
-
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(since="ages", forRemoval=false) 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
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.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(since="ages", forRemoval=false) 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
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
callsAbstractOrderEntry.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
callsAbstractOrderEntry.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
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
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
Called 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(since="ages", forRemoval=false) public void calculateTotals(boolean recalculate) throws JaloPriceFactoryException Deprecated.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, Map<TaxValue, Map<Set<TaxValue>, throws JaloPriceFactoryExceptionDouble>> taxValueMap) calculates 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
returns the sum of all discounts of this (calculated) order.- Overrides:
getTotalDiscountsin classGeneratedAbstractOrder- Returns:
- the totalDiscounts
-
calculateSubtotal
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
-
addAbsoluteEntryTaxValue
-
calculateDiscountValues
protected double calculateDiscountValues(boolean recalculate) Returns the total discount for this abstract order.- Parameters:
recalculate-trueforces a recalculation- Returns:
- totalDiscounts
-
convertDiscountValues
-
calculateTotalTaxValues
protected double calculateTotalTaxValues(boolean recalculate, int digits, double taxAdjustmentFactor, Map<TaxValue, Map<Set<TaxValue>, Double>> taxValueMap) - Parameters:
recalculate-digits-taxAdjustmentFactor-taxValueMap-- Returns:
- total taxes
-
calculateAbsoluteTotalTaxValue
-
calculate
@Deprecated(since="ages", forRemoval=false) 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
fetches 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(Collection<TaxValue> relativeTaxValues) throws JaloPriceFactoryException - Throws:
JaloPriceFactoryException
-
calculate
@Deprecated(since="ages", forRemoval=false) public void calculate(Date date) throws JaloPriceFactoryException Deprecated.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(since="ages", forRemoval=false) 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(since="ages", forRemoval=false) public void recalculate(Date date) throws JaloPriceFactoryException Deprecated.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.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.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
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
Description copied from class:GeneratedAbstractOrderGenerated method - Setter of theAbstractOrder.entriesattribute.- Overrides:
setEntriesin classGeneratedAbstractOrder- Parameters:
value- the entries
-
setEntries
Description copied from class:GeneratedAbstractOrderGenerated method - Setter of theAbstractOrder.entriesattribute.- Overrides:
setEntriesin classGeneratedAbstractOrdervalue- the entries
-
DeliveryStatusinstead