Compiere 3.1

org.compiere.model
Class MAcctSchema

java.lang.Object
  extended by org.compiere.framework.PO
      extended by org.compiere.model.X_C_AcctSchema
          extended by org.compiere.model.MAcctSchema
All Implemented Interfaces:
Serializable, Cloneable, Comparator<PO>, Evaluatee

public class MAcctSchema
extends X_C_AcctSchema

Accounting Schema Model (base)

Version:
$Id: MAcctSchema.java,v 1.4 2006/07/30 00:58:04 jjanke Exp $
Author:
Jorg Janke
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.compiere.model.X_C_AcctSchema
accessLevel, AD_ORGONLY_ID_AD_Reference_ID, COMMITMENTTYPE_AD_Reference_ID, COMMITMENTTYPE_CommitmentOnly, COMMITMENTTYPE_CommitmentReservation, COMMITMENTTYPE_None, COSTINGLEVEL_AD_Reference_ID, COSTINGLEVEL_BatchLot, COSTINGLEVEL_Client, COSTINGLEVEL_Organization, COSTINGMETHOD__, COSTINGMETHOD_AD_Reference_ID, COSTINGMETHOD_AverageInvoice, COSTINGMETHOD_AveragePO, COSTINGMETHOD_FiFo, COSTINGMETHOD_LastInvoice, COSTINGMETHOD_LastPOPrice, COSTINGMETHOD_LiFo, COSTINGMETHOD_StandardCosting, COSTINGMETHOD_UserDefined, GAAP_AD_Reference_ID, GAAP_CustomAccountingRules, GAAP_FrenchAccountingStandard, GAAP_GermanHGB, GAAP_InternationalGAAP, GAAP_USGAAP, Model, Table_ID, Table_Name, TAXCORRECTIONTYPE_AD_Reference_ID, TAXCORRECTIONTYPE_DiscountOnly, TAXCORRECTIONTYPE_None, TAXCORRECTIONTYPE_Write_OffAndDiscount, TAXCORRECTIONTYPE_Write_OffOnly, updatedMS
 
Fields inherited from class org.compiere.framework.PO
ACCESSLEVEL_ALL, ACCESSLEVEL_CLIENT, ACCESSLEVEL_CLIENTORG, ACCESSLEVEL_ORG, ACCESSLEVEL_SYSTEM, ACCESSLEVEL_SYSTEMCLIENT, ENTITYTYPE_Dictionary, ENTITYTYPE_UserMaintained, I_ZERO, log, p_changeVO, p_info, XML_ATTRIBUTE_AD_Table_ID, XML_ATTRIBUTE_Record_ID
 
Constructor Summary
MAcctSchema(Ctx ctx, int C_AcctSchema_ID, String trxName)
          Standard Constructor
MAcctSchema(Ctx ctx, ResultSet rs, String trxName)
          Load Constructor
MAcctSchema(MClient client, KeyNamePair currency)
          Parent Constructor
 
Method Summary
protected  boolean beforeSave(boolean newRecord)
          Before Save
 void checkCosting()
          Check Costing Setup.
static MAcctSchema get(Ctx ctx, int C_AcctSchema_ID)
          Get AccountSchema of Client
static MAcctSchema get(Ctx ctx, int C_AcctSchema_ID, String trxName)
          Get AccountSchema of Client
 MAcctSchemaDefault getAcctSchemaDefault()
          Get AcctSchema Defaults
 MAcctSchemaElement getAcctSchemaElement(String elementType)
          Get AcctSchema Element
 MAcctSchemaElement[] getAcctSchemaElements()
          AcctSchema Elements
 MAcctSchemaGL getAcctSchemaGL()
          Get AcctSchema GL info
static MAcctSchema[] getClientAcctSchema(Ctx ctx, int AD_Client_ID)
          Get AccountSchema of Client
static MAcctSchema[] getClientAcctSchema(Ctx ctx, int AD_Client_ID, String trxName)
          Get AccountSchema of Client
 int getCostingPrecision()
          Get Costing Precision of accounting Currency
 MAccount getCurrencyBalancing_Acct()
          Get Currency Balancing Account
 MAccount getDueFrom_Acct(String segment)
          Get Due From Account for Segment
 MAccount getDueTo_Acct(String segment)
          Get Due To Account for Segment
 Integer[] getOnlyOrgs()
          Set Only Org Childs
 int getStdPrecision()
          Get Std Precision of accounting Currency
 MAccount getSuspenseBalancing_Acct()
          Get Suspense Error Account
 String getTaxCorrectionType()
          Get Tax Correction Type
 boolean isAcctSchemaElement(String segmentType)
          Has AcctSchema Element
 boolean isAutoPeriodControlOpen(Timestamp dateAcct)
          Does the dateAcct fall in the range
 boolean isCostingLevelBatch()
          Is Batch Costing Level
 boolean isCostingLevelClient()
          Is Client Costing Level (default)
 boolean isCostingLevelOrg()
          Is Org Costing Level
 boolean isCreateCommitment()
          Create Commitment Accounting
 boolean isCreateReservation()
          Create Commitment/Reservation Accounting
 boolean isCurrencyBalancing()
          Is Currency Balancing active
 boolean isSkipOrg(int AD_Org_ID)
          Skip creating postings for this Org.
 boolean isSuspenseBalancing()
          Is Suspense Balancing active
 boolean isTaxCorrection()
          Tax Correction
 boolean isTaxCorrectionDiscount()
          Tax Correction for Discount
 boolean isTaxCorrectionWriteOff()
          Tax Correction for WriteOff
 void setOnlyOrgs(Integer[] orgs)
          Set Only Org Children
 String toString()
          String representation
 
Methods inherited from class org.compiere.model.X_C_AcctSchema
get_AccessLevel, getAD_OrgOnly_ID, getC_AcctSchema_ID, getC_Currency_ID, getC_Period_ID, getCommitmentType, getCostingLevel, getCostingMethod, getDescription, getGAAP, getKeyNamePair, getM_CostType_ID, getName, getPeriod_OpenFuture, getPeriod_OpenHistory, getSeparator, initPO, isAccrual, isAdjustCOGS, isAutoPeriodControl, isCommitmentTypeValid, isCostingLevelValid, isCostingMethodValid, isDiscountCorrectsTax, isExplicitCostAdjustment, isGAAPValid, isHasAlias, isHasCombination, isPostServices, isProcessing, isTaxCorrectionTypeValid, isTradeDiscountPosted, setAD_OrgOnly_ID, setAutoPeriodControl, setC_AcctSchema_ID, setC_Currency_ID, setC_Period_ID, setCommitmentType, setCostingLevel, setCostingMethod, setDescription, setGAAP, setHasAlias, setHasCombination, setIsAccrual, setIsAdjustCOGS, setIsDiscountCorrectsTax, setIsExplicitCostAdjustment, setIsPostServices, setIsTradeDiscountPosted, setM_CostType_ID, setName, setPeriod_OpenFuture, setPeriod_OpenHistory, setProcessing, setSeparator, setTaxCorrectionType
 
Methods inherited from class org.compiere.framework.PO
addAttachment, addAttachment, addError, afterDelete, afterSave, beforeDelete, compare, convertToBigDecimal, convertToBoolean, convertToInt, convertToTimestamp, copy, copyValues, copyValues, createAttachment, delete_Accounting, delete, delete, dump, dump, equals, get_ChangeVO, get_ColumnCount, get_ColumnDescription, get_ColumnDisplayType, get_ColumnIndex, get_ColumnLabel, get_ColumnLookup, get_ColumnName, get_DisplayValue, get_EntityType, get_HashMap, get_ID, get_IDOld, get_Info, get_KeyColumns, get_Logger, get_Table_ID, get_Table_ID, get_TableName, get_Translation, get_TrxName, get_Value, get_Value, get_ValueAsInt, get_ValueAsInt, get_ValueAsString, get_ValueDifference, get_ValueDifference, get_ValueOfColumn, get_ValueOld, get_ValueOld, get_ValueOldAsInt, get_ValuesAsString, get_WhereClause, get_xmlDocument, get_xmlString, get_xmlString, getAD_Client_ID, getAD_Org_ID, getAllIDs, getAttachment, getAttachment, getAttachmentData, getCreated, getCreatedBy, getCtx, getFindParameter, getPdfAttachment, getUpdated, getUpdatedBy, getVO, hashCode, insert_Accounting, is_Changed, is_KeyColumn, is_new, is_ValueChanged, is_ValueChanged, isActive, isAttachment, isColumnMandatory, isColumnUpdateable, isMandatoryOK, isPdfAttachment, load, load, load, load, loadComplete, loadDefaults, loadSpecial, lock, save, save, saveNew_getID, saveNewInsertSQL, saveNewSpecial, saveUpdate, set_ChangeVO, set_ColumnUpdateable, set_CustomColumn, set_TrxName, set_Value, set_Value, set_ValueE, set_ValueNoCheck, set_ValueNoCheckE, set_ValueOfColumn, set_ValueString, setAD_Client_ID, setAD_Org_ID, setClientOrg, setClientOrg, setContext, setCtx, setDocWorkflowMgr, setIsActive, setStandardDefaults, setUpdateable, setUpdatedBy, toStringX, unlock, update
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MAcctSchema

public MAcctSchema(Ctx ctx,
                   int C_AcctSchema_ID,
                   String trxName)
Standard Constructor

Parameters:
ctx - context
C_AcctSchema_ID - id
trxName - transaction

MAcctSchema

public MAcctSchema(Ctx ctx,
                   ResultSet rs,
                   String trxName)
Load Constructor

Parameters:
ctx - context
rs - result set
trxName - transaction

MAcctSchema

public MAcctSchema(MClient client,
                   KeyNamePair currency)
Parent Constructor

Parameters:
client - client
currency - currency
Method Detail

get

public static MAcctSchema get(Ctx ctx,
                              int C_AcctSchema_ID)
Get AccountSchema of Client

Parameters:
ctx - context
C_AcctSchema_ID - schema id
Returns:
Accounting schema

get

public static MAcctSchema get(Ctx ctx,
                              int C_AcctSchema_ID,
                              String trxName)
Get AccountSchema of Client

Parameters:
ctx - context
C_AcctSchema_ID - schema id
trxName - optional trx
Returns:
Accounting schema

getClientAcctSchema

public static MAcctSchema[] getClientAcctSchema(Ctx ctx,
                                                int AD_Client_ID)
Get AccountSchema of Client

Parameters:
ctx - context
AD_Client_ID - client or 0 for all
Returns:
Array of AcctSchema of Client

getClientAcctSchema

public static MAcctSchema[] getClientAcctSchema(Ctx ctx,
                                                int AD_Client_ID,
                                                String trxName)
Get AccountSchema of Client

Parameters:
ctx - context
AD_Client_ID - client or 0 for all
trxName - optional trx
Returns:
Array of AcctSchema of Client

getAcctSchemaElements

public MAcctSchemaElement[] getAcctSchemaElements()
AcctSchema Elements

Returns:
ArrayList of AcctSchemaElement

getAcctSchemaElement

public MAcctSchemaElement getAcctSchemaElement(String elementType)
Get AcctSchema Element

Parameters:
elementType - segment type - AcctSchemaElement.ELEMENTTYPE_
Returns:
AcctSchemaElement

isAcctSchemaElement

public boolean isAcctSchemaElement(String segmentType)
Has AcctSchema Element

Parameters:
segmentType - segment type - AcctSchemaElement.SEGMENT_
Returns:
true if schema has segment type

getAcctSchemaGL

public MAcctSchemaGL getAcctSchemaGL()
Get AcctSchema GL info

Returns:
GL info

getAcctSchemaDefault

public MAcctSchemaDefault getAcctSchemaDefault()
Get AcctSchema Defaults

Returns:
defaults

toString

public String toString()
String representation

Overrides:
toString in class X_C_AcctSchema
Returns:
String rep

isSuspenseBalancing

public boolean isSuspenseBalancing()
Is Suspense Balancing active

Returns:
suspense balancing

getSuspenseBalancing_Acct

public MAccount getSuspenseBalancing_Acct()
Get Suspense Error Account

Returns:
suspense error account

isCurrencyBalancing

public boolean isCurrencyBalancing()
Is Currency Balancing active

Returns:
suspense balancing

getCurrencyBalancing_Acct

public MAccount getCurrencyBalancing_Acct()
Get Currency Balancing Account

Returns:
currency balancing account

getDueTo_Acct

public MAccount getDueTo_Acct(String segment)
Get Due To Account for Segment

Parameters:
segment - ignored
Returns:
Account

getDueFrom_Acct

public MAccount getDueFrom_Acct(String segment)
Get Due From Account for Segment

Parameters:
segment - ignored
Returns:
Account

setOnlyOrgs

public void setOnlyOrgs(Integer[] orgs)
Set Only Org Children

Parameters:
orgs -

getOnlyOrgs

public Integer[] getOnlyOrgs()
Set Only Org Childs

Returns:
orgs

isSkipOrg

public boolean isSkipOrg(int AD_Org_ID)
Skip creating postings for this Org. Requires setOnlyOrgs (MReportTree requires MTree in Basis)

Parameters:
AD_Org_ID -
Returns:
true if to skip

getStdPrecision

public int getStdPrecision()
Get Std Precision of accounting Currency

Returns:
precision

getCostingPrecision

public int getCostingPrecision()
Get Costing Precision of accounting Currency

Returns:
precision

checkCosting

public void checkCosting()
Check Costing Setup. Make sure that there is a Cost Type and Cost Element


isCostingLevelClient

public boolean isCostingLevelClient()
Is Client Costing Level (default)

Returns:
true if Client

isCostingLevelOrg

public boolean isCostingLevelOrg()
Is Org Costing Level

Returns:
true if Org

isCostingLevelBatch

public boolean isCostingLevelBatch()
Is Batch Costing Level

Returns:
true if Batch

isCreateCommitment

public boolean isCreateCommitment()
Create Commitment Accounting

Returns:
true if creaet commitments

isCreateReservation

public boolean isCreateReservation()
Create Commitment/Reservation Accounting

Returns:
true if create reservations

getTaxCorrectionType

public String getTaxCorrectionType()
Get Tax Correction Type

Overrides:
getTaxCorrectionType in class X_C_AcctSchema
Returns:
tax correction type

isTaxCorrection

public boolean isTaxCorrection()
Tax Correction

Returns:
true if not none

isTaxCorrectionDiscount

public boolean isTaxCorrectionDiscount()
Tax Correction for Discount

Returns:
true if tax is corrected for Discount

isTaxCorrectionWriteOff

public boolean isTaxCorrectionWriteOff()
Tax Correction for WriteOff

Returns:
true if tax is corrected for WriteOff

isAutoPeriodControlOpen

public boolean isAutoPeriodControlOpen(Timestamp dateAcct)
Does the dateAcct fall in the range

Parameters:
dateAcct -
Returns:
true if falls within range

beforeSave

protected boolean beforeSave(boolean newRecord)
Before Save

Overrides:
beforeSave in class PO
Parameters:
newRecord - new
Returns:
true

Compiere 3.1

Compiere® is a registered trademark of ComPiere, Inc. ©2004-2008 HumanFlash.com All rights reserved.