Interface SalesDocument
-
- All Superinterfaces:
BusinessObject,java.lang.Iterable<Item>,MessageListHolder,SalesDocumentBase<ItemList,Item,Header>,java.io.Serializable,SimpleDocument<ItemList,Item,Header>
- All Known Implementing Classes:
BasketImpl,OrderHistoryImpl,OrderImpl,SalesDocumentImpl
public interface SalesDocument extends SalesDocumentBase<ItemList,Item,Header>
Common interface representing sales documents like Basket or Order
-
-
Field Summary
-
Fields inherited from interface de.hybris.platform.sap.core.common.message.MessageListHolder
INVALID, VALID
-
Fields inherited from interface de.hybris.platform.sap.sapordermgmtbol.transaction.businessobject.interf.SalesDocumentBase
NO_OF_ITEMS_UNKNOWN
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidafterDeleteItemInBackend()Releases all configuration sessions attached to this sales documentvoidclearItemBuffer()Removes all buffered item informationvoidclearShipTos()Clears the list of the shipTo.BillTocreateBillTo()Creates a new billTo objectItemcreateItem()Gets a new Item objectShipTocreateShipTo()Creates a new ship objectvoiddestroyContent()Destroy the data of the document (items and header) in the backend representation.SalesDocumentTypegetDocumentType()Returns the type of the sales document (e.g.TransactionConfigurationgetTransactionConfiguration()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, java.lang.String processType)Initializes an empty instance of this object with the data coming from the provided document.booleanisBackendDown()booleanisCheckCatalogNecessary()Does the document require that the items are checked against the catalog?booleanisExistingInBackend()Checks if the document exists in the backend storagebooleanisExternalToOrder()Indicates whether or not the order has to be maintained as an external document to this one.booleanisGrossValueAvailable()Indicates whether or not the sales document can provide the Gross value.booleanisInitialized()Does the document carry an initialization error?booleanisItemBasedAvailability()Checks if availability is compiled only based on item information.booleanisMultipleAddressesSupported()Returns if multiple addresses are supportedbooleanisNetValueAvailable()Indicates whether or not the sales document can provide a net value.booleanisUpdateMissing()Check whether its required to Update the objectvoidread()Reads the sales document.voidread(boolean force)Reads the sales document.voidreadForUpdate()Reads 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.booleansaveAndCommit()Save the sales document and commit it in the backend.voidsetBillToList(java.util.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(java.util.List<ShipTo> shipToList)Sets shipTo listvoidsetSoldToGuid(TechKey techKeySoldTo, java.lang.String soldToId)voidsetTransactionConfiguration(TransactionConfiguration transConf)The 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, setValid
-
Methods inherited from interface de.hybris.platform.sap.core.common.message.MessageListHolder
addMessage, clearMessages, getMessageList
-
Methods inherited from interface de.hybris.platform.sap.sapordermgmtbol.transaction.businessobject.interf.SalesDocumentBase
getAlternativeBillTos, getAlternativeShipTos, isChangeHeaderOnly, isDeterminationRequired, isPersistentInBackend, setDeterminationRequired, setPersistentInBackend
-
Methods 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 Detail
-
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
void removeItems(TechKey[] techKeys) throws CommunicationException
Deletes items from the sales document.- Parameters:
techKeys- Technical keys of the items to be canceld- Throws:
CommunicationException- in case back-end error
-
destroyContent
void destroyContent() throws CommunicationExceptionDestroy 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
SalesDocumentType getDocumentType() throws CommunicationException
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
void init(PartnerList partnerList) throws CommunicationException
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
void init(SalesDocument posd, java.lang.String processType) throws BusinessObjectException
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
boolean isMultipleAddressesSupported() throws BusinessObjectExceptionReturns 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
void read() throws CommunicationException
Reads the sales document. The backend call happens only if necessary.- Throws:
CommunicationException- in case back-end error
-
read
void read(boolean force) throws CommunicationException
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
void readForUpdate() throws CommunicationExceptionReads 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
void readForUpdate(boolean force) throws CommunicationExceptionReads 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
void removeItem(Item item) throws CommunicationException
Removes the item.- Parameters:
item- to remove- Throws:
CommunicationException- in case back-end error
-
saveAndCommit
boolean saveAndCommit() throws BusinessObjectExceptionSave 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
void setShipToList(java.util.List<ShipTo> shipToList)
Sets shipTo list- Parameters:
shipToList- list of ShipTo's
-
setBillToList
void setBillToList(java.util.List<BillTo> billToList)
Sets BillTo list- Parameters:
billToList- list of BillTo's
-
setTransactionConfiguration
void setTransactionConfiguration(TransactionConfiguration transConf)
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
void update() throws CommunicationExceptionUpdate 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:
SimpleDocument.createItem()
-
setSoldToGuid
void setSoldToGuid(TechKey techKeySoldTo, java.lang.String soldToId)
- Parameters:
techKeySoldTo- the guid of the soldtosoldToId- the partner id of the soldto
-
clearItemBuffer
void clearItemBuffer()
Removes all buffered item information
-
hasPredecessorOfSpecificType
boolean hasPredecessorOfSpecificType(DocumentType docType)
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
void setConverter(Converter converter)
- Parameters:
converter- access object for unit related conversions
-
validate
void validate() throws CommunicationExceptionValidates 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?
-
-