Class MInventory

All Implemented Interfaces:
Serializable, Cloneable, Comparator<Object>, I_M_Inventory, I_Persistent, DocAction, Evaluatee

public class MInventory extends X_M_Inventory implements DocAction
Inventory Document Model
Version:
$Id: MInventory.java,v 1.3 2006/07/30 00:51:05 jjanke Exp $
Author:
Jorg Janke, victor.perez@e-evolution.com, e-Evolution http://www.e-evolution.com
  • FR [ 1948157 ] Is necessary the reference for document reverse
  • FR [ 2520591 ] Support multiples calendar for Org, Armen Rizal, Goodwill Consulting
  • BF [ 1745154 ] Cost in Reversing Material Related Docs
  • See Also:
    • Field Details

      • REVERSE_INDICATOR

        public static String REVERSE_INDICATOR
        Reversal Indicator
      • m_lines

        protected MInventoryLine[] m_lines
        Lines
      • m_processMsg

        protected String m_processMsg
        Process Message
      • m_justPrepared

        protected boolean m_justPrepared
        Just Prepared Flag
      • m_reversal

        protected boolean m_reversal
        Reversal Flag
    • Constructor Details

      • MInventory

        public MInventory(Properties ctx, String M_Inventory_UU, String trxName)
        UUID based Constructor
        Parameters:
        ctx - Context
        M_Inventory_UU - UUID key
        trxName - Transaction
      • MInventory

        public MInventory(Properties ctx, int M_Inventory_ID, String trxName)
        Standard Constructor
        Parameters:
        ctx - context
        M_Inventory_ID - id
        trxName - transaction
      • MInventory

        public MInventory(Properties ctx, ResultSet rs, String trxName)
        Load Constructor
        Parameters:
        ctx - context
        rs - result set
        trxName - transaction
      • MInventory

        @Deprecated public MInventory(MWarehouse wh)
        Deprecated.
        since 3.5.3a . Please use MInventory(MWarehouse, String).
        Warehouse Constructor
        Parameters:
        wh - warehouse
      • MInventory

        public MInventory(MWarehouse wh, String trxName)
        Warehouse Constructor
        Parameters:
        wh -
        trxName -
      • MInventory

        public MInventory(MInventory copy)
        Copy constructor
        Parameters:
        copy -
      • MInventory

        public MInventory(Properties ctx, MInventory copy)
        Copy constructor
        Parameters:
        ctx -
        copy -
      • MInventory

        public MInventory(Properties ctx, MInventory copy, String trxName)
        Copy constructor
        Parameters:
        ctx -
        copy -
        trxName -
    • Method Details

      • get

        public static MInventory get(int M_Inventory_ID)
        Get Inventory from DB
        Parameters:
        M_Inventory_ID - id
        Returns:
        MInventory
      • get

        public static MInventory get(Properties ctx, int M_Inventory_ID)
        Get Inventory from DB
        Parameters:
        ctx - context
        M_Inventory_ID - id
        Returns:
        MInventory
      • getLines

        public MInventoryLine[] getLines(boolean requery)
        Get Lines
        Parameters:
        requery - true to requery from DB
        Returns:
        array of lines
      • addDescription

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

        public void setClientOrg(int AD_Client_ID, int AD_Org_ID)
        Overwrite Client/Org - from Import.
        Overrides:
        setClientOrg in class PO
        Parameters:
        AD_Client_ID - client
        AD_Org_ID - org
      • toString

        public String toString()
        String Representation
        Overrides:
        toString in class X_M_Inventory
        Returns:
        info
      • 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:
        not implemented, always return null
      • beforeSave

        protected boolean beforeSave(boolean newRecord)
        Description copied from class: PO
        Called before Save for Pre-Save Operation.
        Default implementation is nop, to be implemented in sub-classes that needed it.
        Overrides:
        beforeSave in class PO
        Parameters:
        newRecord - true if it is a new record
        Returns:
        true if record can be saved
      • setProcessed

        public void setProcessed(boolean processed)
        Set Processed. Propagate to Lines.
        Specified by:
        setProcessed in interface I_M_Inventory
        Overrides:
        setProcessed in class X_M_Inventory
        Parameters:
        processed - processed
      • 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)
      • 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 ..)
      • setDefiniteDocumentNo

        protected void setDefiniteDocumentNo()
        Set the definite document number after completed
      • checkMaterialPolicy

        protected void checkMaterialPolicy(MInventoryLine line, BigDecimal qtyDiff)
        Check Material Policy and create MInventoryLineMA records (if M_AttributeSetInstance_ID==0)
        Parameters:
        line -
        qtyDiff - qty to allocate
      • voidIt

        public boolean voidIt()
        Void Document.
        Specified by:
        voidIt in interface DocAction
        Returns:
        false
      • closeIt

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

        public boolean reverseCorrectIt()
        Reverse Correction
        Specified by:
        reverseCorrectIt in interface DocAction
        Returns:
        false
      • reverse

        protected MInventory reverse(boolean accrual)
        Reverse this document
        Parameters:
        accrual - true to use current date, false to use this document's movement date
        Returns:
        reversal MInventory document
      • reverseAccrualIt

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

        public boolean reActivateIt()
        Re-activate
        Specified by:
        reActivateIt in interface DocAction
        Returns:
        false
      • 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
      • setReversal

        protected void setReversal(boolean reversal)
        Set Reversal state (instance flag)
        Parameters:
        reversal - reversal
      • isReversal

        protected boolean isReversal()
        Is Reversal
        Returns:
        reversal state (instance flag)
      • isComplete

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