Interface SalesDocument
- All Superinterfaces:
BusinessObject,Iterable<Item>,MessageListHolder,SalesDocumentBase<ItemList,,Item, Header> Serializable,SimpleDocument<ItemList,Item, Header>
- All Known Implementing Classes:
BasketImpl,OrderHistoryImpl,OrderImpl,SalesDocumentImpl
Common interface representing sales documents like Basket or Order
-
Field Summary
Fields inherited from interface de.hybris.platform.sap.core.common.message.MessageListHolder
INVALID, VALIDFields inherited from interface de.hybris.platform.sap.sapordermgmtbol.transaction.businessobject.interf.SalesDocumentBase
NO_OF_ITEMS_UNKNOWN -
Method Summary
Modifier and TypeMethodDescriptionvoidReleases all configuration sessions attached to this sales documentvoidRemoves all buffered item informationvoidClears the list of the shipTo.Creates a new billTo objectGets a new Item objectCreates a new ship objectvoidDestroy the data of the document (items and header) in the backend representation.Returns the type of the sales document (e.g.Returns the transaction configuration.booleanhasPredecessorOfSpecificType(DocumentType docType) Scans list of predecessors for given document type.voidinit(PartnerList partnerList) Initializes the sales document with the given arguments and creates and instance in back-end application memory.voidinit(SalesDocument posd, String processType) Initializes an empty instance of this object with the data coming from the provided document.booleanbooleanDoes the document require that the items are checked against the catalog?booleanChecks if the document exists in the backend storagebooleanIndicates whether or not the order has to be maintained as an external document to this one.booleanIndicates whether or not the sales document can provide the Gross value.booleanDoes the document carry an initialization error?booleanChecks if availability is compiled only based on item information.booleanReturns if multiple addresses are supportedbooleanIndicates whether or not the sales document can provide a net value.booleanCheck whether its required to Update the objectvoidread()Reads the sales document.voidread(boolean force) Reads the sales document.voidReads the sales document for update (tried to get a lock).voidreadForUpdate(boolean force) Reads the sales document for update (tried to get a lock).voidremoveItem(Item item) Removes the item.voidremoveItems(TechKey[] techKeys) Deletes items from the sales document.booleanSave the sales document and commit it in the backend.voidsetBillToList(List<BillTo> billToList) Sets BillTo listvoidsetCheckCatalogNecessary(boolean checkCatalogNecessary) Indicates whether a check of the items against the catalog is requiredvoidsetConverter(Converter converter) voidsetExternalToOrder(boolean isExternalToOrder) Sets whether or not the order has to be maintained as an external document to this one.voidsetGrossValueAvailable(boolean grossValueAvailable) Sets the property grossValueAvailablevoidsetInitialized(boolean b) Indicates whether a sales document could be initializedvoidsetNetValueAvailable(boolean netValueAvailable) Sets the property netValueAvailablevoidsetShipToList(List<ShipTo> shipToList) Sets shipTo listvoidsetSoldToGuid(TechKey techKeySoldTo, String soldToId) voidThe transaction configuration provides access to sales-specific settings (e.g.voidsetUpdateMissing(boolean updateMissing) Sets whether update before save is required.voidupdate()Update the sales document in the backend.voidvalidate()Validates as sales document.Methods inherited from interface de.hybris.platform.sap.core.bol.businessobject.BusinessObject
addExtensionData, clearMessages, clearOwnMessages, copyMessages, copyMessages, createUniqueHandle, destroy, getExtensionData, getExtensionDataValues, getExtensionMap, getHandle, getOwnMessageList, getSubObjectIterator, getTechKey, hasHandle, hasMessages, hasOwnMessages, init, isValid, logMessage, removeExtensionData, removeExtensionDataValues, setExtensionMap, setHandle, setInvalid, setTechKey, setValidMethods inherited from interface java.lang.Iterable
forEach, iterator, spliteratorMethods inherited from interface de.hybris.platform.sap.core.common.message.MessageListHolder
addMessage, clearMessages, getMessageListMethods inherited from interface de.hybris.platform.sap.sapordermgmtbol.transaction.businessobject.interf.SalesDocumentBase
getAlternativeBillTos, getAlternativeShipTos, isChangeHeaderOnly, isDeterminationRequired, isPersistentInBackend, setDeterminationRequired, setPersistentInBackendMethods inherited from interface de.hybris.platform.sap.sapordermgmtbol.transaction.businessobject.interf.SimpleDocument
addItem, clear, clearHeader, clearItems, getApplicationId, getChangeDate, getHeader, getItem, getItemList, getSoldToGuid, getTypedExtensionMap, getVersion, isDirty, setApplicationId, setChangeDate, setDirty, setHeader, setItemList, setSoldToGuid, setVersion
-
Method Details
-
clearShipTos
void clearShipTos()Clears the list of the shipTo. -
createBillTo
BillTo createBillTo()Creates a new billTo object- Returns:
- Newly created billTo
-
createShipTo
ShipTo createShipTo()Creates a new ship object- Returns:
- Newly created shipTo
-
removeItems
Deletes items from the sales document.- Parameters:
techKeys- Technical keys of the items to be canceld- Throws:
CommunicationException- in case back-end error
-
destroyContent
Destroy the data of the document (items and header) in the backend representation. After a call to this method, the object is in an undefined state. You have to call init() before you can use it again.
This method is normally called before removing the BO-representation of the object using the BOM.- Throws:
CommunicationException- in case back-end error
-
getDocumentType
Returns the type of the sales document (e.g. Order, Basket)- Returns:
- type of sales document
- Throws:
CommunicationException- in case back-end error
-
getTransactionConfiguration
TransactionConfiguration getTransactionConfiguration()Returns the transaction configuration. The transaction configuration provides access to sales-specific settings (e.g. sales organisation)- Returns:
- TransactionConfiguration to access the sales-related configuration
-
init
Initializes the sales document with the given arguments and creates and instance in back-end application memory.- Parameters:
partnerList- any partners maintained will be added to the sales document in the same partner function- Throws:
CommunicationException- in case back-end error
-
init
Initializes an empty instance of this object with the data coming from the provided document. The former state of this document is dropped and lost, the fields of the other document are copied into the fields of this document. To do this the clone() method of the fields is used to get an shallow copy and minimise interference between the new and the old object. The creation date of the old document is not copied to the new one but the original date is left as it is. A back-end representation of the new object is created and filled with the data retrieved by the copy operation.- Parameters:
posd- The SalesDocument to retrieve data fromprocessType- process type for the new SalesDocument (optional)- Throws:
BusinessObjectException- in case back-end error
-
isExistingInBackend
boolean isExistingInBackend()Checks if the document exists in the backend storage- Returns:
- does the document exist in backend?
-
isExternalToOrder
boolean isExternalToOrder()Indicates whether or not the order has to be maintained as an external document to this one. (e.g. java basket is external to crm backend order)- Returns:
- true indicates that the order is maintained external to this document, false indicates that the order lies on the same system.
-
isGrossValueAvailable
boolean isGrossValueAvailable()Indicates whether or not the sales document can provide the Gross value.- Returns:
- true indicates that the sales document can provide the gross value. false indicates that the sales document can not deliver the gross value.
-
isMultipleAddressesSupported
Returns if multiple addresses are supported- Returns:
- multiple addresses supported
- Throws:
BusinessObjectException- in case back-end error
-
isNetValueAvailable
boolean isNetValueAvailable()Indicates whether or not the sales document can provide a net value.- Returns:
- true indicates that the sales document can provide the net value false indicates that the sales document can not deliver the net value.
-
read
Reads the sales document. The backend call happens only if necessary.- Throws:
CommunicationException- in case back-end error
-
read
Reads the sales document. The backend call happens if considered as necessary or if forced.- Parameters:
force- If true, then read even if not considered as necessary- Throws:
CommunicationException- in case back-end error
-
readForUpdate
Reads the sales document for update (tried to get a lock). The backend call happens only if necessary.- Throws:
CommunicationException- in case back-end error
-
readForUpdate
Reads the sales document for update (tried to get a lock). The backend call happens if considered as necessary or if forced.- Parameters:
force- If true, then read even if not considered as necessary- Throws:
CommunicationException- in case back-end error
-
removeItem
Removes the item.- Parameters:
item- to remove- Throws:
CommunicationException- in case back-end error
-
saveAndCommit
Save the sales document and commit it in the backend. If successful, locks in backend are released- Returns:
- true if the save and commit was successful
- Throws:
BusinessObjectException- in case back-end error
-
setExternalToOrder
void setExternalToOrder(boolean isExternalToOrder) Sets whether or not the order has to be maintained as an external document to this one. (e.g. a java basket is an external document to crm backend order)- Parameters:
isExternalToOrder- true indicates that the order is maintained external to this document, false indicates that the order lies on the same system.
-
setGrossValueAvailable
void setGrossValueAvailable(boolean grossValueAvailable) Sets the property grossValueAvailable- Parameters:
grossValueAvailable- true indicates that the sales document can provide the gross valuefalseindicates that the sales document can not provide the gross value.
-
setNetValueAvailable
void setNetValueAvailable(boolean netValueAvailable) Sets the property netValueAvailable- Parameters:
netValueAvailable- true indicates that the sales document can deliver the net value false indicates that the sales document can not deliver the net value.
-
setShipToList
Sets shipTo list- Parameters:
shipToList- list of ShipTo's
-
setBillToList
Sets BillTo list- Parameters:
billToList- list of BillTo's
-
setTransactionConfiguration
The transaction configuration provides access to sales-specific settings (e.g. sales organisation)- Parameters:
transConf- API to access the configuration and documents
-
setUpdateMissing
void setUpdateMissing(boolean updateMissing) Sets whether update before save is required. Has to be set to true for initial objects to ensure that update is called at least once before save.- Parameters:
updateMissing- set totrueto force an update before next save
-
isUpdateMissing
boolean isUpdateMissing()Check whether its required to Update the object- Returns:
true, only if the object has to be updated
-
update
Update the sales document in the backend. The method also checks for changes in the businesspartner list- Throws:
CommunicationException- in case back-end error
-
createItem
Item createItem()Gets a new Item object- Specified by:
createItemin interfaceSimpleDocument<ItemList,Item, Header> - Returns:
- new item instance
- See Also:
-
setSoldToGuid
- Parameters:
techKeySoldTo- the guid of the soldtosoldToId- the partner id of the soldto
-
clearItemBuffer
void clearItemBuffer()Removes all buffered item information -
hasPredecessorOfSpecificType
Scans list of predecessors for given document type.- Parameters:
docType- to be searched for in predecessors- Returns:
- true if predecessor list contains given doc type
-
setInitialized
void setInitialized(boolean b) Indicates whether a sales document could be initialized- Parameters:
b- true if initialization was not possible
-
isInitialized
boolean isInitialized()Does the document carry an initialization error?- Returns:
- true if initialization was not possible
-
isCheckCatalogNecessary
boolean isCheckCatalogNecessary()Does the document require that the items are checked against the catalog?- Returns:
- true if check is required
-
setCheckCatalogNecessary
void setCheckCatalogNecessary(boolean checkCatalogNecessary) Indicates whether a check of the items against the catalog is required- Parameters:
checkCatalogNecessary- if check is required
-
isItemBasedAvailability
boolean isItemBasedAvailability()Checks if availability is compiled only based on item information.- Returns:
- Availability is compiled only based item on information?
-
setConverter
- Parameters:
converter- access object for unit related conversions
-
validate
Validates as sales document. Afterwards, all messages are available as part of the message list- Throws:
CommunicationException
-
afterDeleteItemInBackend
void afterDeleteItemInBackend()Releases all configuration sessions attached to this sales document -
isBackendDown
boolean isBackendDown()- Returns:
- Is back end down for a planned downtime?
-