Class SalesDocumentERP
- java.lang.Object
-
- de.hybris.platform.sap.core.bol.backend.BackendBusinessObjectBase
-
- de.hybris.platform.sap.core.bol.backend.jco.BackendBusinessObjectBaseJCo
-
- de.hybris.platform.sap.sapordermgmtbol.transaction.salesdocument.backend.impl.erp.IsaBackendBusinessObjectBaseSalesERP
-
- de.hybris.platform.sap.sapordermgmtbol.transaction.salesdocument.backend.impl.erp.SalesDocumentERP
-
- All Implemented Interfaces:
BackendBusinessObject,BackendBusinessObjectJCo,BackendState,SalesDocumentBackend
- Direct Known Subclasses:
BasketERP,OrderBaseERP
public abstract class SalesDocumentERP extends IsaBackendBusinessObjectBaseSalesERP implements SalesDocumentBackend
-
-
Field Summary
Fields Modifier and Type Field Description protected AdditionalPricingadditionalPricingprotected booleancreateProcessprotected java.lang.StringdeliveryPriorityprotected booleanerroneousprotected GetAllStrategygetAllStrategyStrategy pattern to support various LO-API versionsprotected java.lang.StringheaderCondTypeFreightprotected booleanisIncompletionLogRequestedprotected booleanisUMEDisabledWarningNecessaryWarning message in case UME is disabled.protected java.util.Map<java.lang.String,java.lang.String>itemVariantMapprotected LrdActionsStrategylrdActionsStrategystatic java.lang.StringORDER_HEADER_STRUCTUREUI controller relevant constant for 'OrderHeaderStructure'static java.lang.StringORDER_ITEM_STRUCTUREUI controller relevant constant for 'OrderItemStructure'static java.lang.StringRESOURCE_KEYprotected SetStrategysetStrategyprotected booleanshowInlineConfigstatic java.lang.StringSTRATEGY_FACTORY_ERPconstant naming the key referenced in factory-config.xml where the strategy class is specifiedprotected TransactionConfigurationtransactionConfiguration-
Fields inherited from class de.hybris.platform.sap.sapordermgmtbol.transaction.salesdocument.backend.impl.erp.IsaBackendBusinessObjectBaseSalesERP
docflowRead, headerDocFlow, headerPriceAttribs, headerPropMap, itemConfigChangeableMap, itemDocFlow, itemsPriceAttribMap, itemsPropMap, loadState, messageBufferMap, predecessorShipTo, savedItemsMap, setIpcPriceAttributes, shipToMap
-
Fields inherited from class de.hybris.platform.sap.core.bol.backend.BackendBusinessObjectBase
genericFactory, moduleConfigurationAccess
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedSalesDocumentERP()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddErroneousItem(Item item)Stores an erroneous item to be later able to restore its attrtibutesprotected voidafterReadFromBackend(SalesDocument salesDocument, JCoConnection aJCoCon)protected voidafterWriteDocument(SalesDocument salesDocument, JCoConnection aJCoCon)protected booleancheckForInitializationError(SalesDocument salesDocument)protected voidcheckShippingConditions(SalesDocument salesDocument)Check whether shipping conditions have been changed, and trigger a new pricing if necessary.voidclearErroneousItems()Clear list of erroneous itemsvoidclearItemBuffer()Removes all buffered item informationvoidcloseBackendSession()Closes sales document in backendvoidcreateInBackend(SalesDocument salesDocument)Create back end representation of the objectvoidcreateInBackend(TransactionConfiguration transactionConfiguration, SalesDocument salesDocument)Create back end representation of the object without providing information about the user.voiddeleteItemInBackend(SalesDocument salesDocument, TechKey itemToDelete)Deletes a single item in the backend.voiddeleteItemsInBackend(SalesDocument salesDocument, TechKey[] itemsToDelete, TransactionConfiguration transConf)Deletes multiple items in the backend.voidemptyInBackend(SalesDocument salesDocument)Empties the representation of the provided object in the underlying storage.protected voidexecuteAdditionalPricing(SalesDocument salesDocument, TransactionConfiguration shop)Execute additional pricing call if document is error freeprotected voidfixErroneousHeader(SalesDocument document)Fixing a header which cannot be digested from ERP.protected voidfixErroneousItem(Item item)AdditionalPricinggetAdditionalPricing()protected LrdCloseStrategygetCloseStrategy()HeadergetErroneousHeader()Returns the previously stored information about the erroneous header.java.util.Map<TechKey,Item>getErroneousItems()Returns the previously stored information about erroneous items.GetAllStrategygetGetAllStrategy()ItemBuffergetItemBuffer()java.util.Map<java.lang.String,java.lang.String>getItemVariantMap()Returns the map, to store item variant informationLrdActionsStrategygetLrdActionsStrategy()ModuleConfigurationAccessgetModuleConfigurationAccess()Returns the module configuration access.java.lang.StringgetPayerHandle()java.util.List<SalesDocumentERPHook>getSalesDocumentERPHooks()SetStrategygetSetStrategy()java.lang.StringgetShippingCondition()Returns stored shipping condition.java.lang.StringgetSoldToHandle()protected voidhandleInvalidHeaderAfterRead(SalesDocument salesDocument)Actions which are needed for the header after a read step.protected voidhandleInvalidHeaderAfterUpdate(SalesDocument salesDocument)Document couldn't be created.protected voidhandleInvalidHeaderBeforeUpdate(SalesDocument salesDocument)Actions which are needed before an update call if error situations occur.protected booleanhandleInvalidItems(SalesDocument salesDocument)Checks for invalid items and initialises them, so that they can be deleted afterwards.protected voidhandleInvalidItemsAfterRead(SalesDocument salesDocument)Restores the sales document items after read and adds the information which needed to be removed before.protected voidhandleInvalidItemsAfterUpdate(SalesDocument salesDocument)Clear session storage of erroneous items for those items which are fine after the set call to SDvoidinitBackendObject()Initializes this Business Object.booleanisBackendDown()booleanisCreateProcess()In case an order has just been created, or just been saved, we do not expect certain data to be present already.booleanisDocumentInitial()booleanisErroneous()protected booleanisInBackend(SalesDocument salesDocument)booleanisItemBasedAvailability()Checks if availability is compiled only based on item information.booleanisMultipleAddressesSupported()Checks in the back end whether the multiple addresses are supported.protected ItemListprepareForValidation(SalesDocument salesDocument)Prepares the sales document for the validation call.voidreadForUpdateFromBackend(SalesDocument salesDocument)Read the complete document from backend and reset the dirty flags.voidreadFromBackend(SalesDocument salesDocument, TransactionConfiguration transConf, boolean directRead)Reads Data from the back end.booleanrecoverFromBackend(SalesDocument salesDoc, TechKey basketGuid)Recovers the whole document for the given TechKey from the back end.voidremoveErroneousItems(TechKey[] itemsToDelete)Remove entries from list of error restore information .protected voidrestoreErroneousHeaderAfterRead(SalesDocument salesDocument)Restore invalid header after read step.protected voidrestoreErroneousHeaderAfterSet(Header header)Restoring header: Initializing delivery date.protected voidrestoreErroneousItem(Item savedState, Item errItm)If an item has been fixed so that LO-API can consume it, we later on need to restore the user inputs, so that the user sees the data he/she has entered which need to be corrected.voidsetAdditionalPricing(AdditionalPricing additionalPricing)voidsetCloseStrategy(LrdCloseStrategy closeStrategy)voidsetDocumentInitial(boolean isInitial)Sales document is initial.voidsetErroneous(boolean bool)Set the error state read from the backendvoidsetErroneousHeader(Header header)Sets erroneous header.voidsetGData(SalesDocument salesDocument, TransactionConfiguration shop)Call the ERP_LORD_LOAD for edit.voidsetGetAllStrategy(GetAllStrategy getAllStrategy)voidsetItemBuffer(ItemBuffer itemBuffer)voidsetLoadStateCreate()Copies back end data from basket to the order.voidsetLrdActionsStrategy(LrdActionsStrategy lrdActionsStrategy)voidsetPayerHandle(java.lang.String payer)Sets handle of payervoidsetSalesDocumentERPHooks(java.util.List<SalesDocumentERPHook> salesDocumentERPHooks)voidsetSetStrategy(SetStrategy setStrategy)voidsetShippingCondition(java.lang.String currentShippingCondition)Sets stored shipping condition.voidsetSoldToHandle(java.lang.String soldTo)Sets handle of soldTo partnervoidupdateInBackend(SalesDocument salesDocument)Updates object in the back end without supplying extra information about the transactionConfiguration.voidupdateInBackend(SalesDocument salesDocument, TransactionConfiguration shop)Update object in the backend by putting the data into the underlying storage.voidupdateInBackend(SalesDocument salesDocument, TransactionConfiguration transactionConfiguration, java.util.List<TechKey> itemsToDelete)Updates object in the back end by putting the data into the underlying storage.voidvalidate(SalesDocument salesDocument)Validates a sales document.-
Methods inherited from class de.hybris.platform.sap.sapordermgmtbol.transaction.salesdocument.backend.impl.erp.IsaBackendBusinessObjectBaseSalesERP
adjustFreeGoods, getHeaderDocFlow, getHeaderPriceAttribs, getHeaderPropMap, getItemDocFlow, getItemsPriceAttribMap, getItemsPropMap, getLoadState, getMessageList, getOrCreateMessageList, getSavedItemsMap, getShipToMap, isDocflowRead, removeMessageFromMessageList, setDocflowRead, setHeaderDocFlow, setItemDocFlow, setShipToMap
-
Methods inherited from class de.hybris.platform.sap.core.bol.backend.jco.BackendBusinessObjectBaseJCo
getDefaultConnectionName, getDefaultDestinationName, getDefaultJCoConnection, getJCoConnection, getJCoConnection, getModuleId, setDefaultConnectionName, setDefaultDestinationName, setManagedConnectionContainer, toString
-
Methods inherited from class de.hybris.platform.sap.core.bol.backend.BackendBusinessObjectBase
destroyBackendObject, setGenericFactory, setModuleConfigurationAccess
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface de.hybris.platform.sap.core.bol.backend.BackendBusinessObject
destroyBackendObject
-
Methods inherited from interface de.hybris.platform.sap.sapordermgmtbol.transaction.salesdocument.backend.interf.SalesDocumentBackend
getSalesDocumentType
-
-
-
-
Field Detail
-
RESOURCE_KEY
public static final java.lang.String RESOURCE_KEY
- See Also:
- Constant Field Values
-
STRATEGY_FACTORY_ERP
public static final java.lang.String STRATEGY_FACTORY_ERP
constant naming the key referenced in factory-config.xml where the strategy class is specified- See Also:
- Constant Field Values
-
ORDER_ITEM_STRUCTURE
public static final java.lang.String ORDER_ITEM_STRUCTURE
UI controller relevant constant for 'OrderItemStructure'- See Also:
- Constant Field Values
-
ORDER_HEADER_STRUCTURE
public static final java.lang.String ORDER_HEADER_STRUCTURE
UI controller relevant constant for 'OrderHeaderStructure'- See Also:
- Constant Field Values
-
isUMEDisabledWarningNecessary
protected boolean isUMEDisabledWarningNecessary
Warning message in case UME is disabled. Then we only have one session in ERP, and we cannot fully support multiple documents. UME disabling will not be possible in productive environments.
-
getAllStrategy
protected GetAllStrategy getAllStrategy
Strategy pattern to support various LO-API versions
-
lrdActionsStrategy
protected LrdActionsStrategy lrdActionsStrategy
-
setStrategy
protected SetStrategy setStrategy
-
itemVariantMap
protected java.util.Map<java.lang.String,java.lang.String> itemVariantMap
-
showInlineConfig
protected boolean showInlineConfig
-
headerCondTypeFreight
protected java.lang.String headerCondTypeFreight
-
isIncompletionLogRequested
protected boolean isIncompletionLogRequested
-
deliveryPriority
protected java.lang.String deliveryPriority
-
erroneous
protected boolean erroneous
-
transactionConfiguration
protected TransactionConfiguration transactionConfiguration
-
createProcess
protected boolean createProcess
-
additionalPricing
protected AdditionalPricing additionalPricing
-
-
Method Detail
-
getItemBuffer
public ItemBuffer getItemBuffer()
- Returns:
- the itemBuffer
-
setItemBuffer
public void setItemBuffer(ItemBuffer itemBuffer)
- Parameters:
itemBuffer- the itemBuffer to set
-
getGetAllStrategy
public GetAllStrategy getGetAllStrategy()
- Returns:
- the getAllStrategy
-
setGetAllStrategy
public void setGetAllStrategy(GetAllStrategy getAllStrategy)
- Parameters:
getAllStrategy- the getAllStrategy to set
-
getLrdActionsStrategy
public LrdActionsStrategy getLrdActionsStrategy()
- Returns:
- the lrdActionsStrategy
-
setLrdActionsStrategy
public void setLrdActionsStrategy(LrdActionsStrategy lrdActionsStrategy)
- Parameters:
lrdActionsStrategy- the lrdActionsStrategy to set
-
getSetStrategy
public SetStrategy getSetStrategy()
- Returns:
- the setStrategy
-
setSetStrategy
public void setSetStrategy(SetStrategy setStrategy)
- Parameters:
setStrategy- the setStrategy to set
-
isDocumentInitial
public boolean isDocumentInitial()
- Specified by:
isDocumentInitialin interfaceBackendState- Returns:
- Sales document is initial
-
setSoldToHandle
public void setSoldToHandle(java.lang.String soldTo)
Description copied from interface:BackendStateSets handle of soldTo partner- Specified by:
setSoldToHandlein interfaceBackendState- Parameters:
soldTo- handle of the soldto partner function
-
setPayerHandle
public void setPayerHandle(java.lang.String payer)
Description copied from interface:BackendStateSets handle of payer- Specified by:
setPayerHandlein interfaceBackendState- Parameters:
payer- handle of the payer partner function
-
getPayerHandle
public java.lang.String getPayerHandle()
- Specified by:
getPayerHandlein interfaceBackendState- Returns:
- handle of the payer
-
getSoldToHandle
public java.lang.String getSoldToHandle()
- Specified by:
getSoldToHandlein interfaceBackendState- Returns:
- handle of the soldTo partner
-
setDocumentInitial
public void setDocumentInitial(boolean isInitial)
Description copied from interface:BackendStateSales document is initial. The first update might need to do specific shipto handling- Specified by:
setDocumentInitialin interfaceBackendState- Parameters:
isInitial- true if document is initial
-
createInBackend
public void createInBackend(SalesDocument salesDocument) throws BackendException
Create back end representation of the object- Parameters:
salesDocument- sales document to be created in back end- Throws:
BackendException- case of a back-end error
-
createInBackend
public void createInBackend(TransactionConfiguration transactionConfiguration, SalesDocument salesDocument) throws BackendException
Create back end representation of the object without providing information about the user. This may happen in the B2C scenario where the login may be done later.- Specified by:
createInBackendin interfaceSalesDocumentBackend- Parameters:
transactionConfiguration- The current shopsalesDocument- The document to read the data in- Throws:
BackendException- in case of a back-end or communication error
-
handleInvalidHeaderAfterUpdate
protected void handleInvalidHeaderAfterUpdate(SalesDocument salesDocument) throws BackendException
Document couldn't be created. Now the header needs to be corrected, and the document is again sent to ERP.- Throws:
BackendException
-
restoreErroneousHeaderAfterSet
protected void restoreErroneousHeaderAfterSet(Header header)
Restoring header: Initializing delivery date.- Parameters:
header-
-
fixErroneousHeader
protected void fixErroneousHeader(SalesDocument document)
Fixing a header which cannot be digested from ERP. This implementation sets a delivery date because this is the only error which can be corrected by means of attributes available in WCEM
-
deleteItemInBackend
public void deleteItemInBackend(SalesDocument salesDocument, TechKey itemToDelete) throws BackendException
Deletes a single item in the backend.- Specified by:
deleteItemInBackendin interfaceSalesDocumentBackend- Parameters:
salesDocument- document to delete item fromitemToDelete- item technical key that is going to be deleted- Throws:
BackendException- in case of a back-end or communication error
-
deleteItemsInBackend
public void deleteItemsInBackend(SalesDocument salesDocument, TechKey[] itemsToDelete, TransactionConfiguration transConf) throws BackendException
Deletes multiple items in the backend.- Specified by:
deleteItemsInBackendin interfaceSalesDocumentBackend- Parameters:
salesDocument- Document to delete item fromitemsToDelete- Array of item keys that are going to be deletedtransConf- TransactionConfiguration to delete items dependent on shop settings- Throws:
BackendException- in case of a back-end or communication error
-
removeErroneousItems
public void removeErroneousItems(TechKey[] itemsToDelete)
Description copied from interface:BackendStateRemove entries from list of error restore information .- Specified by:
removeErroneousItemsin interfaceBackendState
-
emptyInBackend
public void emptyInBackend(SalesDocument salesDocument) throws BackendException
Description copied from interface:SalesDocumentBackendEmpties the representation of the provided object in the underlying storage. This means that all items and the header information are cleared. The provided document itself is not changed, so you are responsible for clearing the data representation on the business object layer on your own.- Specified by:
emptyInBackendin interfaceSalesDocumentBackend- Parameters:
salesDocument- the document to remove the representation in the storage- Throws:
BackendException- in case of a back-end or communication error
-
getItemVariantMap
public java.util.Map<java.lang.String,java.lang.String> getItemVariantMap()
Returns the map, to store item variant information- Specified by:
getItemVariantMapin interfaceBackendState- Specified by:
getItemVariantMapin classIsaBackendBusinessObjectBaseSalesERP- Returns:
- HashMap, the map to store item varaint information in
-
fixErroneousItem
protected void fixErroneousItem(Item item)
-
initBackendObject
public void initBackendObject() throws BackendExceptionInitializes this Business Object.- Specified by:
initBackendObjectin interfaceBackendBusinessObject- Overrides:
initBackendObjectin classIsaBackendBusinessObjectBaseSalesERP- Throws:
BackendException-BackendException
-
isCreateProcess
public boolean isCreateProcess()
Description copied from interface:BackendStateIn case an order has just been created, or just been saved, we do not expect certain data to be present already. For Example DocFlow data. So for performance reasons it makes sense not to request those data.- Specified by:
isCreateProcessin interfaceBackendState- Returns:
- true, if the salesdocument is just created
-
isErroneous
public boolean isErroneous()
- Returns:
- true, if error occured
-
isMultipleAddressesSupported
public boolean isMultipleAddressesSupported()
Description copied from interface:SalesDocumentBackendChecks in the back end whether the multiple addresses are supported.- Specified by:
isMultipleAddressesSupportedin interfaceSalesDocumentBackend- Returns:
truewhen the back end supports the multiple addresses
-
readForUpdateFromBackend
public void readForUpdateFromBackend(SalesDocument salesDocument) throws BackendException
Read the complete document from backend and reset the dirty flags.- Specified by:
readForUpdateFromBackendin interfaceSalesDocumentBackend- Parameters:
salesDocument- Sales Document- Throws:
BackendException- in case of a back-end or communication error
-
checkForInitializationError
protected boolean checkForInitializationError(SalesDocument salesDocument)
-
isInBackend
protected boolean isInBackend(SalesDocument salesDocument)
-
readFromBackend
public void readFromBackend(SalesDocument salesDocument, TransactionConfiguration transConf, boolean directRead) throws BackendException
Description copied from interface:SalesDocumentBackendReads Data from the back end. Every document consists of two parts: the header and the items. This method retrieves the header and the item information. If a soldTo is set in the partner list, ship to information should be read- Specified by:
readFromBackendin interfaceSalesDocumentBackend- Parameters:
salesDocument- Sales Document to be readtransConf- Transaction Configuration object that holds the configuration settingsdirectRead- In case other sessions/channels update the sales document in parallel, it is only guaranteed that the most recent data is returned if direct read is set totrue, otherwise the data might be returned from a buffer.- Throws:
BackendException- in case of a back-end or communication error
-
handleInvalidHeaderAfterRead
protected void handleInvalidHeaderAfterRead(SalesDocument salesDocument)
Actions which are needed for the header after a read step. Messages might need to be restored, because the header has been temporarily adjusted before.
-
restoreErroneousHeaderAfterRead
protected void restoreErroneousHeaderAfterRead(SalesDocument salesDocument)
Restore invalid header after read step. Restore required delivery date and messages.
-
handleInvalidItemsAfterRead
protected void handleInvalidItemsAfterRead(SalesDocument salesDocument)
Restores the sales document items after read and adds the information which needed to be removed before.- Parameters:
salesDocument- The cart sales document.
-
restoreErroneousItem
protected void restoreErroneousItem(Item savedState, Item errItm)
If an item has been fixed so that LO-API can consume it, we later on need to restore the user inputs, so that the user sees the data he/she has entered which need to be corrected.- Parameters:
savedState- The original, saved state of the itemerrItm- State of the erroneous item after LO-API can digest it
-
getErroneousItems
public java.util.Map<TechKey,Item> getErroneousItems()
Description copied from interface:BackendStateReturns the previously stored information about erroneous items. Even if the sales document items are technically ok and can be sent via LO-API, this list holds the information which causes the trouble, and which needs to be put to the items after read to persist the user entry- Specified by:
getErroneousItemsin interfaceBackendState- Returns:
- Map for all erroneous items
-
handleInvalidItems
protected boolean handleInvalidItems(SalesDocument salesDocument) throws BackendException
Checks for invalid items and initialises them, so that they can be deleted afterwards. This call is done before the LO-API is called for reading item information.
The items which cannot be digested by LO-API are fixed, the info needed to restore the document are kept ingetErroneousItems()- Parameters:
salesDocument- Cart sales document- Returns:
- Could we fix the document.
- Throws:
BackendException
-
clearErroneousItems
public void clearErroneousItems()
Description copied from interface:BackendStateClear list of erroneous items- Specified by:
clearErroneousItemsin interfaceBackendState
-
addErroneousItem
public void addErroneousItem(Item item)
Description copied from interface:BackendStateStores an erroneous item to be later able to restore its attrtibutes- Specified by:
addErroneousItemin interfaceBackendState- Parameters:
item- The item (including message list, productId which we need to restore
-
recoverFromBackend
public boolean recoverFromBackend(SalesDocument salesDoc, TechKey basketGuid) throws BackendException
Description copied from interface:SalesDocumentBackendRecovers the whole document for the given TechKey from the back end. Before calling this method, it should be checked if the back end is capable of recovering a document. This can be done by calling checkRecoveryInBackend. So far the recovery feature is only available for the java basket (see SalesDocumentDB), it is used during startup to recover a basket via a cookie (see BasketCookieHandler).- Specified by:
recoverFromBackendin interfaceSalesDocumentBackend- Parameters:
salesDoc- The document to load the data in.basketGuid- The TechKey of the basket to read- Returns:
- success
truewhen the recovering is successful - Throws:
BackendException- in case of a back-end or communication error
-
setErroneous
public void setErroneous(boolean bool)
Description copied from interface:BackendStateSet the error state read from the backend- Specified by:
setErroneousin interfaceBackendState- Parameters:
bool- true if ERRKZ is 'X', otherwise false
-
setGData
public void setGData(SalesDocument salesDocument, TransactionConfiguration shop) throws BackendException
Call the ERP_LORD_LOAD for edit.- Specified by:
setGDatain interfaceSalesDocumentBackend- Parameters:
salesDocument- The salesDoc to set the data toshop- Transaction configuration- Throws:
BackendException- in case of a back-end or communication error
-
setLoadStateCreate
public void setLoadStateCreate()
Description copied from interface:SalesDocumentBackendCopies back end data from basket to the order.- Specified by:
setLoadStateCreatein interfaceSalesDocumentBackend
-
updateInBackend
public void updateInBackend(SalesDocument salesDocument) throws BackendException
Description copied from interface:SalesDocumentBackendUpdates object in the back end without supplying extra information about the transactionConfiguration. This method is normally necessary only for the B2C scenario.
Note: For a correct support of the business event AddToDocument the techkey of the items should be filled from the back end.- Specified by:
updateInBackendin interfaceSalesDocumentBackend- Parameters:
salesDocument- the object to update- Throws:
BackendException- in case of a back-end or communication error
-
updateInBackend
public void updateInBackend(SalesDocument salesDocument, TransactionConfiguration shop) throws BackendException
Update object in the backend by putting the data into the underlying storage.- Specified by:
updateInBackendin interfaceSalesDocumentBackend- Parameters:
salesDocument- the document to updateshop- the current shop- Throws:
BackendException- This exception is thrown if an error occurs in the back end
-
afterWriteDocument
protected void afterWriteDocument(SalesDocument salesDocument, JCoConnection aJCoCon)
- Parameters:
salesDocument-aJCoCon-
-
afterReadFromBackend
protected void afterReadFromBackend(SalesDocument salesDocument, JCoConnection aJCoCon)
-
handleInvalidHeaderBeforeUpdate
protected void handleInvalidHeaderBeforeUpdate(SalesDocument salesDocument)
Actions which are needed before an update call if error situations occur. Implementation re-initializes the required delivery date in case nothing was entered- Parameters:
salesDocument- Sales document
-
handleInvalidItemsAfterUpdate
protected void handleInvalidItemsAfterUpdate(SalesDocument salesDocument)
Clear session storage of erroneous items for those items which are fine after the set call to SD- Parameters:
salesDocument-
-
checkShippingConditions
protected void checkShippingConditions(SalesDocument salesDocument) throws BackendException
Check whether shipping conditions have been changed, and trigger a new pricing if necessary.- Parameters:
salesDocument-- Throws:
BackendException
-
setShippingCondition
public void setShippingCondition(java.lang.String currentShippingCondition)
Description copied from interface:BackendStateSets stored shipping condition. We need this to decide whether a pricing update is necessary.- Specified by:
setShippingConditionin interfaceBackendState- Parameters:
currentShippingCondition- Shipping condition
-
getShippingCondition
public java.lang.String getShippingCondition()
Description copied from interface:BackendStateReturns stored shipping condition. We need this to decide whether a pricing update is necessary.- Specified by:
getShippingConditionin interfaceBackendState- Returns:
- Shipping condition
-
updateInBackend
public void updateInBackend(SalesDocument salesDocument, TransactionConfiguration transactionConfiguration, java.util.List<TechKey> itemsToDelete) throws BackendException
Description copied from interface:SalesDocumentBackendUpdates object in the back end by putting the data into the underlying storage.
Note: For a correct support of the business event AddToDocument the techkey of the items should be filled from the back end.- Specified by:
updateInBackendin interfaceSalesDocumentBackend- Parameters:
salesDocument- the document to updatetransactionConfiguration- Transaction Configuration object that holds the configuration settingsitemsToDelete- List of techkeys of the items to be deleted in the back end- Throws:
BackendException- This exception is thrown if an error occurs in the back end
-
clearItemBuffer
public void clearItemBuffer()
Description copied from interface:SalesDocumentBackendRemoves all buffered item information- Specified by:
clearItemBufferin interfaceSalesDocumentBackend
-
getErroneousHeader
public Header getErroneousHeader()
Description copied from interface:BackendStateReturns the previously stored information about the erroneous header.- Specified by:
getErroneousHeaderin interfaceBackendState- Returns:
- Sales document header
-
setErroneousHeader
public void setErroneousHeader(Header header)
Description copied from interface:BackendStateSets erroneous header.- Specified by:
setErroneousHeaderin interfaceBackendState- Parameters:
header- Sales document header
-
executeAdditionalPricing
protected void executeAdditionalPricing(SalesDocument salesDocument, TransactionConfiguration shop) throws BackendException
Execute additional pricing call if document is error free- Parameters:
salesDocument- Sales documentshop- Sales configuration- Throws:
BackendException- Exception from backend call
-
isItemBasedAvailability
public boolean isItemBasedAvailability()
Description copied from interface:SalesDocumentBackendChecks if availability is compiled only based on item information.- Specified by:
isItemBasedAvailabilityin interfaceSalesDocumentBackend- Returns:
- Availability is compiled only based on item information?
-
getModuleConfigurationAccess
public ModuleConfigurationAccess getModuleConfigurationAccess()
Description copied from class:BackendBusinessObjectBaseReturns the module configuration access.- Overrides:
getModuleConfigurationAccessin classBackendBusinessObjectBase- Returns:
- the moduleConfigurationAccess
-
getAdditionalPricing
public AdditionalPricing getAdditionalPricing()
- Returns:
- the additionalPricing
-
setAdditionalPricing
public void setAdditionalPricing(AdditionalPricing additionalPricing)
- Parameters:
additionalPricing- the additionalPricing to set
-
validate
public void validate(SalesDocument salesDocument) throws BackendException
Description copied from interface:SalesDocumentBackendValidates a sales document. Validation messages should be attached to salesDocument after validation- Specified by:
validatein interfaceSalesDocumentBackend- Throws:
BackendException
-
prepareForValidation
protected ItemList prepareForValidation(SalesDocument salesDocument)
Prepares the sales document for the validation call. In this implementation, to be sure to get all warnings related to order quantity: Changes all item quantities- Parameters:
salesDocument-- Returns:
- Item list in its initial state
-
isBackendDown
public boolean isBackendDown()
- Specified by:
isBackendDownin interfaceSalesDocumentBackend- Returns:
- Is back end in planned downtime?
-
getCloseStrategy
protected LrdCloseStrategy getCloseStrategy()
- Returns:
- the closeStrategy
-
setCloseStrategy
public void setCloseStrategy(LrdCloseStrategy closeStrategy)
- Parameters:
closeStrategy- the closeStrategy to set
-
closeBackendSession
public void closeBackendSession()
Description copied from interface:SalesDocumentBackendCloses sales document in backend- Specified by:
closeBackendSessionin interfaceSalesDocumentBackend
-
getSalesDocumentERPHooks
public java.util.List<SalesDocumentERPHook> getSalesDocumentERPHooks()
- Returns:
- the salesDocumentERPHooks
-
setSalesDocumentERPHooks
public void setSalesDocumentERPHooks(java.util.List<SalesDocumentERPHook> salesDocumentERPHooks)
- Parameters:
salesDocumentERPHooks- the salesDocumentERPHooks to set
-
-