Class AbstractOrderEntry
- All Implemented Interfaces:
Serializable,Comparable
- Direct Known Subclasses:
GeneratedCartEntry,GeneratedOrderEntry,GeneratedQuoteEntry
This is a general superclass for all order entries, which describes an ordered (or sold) product amount.
Besides essential information like the product, the amount and unit these object also may contain pricing
information. So base and total price are stored here as well as applied taxes ( as TaxValue
objects ) and discounts (as DiscountValue objects).
Like AbstractOrder an entry does not have this information from the beginning but must be calculated. Since
each entry belongs to an order its calculation status is set by its order if necessary.
As price calculation is done by the installed price factory you should refer to its specific documentation how
calculation for entries is done and if some behaviour differ from the descriptions stated here. Generally entry
calculation is covered by these PriceFactory methods:
PriceFactory.getBasePrice(AbstractOrderEntry),
PriceFactory.getDiscountValues(AbstractOrderEntry) and
PriceFactory.getTaxValues(AbstractOrderEntry).
- See Also:
-
Nested Class Summary
Nested 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 StringQualifier of theAbstractOrderEntry.discountValuesattributestatic final StringDeprecated.static final StringQualifier of theAbstractOrderEntry.taxValuesattributeFields inherited from class de.hybris.platform.jalo.order.GeneratedAbstractOrderEntry
BASEPRICE, CALCULATED, DEFAULT_INITIAL_ATTRIBUTES, DISCOUNTVALUESINTERNAL, ENTRYGROUPNUMBERS, ENTRYNUMBER, GIVEAWAY, INFO, ORDER, ORDERHANDLER, PRODUCT, QUANTITY, REJECTED, TAXVALUESINTERNAL, TOTALPRICE, UNITFields 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 TypeMethodDescriptionvoidaddAllDiscountValues(SessionContext ctx, List values) Deprecated.since ages - Use OrderEntryService.addAllDiscountValues(de.hybris.platform.core.model.order.AbstractOrderEntryModel, List) instead.voidaddAllDiscountValues(List values) Deprecated.since ages - Use OrderEntryService.addAllDiscountValues(de.hybris.platform.core.model.order.AbstractOrderEntryModel, List) instead.voidaddAllDisocuntValues(List values) Deprecated.since ages - UseaddAllDiscountValues(List)insteadvoidaddAllTaxValues(SessionContext ctx, Collection values) Deprecated.since ages - Use OrderEntryService.addAllTaxValues(de.hybris.platform.core.model.order.AbstractOrderEntryModel, List) instead.voidaddAllTaxValues(Collection values) Deprecated.since ages - Use OrderEntryService.addAllTaxValues(de.hybris.platform.core.model.order.AbstractOrderEntryModel, List) instead.voidaddDiscountValue(SessionContext ctx, DiscountValue discountValue) Deprecated.since ages - Use OrderEntryService.addDiscountValue(de.hybris.platform.core.model.order.AbstractOrderEntryModel, DiscountValue) instead.voidaddDiscountValue(DiscountValue discountValue) Deprecated.since ages - Use OrderEntryService.addDiscountValue(de.hybris.platform.core.model.order.AbstractOrderEntryModel, DiscountValue) instead.voidaddTaxValue(SessionContext ctx, TaxValue taxValue) Deprecated.since ages - Use OrderEntryService.addTaxValue(de.hybris.platform.core.model.order.AbstractOrderEntryModel, TaxValue) instead.voidaddTaxValue(TaxValue taxValue) Deprecated.since ages - Use OrderEntryService.addTaxValue(de.hybris.platform.core.model.order.AbstractOrderEntryModel, TaxValue) instead.protected doubleapplyDiscounts(double totalWithoutDiscounts) Applies the discount values of this order entry to the given total value.voidDeprecated.since ages - Use CalculationService.calculate(de.hybris.platform.core.model.order.AbstractOrderEntryModel) intsead.voidcalculateTotals(boolean recalculate) Deprecated.since ages - Use CalculationService.calculateTotals(de.hybris.platform.core.model.order.AbstractOrderEntryModel, boolean) insteadintAbstractOrderEntries are compared by entry number.protected ItemcreateItem(SessionContext ctx, ComposedType type, Item.ItemAttributeMap allAttributes) Has to be implemented for each concrete subtype of item.protected ListFfinds tax values for this entry.protected PriceValueFinds a price for this entry.protected CollectionFinds tax values for this entry.Deprecated.since ages - Use AbstractOrderEntryModel.getDiscountValues() instead.Deprecated.since ages - Use AbstractOrderEntryModel.getDiscountValues() instead.getOrder(SessionContext ctx) This entrys order.Deprecated.since ages - Use AbstractOrderEntryModel.getTaxValues() instead.Deprecated.since ages - Use AbstractOrderEntryModel.getTaxValues() instead.Shows if this entry was calculated before.isGiveAway(SessionContext ctx) Shows if this entry will be treated as a give away (that is, for free).isRejected(SessionContext ctx) Shows if the GIVEAWAY flag of this entry will be ignored.voidDeprecated.since ages - Use CalculationService.recalculate(de.hybris.platform.core.model.order.AbstractOrderEntryModel) instead.voidremove(SessionContext ctx) This method delegates toAbstractOrder.removeEntry(AbstractOrderEntry)instead of removing the item directly.voidDeprecated.since ages - Use AbstractOrderEntryModel.setDiscountValues(List) and ModelService.save() method instead.voidDeprecated.since ages - Use AbstractOrderEntryModel.setDiscountValues(List) and ModelService.save() method instead.voidDeprecated.since ages - Use AbstractOrderEntryModel.setTaxValues(Collection) and ModelService.save() instead.voidDeprecated.since ages - Use AbstractOrderEntryModel.setTaxValues(Collection) and ModelService.save() instead.voidremoveDiscountValue(SessionContext ctx, DiscountValue discountValue) Deprecated.since ages - Use OrderEntryService.removeDiscountValue(de.hybris.platform.core.model.order.AbstractOrderEntryModel, DiscountValue) instead.voidremoveDiscountValue(DiscountValue discountValue) Deprecated.since ages - Use OrderEntryService.removeDiscountValue(de.hybris.platform.core.model.order.AbstractOrderEntryModel, DiscountValue) instead.voidremoveTaxValue(SessionContext ctx, TaxValue taxValue) Deprecated.since ages - Use OrderEntryService.removeTaxValue(de.hybris.platform.core.model.order.AbstractOrderEntryModel, TaxValue) instead.voidremoveTaxValue(TaxValue taxValue) Deprecated.since ages - Use OrderEntryService.removeTaxValue(de.hybris.platform.core.model.order.AbstractOrderEntryModel, TaxValue) instead.protected voidRemoves the entry directly without notifying the enclosingAbstractOrder.protected voidThis tries to get base price, taxes and discounts and sets these values including converting the base price if necessary.voidsetBasePrice(SessionContext ctx, Double price) Sets the calculated base price for this entry.protected voidvoidsetDiscountValues(SessionContext ctx, List discountValues) Deprecated.since ages - Use AbstractOrderEntryModel.setDiscountValues(List) and ModelService.save() method instead.voidsetDiscountValues(List discountValues) voidsetEntryNumber(SessionContext ctx, Integer number) Sets the entry number.protected voidsetEntryNumberDirect(int number) Changes entry number directly.voidsetGiveAway(SessionContext ctx, Boolean giveaway) Generated method - Setter of theAbstractOrderEntry.giveAwayattribute.voidsetOrder(SessionContext ctx, AbstractOrder value) Generated method - Setter of theAbstractOrderEntry.orderattribute.voidsetProduct(SessionContext ctx, Product product) Changes the ordered product.voidsetQuantity(SessionContext ctx, Long qtd) Changes the number of ordered products.voidsetRejected(SessionContext ctx, Boolean rejected) Generated method - Setter of theAbstractOrderEntry.rejectedattribute.voidsetTaxValues(SessionContext ctx, Collection collection) Deprecated.since ages - Use AbstractOrderEntryModel.setTaxValues(Collection) instead.voidsetTaxValues(Collection collection) Deprecated.since ages - Use AbstractOrderEntryModel.setTaxValues(Collection) instead.voidsetUnit(SessionContext ctx, Unit unit) Changes the unit of the ordered amount. Please note that this resets the entry in the 'uncalculated' status since prices might also depend on units.toString()Returns theStringrepresentation of this item.Methods inherited from class de.hybris.platform.jalo.order.GeneratedAbstractOrderEntry
getBasePrice, getBasePrice, getBasePriceAsPrimitive, getBasePriceAsPrimitive, getDefaultAttributeModes, getDiscountValuesInternal, getDiscountValuesInternal, getEntryGroupNumbers, getEntryGroupNumbers, getEntryNumber, getEntryNumber, getEntryNumberAsPrimitive, getEntryNumberAsPrimitive, getInfo, getInfo, getOrder, getProduct, getProduct, getQuantity, getQuantity, getQuantityAsPrimitive, getQuantityAsPrimitive, getTaxValuesInternal, getTaxValuesInternal, getTotalPrice, getTotalPrice, getTotalPriceAsPrimitive, getTotalPriceAsPrimitive, getUnit, getUnit, isCalculated, isCalculatedAsPrimitive, isCalculatedAsPrimitive, isGiveAway, isGiveAwayAsPrimitive, isGiveAwayAsPrimitive, isRejected, isRejectedAsPrimitive, isRejectedAsPrimitive, setBasePrice, setBasePrice, setBasePrice, setCalculated, setCalculated, setCalculated, setCalculated, setDiscountValuesInternal, setDiscountValuesInternal, setEntryGroupNumbers, setEntryGroupNumbers, setEntryNumber, setEntryNumber, setEntryNumber, setGiveAway, setGiveAway, setGiveAway, setInfo, setInfo, setOrder, setProduct, setQuantity, setQuantity, setQuantity, setRejected, setRejected, setRejected, setTaxValuesInternal, setTaxValuesInternal, setTotalPrice, setTotalPrice, setTotalPrice, setTotalPrice, setUnitMethods 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, 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, isMarkModifiedDisabled, 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, setComposedType, setCreationTime, setImplementation, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setModificationTime, setNonInitialAttributes, setOwner, setPermissionsByMap, setTransientObject, setUseTA, suppressRelation, useTA, writeReplaceMethods inherited from class de.hybris.platform.util.BridgeAbstraction
setTenant
-
Field Details
-
DISCOUNTVALUES
Qualifier of theAbstractOrderEntry.discountValuesattribute- See Also:
-
TAXVALUES
Qualifier of theAbstractOrderEntry.taxValuesattribute- See Also:
-
ENTRY_NUMBER
Deprecated.since ages - useGeneratedAbstractOrderEntry.ENTRYNUMBERinsteadThe running order of the CartEntry on the Cart it is assigned to. Defaults to new Integer( de.hybris.platform.jalo.order.AbstractOrder.APPEND_AS_LAST )- See Also:
-
-
Constructor Details
-
AbstractOrderEntry
public AbstractOrderEntry()
-
-
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 classGeneratedAbstractOrderEntry- 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
-
remove
This method delegates toAbstractOrder.removeEntry(AbstractOrderEntry)instead of removing the item directly.- Overrides:
removein classItem- Parameters:
ctx- A SessionContext object- Throws:
ConsistencyCheckException- if this item could not be removed for some reason
-
removeWithoutOrderNotification
Removes the entry directly without notifying the enclosingAbstractOrder. Use with care since the enclosing order is not marked as changed so that incorrect prices may be shown!- Parameters:
ctx-- Throws:
ConsistencyCheckException
-
getOrder
This entrys order.- Overrides:
getOrderin classGeneratedAbstractOrderEntry- Parameters:
ctx- can be used for cached access object may be outdated!- Returns:
- the
AbstractOrderthis abstract order entry is associated to
-
setOrder
Description copied from class:GeneratedAbstractOrderEntryGenerated method - Setter of theAbstractOrderEntry.orderattribute.- Overrides:
setOrderin classGeneratedAbstractOrderEntryvalue- the order
-
setProduct
Changes the ordered product. Please note that this resets the entry in the 'uncalculated' status since price information cannot be valid any more.- Overrides:
setProductin classGeneratedAbstractOrderEntry- Parameters:
ctx- can be used for cached access object may be outdated!product-
-
setQuantity
Changes the number of ordered products. Please note that this resets the entry in the 'uncalculated' status since price information cannot be valid any more.- Overrides:
setQuantityin classGeneratedAbstractOrderEntry- Parameters:
ctx- can be used for cached access value may be outdated!qtd-
-
setUnit
Changes the unit of the ordered amount. Please note that this resets the entry in the 'uncalculated' status since prices might also depend on units.- Overrides:
setUnitin classGeneratedAbstractOrderEntry- Parameters:
ctx- can be used for cached access object may be outdated!unit-
-
setBasePrice
Sets the calculated base price for this entry.- Overrides:
setBasePricein classGeneratedAbstractOrderEntry- Parameters:
ctx- the session contextprice- the new base price
-
getTaxValues
Deprecated.since ages - Use AbstractOrderEntryModel.getTaxValues() instead.The collection of this entry's taxes. These are relativeTaxValueswhich means they dont include real prices but only the tax rate. Please note that duringorder calculationthese tax values are calculated by the currentprice factory.- Returns:
- a collection containing all
TaxValueobjects which are applied on this entry - Throws:
JaloNotYetCalculatedException- if this order entry was not yetcalculated.
-
getTaxValues
Deprecated.since ages - Use AbstractOrderEntryModel.getTaxValues() instead.The collection of this entry's taxes. These are relativeTaxValueswhich means they dont include real prices but only the tax rate. Please note that duringorder calculationthese tax values are calculated by the currentprice factory.- Parameters:
ctx- can be used for cached access values may be outdated!- Returns:
- a collection containing all
TaxValueobjects which are applied on this entry - Throws:
JaloNotYetCalculatedException- if this order entry was not yetcalculated.
-
setTaxValues
Deprecated.since ages - Use AbstractOrderEntryModel.setTaxValues(Collection) instead.discards all present tax values and adds the given values.- Parameters:
collection- the new tax values
-
setTaxValues
@Deprecated(since="ages", forRemoval=false) public void setTaxValues(SessionContext ctx, Collection collection) Deprecated.since ages - Use AbstractOrderEntryModel.setTaxValues(Collection) instead.discards all present tax values and adds the given values.- Parameters:
collection- the new tax values
-
addTaxValue
Deprecated.since ages - Use OrderEntryService.addTaxValue(de.hybris.platform.core.model.order.AbstractOrderEntryModel, TaxValue) instead.Adds a new tax into this entry- Parameters:
taxValue-
-
addTaxValue
@Deprecated(since="ages", forRemoval=false) public void addTaxValue(SessionContext ctx, TaxValue taxValue) Deprecated.since ages - Use OrderEntryService.addTaxValue(de.hybris.platform.core.model.order.AbstractOrderEntryModel, TaxValue) instead.Adds a new tax into this entry- Parameters:
ctx-taxValue-
-
addAllTaxValues
Deprecated.since ages - Use OrderEntryService.addAllTaxValues(de.hybris.platform.core.model.order.AbstractOrderEntryModel, List) instead.Adds a collection of taxes into this entry- Parameters:
values-
-
addAllTaxValues
@Deprecated(since="ages", forRemoval=false) public void addAllTaxValues(SessionContext ctx, Collection values) Deprecated.since ages - Use OrderEntryService.addAllTaxValues(de.hybris.platform.core.model.order.AbstractOrderEntryModel, List) instead.Adds a collection of taxes into this entry- Parameters:
ctx-values-
-
removeTaxValue
Deprecated.since ages - Use OrderEntryService.removeTaxValue(de.hybris.platform.core.model.order.AbstractOrderEntryModel, TaxValue) instead.Removes a new tax out of this entry- Parameters:
taxValue-
-
removeTaxValue
@Deprecated(since="ages", forRemoval=false) public void removeTaxValue(SessionContext ctx, TaxValue taxValue) Deprecated.since ages - Use OrderEntryService.removeTaxValue(de.hybris.platform.core.model.order.AbstractOrderEntryModel, TaxValue) instead.Removes a new tax out of this entry- Parameters:
ctx-taxValue-
-
removeAllTaxValues
Deprecated.since ages - Use AbstractOrderEntryModel.setTaxValues(Collection) and ModelService.save() instead. In order to remove all taxes, use null in the setter.Removes all taxes of this entry -
removeAllTaxValues
Deprecated.since ages - Use AbstractOrderEntryModel.setTaxValues(Collection) and ModelService.save() instead. In order to remove all taxes, use null in the setter.Removes all taxes of this entry- Parameters:
ctx- the session context
-
getDiscountValues
Deprecated.since ages - Use AbstractOrderEntryModel.getDiscountValues() instead.The list of this entry's discount values. In contrary to taxes these values contain "real" prices since all discounts directly apply to this entry ( otherwise they're global discounts and are not applied here). Since this may include absolute discounts the ordering of values is important for correct presentation of this entry, so we chose a List as collection format. Please note that duringorder calculationthese discount values are calculated by the currentprice factory.- Returns:
- a list of all
DiscountValueobjects which are applied on this entry - Throws:
JaloNotYetCalculatedException- if this order entry was not yetcalculated.
-
getDiscountValues
Deprecated.since ages - Use AbstractOrderEntryModel.getDiscountValues() instead.The list of this entry's discount values. In contrary to taxes these values contain "real" prices since all discounts directly apply to this entry ( otherwise they're global discounts and are not applied here). Since this may include absolute discounts the ordering of values is important for correct presentation of this entry, so we chose a List as collection format. Please note that duringorder calculationthese discount values are calculated by the currentprice factory.- Parameters:
ctx- can be used for cached access values may be outdated!- Returns:
- a list of all
DiscountValueobjects which are applied on this entry - Throws:
JaloNotYetCalculatedException- if this order entry was not yetcalculated.
-
setDiscountValues
@Deprecated(since="ages", forRemoval=false) public void setDiscountValues(SessionContext ctx, List discountValues) Deprecated.since ages - Use AbstractOrderEntryModel.setDiscountValues(List) and ModelService.save() method instead.discards all present discount values and adds the given values.- Parameters:
discountValues- the new values
-
setDiscountValues
-
addDiscountValue
@Deprecated(since="ages", forRemoval=false) public void addDiscountValue(DiscountValue discountValue) Deprecated.since ages - Use OrderEntryService.addDiscountValue(de.hybris.platform.core.model.order.AbstractOrderEntryModel, DiscountValue) instead.Adds a new discount into this entry- Parameters:
discountValue-
-
addDiscountValue
@Deprecated(since="ages", forRemoval=false) public void addDiscountValue(SessionContext ctx, DiscountValue discountValue) Deprecated.since ages - Use OrderEntryService.addDiscountValue(de.hybris.platform.core.model.order.AbstractOrderEntryModel, DiscountValue) instead.Adds a new discount into this entry- Parameters:
ctx-discountValue-
-
addAllDisocuntValues
Deprecated.since ages - UseaddAllDiscountValues(List)insteadAdds a collection of discounts into this entry- Parameters:
values-
-
addAllDiscountValues
Deprecated.since ages - Use OrderEntryService.addAllDiscountValues(de.hybris.platform.core.model.order.AbstractOrderEntryModel, List) instead.Adds a collection of discounts into this entry- Parameters:
values-
-
addAllDiscountValues
@Deprecated(since="ages", forRemoval=false) public void addAllDiscountValues(SessionContext ctx, List values) Deprecated.since ages - Use OrderEntryService.addAllDiscountValues(de.hybris.platform.core.model.order.AbstractOrderEntryModel, List) instead.Adds a collection of discounts into this entry- Parameters:
ctx-values-
-
removeDiscountValue
@Deprecated(since="ages", forRemoval=false) public void removeDiscountValue(DiscountValue discountValue) Deprecated.since ages - Use OrderEntryService.removeDiscountValue(de.hybris.platform.core.model.order.AbstractOrderEntryModel, DiscountValue) instead.Removes a new discount out of this entry- Parameters:
discountValue-
-
removeDiscountValue
@Deprecated(since="ages", forRemoval=false) public void removeDiscountValue(SessionContext ctx, DiscountValue discountValue) Deprecated.since ages - Use OrderEntryService.removeDiscountValue(de.hybris.platform.core.model.order.AbstractOrderEntryModel, DiscountValue) instead.Removes a new discount out of this entry- Parameters:
ctx-discountValue-
-
removeAllDiscountValues
Deprecated.since ages - Use AbstractOrderEntryModel.setDiscountValues(List) and ModelService.save() method instead. In order to remove all discounts, simply use null as setter argument.Removes all discounts of this entry -
removeAllDiscountValues
Deprecated.since ages - Use AbstractOrderEntryModel.setDiscountValues(List) and ModelService.save() method instead. In order to remove all discounts, simply use null as setter argument.Removes all discounts of this entry- Parameters:
ctx- the session context
-
isCalculated
Shows if this entry was calculated before. Please note that all calculated fields are only valid if this method returnstrue.- Overrides:
isCalculatedin classGeneratedAbstractOrderEntry- Parameters:
ctx- can be used for cached access value may be outdated!- Returns:
trueif this entry is calculated
-
isGiveAway
Shows if this entry will be treated as a give away (that is, for free).- Overrides:
isGiveAwayin classGeneratedAbstractOrderEntry- Parameters:
ctx- can be used for cached access value may be outdated!- Returns:
trueif this entry is calculated
-
setGiveAway
Description copied from class:GeneratedAbstractOrderEntryGenerated method - Setter of theAbstractOrderEntry.giveAwayattribute.- Overrides:
setGiveAwayin classGeneratedAbstractOrderEntry- Parameters:
ctx- the session contextgiveaway- the giveaway flag
-
isRejected
Shows if the GIVEAWAY flag of this entry will be ignored.- Overrides:
isRejectedin classGeneratedAbstractOrderEntry- Parameters:
ctx- can be used for cached access value may be outdated!- Returns:
truethe rejected flag
-
setRejected
Description copied from class:GeneratedAbstractOrderEntryGenerated method - Setter of theAbstractOrderEntry.rejectedattribute.- Overrides:
setRejectedin classGeneratedAbstractOrderEntry- Parameters:
ctx- the session contextrejected- the rejected flag
-
calculate
@Deprecated(since="ages", forRemoval=false) public void calculate() throws JaloPriceFactoryExceptionDeprecated.since ages - Use CalculationService.calculate(de.hybris.platform.core.model.order.AbstractOrderEntryModel) intsead.Calculates this entry if the entry is not calculated yet. This includes finding the correct base price, taxes and discount using the currently installed price factory.If prices should be left as currently set but the entry totals have to be consolidated (e.g. when the quantity has changed) call
calculateTotals(boolean)instead !- Throws:
JaloPriceFactoryException- if no price could be found or other price factory errors occurred.
-
recalculate
@Deprecated(since="ages", forRemoval=false) public void recalculate() throws JaloPriceFactoryExceptionDeprecated.since ages - Use CalculationService.recalculate(de.hybris.platform.core.model.order.AbstractOrderEntryModel) instead.Calculates this entry even if the entry was calculated before. This includes finding the correct base price, taxes and discount using the currently installed price factory.If prices should be left as currently set but the entry totals have to be consolidated (e.g. when the quantity has changed) call
calculateTotals(boolean)instead !- Throws:
JaloPriceFactoryException- if no price could be found or other price factory errors occurred.
-
setEntryNumber
Sets the entry number. This number affects the position of this entry within the collection obtainable viaAbstractOrder.getAllEntries()which is ordered by entry numbers.- Overrides:
setEntryNumberin classGeneratedAbstractOrderEntry- Parameters:
number- the new entry number
-
setEntryNumberDirect
protected void setEntryNumberDirect(int number) Changes entry number directly.- Parameters:
number- the new entry number
-
resetAllValues
This tries to get base price, taxes and discounts and sets these values including converting the base price if necessary. Please note that this doesnt change this entry's total. You have to callcalculateTotals(boolean)to do so.- Throws:
JaloPriceFactoryException
-
findPrice
Finds a price for this entry. as default this just callsAbstractPriceFactory.getBasePrice(AbstractOrderEntry)but you may override this four your own (non-pricefactory) logic.The returned price value does not need to have the net/gross state of this order nor does it have to have the same currency as this entry's order.
- Returns:
- a price value - null is not allowed
- Throws:
JaloPriceFactoryException- on pricefactory errors
-
findTaxes
Finds tax values for this entry. as default this just callsAbstractPriceFactory.getTaxValues(AbstractOrderEntry)but you may override this four your own (non-pricefactory) logic.The returned tax values are converted into applied tax values after the price was found.
- Returns:
- a collection of
TaxValue - Throws:
JaloPriceFactoryException- on pricefactory errors
-
findDiscounts
Ffinds tax values for this entry. as default this just callsAbstractPriceFactory.getDiscountValues(AbstractOrderEntry)but you may override this four your own (non-pricefactory) logic.The returned discount values are converted into applied tax values after the price was found.
- Returns:
- a collection of
DiscountValue - Throws:
JaloPriceFactoryException- on pricefactory errors
-
calculateTotals
Deprecated.since ages - Use CalculationService.calculateTotals(de.hybris.platform.core.model.order.AbstractOrderEntryModel, boolean) insteadRecalculates this entries total prices and re-applies tax and discount values. This does not include finding price, taxes or discount but uses all currently set values.- Parameters:
recalculate- forces the recalculation of the abstract order entry.
-
applyDiscounts
protected double applyDiscounts(double totalWithoutDiscounts) Applies the discount values of this order entry to the given total value. The calculation algorithm is:value = given total value for each DiscountValue dv { if dv is absolute subtract from value the value of dv else subtract from value ( the value of dv * value / 100 ) } round value to order currency- Parameters:
totalWithoutDiscounts-- Returns:
- the total minus all discounts
-
toString
Description copied from class:ItemReturns theStringrepresentation of this item. This is by default the representation of the primary key of this item. -
compareTo
AbstractOrderEntries are compared by entry number.- Specified by:
compareToin interfaceComparable- Overrides:
compareToin classItem- Parameters:
order- the abstract order entry, which should be compared with this abstract order entry- Returns:
- an int value calculated by subtracting the entry number of the argument abstract order entry from the entry number of this abstract order entry.
-
setChanged
protected void setChanged()
-
GeneratedAbstractOrderEntry.ENTRYNUMBERinstead