Adempiere 3.5.2a

org.compiere.model
Class MTax

java.lang.Object
  extended by org.compiere.model.PO
      extended by org.compiere.model.X_C_Tax
          extended by org.compiere.model.MTax
All Implemented Interfaces:
Serializable, Comparator, I_C_Tax, I_Persistent, Evaluatee

public class MTax
extends X_C_Tax

Tax Model

Version:
$Id: MTax.java,v 1.3 2006/07/30 00:51:02 jjanke Exp $
Author:
Jorg Janke
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.compiere.model.X_C_Tax
C_COUNTRY_ID_AD_Reference_ID, C_REGION_ID_AD_Reference_ID, PARENT_TAX_ID_AD_Reference_ID, SOPOTYPE_AD_Reference_ID, SOPOTYPE_Both, SOPOTYPE_PurchaseTax, SOPOTYPE_SalesTax, TO_COUNTRY_ID_AD_Reference_ID, TO_REGION_ID_AD_Reference_ID
 
Fields inherited from class org.compiere.model.PO
ACCESSLEVEL_ALL, ACCESSLEVEL_CLIENT, ACCESSLEVEL_CLIENTORG, ACCESSLEVEL_ORG, ACCESSLEVEL_SYSTEM, ACCESSLEVEL_SYSTEMCLIENT, ENTITYTYPE_Dictionary, ENTITYTYPE_UserMaintained, I_ZERO, log, p_ctx, p_info, XML_ATTRIBUTE_AD_Table_ID, XML_ATTRIBUTE_Record_ID
 
Fields inherited from interface org.compiere.model.I_C_Tax
accessLevel, COLUMNNAME_AD_Rule_ID, COLUMNNAME_C_Country_ID, COLUMNNAME_C_Region_ID, COLUMNNAME_C_Tax_ID, COLUMNNAME_C_TaxCategory_ID, COLUMNNAME_Description, COLUMNNAME_IsDefault, COLUMNNAME_IsDocumentLevel, COLUMNNAME_IsSalesTax, COLUMNNAME_IsSummary, COLUMNNAME_IsTaxExempt, COLUMNNAME_Name, COLUMNNAME_Parent_Tax_ID, COLUMNNAME_Rate, COLUMNNAME_RequiresTaxCertificate, COLUMNNAME_SOPOType, COLUMNNAME_TaxIndicator, COLUMNNAME_To_Country_ID, COLUMNNAME_To_Region_ID, COLUMNNAME_ValidFrom, Model, Table_ID, Table_Name
 
Constructor Summary
MTax(Properties ctx, int C_Tax_ID, String trxName)
          Standard Constructor
MTax(Properties ctx, ResultSet rs, String trxName)
          Load Constructor
MTax(Properties ctx, String Name, BigDecimal Rate, int C_TaxCategory_ID, String trxName)
          New Constructor
 
Method Summary
protected  boolean afterSave(boolean newRecord, boolean success)
          After Save
protected  boolean beforeDelete()
          Before Delete
 BigDecimal calculateTax(BigDecimal amount, boolean taxIncluded, int scale)
          Calculate Tax - no rounding
static MTax get(Properties ctx, int C_Tax_ID)
          Get Tax from Cache
static MTax[] getAll(Properties ctx)
          Get All Tax codes (for AD_Client)
 MTax[] getChildTaxes(boolean requery)
          Get Child Taxes
 MTaxPostal[] getPostals(boolean requery)
          Get Postal Qualifiers
 boolean isPostal()
          Do we have Postal Codes
 boolean isZeroTax()
          Is Zero Tax
 String toString()
          String Representation
 
Methods inherited from class org.compiere.model.X_C_Tax
get_AccessLevel, getAD_Rule_ID, getAD_Rule, getC_Country_ID, getC_Region_ID, getC_Tax_ID, getC_TaxCategory_ID, getC_TaxCategory, getDescription, getKeyNamePair, getName, getParent_Tax_ID, getRate, getSOPOType, getTaxIndicator, getTo_Country_ID, getTo_Region_ID, getValidFrom, initPO, isDefault, isDocumentLevel, isRequiresTaxCertificate, isSalesTax, isSummary, isTaxExempt, setAD_Rule_ID, setC_Country_ID, setC_Region_ID, setC_Tax_ID, setC_TaxCategory_ID, setDescription, setIsDefault, setIsDocumentLevel, setIsSalesTax, setIsSummary, setIsTaxExempt, setName, setParent_Tax_ID, setRate, setRequiresTaxCertificate, setSOPOType, setTaxIndicator, setTo_Country_ID, setTo_Region_ID, setValidFrom
 
Methods inherited from class org.compiere.model.PO
afterDelete, beforeSave, compare, copyValues, copyValues, createAttachment, delete_Accounting, delete_Tree, delete, delete, deleteEx, deleteEx, dump, dump, equals, get_ColumnCount, get_ColumnDescription, get_ColumnDisplayType, get_ColumnIndex, get_ColumnLabel, get_ColumnLookup, get_ColumnName, get_DisplayValue, get_HashMap, get_ID, get_IDOld, get_KeyColumns, get_Logger, get_Table_ID, get_TableName, get_Translation, get_TrxName, get_Value, get_Value, get_ValueAsInt, get_ValueAsString, get_ValueDifference, get_ValueDifference, get_ValueE, get_ValueOfColumn, get_ValueOld, get_ValueOld, get_ValueOldAsInt, get_WhereClause, get_xmlDocument, get_xmlString, getAD_Client_ID, getAD_Org_ID, getAllIDs, getAttachment, getAttachment, getAttachmentData, getCreated, getCreatedBy, getCtx, getDoc, getFindParameter, getPdfAttachment, getUpdated, getUpdatedBy, insert_Accounting, insert_Tree, insert_Tree, is_Changed, is_new, is_ValueChanged, is_ValueChanged, isActive, isAttachment, isColumnMandatory, isColumnUpdateable, isMandatoryOK, isPdfAttachment, isReplication, load, load, load, load, loadComplete, loadDefaults, loadSpecial, lock, save, save, saveEx, saveEx, saveNew_getID, saveNewSpecial, saveReplica, saveUpdate, set_ColumnUpdateable, set_CustomColumn, set_TrxName, set_TrxName, set_Value, set_Value, set_ValueE, set_ValueNoCheck, set_ValueNoCheckE, set_ValueOfColumn, set_ValueOfColumn, setAD_Client_ID, setAD_Org_ID, setClientOrg, setClientOrg, setDoc, setDocWorkflowMgr, setIsActive, setReplication, setStandardDefaults, setUpdateable, setUpdatedBy, unlock
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.compiere.model.I_Persistent
save
 

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
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(Properties ctx,
                       int C_Tax_ID)
Get Tax from Cache

Parameters:
ctx - context
C_Tax_ID - id
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()
String Representation

Overrides:
toString in class X_C_Tax
Returns:
info

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

afterSave

protected boolean afterSave(boolean newRecord,
                            boolean success)
After Save

Overrides:
afterSave in class PO
Parameters:
newRecord - new
success - success
Returns:
success

beforeDelete

protected boolean beforeDelete()
Before Delete

Overrides:
beforeDelete in class PO
Returns:
true

Adempiere 3.5.2a

Adempiere® is a registered trademark of ADempiere Business Inc. ©2004-2008 HumanFlash.com All rights reserved.