Package org.compiere.model
Class MAcctSchema
- java.lang.Object
-
- org.compiere.model.PO
-
- org.compiere.model.X_C_AcctSchema
-
- org.compiere.model.MAcctSchema
-
- All Implemented Interfaces:
Serializable,Cloneable,Comparator<Object>,I_C_AcctSchema,I_Persistent,Evaluatee,ImmutablePOSupport
public class MAcctSchema extends X_C_AcctSchema implements ImmutablePOSupport
Accounting Schema Model (base)- Version:
- $Id: MAcctSchema.java,v 1.4 2006/07/30 00:58:04 jjanke Exp $
- Author:
- Jorg Janke, victor.perez@e-evolution.com, www.e-evolution.com
- RF [ 2214883 ] Remove SQL code and Replace for Query https://sourceforge.net/p/adempiere/feature-requests/557/
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.compiere.model.X_C_AcctSchema
COMMITMENTTYPE_AD_Reference_ID, COMMITMENTTYPE_None, COMMITMENTTYPE_POCommitmentOnly, COMMITMENTTYPE_POCommitmentReservation, COMMITMENTTYPE_POSOCommitment, COMMITMENTTYPE_POSOCommitmentReservation, COMMITMENTTYPE_SOCommitmentOnly, 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, TAXCORRECTIONTYPE_AD_Reference_ID, TAXCORRECTIONTYPE_DiscountOnly, TAXCORRECTIONTYPE_None, TAXCORRECTIONTYPE_Write_OffAndDiscount, TAXCORRECTIONTYPE_Write_OffOnly
-
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, LOCAL_TRX_PREFIX, log, p_ctx, p_info, XML_ATTRIBUTE_AD_Table_ID, XML_ATTRIBUTE_Record_ID
-
Fields inherited from interface org.compiere.model.I_C_AcctSchema
accessLevel, COLUMNNAME_AD_Client_ID, COLUMNNAME_AD_Org_ID, COLUMNNAME_AD_OrgOnly_ID, COLUMNNAME_AutoPeriodControl, COLUMNNAME_C_AcctSchema_ID, COLUMNNAME_C_AcctSchema_UU, COLUMNNAME_C_Currency_ID, COLUMNNAME_C_Period_ID, COLUMNNAME_CommitmentType, COLUMNNAME_CostingLevel, COLUMNNAME_CostingMethod, COLUMNNAME_Created, COLUMNNAME_CreatedBy, COLUMNNAME_Description, COLUMNNAME_GAAP, COLUMNNAME_HasAlias, COLUMNNAME_HasCombination, COLUMNNAME_IsAccrual, COLUMNNAME_IsActive, COLUMNNAME_IsAdjustCOGS, COLUMNNAME_IsAllowNegativePosting, COLUMNNAME_IsDiscountCorrectsTax, COLUMNNAME_IsExplicitCostAdjustment, COLUMNNAME_IsPostIfClearingEqual, COLUMNNAME_IsPostServices, COLUMNNAME_IsTradeDiscountPosted, COLUMNNAME_M_CostType_ID, COLUMNNAME_Name, COLUMNNAME_Period_OpenFuture, COLUMNNAME_Period_OpenHistory, COLUMNNAME_Processing, COLUMNNAME_Separator, COLUMNNAME_TaxCorrectionType, COLUMNNAME_Updated, COLUMNNAME_UpdatedBy, Model, Table_ID, Table_Name
-
-
Constructor Summary
Constructors Constructor Description MAcctSchema(Properties ctx, int C_AcctSchema_ID, String trxName)Standard ConstructorMAcctSchema(Properties ctx, ResultSet rs, String trxName)Load ConstructorMAcctSchema(Properties ctx, MAcctSchema copy)MAcctSchema(Properties ctx, MAcctSchema copy, String trxName)MAcctSchema(MAcctSchema copy)MAcctSchema(MClient client, KeyNamePair currency)Parent Constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected booleanbeforeSave(boolean newRecord)Before SavevoidcheckCosting()Check Costing Setup.static MAcctSchemaget(int C_AcctSchema_ID)Get AccountSchemastatic MAcctSchemaget(Properties ctx, int C_AcctSchema_ID)Get AccountSchemastatic MAcctSchemaget(Properties ctx, int C_AcctSchema_ID, String trxName)Get AccountSchemaMAcctSchemaDefaultgetAcctSchemaDefault()Get AcctSchema DefaultsMAcctSchemaElementgetAcctSchemaElement(String elementType)Get AcctSchema ElementMAcctSchemaElement[]getAcctSchemaElements()AcctSchema ElementsMAcctSchemaGLgetAcctSchemaGL()Get AcctSchema GL infostatic MAcctSchema[]getClientAcctSchema(Properties ctx, int AD_Client_ID)Get AccountSchema of Clientstatic MAcctSchema[]getClientAcctSchema(Properties ctx, int AD_Client_ID, String trxName)Get AccountSchema of Clientstatic MAcctSchemagetCopy(Properties ctx, int C_AcctSchema_ID, String trxName)Get updateable copy of MAcctSchema from cacheintgetCostingPrecision()Get Costing Precision of accounting CurrencyMAccountgetCurrencyBalancing_Acct()Get Currency Balancing AccountMAccountgetDueFrom_Acct(String segment)Get Due From Account for SegmentMAccountgetDueTo_Acct(String segment)Get Due To Account for SegmentInteger[]getOnlyOrgs()Get Only Org ChildrenintgetStdPrecision()Get Std Precision of accounting CurrencyMAccountgetSuspenseBalancing_Acct()Get Suspense Error AccountStringgetTaxCorrectionType()Get Tax Correction TypebooleanisAcctSchemaElement(String segmentType)Has AcctSchema ElementbooleanisCostingLevelBatch()Is Batch Costing LevelbooleanisCostingLevelClient()Is Client Costing Level (default)booleanisCostingLevelOrg()Is Org Costing LevelbooleanisCreatePOCommitment()Create PO Commitment AccountingbooleanisCreateReservation()Create Commitment/Reservation AccountingbooleanisCreateSOCommitment()Create SO Commitment AccountingbooleanisCurrencyBalancing()Is Currency Balancing activebooleanisSkipOrg(int AD_Org_ID)Skip creating postings for this Org.booleanisSuspenseBalancing()Is Suspense Balancing activebooleanisTaxCorrection()Tax CorrectionbooleanisTaxCorrectionDiscount()Tax Correction for DiscountbooleanisTaxCorrectionWriteOff()Tax Correction for WriteOffMAcctSchemamarkImmutable()mark PO as immutablevoidsetOnlyOrgs(Integer[] orgs)Deprecated.only orgs are now fetched automaticallyStringtoString()String representation-
Methods inherited from class org.compiere.model.X_C_AcctSchema
get_AccessLevel, getAD_OrgOnly_ID, getC_AcctSchema_ID, getC_AcctSchema_UU, getC_Currency, getC_Currency_ID, getC_Period, getC_Period_ID, getCommitmentType, getCostingLevel, getCostingMethod, getDescription, getGAAP, getKeyNamePair, getM_CostType, getM_CostType_ID, getName, getPeriod_OpenFuture, getPeriod_OpenHistory, getSeparator, initPO, isAccrual, isAdjustCOGS, isAllowNegativePosting, isAutoPeriodControl, isDiscountCorrectsTax, isExplicitCostAdjustment, isHasAlias, isHasCombination, isPostIfClearingEqual, isPostServices, isProcessing, isTradeDiscountPosted, setAD_OrgOnly_ID, setAutoPeriodControl, setC_AcctSchema_ID, setC_AcctSchema_UU, setC_Currency_ID, setC_Period_ID, setCommitmentType, setCostingLevel, setCostingMethod, setDescription, setGAAP, setHasAlias, setHasCombination, setIsAccrual, setIsAdjustCOGS, setIsAllowNegativePosting, setIsDiscountCorrectsTax, setIsExplicitCostAdjustment, setIsPostIfClearingEqual, setIsPostServices, setIsTradeDiscountPosted, setM_CostType_ID, setName, setPeriod_OpenFuture, setPeriod_OpenHistory, setProcessing, setSeparator, setTaxCorrectionType
-
Methods inherited from class org.compiere.model.PO
afterDelete, afterSave, beforeDelete, checkImmutable, clearCrossTenantSafe, clone, columnExists, columnExists, compare, copyPO, copyValues, copyValues, createAttachment, delete, delete, delete_Accounting, delete_Tree, deleteEx, deleteEx, dump, dump, equals, get_Attribute, get_Attributes, 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_OptimisticLockingColumns, get_Table_ID, get_TableName, get_Translation, get_Translation, get_Translation, get_Translation, get_Translation, get_TrxName, get_Value, get_Value, get_ValueAsBoolean, get_ValueAsInt, get_ValueAsInt, get_ValueAsString, get_ValueDifference, get_ValueDifference, get_ValueE, get_ValueOfColumn, get_ValueOld, get_ValueOld, get_ValueOldAsInt, get_WhereClause, get_WhereClause, get_xmlDocument, get_xmlString, getAD_Client_ID, getAD_Org_ID, getAllIDs, getAttachment, getAttachment, getAttachmentData, getCreated, getCreatedBy, getCtx, getDoc, getFindParameter, getPdfAttachment, getUpdated, getUpdatedBy, getUUIDColumnName, getUUIDColumnName, hashCode, insert_Accounting, insert_Tree, insert_Tree, is_Changed, is_Immutable, is_new, is_UseOptimisticLocking, is_ValueChanged, is_ValueChanged, isActive, isAttachment, isColumnMandatory, isColumnUpdateable, isMandatoryOK, isPdfAttachment, isReplication, load, load, load, load, load, loadByUU, loadComplete, loadDefaults, loadSpecial, lock, makeImmutable, postDelete, retrieveIdOfParentValue, retrieveIdOfParentValue, save, save, saveEx, saveEx, saveNew_afterSetID, saveNew_getID, saveNewSpecial, saveReplica, saveUpdate, set_Attribute, set_ColumnUpdateable, set_CustomColumn, set_CustomColumnReturningBoolean, set_OptimisticLockingColumns, set_TrxName, set_TrxName, set_UseOptimisticLocking, set_Value, set_Value, set_Value, set_Value, set_ValueE, set_ValueNoCheck, set_ValueNoCheckE, set_ValueOfColumn, set_ValueOfColumn, set_ValueOfColumnReturningBoolean, set_ValueOfColumnReturningBoolean, setAD_Client_ID, setAD_Org_ID, setClientOrg, setClientOrg, setCrossTenantSafe, setDoc, setDocWorkflowMgr, setIsActive, setProcessedOn, setReplication, setStandardDefaults, setUpdateable, setUpdatedBy, unlock, update_Tree, validForeignKeys
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Comparator
reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Methods inherited from interface org.compiere.model.I_C_AcctSchema
getAD_Client_ID, getAD_Org_ID, getCreated, getCreatedBy, getUpdated, getUpdatedBy, isActive, setAD_Org_ID, setIsActive
-
Methods inherited from interface org.compiere.model.I_Persistent
save
-
-
-
-
Constructor Detail
-
MAcctSchema
public MAcctSchema(Properties ctx, int C_AcctSchema_ID, String trxName)
Standard Constructor- Parameters:
ctx- contextC_AcctSchema_ID- idtrxName- transaction
-
MAcctSchema
public MAcctSchema(Properties ctx, ResultSet rs, String trxName)
Load Constructor- Parameters:
ctx- contextrs- result settrxName- transaction
-
MAcctSchema
public MAcctSchema(MClient client, KeyNamePair currency)
Parent Constructor- Parameters:
client- clientcurrency- currency
-
MAcctSchema
public MAcctSchema(MAcctSchema copy)
- Parameters:
copy-
-
MAcctSchema
public MAcctSchema(Properties ctx, MAcctSchema copy)
- Parameters:
ctx-copy-
-
MAcctSchema
public MAcctSchema(Properties ctx, MAcctSchema copy, String trxName)
- Parameters:
ctx-copy-trxName-
-
-
Method Detail
-
get
public static MAcctSchema get(int C_AcctSchema_ID)
Get AccountSchema- Parameters:
C_AcctSchema_ID- schema id- Returns:
- Accounting schema
-
get
public static MAcctSchema get(Properties ctx, int C_AcctSchema_ID)
Get AccountSchema- Parameters:
ctx- contextC_AcctSchema_ID- schema id- Returns:
- Accounting schema
-
get
public static MAcctSchema get(Properties ctx, int C_AcctSchema_ID, String trxName)
Get AccountSchema- Parameters:
ctx- contextC_AcctSchema_ID- schema idtrxName- optional trx- Returns:
- Accounting schema
-
getCopy
public static MAcctSchema getCopy(Properties ctx, int C_AcctSchema_ID, String trxName)
Get updateable copy of MAcctSchema from cache- Parameters:
ctx-C_AcctSchema_ID-trxName-- Returns:
- MAcctSchema
-
getClientAcctSchema
public static MAcctSchema[] getClientAcctSchema(Properties ctx, int AD_Client_ID)
Get AccountSchema of Client- Parameters:
ctx- contextAD_Client_ID- client or 0 for all- Returns:
- Array of AcctSchema of Client
-
getClientAcctSchema
public static MAcctSchema[] getClientAcctSchema(Properties ctx, int AD_Client_ID, String trxName)
Get AccountSchema of Client- Parameters:
ctx- contextAD_Client_ID- client or 0 for alltrxName- 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:
toStringin classX_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)
Deprecated.only orgs are now fetched automaticallySet Only Org Childs- Parameters:
orgs-- Throws:
IllegalStateException- every time when you call it
-
getOnlyOrgs
public Integer[] getOnlyOrgs()
Get Only Org Children- Returns:
- array of AD_Org_ID
-
isSkipOrg
public boolean isSkipOrg(int AD_Org_ID)
Skip creating postings for this Org.- 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
-
isCreatePOCommitment
public boolean isCreatePOCommitment()
Create PO Commitment Accounting- Returns:
- true if creaet commitments
-
isCreateSOCommitment
public boolean isCreateSOCommitment()
Create SO 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- Specified by:
getTaxCorrectionTypein interfaceI_C_AcctSchema- Overrides:
getTaxCorrectionTypein classX_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
-
beforeSave
protected boolean beforeSave(boolean newRecord)
Before Save- Overrides:
beforeSavein classPO- Parameters:
newRecord- new- Returns:
- true
-
markImmutable
public MAcctSchema markImmutable()
Description copied from interface:ImmutablePOSupportmark PO as immutable- Specified by:
markImmutablein interfaceImmutablePOSupport- Returns:
- PO
-
-