Class AbstractOrder
- java.lang.Object
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable
- Direct Known Subclasses:
GeneratedCart
,GeneratedOrder
,GeneratedQuote
public abstract class AbstractOrder extends GeneratedAbstractOrder
This is the general superclass of all order objects. An abstract order keeps all information which is necessary to describe a user - vendor - contract.Mainly an order consists of several entries which represents ordered products of a certain quantity and unit. Further it holds delivery, payment, discount and tax information.
An order does not provide pricing information unless it was calculated explicitly viacalculate()
,calculate(Date)
,recalculate()
orrecalculate(Date)
. Once prices have been set you may also usecalculateTotals(boolean)
which does not fetch new prices, taxes or discounts but consolidates all totals according to price relevant changes of this order ( e.g. entry quantities, base prices etc. ). After calculation the order is marked ascalculated
. Please note that all values are fixed and do not change automatically upon changes in the price model ( via PriceFactory ). You have to recalculate the order to see these changes.
Since prices, taxes and discounts are retrieved from the installed pricefactory refer to its documentation how to manage prices, taxes and discounts.
Similar refer to the installed payment and delivery mode extension documentation for how to manager payment and delivery prices. the order calculation process fetches payment and delivery prices from them.If you like to bypass the pricefactory and implement you own logic within a special jalo order type you have to override
findDeliveryCosts()
,findGlobalDiscounts()
andfindPaymentCosts()
. Further you have to provide a own jalo type fororder entries
which overridesAbstractOrderEntry.findPrice()
,AbstractOrderEntry.findTaxes()
andAbstractOrderEntry.findDiscounts()
.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
AbstractOrder.DELIVERY_STATUS
Deprecated.since ages - useDeliveryStatus
insteadstatic interface
AbstractOrder.EXPORT_STATUS
Deprecated.since ages - useExportStatus
insteadstatic interface
AbstractOrder.ORDER_STATUS
Deprecated.since ages - useOrderStatus
insteadstatic interface
AbstractOrder.PAYMENT_STATUS
Deprecated.since ages - usePaymentStatus
instead-
Nested classes/interfaces inherited from class de.hybris.platform.jalo.GenericItem
GenericItem.GenericItemImpl
-
Nested classes/interfaces inherited from class de.hybris.platform.jalo.c2l.LocalizableItem
LocalizableItem.LocalizableItemImpl
-
Nested classes/interfaces inherited from class de.hybris.platform.jalo.ExtensibleItem
ExtensibleItem.ExtensibleItemImpl
-
Nested classes/interfaces inherited from class de.hybris.platform.jalo.Item
Item.AttributeFilter, Item.AttributeMode, Item.CachedGetter, Item.CachedSetter, Item.ItemAttributeMap, Item.ItemConstraint, Item.ItemImpl, Item.JaloCachedComputationException
-
-
Field Summary
Fields Modifier and Type Field Description static int
APPEND_AS_LAST
static java.lang.String
CFG_TAX_FREE_ENTRIES_SUPPORT
static java.lang.String
DELIVERY_ADDRESS
Deprecated.since ages - useGeneratedAbstractOrder.DELIVERYADDRESS
insteadstatic java.lang.String
DELIVERY_COST
Deprecated.since ages - useGeneratedAbstractOrder.DELIVERYCOST
insteadstatic java.lang.String
DELIVERY_MODE
Deprecated.since ages - useGeneratedAbstractOrder.DELIVERYMODE
insteadstatic java.lang.String
DELIVERY_STATUS
Deprecated.since ages - useGeneratedAbstractOrder.DELIVERYSTATUS
insteadstatic java.lang.String
DELIVERY_STATUS_TYPE
Deprecated.since ages - useDeliveryStatus#_TYPECODE
insteadstatic java.lang.String
EXPORT_STATUS
Deprecated.since ages - useGeneratedAbstractOrder.EXPORTSTATUS
insteadstatic java.lang.String
EXPORT_STATUS_TYPE
Deprecated.since ages - useExportStatus#_TYPECODE
insteadstatic java.lang.String
GLOBAL_DISCOUNT_VALUES
Deprecated.static java.lang.String
ORDER_DISCOUNT_RELATION_NAME
Deprecated.since ages - useDiscountModel#_ORDERDISCOUNTRELATION
insteadstatic java.lang.String
ORDER_STATUS_TYPE
Deprecated.since ages - useOrderStatus#_TYPECODE
insteadstatic java.lang.String
PAYMENT_ADDRESS
Deprecated.since ages - useGeneratedAbstractOrder.PAYMENTADDRESS
insteadstatic java.lang.String
PAYMENT_COST
Deprecated.since ages - useGeneratedAbstractOrder.PAYMENTCOST
insteadstatic java.lang.String
PAYMENT_INFO
Deprecated.since ages - useGeneratedAbstractOrder.PAYMENTINFO
insteadstatic java.lang.String
PAYMENT_MODE
Deprecated.since ages - useGeneratedAbstractOrder.PAYMENTMODE
insteadstatic java.lang.String
PAYMENT_STATUS
Deprecated.since ages - useGeneratedAbstractOrder.PAYMENTSTATUS
insteadstatic java.lang.String
PAYMENT_STATUS_TYPE
Deprecated.since ages - usePaymentStatus#_TYPECODE
insteadstatic java.lang.String
STATUS_INFO
Deprecated.since ages - useGeneratedAbstractOrder.STATUSINFO
insteadstatic java.lang.String
TOTAL
Deprecated.since ages - useGeneratedAbstractOrder.TOTALPRICE
insteadstatic java.lang.String
TOTAL_DISCOUNTS
Deprecated.since ages - useGeneratedAbstractOrder.TOTALDISCOUNTS
insteadstatic java.lang.String
TOTAL_TAX
Deprecated.since ages - useGeneratedAbstractOrder.TOTALTAX
insteadstatic java.lang.String
TOTAL_TAX_VALUES
Deprecated.-
Fields inherited from class de.hybris.platform.jalo.order.GeneratedAbstractOrder
CALCULATED, CODE, CURRENCY, DATE, DEFAULT_INITIAL_ATTRIBUTES, DELIVERYADDRESS, DELIVERYCOST, DELIVERYMODE, DELIVERYSTATUS, DESCRIPTION, DISCOUNTS, DISCOUNTSINCLUDEDELIVERYCOST, DISCOUNTSINCLUDEPAYMENTCOST, ENTRIES, ENTRIESHANDLER, ENTRYGROUPS, EXPIRATIONTIME, EXPORTSTATUS, GLOBALDISCOUNTVALUESINTERNAL, NAME, NET, ORDERDISCOUNTRELATION_MARKMODIFIED, ORDERDISCOUNTRELATION_SRC_ORDERED, ORDERDISCOUNTRELATION_TGT_ORDERED, PAYMENTADDRESS, PAYMENTCOST, PAYMENTINFO, PAYMENTMODE, PAYMENTSTATUS, STATUS, STATUSINFO, SUBTOTAL, TOTALDISCOUNTS, TOTALPRICE, TOTALTAX, TOTALTAXVALUESINTERNAL, USER
-
Fields inherited from class de.hybris.platform.jalo.c2l.LocalizableItem
LANGUAGE_FALLBACK_ENABLED
-
Fields inherited from class de.hybris.platform.jalo.Item
_CREATION_TIME_INTERNAL, _MODIFIED_TIME_INTERNAL, accessorLog, CREATION_TIME, DISABLE_ATTRIBUTE_CHECK, DISABLE_ITEMCHECK_BEFORE_REMOVABLE, EVEN, FEATURE_ACCESSMAP_QUALIFIER, HJMPTS, INITIAL_CREATION_FLAG, isJaloOnly, MODIFIED_TIME, NEGATIVE, NOT_FOUND, OWNER, PK, POSITIVE, SAVE_FROM_SERVICE_LAYER, staticTransientObjects, TYPE
-
Fields inherited from class de.hybris.platform.util.BridgeAbstraction
impl, tenant
-
-
Constructor Summary
Constructors Constructor Description AbstractOrder()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected void
addAbsoluteEntryTaxValue(long entryQuantity, TaxValue taxValue, java.util.Map<TaxValue,java.util.Map<java.util.Set<TaxValue>,java.lang.Double>> taxValueMap)
void
addAllGlobalDiscountValues(SessionContext ctx, java.util.Collection values)
Deprecated.since ages - Use OrderService.addAllGlobalDiscountValues(de.hybris.platform.core.model.order.AbstractOrderModel, List) instead.void
addAllGlobalDiscountValues(java.util.Collection values)
Deprecated.since ages - Use OrderService.addAllGlobalDiscountValues(de.hybris.platform.core.model.order.AbstractOrderModel, List) instead.void
addAllTotalTaxValues(SessionContext ctx, java.util.Collection values)
Deprecated.since ages - Use OrderService.addAllTotalTaxValues(de.hybris.platform.core.model.order.AbstractOrderModel, List) instead.void
addAllTotalTaxValues(java.util.Collection values)
Deprecated.since ages - Use OrderService.addAllTotalTaxValues(de.hybris.platform.core.model.order.AbstractOrderModel, List) instead.void
addDiscount(Discount discount)
Deprecated.since ages - useGeneratedAbstractOrder.addToDiscounts(Discount)
void
addGlobalDiscountValue(SessionContext ctx, DiscountValue discountValue)
Deprecated.since ages - Use OrderService.addGlobalDiscountValue(de.hybris.platform.core.model.order.AbstractOrderModel, DiscountValue) instead.void
addGlobalDiscountValue(DiscountValue discountValue)
Deprecated.since ages - Use OrderService.addGlobalDiscountValue(de.hybris.platform.core.model.order.AbstractOrderModel, DiscountValue) instead.AbstractOrderEntry
addNewEntry(Product prod, long qtd, Unit unit)
Deprecated.since 4.3, please use suitable OrderService.addNewEntry() methodAbstractOrderEntry
addNewEntry(Product prod, long qtd, Unit unit, boolean addToPresent)
Deprecated.since 4.3, please use suitable OrderService.addNewEntry() methodAbstractOrderEntry
addNewEntry(Product prod, long qtd, Unit unit, int position, boolean addToPresent)
Deprecated.since 4.3, please use suitable OrderService.addNewEntry() methodAbstractOrderEntry
addNewEntry(ComposedType type, Product prod, long qtd, Unit unit, int position, boolean addToPresent)
Deprecated.since 4.3, please use suitable OrderService.addNewEntry() methodprotected void
addRelativeEntryTaxValue(double entryTotal, TaxValue taxValue, java.util.Set<TaxValue> relativeEntryTaxValues, java.util.Map<TaxValue,java.util.Map<java.util.Set<TaxValue>,java.lang.Double>> taxValueMap)
void
addTotalTaxValue(SessionContext ctx, TaxValue taxValue)
Deprecated.since ages - Use OrderService.addTotalTaxValue(de.hybris.platform.core.model.order.AbstractOrderModel, TaxValue) instead.void
addTotalTaxValue(TaxValue taxValue)
Deprecated.since ages - Use OrderService.addTotalTaxValue(de.hybris.platform.core.model.order.AbstractOrderModel, TaxValue) instead.void
calculate()
Deprecated.since ages - Use CalculationService.calculate(de.hybris.platform.core.model.order.AbstractOrderModel) instead.void
calculate(java.util.Date date)
Deprecated.since ages - Use CalculationService#calculate(de.hybris.platform.core.model.order.AbstractOrderModel, Date)protected TaxValue
calculateAbsoluteTotalTaxValue(Currency curr, java.lang.String currencyIso, int digits, boolean net, TaxValue taxValue, double cumulatedEntryQuantities)
protected double
calculateDiscountValues(boolean recalculate)
Returns the total discount for this abstract order.protected void
calculateEntries()
callsAbstractOrderEntry.calculate()
on all entries of this order and sets this orders subtotal to the sum of the entry totals.protected java.util.Map<TaxValue,java.util.Map<java.util.Set<TaxValue>,java.lang.Double>>
calculateSubtotal(boolean recalculate)
Calculates this order's subtotal and returns a total tax value map.void
calculateTotals(boolean recalculate)
Deprecated.since ages - Use CalculationService#calculateTotals(de.hybris.platform.core.model.order.AbstractOrderModel, boolean) insteadprotected void
calculateTotals(boolean recalculate, java.util.Map<TaxValue,java.util.Map<java.util.Set<TaxValue>,java.lang.Double>> taxValueMap)
calculates all totals.protected double
calculateTotalTaxValues(boolean recalculate, int digits, double taxAdjustmentFactor, java.util.Map<TaxValue,java.util.Map<java.util.Set<TaxValue>,java.lang.Double>> taxValueMap)
protected java.util.List
convertDiscountValues(java.util.List dvs)
protected java.lang.String
createEntryInformation(AbstractOrderEntry newEntry)
Deprecated.since 4.3 order entry info is set in prepare interceptor.protected Item
createItem(SessionContext ctx, ComposedType type, Item.ItemAttributeMap allAttributes)
Has to be implemented for each concrete subtype of item.Address
createNewDeliveryAddress()
creates a new address which is set as this orders delivery address.Address
createNewDeliveryAddress(SessionContext ctx)
creates a new address which is set as this orders delivery address.protected abstract AbstractOrderEntry
createNewEntry(SessionContext ctx, ComposedType entryType, Product product, long quantity, Unit unit, int position)
protected int
createNewEntryNumber(int requested)
Address
createNewPaymentAddress()
creates a new address which is set as this orders payment address.Address
createNewPaymentAddress(SessionContext ctx)
creates a new address which is set as this orders payment address.boolean
discountsIncludeDeliveryCosts()
Deprecated.since ages - useGeneratedAbstractOrder.isDiscountsIncludePaymentCostAsPrimitive()
insteadboolean
discountsIncludePaymentCosts()
Deprecated.since ages - useGeneratedAbstractOrder.isDiscountsIncludePaymentCostAsPrimitive()
insteadprotected void
doSetDeliveryAddress(SessionContext ctx, Address newOne)
Performs changing of delivery address.protected void
doSetPaymentAddress(SessionContext ctx, Address newOne)
Performs changing of payment address.protected PriceValue
findDeliveryCosts()
Called duringcalculate()
,calculate(Date)
,recalculate()
andrecalculate(Date)
to fetch and set the delivery cost for this order.protected java.util.List
findGlobalDiscounts()
Called duringcalculate()
,calculate(Date)
,recalculate()
andrecalculate(Date)
to fetch and set global discount values for this order.protected PriceValue
findPaymentCosts()
called duringcalculate()
,calculate(Date)
,recalculate()
andrecalculate(Date)
to fetch and set the payment costs for this order.protected abstract java.lang.String
getAbstractOrderEntryTypeCode()
java.util.List
getAllEntries()
Deprecated.since ages - usegetEntries(SessionContext)
protected java.lang.Object
getAttributeValue(Item item, java.lang.String qualifer)
protected ComposedType
getCustomEntryType()
when overriding abstract order type this defines the corresponding entry typejava.util.Date
getDate(SessionContext ctx)
The creation date of an order.double
getDeliveryCosts()
The calculated delivery costs of this order.double
getDeliveryCosts(SessionContext ctx)
Deprecated.since ages - useGeneratedAbstractOrder.getDeliveryCostAsPrimitive(SessionContext)
insteadjava.util.List<AbstractOrderEntry>
getEntries()
Generated method - Getter of theAbstractOrder.entries
attribute.java.util.Collection
getEntries(int startIdx, int endIdx)
java.util.List<AbstractOrderEntry>
getEntries(SessionContext ctx)
Generated method - Getter of theAbstractOrder.entries
attribute.java.util.List
getEntriesByProduct(Product product)
Returns all entries which belong to a specified product.AbstractOrderEntry
getEntry(int index)
Deprecated.since ages - Use OrderService.getEntryForNumber(de.hybris.platform.core.model.order.AbstractOrderModel, int) instead.java.util.List
getGlobalDiscountValues()
Deprecated.since ages - Use model getter AbstractOrderModel.getGlobalDiscountValues() instead.java.util.List
getGlobalDiscountValues(SessionContext ctx)
Deprecated.since ages - Use model getter AbstractOrderModel.getGlobalDiscountValues() instead.protected int
getNewEntryNumberForAppending(java.util.List<AbstractOrderEntry> all)
protected int
getNextEntryNumber(AbstractOrderEntry forMe)
double
getPaymentCosts()
The calculated costs according to the chosen payment mode.double
getPaymentCosts(SessionContext ctx)
Deprecated.since ages - useGeneratedAbstractOrder.getPaymentCost(SessionContext)
insteaddouble
getTotal()
Deprecated.since ages - useGeneratedAbstractOrder.getTotalPriceAsPrimitive()
insteaddouble
getTotal(SessionContext ctx)
Deprecated.since ages - useGeneratedAbstractOrder.getTotalPriceAsPrimitive(SessionContext)
insteadjava.lang.Double
getTotalDiscounts()
returns the sum of all discounts of this (calculated) order.java.lang.Double
getTotalTax()
The calculated total tax amount of this order.java.util.Collection
getTotalTaxValues()
Deprecated.since ages - Use model getter AbstractOrderModel.getTotalTaxValues() instead.java.util.Collection
getTotalTaxValues(SessionContext ctx)
Deprecated.since ages - Use model getter AbstractOrderModel.getTotalTaxValues() instead.java.lang.Boolean
isCalculated()
Shows if this order was calculated before.java.lang.Boolean
isCalculated(SessionContext ctx)
Shows if this order was calculated before.java.lang.Boolean
isNet()
The gross / net status of this order.protected void
notifyDiscountsAboutCalculation()
protected void
notifyDiscountsAboutRemoval()
void
recalculate()
Deprecated.since ages - Use CalculationService#recalculate(de.hybris.platform.core.model.order.AbstractOrderModel) instead.void
recalculate(java.util.Date date)
Deprecated.since ages - Use CalculationService#recalculate(de.hybris.platform.core.model.order.AbstractOrderModel, java.util.Date) instead.protected void
recalculateEntries()
callsAbstractOrderEntry.recalculate()
on all entries of this order and sets this orders subtotal to the sum of the entry totals.void
remove(SessionContext ctx)
Removes this item.void
removeAllEntries()
Deprecated.since ages - UseModelService
.remove() instead.void
removeAllGlobalDiscountValues()
Deprecated.since ages - Use model setter AbstractOrderModel.setGlobalDiscountValues(List) and ModelService.save() method instead.void
removeAllGlobalDiscountValues(SessionContext ctx)
Deprecated.since ages - Use model setter AbstractOrderModel.setGlobalDiscountValues(List) and ModelService.save() method instead.void
removeAllTotalTaxValues()
Deprecated.since ages - Use model setter AbstractOrderModel.setTotalTaxValues(Collection) and ModelService.save() method instead.void
removeAllTotalTaxValues(SessionContext ctx)
Deprecated.since ages - Use model setter AbstractOrderModel.setTotalTaxValues(Collection) and ModelService.save() method instead.void
removeDiscount(Discount discount)
Deprecated.since ages - useGeneratedAbstractOrder.removeFromDiscounts(Discount)
protected void
removeEntries(SessionContext ctx, java.util.Set<AbstractOrderEntry> entries)
Deprecated.since ages - UseModelService
.remove() instead.void
removeEntry(AbstractOrderEntry entry)
Deprecated.since ages - UseModelService
.remove() instead.void
removeGlobalDiscountValue(SessionContext ctx, DiscountValue discountValue)
Deprecated.since ages - Use OrderService.removeGlobalDiscountValue(de.hybris.platform.core.model.order.AbstractOrderModel, DiscountValue) instead.void
removeGlobalDiscountValue(DiscountValue discountValue)
Deprecated.since ages - Use OrderService.removeGlobalDiscountValue(de.hybris.platform.core.model.order.AbstractOrderModel, DiscountValue) instead.void
removeTotalTaxValue(SessionContext ctx, TaxValue taxValue)
Deprecated.since ages - Use OrderService.removeTotalTaxValue(de.hybris.platform.core.model.order.AbstractOrderModel, TaxValue) instead.void
removeTotalTaxValue(TaxValue taxValue)
Deprecated.since ages - Use OrderService.removeTotalTaxValue(de.hybris.platform.core.model.order.AbstractOrderModel, TaxValue) instead.protected void
resetAdditionalCosts(java.util.Collection<TaxValue> relativeTaxValues)
protected java.util.Map
resetAllValues()
fetches all prices, taxes, discount, payment and delivery costs and sets these fields.protected void
setAllEntries(SessionContext ctx, java.util.List value)
protected void
setChanged(boolean entriesToo)
void
setCode(SessionContext ctx, java.lang.String code)
Sets the order code.void
setCode(java.lang.String code)
Sets the order code.Item
setComposedType(ComposedType type)
Changes this order's composed type and the composed type of its entries provided thatgetCustomEntryType()
returns a valid entry class.void
setCurrency(Currency curr)
Changes the currency for all pricing informations of this order.void
setCurrency(SessionContext ctx, Currency curr)
Changes the currency for all pricing informations of this order.void
setDate(SessionContext ctx, java.util.Date date)
Changes creation date of an order.void
setDate(java.util.Date date)
Changes creation date of an order.void
setDeliveryAddress(SessionContext ctx, Address address)
Changes the delivery address.void
setDeliveryAddress(Address address)
Changes the delivery address.void
setDeliveryCost(SessionContext ctx, java.lang.Double value)
Generated method - Setter of theAbstractOrder.deliveryCost
attribute.void
setDeliveryCosts(double deliveryCost)
Sets The calculated delivery costs of this order.void
setDeliveryCosts(SessionContext ctx, double deliveryCost)
Deprecated.since ages - useGeneratedAbstractOrder.setDeliveryCost(double)
insteadvoid
setDeliveryMode(DeliveryMode mode)
Changes the chosen delivery mode for this order.void
setDeliveryMode(SessionContext ctx, DeliveryMode mode)
Changes the chosen delivery mode for this order.void
setDeliveryStatus(EnumerationValue deliveryStatus)
Changes the order delivery status.void
setDeliveryStatus(SessionContext ctx, EnumerationValue deliveryStatus)
Changes the order delivery status.void
setDiscountsIncludeDeliveryCost(SessionContext ctx, java.lang.Boolean value)
Generated method - Setter of theAbstractOrder.discountsIncludeDeliveryCost
attribute.void
setDiscountsIncludeDeliveryCosts(boolean includes)
Deprecated.since ages - useGeneratedAbstractOrder.setDiscountsIncludeDeliveryCost(boolean)
insteadvoid
setDiscountsIncludePaymentCost(SessionContext ctx, java.lang.Boolean value)
Generated method - Setter of theAbstractOrder.discountsIncludePaymentCost
attribute.void
setDiscountsIncludePaymentCosts(boolean includes)
Deprecated.since ages - usesetDiscountsIncludePaymentCosts(boolean)
insteadvoid
setEntries(SessionContext ctx, java.util.List<AbstractOrderEntry> value)
Generated method - Setter of theAbstractOrder.entries
attribute.void
setEntries(java.util.List<AbstractOrderEntry> value)
Generated method - Setter of theAbstractOrder.entries
attribute.void
setGlobalDiscountValues(SessionContext ctx, java.util.List globalDiscounts)
Deprecated.since ages - Use model setter AbstractOrderModel.setGlobalDiscountValues(List) and ModelService.save() method instead.void
setGlobalDiscountValues(java.util.List globalDiscounts)
Deprecated.since ages - Use model setter AbstractOrderModel.setGlobalDiscountValues(List) and ModelService.save() method instead.void
setNet(boolean net)
Changes the gross / net status of this order.void
setNet(SessionContext ctx, boolean net)
Changes the gross / net status of this order.void
setPaymentAddress(SessionContext ctx, Address adr)
Changes the payment address of this order.void
setPaymentAddress(Address adr)
Changes the payment address of this order.void
setPaymentCost(SessionContext ctx, java.lang.Double value)
Generated method - Setter of theAbstractOrder.paymentCost
attribute.void
setPaymentCosts(double paymentCost)
Sets the costs of the chosen payment mode.void
setPaymentCosts(SessionContext ctx, double paymentCost)
Deprecated.since ages - useGeneratedAbstractOrder.setPaymentCost(SessionContext, double)
insteadvoid
setPaymentMode(PaymentMode mode)
Changes the payment mode of this order.void
setPaymentMode(SessionContext ctx, PaymentMode mode)
Changes the payment mode of this order.void
setPaymentStatus(EnumerationValue paymentStatus)
Changes the payment order status.void
setPaymentStatus(SessionContext ctx, EnumerationValue paymentStatus)
Changes the order payment status.void
setStatus(EnumerationValue status)
Changes the order status.void
setStatus(SessionContext ctx, EnumerationValue status)
Changes the order status.void
setTotal(double total)
Sets the calculated total price of this order.void
setTotal(SessionContext ctx, double price)
Deprecated.since ages - useGeneratedAbstractOrder.setTotalPrice(SessionContext, double)
insteadvoid
setTotalTaxValues(SessionContext ctx, java.util.Collection totalTaxValues)
Deprecated.since ages - Use model setter AbstractOrderModel.setTotalTaxValues(Collection) and ModelService.save() method instead.void
setTotalTaxValues(java.util.Collection totalTaxValues)
Deprecated.since ages - Use model setter AbstractOrderModel.setTotalTaxValues(Collection) and ModelService.save() method instead.void
setUser(SessionContext ctx, User user)
Changes the user which this order belongs to.void
setUser(User user)
Changes the user which this order belongs to.protected void
shuffleEntriesOnInsertNew(java.util.List<AbstractOrderEntry> all, int newEntryNumber)
protected Language
tryToFindFallbackLanguage(JaloSession js)
-
Methods inherited from class de.hybris.platform.jalo.order.GeneratedAbstractOrder
addToDiscounts, addToDiscounts, addToEntries, addToEntries, getCode, getCode, getCurrency, getCurrency, getDate, getDefaultAttributeModes, getDeliveryAddress, getDeliveryAddress, getDeliveryCost, getDeliveryCost, getDeliveryCostAsPrimitive, getDeliveryCostAsPrimitive, getDeliveryMode, getDeliveryMode, getDeliveryStatus, getDeliveryStatus, getDescription, getDescription, getDiscounts, getDiscounts, getDiscountsCount, getDiscountsCount, getEntryGroups, getEntryGroups, getExpirationTime, getExpirationTime, getExportStatus, getExportStatus, getGlobalDiscountValuesInternal, getGlobalDiscountValuesInternal, getName, getName, getPaymentAddress, getPaymentAddress, getPaymentCost, getPaymentCost, getPaymentCostAsPrimitive, getPaymentCostAsPrimitive, getPaymentInfo, getPaymentInfo, getPaymentMode, getPaymentMode, getPaymentStatus, getPaymentStatus, getStatus, getStatus, getStatusInfo, getStatusInfo, getSubtotal, getSubtotal, getSubtotalAsPrimitive, getSubtotalAsPrimitive, getTotalDiscounts, getTotalDiscountsAsPrimitive, getTotalDiscountsAsPrimitive, getTotalPrice, getTotalPrice, getTotalPriceAsPrimitive, getTotalPriceAsPrimitive, getTotalTax, getTotalTaxAsPrimitive, getTotalTaxAsPrimitive, getTotalTaxValuesInternal, getTotalTaxValuesInternal, getUser, getUser, isCalculatedAsPrimitive, isCalculatedAsPrimitive, isDiscountsIncludeDeliveryCost, isDiscountsIncludeDeliveryCost, isDiscountsIncludeDeliveryCostAsPrimitive, isDiscountsIncludeDeliveryCostAsPrimitive, isDiscountsIncludePaymentCost, isDiscountsIncludePaymentCost, isDiscountsIncludePaymentCostAsPrimitive, isDiscountsIncludePaymentCostAsPrimitive, isMarkModifiedDisabled, isNet, isNetAsPrimitive, isNetAsPrimitive, removeFromDiscounts, removeFromDiscounts, removeFromEntries, removeFromEntries, setCalculated, setCalculated, setCalculated, setCalculated, setDeliveryCost, setDeliveryCost, setDeliveryCost, setDescription, setDescription, setDiscounts, setDiscounts, setDiscountsIncludeDeliveryCost, setDiscountsIncludeDeliveryCost, setDiscountsIncludeDeliveryCost, setDiscountsIncludePaymentCost, setDiscountsIncludePaymentCost, setDiscountsIncludePaymentCost, setEntryGroups, setEntryGroups, setExpirationTime, setExpirationTime, setExportStatus, setExportStatus, setGlobalDiscountValuesInternal, setGlobalDiscountValuesInternal, setName, setName, setNet, setNet, setPaymentCost, setPaymentCost, setPaymentCost, setPaymentInfo, setPaymentInfo, setStatusInfo, setStatusInfo, setSubtotal, setSubtotal, setSubtotal, setSubtotal, setTotalDiscounts, setTotalDiscounts, setTotalDiscounts, setTotalDiscounts, setTotalPrice, setTotalPrice, setTotalPrice, setTotalPrice, setTotalTax, setTotalTax, setTotalTax, setTotalTax, setTotalTaxValuesInternal, setTotalTaxValuesInternal
-
Methods inherited from class de.hybris.platform.jalo.GenericItem
getImplementation, getInitialProperties, getNonInitialAttributes, getRelatedItems, setRelatedItems
-
Methods inherited from class de.hybris.platform.jalo.c2l.LocalizableItem
getAllLocalizedProperties, getAllLocalizedProperties, getAllLocalizedProperties, getAllLocalizedProperties, getAllValuesSessionContext, getLocalizedProperty, getLocalizedProperty, getLocalizedPropertyInternal, getLocalizedPropertyNames, getLocalizedPropertyNames, hasLanguage, isEmptyValue, isFallbackEnabled, removeLocalizedProperty, removeLocalizedProperty, setAllLocalizedProperties, setAllLocalizedProperties, setLocalizedProperty, setLocalizedProperty
-
Methods inherited from class de.hybris.platform.jalo.ExtensibleItem
createNonClassAccessor, getAllProperties, getAllProperties, getProperty, getProperty, getPropertyNames, getPropertyNames, removeProperty, removeProperty, setAllProperties, setAllProperties, setProperty, setProperty
-
Methods inherited from class de.hybris.platform.jalo.Item
addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addNegativePermission, addPermission, addPositivePermission, assureExtensionsLoaded, changeTypeAfterCreation, checkConstraint, checkItemPermission, checkMandatoryAttribute, checkMandatoryAttribute, checkPermission, checkPermission, checkRemovable, clearPermission, compareTo, ctx, doAfterRemove, doBeforeRemove, equals, getAccessorFor, getAllAttributes, getAllAttributes, getAllAttributes, getAllAttributes, getAllAttributesInternal, getAllLinkedItems, getAndCheckCacheBoundItem, getAttribute, getAttribute, getCacheBoundItem, getComposedType, getComposedTypePK, getCreationTime, getCurrentlyRemovingCount, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItemsCount, getLinkedItemsCount, getLinkedItemsCount, getModificationTime, getNegativePermissions, getOwner, getPermissionMap, getPermissions, getPersistenceVersion, getPK, getPositivePermissions, getRestrictedPrincipals, getSession, getSyncObject, getTenant, getTransientObject, getTransientObjectMap, hashCode, hasRegisteredClassAccessorFor, internal_registerClassAccessorFor, internal_registerNonClassAccessorFor, invalidateLocalCaches, isAlive, isCacheBound, isCurrentlyRemoving, isCurrentlyRemoving, isEmptyRelationValue, isInCreate, isInstanceOf, isItemCheckBeforeRemoveableDisabled, isRelationLocalizationFallbackEnabled, newInstance, notifyExtensionsAfterItemCreation, notifyExtensionsBeforeItemCreation, notifyItemRemoval, notifyManagerAboutItemRemoval, readResolve, registerAccessFor, registerAccessFor, registerJaloInvalidationListeners, remove, removeItemCollection, removeItemCollection, removeLinkedItems, removeLinkedItems, removeLinkedItems, removeLinkedItems, removeLinks, removePartOfItems, removePartOfItems, setAllAttributes, setAllAttributes, setAllAttributesInternal, setAllLinkedItems, setAllLinkedItems, setAllLinkedItems, setAllLinkedItems, setAttribute, setAttribute, setAttributeFromString, setAttributeFromString, setCacheBound, setCreationTime, setImplementation, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setModificationTime, setNonInitialAttributes, setOwner, setPermissionsByMap, setTransientObject, setUseTA, toString, useTA, writeReplace
-
Methods inherited from class de.hybris.platform.util.BridgeAbstraction
setTenant
-
-
-
-
Field Detail
-
CFG_TAX_FREE_ENTRIES_SUPPORT
public static final java.lang.String CFG_TAX_FREE_ENTRIES_SUPPORT
- See Also:
- Constant Field Values
-
APPEND_AS_LAST
public static final int APPEND_AS_LAST
- See Also:
- Constant Field Values
-
DELIVERY_ADDRESS
@Deprecated public static final java.lang.String DELIVERY_ADDRESS
Deprecated.since ages - useGeneratedAbstractOrder.DELIVERYADDRESS
instead- See Also:
- Constant Field Values
-
PAYMENT_ADDRESS
@Deprecated public static final java.lang.String PAYMENT_ADDRESS
Deprecated.since ages - useGeneratedAbstractOrder.PAYMENTADDRESS
instead- See Also:
- Constant Field Values
-
EXPORT_STATUS
@Deprecated public static final java.lang.String EXPORT_STATUS
Deprecated.since ages - useGeneratedAbstractOrder.EXPORTSTATUS
instead- See Also:
- Constant Field Values
-
PAYMENT_MODE
@Deprecated public static final java.lang.String PAYMENT_MODE
Deprecated.since ages - useGeneratedAbstractOrder.PAYMENTMODE
instead- See Also:
- Constant Field Values
-
DELIVERY_MODE
@Deprecated public static final java.lang.String DELIVERY_MODE
Deprecated.since ages - useGeneratedAbstractOrder.DELIVERYMODE
instead- See Also:
- Constant Field Values
-
PAYMENT_INFO
@Deprecated public static final java.lang.String PAYMENT_INFO
Deprecated.since ages - useGeneratedAbstractOrder.PAYMENTINFO
instead- See Also:
- Constant Field Values
-
PAYMENT_STATUS
@Deprecated public static final java.lang.String PAYMENT_STATUS
Deprecated.since ages - useGeneratedAbstractOrder.PAYMENTSTATUS
instead- See Also:
- Constant Field Values
-
DELIVERY_STATUS
@Deprecated public static final java.lang.String DELIVERY_STATUS
Deprecated.since ages - useGeneratedAbstractOrder.DELIVERYSTATUS
instead- See Also:
- Constant Field Values
-
GLOBAL_DISCOUNT_VALUES
@Deprecated public static final java.lang.String GLOBAL_DISCOUNT_VALUES
Deprecated.- See Also:
- Constant Field Values
-
TOTAL_TAX_VALUES
@Deprecated public static final java.lang.String TOTAL_TAX_VALUES
Deprecated.- See Also:
- Constant Field Values
-
TOTAL_TAX
@Deprecated public static final java.lang.String TOTAL_TAX
Deprecated.since ages - useGeneratedAbstractOrder.TOTALTAX
instead- See Also:
- Constant Field Values
-
TOTAL
@Deprecated public static final java.lang.String TOTAL
Deprecated.since ages - useGeneratedAbstractOrder.TOTALPRICE
instead- See Also:
- Constant Field Values
-
DELIVERY_COST
@Deprecated public static final java.lang.String DELIVERY_COST
Deprecated.since ages - useGeneratedAbstractOrder.DELIVERYCOST
instead- See Also:
- Constant Field Values
-
PAYMENT_COST
@Deprecated public static final java.lang.String PAYMENT_COST
Deprecated.since ages - useGeneratedAbstractOrder.PAYMENTCOST
instead- See Also:
- Constant Field Values
-
STATUS_INFO
@Deprecated public static final java.lang.String STATUS_INFO
Deprecated.since ages - useGeneratedAbstractOrder.STATUSINFO
instead- See Also:
- Constant Field Values
-
TOTAL_DISCOUNTS
@Deprecated public static final java.lang.String TOTAL_DISCOUNTS
Deprecated.since ages - useGeneratedAbstractOrder.TOTALDISCOUNTS
instead- See Also:
- Constant Field Values
-
ORDER_DISCOUNT_RELATION_NAME
@Deprecated public static final java.lang.String ORDER_DISCOUNT_RELATION_NAME
Deprecated.since ages - useDiscountModel#_ORDERDISCOUNTRELATION
instead- See Also:
- Constant Field Values
-
ORDER_STATUS_TYPE
@Deprecated public static final java.lang.String ORDER_STATUS_TYPE
Deprecated.since ages - useOrderStatus#_TYPECODE
instead- See Also:
- Constant Field Values
-
PAYMENT_STATUS_TYPE
@Deprecated public static final java.lang.String PAYMENT_STATUS_TYPE
Deprecated.since ages - usePaymentStatus#_TYPECODE
instead- See Also:
- Constant Field Values
-
DELIVERY_STATUS_TYPE
@Deprecated public static final java.lang.String DELIVERY_STATUS_TYPE
Deprecated.since ages - useDeliveryStatus#_TYPECODE
instead- See Also:
- Constant Field Values
-
EXPORT_STATUS_TYPE
@Deprecated public static final java.lang.String EXPORT_STATUS_TYPE
Deprecated.since ages - useExportStatus#_TYPECODE
instead- See Also:
- Constant Field Values
-
-
Method Detail
-
createItem
protected Item createItem(SessionContext ctx, ComposedType type, Item.ItemAttributeMap allAttributes) throws JaloBusinessException
Description copied from class:Item
Has 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:
createItem
in classGenericItem
- Parameters:
ctx
- the current session context which this item is created withintype
- the actual item type ( since subtypes may not provide a own jalo class this may be different from the type which this method was implemented for )- Returns:
- the new item instance
- Throws:
JaloBusinessException
- indicates an error during creation - any changes will be rollbacked
-
getAbstractOrderEntryTypeCode
protected abstract java.lang.String getAbstractOrderEntryTypeCode()
-
getAllEntries
@Deprecated public java.util.List getAllEntries()
Deprecated.since ages - usegetEntries(SessionContext)
All order positions. These are ordered product quantities, described by a number and a unit.
-
getEntries
public java.util.List<AbstractOrderEntry> getEntries()
Description copied from class:GeneratedAbstractOrder
Generated method - Getter of theAbstractOrder.entries
attribute.- Overrides:
getEntries
in classGeneratedAbstractOrder
- Returns:
- the entries
-
getEntries
public java.util.List<AbstractOrderEntry> getEntries(SessionContext ctx)
Description copied from class:GeneratedAbstractOrder
Generated method - Getter of theAbstractOrder.entries
attribute.- Overrides:
getEntries
in classGeneratedAbstractOrder
- Returns:
- the entries
-
setAllEntries
protected void setAllEntries(SessionContext ctx, java.util.List value)
-
getEntry
@Deprecated public AbstractOrderEntry getEntry(int index) throws JaloItemNotFoundException
Deprecated.since ages - Use OrderService.getEntryForNumber(de.hybris.platform.core.model.order.AbstractOrderModel, int) instead.Returns the order entry at a specified position.- Parameters:
index
-- Throws:
JaloItemNotFoundException
-
getEntries
public java.util.Collection getEntries(int startIdx, int endIdx)
-
getEntriesByProduct
public java.util.List getEntriesByProduct(Product product)
Returns all entries which belong to a specified product.- Parameters:
product
-
-
createNewEntryNumber
protected int createNewEntryNumber(int requested)
-
shuffleEntriesOnInsertNew
protected void shuffleEntriesOnInsertNew(java.util.List<AbstractOrderEntry> all, int newEntryNumber)
-
getNewEntryNumberForAppending
protected int getNewEntryNumberForAppending(java.util.List<AbstractOrderEntry> all)
-
getNextEntryNumber
protected int getNextEntryNumber(AbstractOrderEntry forMe)
-
addNewEntry
@Deprecated public AbstractOrderEntry addNewEntry(Product prod, long qtd, Unit unit)
Deprecated.since 4.3, please use suitable OrderService.addNewEntry() methodAdds a new entry to this order. A new entry is created for this reason. You can create multiple entries whith the same product: there is no automatic summing-up of similar entries.- Parameters:
prod
- - must not be nullqtd
-unit
- - must not be null- Throws:
java.lang.IllegalArgumentException
- if eighter given Product or Unit was null
-
addNewEntry
@Deprecated public AbstractOrderEntry addNewEntry(Product prod, long qtd, Unit unit, boolean addToPresent)
Deprecated.since 4.3, please use suitable OrderService.addNewEntry() methodAdds a new entry to this order. A new entry is created for this reason. You can create multiple entries whith the same product: there is no automatic summing-up of similar entries.- Parameters:
prod
- - must not be nullqtd
-unit
- - must not be nulladdToPresent
- if true an existing entry with matching product and unit will get its quantity increased; otherwise a new entry is created- Throws:
java.lang.IllegalArgumentException
- if eighter given Product or Unit was null
-
addNewEntry
@Deprecated public AbstractOrderEntry addNewEntry(Product prod, long qtd, Unit unit, int position, boolean addToPresent)
Deprecated.since 4.3, please use suitable OrderService.addNewEntry() methodAdds a new entry to this order. A new entry is created for this reason. You can create multiple entries whith the same product: there is no automatic summing-up of similar entries.- Parameters:
prod
- - must not be nullqtd
-unit
- - must not be nulladdToPresent
- if true an existing entry with matching product and unit will get its quantity increased; otherwise a new entry is created- Throws:
java.lang.IllegalArgumentException
- if eighter given Product or Unit was null
-
addNewEntry
@Deprecated public AbstractOrderEntry addNewEntry(ComposedType type, Product prod, long qtd, Unit unit, int position, boolean addToPresent)
Deprecated.since 4.3, please use suitable OrderService.addNewEntry() methodAdds a new entry to this order. A new entry is created for this reason. You can create multiple entries whith the same product: there is no automatic summing-up of similar entries.- Parameters:
type
- the item type of the new entry (note that the type is not changed if a existing entry is just increased!)prod
- - must not be nullqtd
-unit
- - must not be nulladdToPresent
- if true an existing entry with matching product and unit will get its quantity increased; otherwise a new entry is created- Throws:
java.lang.IllegalArgumentException
- if eighter given Product or Unit was null
-
createNewEntry
protected abstract AbstractOrderEntry createNewEntry(SessionContext ctx, ComposedType entryType, Product product, long quantity, Unit unit, int position)
-
getCustomEntryType
protected ComposedType getCustomEntryType()
when overriding abstract order type this defines the corresponding entry type- Returns:
- null as default; subtypes may return their corresponding entry type
-
setComposedType
public Item setComposedType(ComposedType type) throws JaloInvalidParameterException
Changes this order's composed type and the composed type of its entries provided thatgetCustomEntryType()
returns a valid entry class.- Overrides:
setComposedType
in classItem
- Parameters:
type
- the new type of the item- Returns:
- the new version of this item - the new type may require a new jalo class type !!!
- Throws:
JaloInvalidParameterException
- in case the new type is not compatible with the current type. this happens a) if the type is abstract, b) the new type's class is not compatible with the current class, or c) if the new type has a different deployment (JNDI name, Table) than the current one
-
createEntryInformation
@Deprecated protected java.lang.String createEntryInformation(AbstractOrderEntry newEntry)
Deprecated.since 4.3 order entry info is set in prepare interceptor.Creates the info field text for a newly create entry of this order. This method could be overwritten in subtypes of AbstractOrder but it isnt useful anymore. With an entry in filelocal.properties
(orproject.properties
) you can define the text and attributes for each itemtype individually.
The entry in the property file is likeorderentry.infofield.your_type = your pattern with this ${attribute_of_your_type}
samples:
orderentry.infofield.product = product "${code}" with name "${name}"
generates in the info field the entryproduct "P000010" with name "bett"
orderentry.infofield.shirt = product ${code} in color ${color} and size ${size.code}
generates in the info field the entryproduct P000123 in color green and size m
For MyProduct, which is a subtyp from Product, the same pattern as product is used, not the pattern for shirt.
rules:
-orderentry.infofield.xxxxxx
<- all in lower case !
- if you want to use an attribute of a type where the type itself is an attribute of a type use all (path)attributes seperated with a dot (.). For example to use the unit iso code in MyVariantTyp use ${myVariantUnitAttributeName.unit.code}
If no pattern is defined, the product code is used in info field. Alternatively, override this method.- Parameters:
newEntry
- the newly created (and added) entry of this order- Returns:
- the text for the AbstractOrderEntry.info field
-
getAttributeValue
protected java.lang.Object getAttributeValue(Item item, java.lang.String qualifer) throws JaloSecurityException
- Throws:
JaloSecurityException
-
tryToFindFallbackLanguage
protected Language tryToFindFallbackLanguage(JaloSession js)
-
removeEntry
@Deprecated public void removeEntry(AbstractOrderEntry entry)
Deprecated.since ages - UseModelService
.remove() instead. All the remove logic is handled by dedicatedRemoveInterceptor
s. Removes an entry from this order. Since entries can per definition not exists without a containing order the entry object is permanently deleted, so be careful.- Parameters:
entry
-
-
removeEntries
@Deprecated protected void removeEntries(SessionContext ctx, java.util.Set<AbstractOrderEntry> entries)
Deprecated.since ages - UseModelService
.remove() instead. All the remove logic is handled by dedicatedRemoveInterceptor
s.
-
removeAllEntries
@Deprecated public void removeAllEntries()
Deprecated.since ages - UseModelService
.remove() instead. All the remove logic is handled by dedicatedRemoveInterceptor
s. Removes all entries from this order. Since entries can per definition not exists without a containing order they are permanently deleted. Please use this method with care.
-
setCode
public void setCode(java.lang.String code)
Sets the order code. Used for easier picking of orders without dealing with pk's. Besides code has no special meaning so you can map any information in it.- Overrides:
setCode
in classGeneratedAbstractOrder
- Parameters:
code
-
-
setCode
public void setCode(SessionContext ctx, java.lang.String code)
Sets the order code. Used for easier picking of orders without dealing with pk's. Besides code has no special meaning so you can map any information in it.- Overrides:
setCode
in classGeneratedAbstractOrder
- Parameters:
ctx
- can be used for cached access of 'code' value may be outdated!code
-
-
setDate
public void setDate(java.util.Date date)
Changes creation date of an order. This has no immediate affects on this orders informations, though a re-calculation might give varying prices, so use with care.- Overrides:
setDate
in classGeneratedAbstractOrder
- Parameters:
date
-
-
getDate
public java.util.Date getDate(SessionContext ctx)
The creation date of an order.- Overrides:
getDate
in classGeneratedAbstractOrder
- Parameters:
ctx
- can be used for cached access of 'date' value may be outdated!- Returns:
- the date
-
setDate
public void setDate(SessionContext ctx, java.util.Date date)
Changes creation date of an order. This has no immediate affects on this orders informations, though a re-calculation might give varying prices, so use with care.- Overrides:
setDate
in classGeneratedAbstractOrder
- Parameters:
ctx
- can be used for cached access of 'date' value may be outdated!date
-
-
setUser
public void setUser(User user)
Changes the user which this order belongs to. Please note that this results in a uncalculated order since pricing informations are user - specific and therefore not convertible.- Overrides:
setUser
in classGeneratedAbstractOrder
- Parameters:
user
-
-
setUser
public void setUser(SessionContext ctx, User user)
Changes the user which this order belongs to. Please note that this results in a uncalculated order since pricing informations are user - specific and therefore not convertible.- Overrides:
setUser
in classGeneratedAbstractOrder
- Parameters:
ctx
- can be used for cached access of the user object object may be outdated!user
-
-
setCurrency
public void setCurrency(Currency curr)
Changes the currency for all pricing informations of this order. Please not that this result in a uncalculated order since prices are currency - dependant and therefore not convertible.- Overrides:
setCurrency
in classGeneratedAbstractOrder
- Parameters:
curr
-
-
setCurrency
public void setCurrency(SessionContext ctx, Currency curr)
Changes the currency for all pricing informations of this order. Please not that this result in a uncalculated order since prices are currency - dependant and therefore not convertible.- Overrides:
setCurrency
in classGeneratedAbstractOrder
- Parameters:
ctx
- can be used for cached access of the currency object object may be outdated!curr
-
-
setStatus
public void setStatus(EnumerationValue status)
Changes the order status. Since status has no deeper meaning (from core view) the order remains unchanged.- Overrides:
setStatus
in classGeneratedAbstractOrder
- Parameters:
status
- the status of this order.
-
setStatus
public void setStatus(SessionContext ctx, EnumerationValue status)
Changes the order status. Since status has no deeper meaning (from core view) the order remains unchanged.- Overrides:
setStatus
in classGeneratedAbstractOrder
- Parameters:
ctx
- can be used for cached access of status value may be outdated!status
- the status of this order
-
setPaymentStatus
public void setPaymentStatus(EnumerationValue paymentStatus)
Changes the payment order status.- Overrides:
setPaymentStatus
in classGeneratedAbstractOrder
- Parameters:
paymentStatus
- the payment status of this order.
-
setPaymentStatus
public void setPaymentStatus(SessionContext ctx, EnumerationValue paymentStatus)
Changes the order payment status.- Overrides:
setPaymentStatus
in classGeneratedAbstractOrder
paymentStatus
- the paymentStatus
-
setDeliveryStatus
public void setDeliveryStatus(EnumerationValue deliveryStatus)
Changes the order delivery status.- Overrides:
setDeliveryStatus
in classGeneratedAbstractOrder
- Parameters:
deliveryStatus
- the delivery status of this order.
-
setDeliveryStatus
public void setDeliveryStatus(SessionContext ctx, EnumerationValue deliveryStatus)
Changes the order delivery status.- Overrides:
setDeliveryStatus
in classGeneratedAbstractOrder
deliveryStatus
- the deliveryStatus
-
isNet
public java.lang.Boolean isNet()
The gross / net status of this order. An order has generally to be seen as 'gross' or 'net'. All calculated prices depend on base prices which are either gross or net (including rounding if prices must be computed to fut gross - net status ).- Overrides:
isNet
in 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:
setNet
in classGeneratedAbstractOrder
- Parameters:
net
-
-
setNet
public void setNet(SessionContext ctx, boolean net)
Changes the gross / net status of this order. Please note that this result in an uncalculated order, since prices also depend on gross / net status. This is because of the fact that prices may be just kept in one form (e.g. 'net') and muste be converted (and of course rounded to the currencies correct digits) if the other one is requested (e.g. 'gross').- Overrides:
setNet
in classGeneratedAbstractOrder
- Parameters:
ctx
- can be used for cached access of net status value may be outdated!net
-
-
setDeliveryMode
public void setDeliveryMode(DeliveryMode mode)
Changes the chosen delivery mode for this order. Please note that this un-calculates this order, though all entries keep their calculation status.- Overrides:
setDeliveryMode
in classGeneratedAbstractOrder
- Parameters:
mode
-
-
setDeliveryMode
public void setDeliveryMode(SessionContext ctx, DeliveryMode mode)
Changes the chosen delivery mode for this order. Please note that this un-calculates this order, though all entries keep their calculation status.- Overrides:
setDeliveryMode
in classGeneratedAbstractOrder
- Parameters:
ctx
- can be used for cached access of delivery mode object object may be outdated!mode
-
-
setDeliveryAddress
public void setDeliveryAddress(Address address)
Changes the delivery address. This does not cause any other changes in the order.- Overrides:
setDeliveryAddress
in classGeneratedAbstractOrder
- Parameters:
address
-
-
createNewDeliveryAddress
public Address createNewDeliveryAddress()
creates a new address which is set as this orders delivery address.
-
createNewDeliveryAddress
public Address createNewDeliveryAddress(SessionContext ctx)
creates a new address which is set as this orders delivery address.
-
setDeliveryAddress
public void setDeliveryAddress(SessionContext ctx, Address address)
Changes the delivery address. This does not cause any other changes in the order.- Overrides:
setDeliveryAddress
in classGeneratedAbstractOrder
- Parameters:
ctx
- can be used for cached access of address object object may be outdated!address
-
-
doSetDeliveryAddress
protected void doSetDeliveryAddress(SessionContext ctx, Address newOne)
Performs changing of delivery address. In case the current address is a duplicate it will be removed.
-
getDeliveryCosts
public double getDeliveryCosts()
The calculated delivery costs of this order. Only valid ifisCalculated()
returnstrue
and/or it was set by your own using the methodsetDeliveryCosts(double)
.
-
setDeliveryCosts
public void setDeliveryCosts(double deliveryCost)
Sets The calculated delivery costs of this order.- Parameters:
deliveryCost
-
-
getDeliveryCosts
@Deprecated public double getDeliveryCosts(SessionContext ctx)
Deprecated.since ages - useGeneratedAbstractOrder.getDeliveryCostAsPrimitive(SessionContext)
insteadThe calculated delivery costs of this order. Only valid ifisCalculated()
returnstrue
and/or it was set by your own using the methodsetDeliveryCosts(SessionContext, double)
.
-
setDeliveryCosts
@Deprecated public void setDeliveryCosts(SessionContext ctx, double deliveryCost)
Deprecated.since ages - useGeneratedAbstractOrder.setDeliveryCost(double)
insteadSets The calculated delivery costs of this order.- Parameters:
ctx
-deliveryCost
-
-
setDeliveryCost
public void setDeliveryCost(SessionContext ctx, java.lang.Double value)
Description copied from class:GeneratedAbstractOrder
Generated method - Setter of theAbstractOrder.deliveryCost
attribute.- Overrides:
setDeliveryCost
in classGeneratedAbstractOrder
value
- the deliveryCost
-
setPaymentMode
public void setPaymentMode(PaymentMode mode)
Changes the payment mode of this order. Please note that this results in an uncalculated order, though all entries keep their calculation status.- Overrides:
setPaymentMode
in classGeneratedAbstractOrder
- Parameters:
mode
-
-
setPaymentMode
public void setPaymentMode(SessionContext ctx, PaymentMode mode)
Changes the payment mode of this order. Please note that this results in an uncalculated order, though all entries keep their calculation status.- Overrides:
setPaymentMode
in classGeneratedAbstractOrder
- Parameters:
ctx
- can be used for cached access object may be outdated!mode
-
-
setPaymentAddress
public void setPaymentAddress(Address adr)
Changes the payment address of this order. This does not cause any other changes in the order.- Overrides:
setPaymentAddress
in classGeneratedAbstractOrder
- Parameters:
adr
-
-
createNewPaymentAddress
public Address createNewPaymentAddress()
creates a new address which is set as this orders payment address.
-
createNewPaymentAddress
public Address createNewPaymentAddress(SessionContext ctx)
creates a new address which is set as this orders payment address.
-
setPaymentAddress
public void setPaymentAddress(SessionContext ctx, Address adr)
Changes the payment address of this order. This does not cause any other changes in the order.- Overrides:
setPaymentAddress
in classGeneratedAbstractOrder
- Parameters:
ctx
- can be used for cached access object may be outdated!adr
-
-
doSetPaymentAddress
protected void doSetPaymentAddress(SessionContext ctx, Address newOne)
Performs changing of payment address. In case the current address is a duplicate it will be removed.
-
getPaymentCosts
public double getPaymentCosts()
The calculated costs according to the chosen payment mode.
-
setPaymentCosts
public void setPaymentCosts(double paymentCost)
Sets the costs of the chosen payment mode.- Parameters:
paymentCost
-
-
getPaymentCosts
@Deprecated public double getPaymentCosts(SessionContext ctx)
Deprecated.since ages - useGeneratedAbstractOrder.getPaymentCost(SessionContext)
insteadThe calculated costs according to the chosen payment mode.
-
setPaymentCosts
@Deprecated public void setPaymentCosts(SessionContext ctx, double paymentCost)
Deprecated.since ages - useGeneratedAbstractOrder.setPaymentCost(SessionContext, double)
insteadSets the costs of the chosen payment mode.- Parameters:
ctx
-paymentCost
-
-
setPaymentCost
public void setPaymentCost(SessionContext ctx, java.lang.Double value)
Description copied from class:GeneratedAbstractOrder
Generated method - Setter of theAbstractOrder.paymentCost
attribute.- Overrides:
setPaymentCost
in classGeneratedAbstractOrder
value
- the paymentCost
-
getTotalTax
public java.lang.Double getTotalTax()
The calculated total tax amount of this order. This is the sum of all taxes accessible viagetTotalTaxValues()
.- Overrides:
getTotalTax
in classGeneratedAbstractOrder
- Returns:
- the totalTax
-
getTotal
@Deprecated public double getTotal()
Deprecated.since ages - useGeneratedAbstractOrder.getTotalPriceAsPrimitive()
insteadThe calculated total price of this order. Depending on gross / net status this may include taxes or not.
-
setTotal
public void setTotal(double total)
Sets the calculated total price of this order. please note that this field is overwritten each timecalculate()
,calculate(Date)
,recalculate()
,recalculate(Date)
orcalculateTotals(boolean)
is called.- Parameters:
total
-
-
getTotal
@Deprecated public double getTotal(SessionContext ctx)
Deprecated.since ages - useGeneratedAbstractOrder.getTotalPriceAsPrimitive(SessionContext)
insteadThe calculated total price of this order. Depending on gross / net status this may include taxes or not.
-
setTotal
@Deprecated public void setTotal(SessionContext ctx, double price)
Deprecated.since ages - useGeneratedAbstractOrder.setTotalPrice(SessionContext, double)
insteadSets the calculated total price of this order. please note that this field is overwritten each timecalculate()
,calculate(Date)
,recalculate()
,recalculate(Date)
orcalculateTotals(boolean)
is called.- Parameters:
ctx
-price
-
-
addTotalTaxValue
@Deprecated public void addTotalTaxValue(TaxValue taxValue)
Deprecated.since ages - Use OrderService.addTotalTaxValue(de.hybris.platform.core.model.order.AbstractOrderModel, TaxValue) instead.Adds a tax value into this order. please note that this field is overwritten each timecalculate()
,calculate(Date)
,recalculate()
,recalculate(Date)
orcalculateTotals(boolean)
is called.- Parameters:
taxValue
-
-
addAllTotalTaxValues
@Deprecated public void addAllTotalTaxValues(java.util.Collection values)
Deprecated.since ages - Use OrderService.addAllTotalTaxValues(de.hybris.platform.core.model.order.AbstractOrderModel, List) instead.Adds a collection of tax values into this order. please note that this field is overwritten each timecalculate()
,calculate(Date)
,recalculate()
,recalculate(Date)
orcalculateTotals(boolean)
is called.- Parameters:
values
-
-
removeTotalTaxValue
@Deprecated public void removeTotalTaxValue(TaxValue taxValue)
Deprecated.since ages - Use OrderService.removeTotalTaxValue(de.hybris.platform.core.model.order.AbstractOrderModel, TaxValue) instead.Removes a tax value of this order. please note that this field is overwritten each timecalculate()
,calculate(Date)
,recalculate()
,recalculate(Date)
orcalculateTotals(boolean)
is called.- Parameters:
taxValue
-
-
removeAllTotalTaxValues
@Deprecated public void removeAllTotalTaxValues()
Deprecated.since ages - Use model setter AbstractOrderModel.setTotalTaxValues(Collection) and ModelService.save() method instead.Removes all tax values of this order. please note that this field is overwritten each timecalculate()
,calculate(Date)
,recalculate()
,recalculate(Date)
orcalculateTotals(boolean)
is called.
-
getTotalTaxValues
@Deprecated public java.util.Collection getTotalTaxValues()
Deprecated.since ages - Use model getter AbstractOrderModel.getTotalTaxValues() instead.Returns all tax values ( seeTaxValue
) of this order. These values represent the grouped taxes of all entries.
-
getTotalTaxValues
@Deprecated public java.util.Collection getTotalTaxValues(SessionContext ctx)
Deprecated.since ages - Use model getter AbstractOrderModel.getTotalTaxValues() instead.Returns all tax values ( seeTaxValue
) of this order. These values represent the grouped taxes of all entries.
-
addTotalTaxValue
@Deprecated public void addTotalTaxValue(SessionContext ctx, TaxValue taxValue)
Deprecated.since ages - Use OrderService.addTotalTaxValue(de.hybris.platform.core.model.order.AbstractOrderModel, TaxValue) instead.Adds a tax value to this order. please note that this field is overwritten each timecalculate()
,calculate(Date)
,recalculate()
,recalculate(Date)
orcalculateTotals(boolean)
is called.- Parameters:
taxValue
-
-
addAllTotalTaxValues
@Deprecated public void addAllTotalTaxValues(SessionContext ctx, java.util.Collection values)
Deprecated.since ages - Use OrderService.addAllTotalTaxValues(de.hybris.platform.core.model.order.AbstractOrderModel, List) instead.Adds a collection of tax values into this order. please note that this field is overwritten each timecalculate()
,calculate(Date)
,recalculate()
,recalculate(Date)
orcalculateTotals(boolean)
is called.- Parameters:
values
-
-
removeTotalTaxValue
@Deprecated public void removeTotalTaxValue(SessionContext ctx, TaxValue taxValue)
Deprecated.since ages - Use OrderService.removeTotalTaxValue(de.hybris.platform.core.model.order.AbstractOrderModel, TaxValue) instead.Removes a tax value of this order. please note that this field is overwritten each timecalculate()
,calculate(Date)
,recalculate()
,recalculate(Date)
orcalculateTotals(boolean)
is called.- Parameters:
taxValue
-
-
removeAllTotalTaxValues
@Deprecated public void removeAllTotalTaxValues(SessionContext ctx)
Deprecated.since ages - Use model setter AbstractOrderModel.setTotalTaxValues(Collection) and ModelService.save() method instead.Removes all tax values of this order. please note that this field is overwritten each timecalculate()
,calculate(Date)
,recalculate()
,recalculate(Date)
orcalculateTotals(boolean)
is called.
-
setTotalTaxValues
@Deprecated public void setTotalTaxValues(java.util.Collection totalTaxValues)
Deprecated.since ages - Use model setter AbstractOrderModel.setTotalTaxValues(Collection) and ModelService.save() method instead.
-
setTotalTaxValues
@Deprecated public void setTotalTaxValues(SessionContext ctx, java.util.Collection totalTaxValues)
Deprecated.since ages - Use model setter AbstractOrderModel.setTotalTaxValues(Collection) and ModelService.save() method instead.
-
addGlobalDiscountValue
@Deprecated public void addGlobalDiscountValue(DiscountValue discountValue)
Deprecated.since ages - Use OrderService.addGlobalDiscountValue(de.hybris.platform.core.model.order.AbstractOrderModel, DiscountValue) instead.Adds a global discount value into this order.- Parameters:
discountValue
-
-
addAllGlobalDiscountValues
@Deprecated public void addAllGlobalDiscountValues(java.util.Collection values)
Deprecated.since ages - Use OrderService.addAllGlobalDiscountValues(de.hybris.platform.core.model.order.AbstractOrderModel, List) instead.Adds a collection of global discount values into this order.- Parameters:
values
-
-
removeGlobalDiscountValue
@Deprecated public void removeGlobalDiscountValue(DiscountValue discountValue)
Deprecated.since ages - Use OrderService.removeGlobalDiscountValue(de.hybris.platform.core.model.order.AbstractOrderModel, DiscountValue) instead.Removes a global discount value of this order.- Parameters:
discountValue
-
-
removeAllGlobalDiscountValues
@Deprecated public void removeAllGlobalDiscountValues()
Deprecated.since ages - Use model setter AbstractOrderModel.setGlobalDiscountValues(List) and ModelService.save() method instead.Removes all global discount values of this order.
-
getGlobalDiscountValues
@Deprecated public java.util.List getGlobalDiscountValues()
Deprecated.since ages - Use model getter AbstractOrderModel.getGlobalDiscountValues() instead.Returns a list of all global discount values (this are discount which are applied to on order level instead of entry level). Since this might include absolute discounts the order is important, so we chose a List.
-
getGlobalDiscountValues
@Deprecated public java.util.List getGlobalDiscountValues(SessionContext ctx)
Deprecated.since ages - Use model getter AbstractOrderModel.getGlobalDiscountValues() instead.Returns a list of all global discount values (this are discount which are applied to on order level instead of entry level). Since this might include absolute discounts the order is important, so we chose a List.
-
addGlobalDiscountValue
@Deprecated public void addGlobalDiscountValue(SessionContext ctx, DiscountValue discountValue)
Deprecated.since ages - Use OrderService.addGlobalDiscountValue(de.hybris.platform.core.model.order.AbstractOrderModel, DiscountValue) instead.Adds a global discount value to this order.- Parameters:
discountValue
-
-
addAllGlobalDiscountValues
@Deprecated public void addAllGlobalDiscountValues(SessionContext ctx, java.util.Collection values)
Deprecated.since ages - Use OrderService.addAllGlobalDiscountValues(de.hybris.platform.core.model.order.AbstractOrderModel, List) instead.Adds a collection of global discount values into this order.- Parameters:
values
-
-
removeGlobalDiscountValue
@Deprecated public void removeGlobalDiscountValue(SessionContext ctx, DiscountValue discountValue)
Deprecated.since ages - Use OrderService.removeGlobalDiscountValue(de.hybris.platform.core.model.order.AbstractOrderModel, DiscountValue) instead.Removes a global discount value of this order.- Parameters:
discountValue
-
-
removeAllGlobalDiscountValues
@Deprecated public void removeAllGlobalDiscountValues(SessionContext ctx)
Deprecated.since ages - Use model setter AbstractOrderModel.setGlobalDiscountValues(List) and ModelService.save() method instead.Removes all global discount values of this order.
-
setGlobalDiscountValues
@Deprecated public void setGlobalDiscountValues(java.util.List globalDiscounts)
Deprecated.since ages - Use model setter AbstractOrderModel.setGlobalDiscountValues(List) and ModelService.save() method instead.
-
setGlobalDiscountValues
@Deprecated public void setGlobalDiscountValues(SessionContext ctx, java.util.List globalDiscounts)
Deprecated.since ages - Use model setter AbstractOrderModel.setGlobalDiscountValues(List) and ModelService.save() method instead.
-
isCalculated
public java.lang.Boolean isCalculated()
Shows if this order was calculated before. All calculated fields are only valid if this metho returnstrue
.- Overrides:
isCalculated
in classGeneratedAbstractOrder
- Returns:
- the calculated
- See Also:
calculate()
,calculate(Date)
,recalculate()
,recalculate(Date)
,calculateTotals(boolean)
-
isCalculated
public java.lang.Boolean isCalculated(SessionContext ctx)
Shows if this order was calculated before. All calculated fields are only valid if this metho returnstrue
.- Overrides:
isCalculated
in classGeneratedAbstractOrder
- Returns:
- the calculated
- See Also:
calculate()
,calculate(Date)
,recalculate()
,recalculate(Date)
,calculateTotals(boolean)
-
discountsIncludePaymentCosts
@Deprecated public boolean discountsIncludePaymentCosts()
Deprecated.since ages - useGeneratedAbstractOrder.isDiscountsIncludePaymentCostAsPrimitive()
insteadtells whether payment costs should be included in discount calculation or not. in other words: if this field is true payment costs are changed the same way as product costs if discount values are set at this order.
-
setDiscountsIncludePaymentCosts
@Deprecated public void setDiscountsIncludePaymentCosts(boolean includes)
Deprecated.since ages - usesetDiscountsIncludePaymentCosts(boolean)
insteadchanges whether payment costs should be included in discount calculation or not. in other words: if this field is true payment costs are changed the same way as product costs if discount values are set at this order.
-
setDiscountsIncludePaymentCost
public void setDiscountsIncludePaymentCost(SessionContext ctx, java.lang.Boolean value)
Description copied from class:GeneratedAbstractOrder
Generated method - Setter of theAbstractOrder.discountsIncludePaymentCost
attribute.- Overrides:
setDiscountsIncludePaymentCost
in classGeneratedAbstractOrder
value
- the discountsIncludePaymentCost - Tells whether payment costs should be included in discount calculation or not. If this field is true payment costs are changed the same way as product costs if discount values are set at this order.
-
discountsIncludeDeliveryCosts
@Deprecated public boolean discountsIncludeDeliveryCosts()
Deprecated.since ages - useGeneratedAbstractOrder.isDiscountsIncludePaymentCostAsPrimitive()
insteadtells whether delivery costs should be included in discount calculation or not. in other words: if this field is true delivery costs are changed the same way as product costs if discount values are set at this order.
-
setDiscountsIncludeDeliveryCosts
@Deprecated public void setDiscountsIncludeDeliveryCosts(boolean includes)
Deprecated.since ages - useGeneratedAbstractOrder.setDiscountsIncludeDeliveryCost(boolean)
insteadchanges whether delivery costs should be included in discount calculation or not. in other words: if this field is true delivery costs are changed the same way as product costs if discount values are set at this order.
-
setDiscountsIncludeDeliveryCost
public void setDiscountsIncludeDeliveryCost(SessionContext ctx, java.lang.Boolean value)
Description copied from class:GeneratedAbstractOrder
Generated method - Setter of theAbstractOrder.discountsIncludeDeliveryCost
attribute.- Overrides:
setDiscountsIncludeDeliveryCost
in classGeneratedAbstractOrder
value
- the discountsIncludeDeliveryCost - Tells whether delivery costs should be included in discount calculation or not. If this field is true delivery costs are changed the same way as product costs if discount values are set at this order.
-
calculateEntries
protected void calculateEntries() throws JaloPriceFactoryException
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
protected void recalculateEntries() throws JaloPriceFactoryException
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
protected PriceValue findPaymentCosts() throws JaloPriceFactoryException
called duringcalculate()
,calculate(Date)
,recalculate()
andrecalculate(Date)
to fetch and set the payment costs for this order.as default this method calls
PaymentMode.getCost(AbstractOrder)
when a payment mode was set. you may override this method to implement different behavior. please note that at this time no order total have been set ( except the order total which holds the entry total sum )so dont rely on these values.- Returns:
- the payment costs of this abstract order
- Throws:
JaloPriceFactoryException
-
findDeliveryCosts
protected PriceValue findDeliveryCosts() throws JaloPriceFactoryException
Called duringcalculate()
,calculate(Date)
,recalculate()
andrecalculate(Date)
to fetch and set the delivery cost for this order.As default this method calls
DefaultDeliveryCostsStrategy.findDeliveryCosts(de.hybris.platform.jalo.SessionContext, de.hybris.platform.jalo.order.AbstractOrder)
when a delivery mode was set. You may override this method to implement different behavior. Please note that at this time no order total have been set (Except the order total which holds the entry total sum) so dont rely on these values. You may replace this strtegy by configuirng your spring.xml accordingly See: Configuration: core-spring.xmlbean id="core.orderManager" class="de.hybris.platform.jalo.order.OrderManager" scope="tenant"> <property name="deliveryCostsStrategy" ref="core.deliverycostsstrategy.default"/> /bean>
- Returns:
- the delivery costs of this abstract order
- Throws:
JaloPriceFactoryException
-
findGlobalDiscounts
protected java.util.List findGlobalDiscounts() throws JaloPriceFactoryException
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 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, java.util.Map<TaxValue,java.util.Map<java.util.Set<TaxValue>,java.lang.Double>> taxValueMap) throws JaloPriceFactoryException
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
public java.lang.Double getTotalDiscounts()
returns the sum of all discounts of this (calculated) order.- Overrides:
getTotalDiscounts
in classGeneratedAbstractOrder
- Returns:
- the totalDiscounts
-
calculateSubtotal
protected java.util.Map<TaxValue,java.util.Map<java.util.Set<TaxValue>,java.lang.Double>> calculateSubtotal(boolean recalculate)
Calculates this order's subtotal and returns a total tax value map.The map groups entry totals per applied tax values. This is necessary to support multiple (relative) taxes per entry:
One example
entry 1: base price = 10 EUR, tax values = [ VAT_FULL 19%, CUSTOM 2% ] entry 2: base price = 20 EUR, tax values = [ VAT_FULL 19% ] entry 3: base price = 30 EUR, tax values = [ VAT_HALF 7% ] ==> { VAT_FULL 19% -> { ( VAT_FULL 19% , CUSTOM 2% ) -> 10 EUR ( VAT_FULL 19% ) -> 20 EUR } VAT_HALF 7% -> { ( VAT_HALF 7% ) -> 30 EUR } CUSTOM 2% -> { ( VAT_FULL 19% , CUSTOM 2% ) -> 10 EUR } }
- Parameters:
recalculate
-- Returns:
- a map holding { TaxValue -> Double( sum of entries with this tax value ) }, means these are the total tax values mapped to the total price they apply to
-
addRelativeEntryTaxValue
protected void addRelativeEntryTaxValue(double entryTotal, TaxValue taxValue, java.util.Set<TaxValue> relativeEntryTaxValues, java.util.Map<TaxValue,java.util.Map<java.util.Set<TaxValue>,java.lang.Double>> taxValueMap)
-
addAbsoluteEntryTaxValue
protected void addAbsoluteEntryTaxValue(long entryQuantity, TaxValue taxValue, java.util.Map<TaxValue,java.util.Map<java.util.Set<TaxValue>,java.lang.Double>> taxValueMap)
-
calculateDiscountValues
protected double calculateDiscountValues(boolean recalculate)
Returns the total discount for this abstract order.- Parameters:
recalculate
-true
forces a recalculation- Returns:
- totalDiscounts
-
convertDiscountValues
protected java.util.List convertDiscountValues(java.util.List dvs)
-
calculateTotalTaxValues
protected double calculateTotalTaxValues(boolean recalculate, int digits, double taxAdjustmentFactor, java.util.Map<TaxValue,java.util.Map<java.util.Set<TaxValue>,java.lang.Double>> taxValueMap)
- Parameters:
recalculate
-digits
-taxAdjustmentFactor
-taxValueMap
-- Returns:
- total taxes
-
calculateAbsoluteTotalTaxValue
protected TaxValue calculateAbsoluteTotalTaxValue(Currency curr, java.lang.String currencyIso, int digits, boolean net, TaxValue taxValue, double cumulatedEntryQuantities)
-
calculate
@Deprecated public void calculate() throws JaloPriceFactoryException
Deprecated.since ages - Use CalculationService.calculate(de.hybris.platform.core.model.order.AbstractOrderModel) instead.Calculates the whole order and all its entries unless they're already calculated and the order has not been modified.So this method will fetch prices, taxes and discounts for uncalculated or modified entries only - all other will remain unchanged. If at least one entry has been calculated or the order itself has been modified the totals will be calculated as well.
if you merely like to adjust totals while keeping prices, taxes and discounts you should call
calculateTotals(boolean)
instead (e.g. if just a quantity has changed or prices have been imported and cannot be found via price factory ).- Throws:
JaloPriceFactoryException
- if a pricefactory error occured
-
notifyDiscountsAboutCalculation
protected void notifyDiscountsAboutCalculation()
-
notifyDiscountsAboutRemoval
protected void notifyDiscountsAboutRemoval()
-
resetAllValues
protected java.util.Map resetAllValues() throws JaloPriceFactoryException
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(java.util.Collection<TaxValue> relativeTaxValues) throws JaloPriceFactoryException
- Throws:
JaloPriceFactoryException
-
calculate
@Deprecated public void calculate(java.util.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 public void recalculate() throws JaloPriceFactoryException
Deprecated.since ages - Use CalculationService#recalculate(de.hybris.platform.core.model.order.AbstractOrderModel) instead.recalculates the whole order and all its entries. this includes finding prices, taxes, discounts, payment and delivery costs by calling the currently installed price factory.if you merely like to adjust totals while keeping prices, taxes and discounts you should call
calculateTotals(boolean)
instead (e.g. if just a quantity has changed or prices have been imported and cannot be found via price factory ).- Throws:
JaloPriceFactoryException
- if a pricefactory error occured
-
recalculate
@Deprecated public void recalculate(java.util.Date date) throws 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 public void addDiscount(Discount discount)
Deprecated.since ages - useGeneratedAbstractOrder.addToDiscounts(Discount)
Assigns a discount to this order. These discounts are involved in order (re)calculation by fetching avalue
viaDiscount.getDiscountValue(AbstractOrder)
. Unlike all calculated values the discount collection is not cleared by (re)calculation !- Parameters:
discount
- the discount to assign
-
removeDiscount
@Deprecated public void removeDiscount(Discount discount)
Deprecated.since ages - useGeneratedAbstractOrder.removeFromDiscounts(Discount)
Unassigns a discount from this order. These discounts are involved in order (re)calculation by fetching avalue
viaDiscount.getDiscountValue(AbstractOrder)
. Unlike all calculated values the discount collection is not cleared by (re)calculation !- Parameters:
discount
- the discount to unassign
-
setChanged
protected void setChanged(boolean entriesToo)
-
remove
public void remove(SessionContext ctx) throws ConsistencyCheckException
Description copied from class:Item
Removes 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:
remove
in classItem
- Parameters:
ctx
- A SessionContext object- Throws:
ConsistencyCheckException
- if this item could not be removed for some reason
-
setEntries
public void setEntries(java.util.List<AbstractOrderEntry> value)
Description copied from class:GeneratedAbstractOrder
Generated method - Setter of theAbstractOrder.entries
attribute.- Overrides:
setEntries
in classGeneratedAbstractOrder
- Parameters:
value
- the entries
-
setEntries
public void setEntries(SessionContext ctx, java.util.List<AbstractOrderEntry> value)
Description copied from class:GeneratedAbstractOrder
Generated method - Setter of theAbstractOrder.entries
attribute.- Overrides:
setEntries
in classGeneratedAbstractOrder
value
- the entries
-
-