Class MTax

    • Constructor Detail

      • MTax

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

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

        public MTax​(Properties ctx,
                    String Name,
                    BigDecimal Rate,
                    int C_TaxCategory_ID,
                    String trxName)
        New Constructor
        Parameters:
        ctx -
        Name -
        Rate -
        C_TaxCategory_ID -
        trxName - transaction
      • MTax

        public MTax​(MTax copy)
        Parameters:
        copy -
      • MTax

        public MTax​(Properties ctx,
                    MTax copy)
        Parameters:
        ctx -
        copy -
      • MTax

        public MTax​(Properties ctx,
                    MTax copy,
                    String trxName)
        Parameters:
        ctx -
        copy -
        trxName -
    • Method Detail

      • getAll

        public static MTax[] getAll​(Properties ctx)
        Get All Tax codes (for AD_Client)
        Parameters:
        ctx - context
        Returns:
        MTax
      • get

        public static MTax get​(int C_Tax_ID)
        Get Tax from Cache (immutable)
        Parameters:
        C_Tax_ID - id
        Returns:
        MTax
      • get

        public static MTax get​(Properties ctx,
                               int C_Tax_ID)
        Get Tax from Cache (immutable)
        Parameters:
        ctx - context
        C_Tax_ID - id
        Returns:
        MTax
      • getCopy

        public static MTax getCopy​(Properties ctx,
                                   int C_Tax_ID,
                                   String trxName)
        Get updateable copy of MTax from cache
        Parameters:
        ctx -
        C_Tax_ID -
        trxName -
        Returns:
        MTax
      • getChildTaxes

        public MTax[] getChildTaxes​(boolean requery)
        Get Child Taxes
        Parameters:
        requery - reload
        Returns:
        array of taxes or null
      • getPostals

        public MTaxPostal[] getPostals​(boolean requery)
        Get Postal Qualifiers
        Parameters:
        requery - requery
        Returns:
        array of postal codes
      • isPostal

        public boolean isPostal()
        Do we have Postal Codes
        Returns:
        true if postal codes exist
      • isZeroTax

        public boolean isZeroTax()
        Is Zero Tax
        Returns:
        true if tax rate is 0
      • toString

        public String toString()
        Description copied from class: PO
        String representation
        Overrides:
        toString in class X_C_Tax
        Returns:
        String representation
      • calculateTax

        public BigDecimal calculateTax​(BigDecimal amount,
                                       boolean taxIncluded,
                                       int scale)
        Calculate Tax - no rounding
        Parameters:
        amount - amount
        taxIncluded - if true tax is calculated from gross otherwise from net
        scale - scale
        Returns:
        tax amount
      • beforeSave

        protected boolean beforeSave​(boolean newRecord)
        Description copied from class: PO
        Called before Save for Pre-Save Operation
        Overrides:
        beforeSave in class PO
        Parameters:
        newRecord - new record
        Returns:
        true if record can be saved
      • afterSave

        protected boolean afterSave​(boolean newRecord,
                                    boolean success)
        After Save
        Overrides:
        afterSave in class PO
        Parameters:
        newRecord - new
        success - success
        Returns:
        success