Class MTax

All Implemented Interfaces:
Serializable, Cloneable, Comparator<Object>, I_C_Tax, I_Persistent, Evaluatee, ImmutablePOSupport

public class MTax extends X_C_Tax implements ImmutablePOSupport
Tax Model
Version:
$Id: MTax.java,v 1.3 2006/07/30 00:51:02 jjanke Exp $ red1 - FR: [ 2214883 ] Remove SQL code and Replace for Query trifonnt - BF [2913276] - Allow only one Default Tax Rate per Tax Category mjmckay - BF [2948632] - Allow edits to the Default Tax Rate
Author:
Jorg Janke
See Also:
  • Constructor Details

    • MTax

      public MTax(Properties ctx, String C_Tax_UU, String trxName)
      UUID based Constructor
      Parameters:
      ctx - Context
      C_Tax_UU - UUID key
      trxName - Transaction
    • 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 record Constructor
      Parameters:
      ctx -
      Name -
      Rate -
      C_TaxCategory_ID -
      trxName - transaction
    • MTax

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

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

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

    • getAll

      public static MTax[] getAll(Properties ctx)
      Get All Tax codes for client of this session/context
      Parameters:
      ctx - context
      Returns:
      array of 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 - true to reload from DB
      Returns:
      array of taxes or null
    • getPostals

      public MTaxPostal[] getPostals(boolean requery)
      Get Postal Qualifiers
      Parameters:
      requery - true to reload from DB
      Returns:
      array of MTaxPostal
    • isPostal

      public boolean isPostal()
      Is this tax uses postal code criteria
      Returns:
      true if uses postal code criteria
    • 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 Amount
      Parameters:
      amount - base amount to calculate tax amount
      taxIncluded - if true tax amount is already included in the amount parameter and we need to extract tax amount from it.
      scale - rounding scale for tax amount
      Returns:
      tax amount
    • 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
    • afterSave

      protected boolean afterSave(boolean newRecord, boolean success)
      Description copied from class: PO
      Called after Save for Post-Save Operation.
      Default implementation is nop, to be implemented in sub-classes that needed it.
      Overrides:
      afterSave in class PO
      Parameters:
      newRecord - true if it is a new record
      success - true if save operation was success
      Returns:
      if save was a success
    • markImmutable

      public MTax markImmutable()
      Description copied from interface: ImmutablePOSupport
      mark PO as immutable
      Specified by:
      markImmutable in interface ImmutablePOSupport
      Returns:
      PO
    • isDistributeTaxWithLineItem

      public boolean isDistributeTaxWithLineItem()
      Returns:
      - true if tax is posted to the product asset account and added to product cost (non deductible input tax).
      - false if tax is posted to a separate GL account from product asset account (deductible input tax).