Class MDDOrder

    • Constructor Detail

      • MDDOrder

        public MDDOrder​(Properties ctx,
                        int DD_Order_ID,
                        String trxName)
        Default Constructor
        Parameters:
        ctx - context
        DD_Order_ID - order to load, (0 create new order)
        trxName - trx name
      • MDDOrder

        public MDDOrder​(MProject project,
                        boolean IsSOTrx,
                        String DocSubTypeSO)
        Project Constructor
        Parameters:
        project - Project to create Order from
        IsSOTrx - sales order
        DocSubTypeSO - if SO DocType Target (default DocSubTypeSO_OnCredit)
      • MDDOrder

        public MDDOrder​(Properties ctx,
                        ResultSet rs,
                        String trxName)
        Load Constructor
        Parameters:
        ctx - context
        rs - result set record
        trxName - transaction
    • Method Detail

      • copyFrom

        public static MDDOrder copyFrom​(MDDOrder from,
                                        Timestamp dateDoc,
                                        int C_DocTypeTarget_ID,
                                        boolean isSOTrx,
                                        boolean counter,
                                        boolean copyASI,
                                        String trxName)
        Create new Order by copying
        Parameters:
        from - order
        dateDoc - date of the document date
        C_DocTypeTarget_ID - target document type
        isSOTrx - sales order
        counter - create counter links
        copyASI - copy line attributes Attribute Set Instance, Resaouce Assignment
        trxName - trx
        Returns:
        Distribution Order
      • addDescription

        public void addDescription​(String description)
        Add to Description
        Parameters:
        description - text
      • setShip_BPartner_ID

        public void setShip_BPartner_ID​(int C_BPartner_ID)
        Set Ship Business Partner
        Parameters:
        C_BPartner_ID - bpartner
      • setShip_Location_ID

        public void setShip_Location_ID​(int C_BPartner_Location_ID)
        Set Ship Business Partner Location
        Parameters:
        C_BPartner_Location_ID - bp location
      • setShip_User_ID

        public void setShip_User_ID​(int AD_User_ID)
        Set Ship Business Partner Contact
        Parameters:
        AD_User_ID - user
      • setBPartner

        public void setBPartner​(MBPartner bp)
        Set Business Partner Defaults and Details. SOTrx should be set.
        Parameters:
        bp - business partner
      • copyLinesFrom

        public int copyLinesFrom​(MDDOrder otherOrder,
                                 boolean counter,
                                 boolean copyASI)
        Copy Lines From other Order
        Parameters:
        otherOrder - order
        counter - set counter info
        copyASI - copy line attributes Attribute Set Instance, Resource Assignment
        Returns:
        number of lines copied
      • getDocumentInfo

        public String getDocumentInfo()
        Get Document Info
        Specified by:
        getDocumentInfo in interface DocAction
        Returns:
        document info (untranslated)
      • createPDF

        public File createPDF()
        Create PDF
        Specified by:
        createPDF in interface DocAction
        Returns:
        File or null
      • createPDF

        public File createPDF​(File file)
        Create PDF file
        Parameters:
        file - output file
        Returns:
        file if success
      • getLines

        public MDDOrderLine[] getLines​(String whereClause,
                                       String orderClause)
        Get Lines of Order
        Parameters:
        whereClause - where clause or null (starting with AND)
        orderClause - order clause
        Returns:
        lines
      • getLines

        public MDDOrderLine[] getLines​(boolean requery,
                                       String orderBy)
        Get Lines of Order
        Parameters:
        requery - requery
        orderBy - optional order by column
        Returns:
        lines
      • getLines

        public MDDOrderLine[] getLines()
        Get Lines of Order. (useb by web store)
        Returns:
        lines
      • renumberLines

        public void renumberLines​(int step)
        Renumber Lines
        Parameters:
        step - start and step
      • getMovement

        public MMovement[] getMovement()
        Get Shipments of Order
        Returns:
        shipments
      • getDocStatusName

        public String getDocStatusName()
        Get Document Status
        Returns:
        Document Status Clear Text
      • setProcessed

        public void setProcessed​(boolean processed)
        Set Processed. Propergate to Lines/Taxes
        Specified by:
        setProcessed in interface I_DD_Order
        Overrides:
        setProcessed in class X_DD_Order
        Parameters:
        processed - processed
      • beforeSave

        protected boolean beforeSave​(boolean newRecord)
        Before Save
        Overrides:
        beforeSave in class PO
        Parameters:
        newRecord - new
        Returns:
        save
      • afterSave

        protected boolean afterSave​(boolean newRecord,
                                    boolean success)
        After Save
        Overrides:
        afterSave in class PO
        Parameters:
        newRecord - new
        success - success
        Returns:
        true if can be saved
      • setDocAction

        public void setDocAction​(String DocAction,
                                 boolean forceCreation)
        Set DocAction
        Parameters:
        DocAction - doc oction
        forceCreation - force creation
      • beforeDelete

        protected boolean beforeDelete()
        Before Delete
        Overrides:
        beforeDelete in class PO
        Returns:
        true of it can be deleted
      • processIt

        public boolean processIt​(String processAction)
        Process document
        Specified by:
        processIt in interface DocAction
        Parameters:
        processAction - document action
        Returns:
        true if performed
      • unlockIt

        public boolean unlockIt()
        Unlock Document.
        Specified by:
        unlockIt in interface DocAction
        Returns:
        true if success
      • invalidateIt

        public boolean invalidateIt()
        Invalidate Document
        Specified by:
        invalidateIt in interface DocAction
        Returns:
        true if success
      • prepareIt

        public String prepareIt()
        Prepare Document
        Specified by:
        prepareIt in interface DocAction
        Returns:
        new status (In Progress or Invalid)
      • reserveStock

        public void reserveStock​(MDDOrderLine[] lines)
        Reserve Inventory. Counterpart: MMovement.completeIt()
        Parameters:
        lines - distribution order lines (ordered by M_Product_ID for deadlock prevention)
      • approveIt

        public boolean approveIt()
        Approve Document
        Specified by:
        approveIt in interface DocAction
        Returns:
        true if success
      • rejectIt

        public boolean rejectIt()
        Reject Approval
        Specified by:
        rejectIt in interface DocAction
        Returns:
        true if success
      • completeIt

        public String completeIt()
        Complete Document
        Specified by:
        completeIt in interface DocAction
        Returns:
        new status (Complete, In Progress, Invalid, Waiting ..)
      • voidIt

        public boolean voidIt()
        Void Document. Set Qtys to 0 - Sales: reverse all documents
        Specified by:
        voidIt in interface DocAction
        Returns:
        true if success
      • closeIt

        public boolean closeIt()
        Close Document. Cancel not delivered Qunatities
        Specified by:
        closeIt in interface DocAction
        Returns:
        true if success
      • reverseCorrectIt

        public boolean reverseCorrectIt()
        Reverse Correction - same void
        Specified by:
        reverseCorrectIt in interface DocAction
        Returns:
        true if success
      • reverseAccrualIt

        public boolean reverseAccrualIt()
        Reverse Accrual - none
        Specified by:
        reverseAccrualIt in interface DocAction
        Returns:
        false
      • reActivateIt

        public boolean reActivateIt()
        Re-activate.
        Specified by:
        reActivateIt in interface DocAction
        Returns:
        true if success
      • getSummary

        public String getSummary()
        Get Summary
        Specified by:
        getSummary in interface DocAction
        Returns:
        Summary of Document
      • getProcessMsg

        public String getProcessMsg()
        Get Process Message
        Specified by:
        getProcessMsg in interface DocAction
        Returns:
        clear text error message
      • getDoc_User_ID

        public int getDoc_User_ID()
        Get Document Owner (Responsible)
        Specified by:
        getDoc_User_ID in interface DocAction
        Returns:
        AD_User_ID
      • getC_Currency_ID

        public int getC_Currency_ID()
        Description copied from interface: DocAction
        Get Document Currency
        Specified by:
        getC_Currency_ID in interface DocAction
        Returns:
        C_Currency_ID
      • isComplete

        public boolean isComplete()
        Document Status is Complete or Closed
        Returns:
        true if CO, CL or RE