Package org.compiere.model
Class MAccount
java.lang.Object
org.compiere.model.PO
org.compiere.model.X_C_ValidCombination
org.compiere.model.MAccount
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparator<Object>
,I_C_ValidCombination
,I_Persistent
,Evaluatee
,ImmutablePOSupport
Combination of account element and segment values
- Version:
- $Id: MAccount.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.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_ValidCombination
accessLevel, COLUMNNAME_Account_ID, COLUMNNAME_AD_Client_ID, COLUMNNAME_AD_Org_ID, COLUMNNAME_AD_OrgTrx_ID, COLUMNNAME_Alias, COLUMNNAME_C_AcctSchema_ID, COLUMNNAME_C_Activity_ID, COLUMNNAME_C_BPartner_ID, COLUMNNAME_C_Campaign_ID, COLUMNNAME_C_LocFrom_ID, COLUMNNAME_C_LocTo_ID, COLUMNNAME_C_Project_ID, COLUMNNAME_C_SalesRegion_ID, COLUMNNAME_C_SubAcct_ID, COLUMNNAME_C_ValidCombination_ID, COLUMNNAME_C_ValidCombination_UU, COLUMNNAME_Combination, COLUMNNAME_Created, COLUMNNAME_CreatedBy, COLUMNNAME_Description, COLUMNNAME_IsActive, COLUMNNAME_IsFullyQualified, COLUMNNAME_M_Product_ID, COLUMNNAME_Updated, COLUMNNAME_UpdatedBy, COLUMNNAME_User1_ID, COLUMNNAME_User2_ID, COLUMNNAME_UserElement1_ID, COLUMNNAME_UserElement2_ID, Model, Table_ID, Table_Name
-
Constructor Summary
ConstructorDescriptionMAccount
(Properties ctx, int C_ValidCombination_ID, String trxName) Default constructorMAccount
(Properties ctx, String C_ValidCombination_UU, String trxName) UUID based ConstructorMAccount
(Properties ctx, ResultSet rs, String trxName) Load constructorMAccount
(Properties ctx, MAccount copy) MAccount
(Properties ctx, MAccount copy, String trxName) MAccount
(MAcctSchema as) Parent Constructor -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
beforeSave
(boolean newRecord) Before Savestatic MAccount
get
(int C_ValidCombination_ID) Get Account from cache (immutable)static MAccount
get
(Properties ctx, int C_ValidCombination_ID) Get Account from cache (immutable)static MAccount
get
(Properties ctx, int ad_Client_ID, int ad_Org_ID, int c_AcctSchema_ID, int new_account_id, int c_SubAcct_ID, int m_Product_ID, int c_BPartner_ID, int ad_OrgTrx_ID, int c_LocFrom_ID, int c_LocTo_ID, int c_SalesRegion_ID, int c_Project_ID, int c_Campaign_ID, int c_Activity_ID, int user1_ID, int user2_ID, int userElement1_ID, int userElement2_ID) Deprecated.static MAccount
get
(Properties ctx, int AD_Client_ID, int AD_Org_ID, int C_AcctSchema_ID, int Account_ID, int C_SubAcct_ID, int M_Product_ID, int C_BPartner_ID, int AD_OrgTrx_ID, int C_LocFrom_ID, int C_LocTo_ID, int C_SalesRegion_ID, int C_Project_ID, int C_Campaign_ID, int C_Activity_ID, int User1_ID, int User2_ID, int UserElement1_ID, int UserElement2_ID, String trxName) Get existing account combination or create a new one (if not exists)static MAccount
get
(Properties ctx, int C_AcctSchema_ID, String alias) Get first with Aliasstatic MAccount
get
(X_Fact_Acct fa) Get from existing Accounting factstatic MAccount
get
(X_Fact_Acct fa, String trxName) Get from existing Accounting factGet Account Typestatic MAccount
getDefault
(Properties ctx, int C_AcctSchema_ID, boolean optionalNull, String trxName) Factory: default combinationstatic MAccount
getDefault
(MAcctSchema acctSchema, boolean optionalNull) Factory: create new account with default combinationboolean
isActiva()
Is this an Activa Accountboolean
Is this a Balance Sheet Accountboolean
Is this a Liability Accountmark PO as immutablevoid
setAccount_ID
(int Account_ID) Set account element idvoid
Set Value and Description and Fully Qualified Flag for CombinationtoString()
Return String representationstatic void
updateValueDescription
(Properties ctx, String where, String trxName) Update Value/Description after change of account element value/description.boolean
validate()
Validate combinationMethods inherited from class org.compiere.model.X_C_ValidCombination
get_AccessLevel, getAccount_ID, getAD_OrgTrx_ID, getAlias, getC_AcctSchema, getC_AcctSchema_ID, getC_Activity, getC_Activity_ID, getC_BPartner, getC_BPartner_ID, getC_Campaign, getC_Campaign_ID, getC_LocFrom, getC_LocFrom_ID, getC_LocTo, getC_LocTo_ID, getC_Project, getC_Project_ID, getC_SalesRegion, getC_SalesRegion_ID, getC_SubAcct, getC_SubAcct_ID, getC_ValidCombination_ID, getC_ValidCombination_UU, getCombination, getDescription, getKeyNamePair, getM_Product, getM_Product_ID, getUser1, getUser1_ID, getUser2, getUser2_ID, getUserElement1_ID, getUserElement2_ID, initPO, isFullyQualified, setAD_OrgTrx_ID, setAlias, setC_AcctSchema_ID, setC_Activity_ID, setC_BPartner_ID, setC_Campaign_ID, setC_LocFrom_ID, setC_LocTo_ID, setC_Project_ID, setC_SalesRegion_ID, setC_SubAcct_ID, setC_ValidCombination_ID, setC_ValidCombination_UU, setCombination, setDescription, setIsFullyQualified, setM_Product_ID, setUser1_ID, setUser2_ID, setUserElement1_ID, setUserElement2_ID
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_ValidCombination
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
-
MAccount
UUID based Constructor- Parameters:
ctx
- ContextC_ValidCombination_UU
- UUID keytrxName
- Transaction
-
MAccount
Default constructor- Parameters:
ctx
- contextC_ValidCombination_ID
- combinationtrxName
- transaction
-
MAccount
Load constructor- Parameters:
ctx
- contextrs
- result settrxName
- transaction
-
MAccount
Parent Constructor- Parameters:
as
- account schema
-
MAccount
- Parameters:
copy
-
-
MAccount
- Parameters:
ctx
-copy
-
-
MAccount
- Parameters:
ctx
-copy
-trxName
-
-
-
Method Details
-
get
@Deprecated public static MAccount get(Properties ctx, int ad_Client_ID, int ad_Org_ID, int c_AcctSchema_ID, int new_account_id, int c_SubAcct_ID, int m_Product_ID, int c_BPartner_ID, int ad_OrgTrx_ID, int c_LocFrom_ID, int c_LocTo_ID, int c_SalesRegion_ID, int c_Project_ID, int c_Campaign_ID, int c_Activity_ID, int user1_ID, int user2_ID, int userElement1_ID, int userElement2_ID) Deprecated. -
get
public static MAccount get(Properties ctx, int AD_Client_ID, int AD_Org_ID, int C_AcctSchema_ID, int Account_ID, int C_SubAcct_ID, int M_Product_ID, int C_BPartner_ID, int AD_OrgTrx_ID, int C_LocFrom_ID, int C_LocTo_ID, int C_SalesRegion_ID, int C_Project_ID, int C_Campaign_ID, int C_Activity_ID, int User1_ID, int User2_ID, int UserElement1_ID, int UserElement2_ID, String trxName) Get existing account combination or create a new one (if not exists)- Parameters:
ctx
- contextAD_Client_ID
-AD_Org_ID
-C_AcctSchema_ID
-Account_ID
-C_SubAcct_ID
-M_Product_ID
-C_BPartner_ID
-AD_OrgTrx_ID
-C_LocFrom_ID
-C_LocTo_ID
-C_SalesRegion_ID
-C_Project_ID
-C_Campaign_ID
-C_Activity_ID
-User1_ID
-User2_ID
-UserElement1_ID
-UserElement2_ID
-trxName
-- Returns:
- account or null
-
get
Get first with Alias- Parameters:
ctx
- contextC_AcctSchema_ID
- asalias
- alias- Returns:
- account
-
get
Get from existing Accounting fact- Parameters:
fa
- accounting fact- Returns:
- account
-
get
Get from existing Accounting fact- Parameters:
fa
- accounting facttrxName
-- Returns:
- account
-
getDefault
public static MAccount getDefault(Properties ctx, int C_AcctSchema_ID, boolean optionalNull, String trxName) Factory: default combination- Parameters:
ctx
- contextC_AcctSchema_ID
- accounting schemaoptionalNull
- if true the optional values are nulltrxName
- transaction- Returns:
- Account
-
getDefault
Factory: create new account with default combination- Parameters:
acctSchema
- accounting schemaoptionalNull
- if true, the optional values are null- Returns:
- new MAccount record
-
get
Get Account from cache (immutable)- Parameters:
C_ValidCombination_ID
- combination- Returns:
- Account
-
get
Get Account from cache (immutable)- Parameters:
ctx
- contextC_ValidCombination_ID
- combination- Returns:
- Immutable instance of Account
-
updateValueDescription
Update Value/Description after change of account element value/description.- Parameters:
ctx
- contextwhere
- where clausetrxName
- transaction
-
toString
Return String representation- Overrides:
toString
in classX_C_ValidCombination
- Returns:
- String
-
setAccount_ID
public void setAccount_ID(int Account_ID) Set account element id- Specified by:
setAccount_ID
in interfaceI_C_ValidCombination
- Overrides:
setAccount_ID
in classX_C_ValidCombination
- Parameters:
Account_ID
- id
-
getAccount
- Specified by:
getAccount
in interfaceI_C_ValidCombination
- Overrides:
getAccount
in classX_C_ValidCombination
- Returns:
- account element value
-
getAccountType
Get Account Type- Returns:
- Account Type of Account Element
-
isBalanceSheet
public boolean isBalanceSheet()Is this a Balance Sheet Account- Returns:
- true if this is a balance sheet account
-
isActiva
public boolean isActiva()Is this an Activa Account- Returns:
- boolean
-
isPassiva
public boolean isPassiva()Is this a Liability Account- Returns:
- true if this is a liability account
-
setValueDescription
public void setValueDescription()Set Value and Description and Fully Qualified Flag for Combination -
validate
public boolean validate()Validate combination- Returns:
- true if valid
-
beforeSave
protected boolean beforeSave(boolean newRecord) Before Save- Overrides:
beforeSave
in classPO
- Parameters:
newRecord
- new- Returns:
- true
-
markImmutable
Description copied from interface:ImmutablePOSupport
mark PO as immutable- Specified by:
markImmutable
in interfaceImmutablePOSupport
- Returns:
- PO
-