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
Accounting Schema Model
- 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:
-
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, UUID_NEW_RECORD, 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
ConstructorDescriptionMAcctSchema
(Properties ctx, int C_AcctSchema_ID, String trxName) Standard ConstructorMAcctSchema
(Properties ctx, String C_AcctSchema_UU, String trxName) UUID based ConstructorMAcctSchema
(Properties ctx, ResultSet rs, String trxName) Load ConstructorMAcctSchema
(Properties ctx, MAcctSchema copy) Copy constructorMAcctSchema
(Properties ctx, MAcctSchema copy, String trxName) Copy constructorMAcctSchema
(MAcctSchema copy) Copy constructorMAcctSchema
(MClient client, KeyNamePair currency) Parent Constructor -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
beforeSave
(boolean newRecord) Called before Save for Pre-Save Operation.
Default implementation is nop, to be implemented in sub-classes that needed it.void
Check Costing Setup.static MAcctSchema
get
(int C_AcctSchema_ID) Get AccountSchemastatic MAcctSchema
get
(Properties ctx, int C_AcctSchema_ID) Get AccountSchemastatic MAcctSchema
get
(Properties ctx, int C_AcctSchema_ID, String trxName) Get AccountSchemaGet AcctSchema DefaultsgetAcctSchemaElement
(String elementType) Get AcctSchema Element via element typeAcctSchema ElementsGet 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 MAcctSchema
getCopy
(Properties ctx, int C_AcctSchema_ID, String trxName) Get updateable copy of MAcctSchema from cacheint
Get Costing Precision of accounting CurrencyGet Currency Balancing AccountgetDueFrom_Acct
(String segment) Get Due From Account for SegmentgetDueTo_Acct
(String segment) Get Due To Account for SegmentInteger[]
Get Only Org Childrenint
Get Std Precision of accounting CurrencyGet Suspense Balancing AccountGet Tax Correction Typeboolean
isAcctSchemaElement
(String segmentType) boolean
Is Batch Costing Levelboolean
Is Client Costing Level (default)boolean
Is Org Costing Levelboolean
boolean
boolean
boolean
Is Currency Balancing activeboolean
isSkipOrg
(int AD_Org_ID) Skip creating postings for this Org.boolean
Is Suspense Balancing activeboolean
Tax Correctionboolean
boolean
mark PO as immutablevoid
setOnlyOrgs
(Integer[] orgs) Deprecated.only orgs are now fetched automaticallytoString()
String representationMethods 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, buildInsertSQL, 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_UUID, get_Value, get_Value, get_ValueAsBoolean, get_ValueAsInt, get_ValueAsInt, get_ValueAsString, 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, loadByUU, loadComplete, loadDefaults, loadPO, loadSpecial, lock, makeImmutable, postDelete, retrieveIdOfParentValue, retrieveIdOfParentValue, save, save, saveCrossTenantSafe, saveCrossTenantSafeEx, saveCrossTenantSafeEx, 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, toInsertSQL, 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 Details
-
MAcctSchema
UUID based Constructor- Parameters:
ctx
- ContextC_AcctSchema_UU
- UUID keytrxName
- Transaction
-
MAcctSchema
Standard Constructor- Parameters:
ctx
- contextC_AcctSchema_ID
- idtrxName
- transaction
-
MAcctSchema
Load Constructor- Parameters:
ctx
- contextrs
- result settrxName
- transaction
-
MAcctSchema
Parent Constructor- Parameters:
client
- clientcurrency
- currency
-
MAcctSchema
Copy constructor- Parameters:
copy
-
-
MAcctSchema
Copy constructor- Parameters:
ctx
-copy
-
-
MAcctSchema
Copy constructor- Parameters:
ctx
-copy
-trxName
-
-
-
Method Details
-
get
Get AccountSchema- Parameters:
C_AcctSchema_ID
- schema id- Returns:
- Accounting schema
-
get
Get AccountSchema- Parameters:
ctx
- contextC_AcctSchema_ID
- schema id- Returns:
- Accounting schema
-
get
Get AccountSchema- Parameters:
ctx
- contextC_AcctSchema_ID
- schema idtrxName
- optional trx- Returns:
- Accounting schema
-
getCopy
Get updateable copy of MAcctSchema from cache- Parameters:
ctx
-C_AcctSchema_ID
-trxName
-- Returns:
- MAcctSchema
-
getClientAcctSchema
Get AccountSchema of Client- Parameters:
ctx
- contextAD_Client_ID
- client or 0 for all- Returns:
- Array of AcctSchema of Client
-
getClientAcctSchema
Get AccountSchema of Client- Parameters:
ctx
- contextAD_Client_ID
- client or 0 for alltrxName
- optional trx- Returns:
- Array of AcctSchema of Client
-
getAcctSchemaElements
AcctSchema Elements- Returns:
- Array of AcctSchemaElement
-
getAcctSchemaElement
Get AcctSchema Element via element type- Parameters:
elementType
- segment type - AcctSchemaElement.ELEMENTTYPE_- Returns:
- AcctSchemaElement
-
isAcctSchemaElement
- Parameters:
segmentType
- segment type - AcctSchemaElement.SEGMENT_- Returns:
- true if schema has segment type
-
getAcctSchemaGL
Get AcctSchema GL info- Returns:
- GL info
-
getAcctSchemaDefault
Get AcctSchema Defaults- Returns:
- defaults
-
toString
String representation- Overrides:
toString
in classX_C_AcctSchema
- Returns:
- String representation
-
isSuspenseBalancing
public boolean isSuspenseBalancing()Is Suspense Balancing active- Returns:
- true if schema is using suspense balancing account
-
getSuspenseBalancing_Acct
Get Suspense Balancing Account- Returns:
- suspense balancing account
-
isCurrencyBalancing
public boolean isCurrencyBalancing()Is Currency Balancing active- Returns:
- true if schema is using currency balancing account
-
getCurrencyBalancing_Acct
Get Currency Balancing Account- Returns:
- currency balancing account
-
getDueTo_Acct
Get Due To Account for Segment- Parameters:
segment
- ignored- Returns:
- Account
-
getDueFrom_Acct
Get Due From Account for Segment- Parameters:
segment
- ignored- Returns:
- Account
-
setOnlyOrgs
Deprecated.only orgs are now fetched automaticallySet Only Org Childs- Parameters:
orgs
-- Throws:
IllegalStateException
- every time when you call it
-
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 posting
-
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 schema costing is at client level
-
isCostingLevelOrg
public boolean isCostingLevelOrg()Is Org Costing Level- Returns:
- true if schema costing is at organization level
-
isCostingLevelBatch
public boolean isCostingLevelBatch()Is Batch Costing Level- Returns:
- true if schema costing is at lot/batch level
-
isCreatePOCommitment
public boolean isCreatePOCommitment()- Returns:
- true if using commitments accounting for PO
-
isCreateSOCommitment
public boolean isCreateSOCommitment()- Returns:
- true if using commitments accounting for SO
-
isCreateReservation
public boolean isCreateReservation()- Returns:
- true if create reservations for PO
-
getTaxCorrectionType
Get Tax Correction Type- Specified by:
getTaxCorrectionType
in interfaceI_C_AcctSchema
- Overrides:
getTaxCorrectionType
in classX_C_AcctSchema
- Returns:
- tax correction type (discount, write off or none)
-
isTaxCorrection
public boolean isTaxCorrection()Tax Correction- Returns:
- true if tax correction type is not none
-
isTaxCorrectionDiscount
public boolean isTaxCorrectionDiscount()- Returns:
- true if tax correction type is discount or write off+discount
-
isTaxCorrectionWriteOff
public boolean isTaxCorrectionWriteOff()- Returns:
- true if tax correction type is write off or write off+discount
-
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 classPO
- Parameters:
newRecord
- true if it is a new record- Returns:
- true if record can be saved
-
markImmutable
Description copied from interface:ImmutablePOSupport
mark PO as immutable- Specified by:
markImmutable
in interfaceImmutablePOSupport
- Returns:
- PO
-