Class MDocTypeCounter

    • Constructor Detail

      • MDocTypeCounter

        public MDocTypeCounter​(Properties ctx,
                               int C_DocTypeCounter_ID,
                               String trxName)
        Standard Constructor
        Parameters:
        ctx - context
        C_DocTypeCounter_ID - id
        trxName - transaction
      • MDocTypeCounter

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

        public MDocTypeCounter​(MDocTypeCounter copy)
        Parameters:
        copy -
    • Method Detail

      • getCounterDocType_ID

        public static int getCounterDocType_ID​(Properties ctx,
                                               int C_DocType_ID)
        Get Counter document for document type
        Parameters:
        ctx - context
        C_DocType_ID - base document
        Returns:
        counter document C_DocType_ID or 0 or -1 if no counter doc
      • getCounterDocType

        public static MDocTypeCounter getCounterDocType​(Properties ctx,
                                                        int C_DocType_ID)
        Get (first) valid Counter document for document type
        Parameters:
        ctx - ignore
        C_DocType_ID - base document
        Returns:
        counter document (may be invalid) or null
      • getCounterDocType

        public static MDocTypeCounter getCounterDocType​(int C_DocType_ID)
        Get (first) valid Counter document for document type
        Parameters:
        C_DocType_ID - base document
        Returns:
        counter document (may be invalid) or null
      • get

        public static MDocTypeCounter get​(int C_DocTypeCounter_ID)
        Get MDocTypeCounter from Cache
        Parameters:
        C_DocTypeCounter_ID - id
        Returns:
        MDocTypeCounter
      • get

        public static MDocTypeCounter get​(int C_DocTypeCounter_ID,
                                          String trxName)
        Get MDocTypeCounter from Cache
        Parameters:
        C_DocTypeCounter_ID - id
        trxName - transaction
        Returns:
        MDocTypeCounter
      • get

        public static MDocTypeCounter get​(Properties ctx,
                                          int C_DocTypeCounter_ID,
                                          String trxName)
        Get MDocTypeCounter from Cache
        Parameters:
        ctx - context
        C_DocTypeCounter_ID - id
        trxName -
        Returns:
        MDocTypeCounter
      • getCounterDocBaseType

        public static String getCounterDocBaseType​(String DocBaseType)
        Get Counter Document BaseType
        Parameters:
        DocBaseType - Document Base Type (e.g. SOO)
        Returns:
        Counter Document BaseType (e.g. POO) or null if there is none
      • getDocType

        public MDocType getDocType()
        Get Doc Type (immutable)
        Returns:
        doc type or null if not existing
      • getCounterDocType

        public MDocType getCounterDocType()
        Get Counter Doc Type (immutable)
        Returns:
        counter doc type or null if not existing
      • validate

        public String validate()
        Validate Document Type compatability
        Returns:
        Error message or null if valid
      • beforeSave

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