All Implemented Interfaces:
BackendBusinessObject, BackendBusinessObjectJCo, OrderBaseBackend, BackendState, SalesDocumentBackend
Direct Known Subclasses:
OrderERP, OrderHistoryERP

public abstract class OrderBaseERP extends SalesDocumentERP implements OrderBaseBackend
Back end Object representing an ERP Order document
  • Field Details

    • quotationPredecessorDocument

      protected ConnectedDocument quotationPredecessorDocument
      When the order is created with a reference to a quotation, the following reads of the order do not return docflow entries as long as the order was not saved. Thus we remember the Predecessor Quotation here, until the order has been saved, so we can properly fill the predecessor list for the reads before the order was saved.
  • Constructor Details

    • OrderBaseERP

      public OrderBaseERP()
  • Method Details

    • saveInBackend

      public boolean saveInBackend(Order ordr, boolean commit) throws BackendException
      Saves the order in the backend.
      The order will be saved in the backend.
      Specified by:
      saveInBackend in interface OrderBaseBackend
      Parameters:
      ordr - The order to be saved
      commit - The transaction should also be commited
      Returns:
      true if the save in the back end was successful.
      Throws:
      BackendException - in case of a back-end error
    • saveOrder

      protected boolean saveOrder(Order ordr, boolean commit) throws BackendException
      Saves the order in the backend and returns, if it was successufull.
      Parameters:
      ordr -
      commit -
      Returns:
      true, if save was successfull, false otherwise
      Throws:
      BackendException
    • saveOrderInBackend

      public int saveOrderInBackend(Order ordr, boolean commit) throws BackendException
      Copies the basket object to the order object
      Parameters:
      ordr - Order document
      commit - Flag controlling DB commit in back end
      Returns:
      0, if success, otherwise -1
      Throws:
      BackendException - in case of a back-end error
    • setLoadStateCreate

      public void setLoadStateCreate()
      Sets the Load State of LO-API to "create" mode. This is needed in case a basket gets copied into an order. Only for ERP backend.
      Specified by:
      setLoadStateCreate in interface SalesDocumentBackend
      Overrides:
      setLoadStateCreate in class SalesDocumentERP
    • getSalesDocumentType

      public SalesDocumentType getSalesDocumentType()
      Description copied from interface: SalesDocumentBackend
      Each implementing class has to define the used sales document type. This is e.g. used for finding the right strategies.
      Specified by:
      getSalesDocumentType in interface SalesDocumentBackend
      Returns:
      sales document type
    • isCancelable

      public boolean isCancelable(Order order)
      The ERP order can be canceled if the overall status is opened or if the overall status is in process , but not shipped, not billed and no delivery created for the any position can be cancelled. This can happened if the credit check is switched off for instance. The credit check is performed for the order and set order status "in process". But order can be cancelled in this case
      Specified by:
      isCancelable in interface OrderBaseBackend
      Parameters:
      order - Order which is checked
      Returns:
      true if order is cancelable
    • updateInBackend

      public void updateInBackend(SalesDocument salesDocument, TransactionConfiguration shop) throws BackendException
      Description copied from class: SalesDocumentERP
      Update object in the backend by putting the data into the underlying storage.
      Specified by:
      updateInBackend in interface SalesDocumentBackend
      Overrides:
      updateInBackend in class SalesDocumentERP
      Parameters:
      salesDocument - the document to update
      shop - the current shop
      Throws:
      BackendException - This exception is thrown if an error occurs in the back end