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
public class MAccount extends X_C_ValidCombination implements ImmutablePOSupport
Account Object Entity to maintain all segment values. C_ValidCombination- 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:
- Serialized Form
-
-
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, 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
Constructors Constructor Description MAccount(Properties ctx, int C_ValidCombination_ID, String trxName)
Default constructorMAccount(Properties ctx, ResultSet rs, String trxName)
Load constructorMAccount(Properties ctx, MAccount copy)
MAccount(Properties ctx, MAccount copy, String trxName)
MAccount(MAccount copy)
MAccount(MAcctSchema as)
Parent Constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected 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 or create itstatic MAccount
get(Properties ctx, int C_AcctSchema_ID, String alias)
Get first with Aliasstatic MAccount
get(X_Fact_Acct fa)
Get from existing Accounting factMElementValue
getAccount()
Set Account_IDString
getAccountType()
Get Account Typestatic MAccount
getDefault(Properties ctx, int C_AcctSchema_ID, boolean optionalNull, String trxName)
Factory: default combinationstatic MAccount
getDefault(MAcctSchema acctSchema, boolean optionalNull)
Factory: default combinationboolean
isActiva()
Is this an Activa Accountboolean
isBalanceSheet()
Is this a Balance Sheet Accountboolean
isPassiva()
Is this a Passiva Accountstatic void
main(String[] args)
TestMAccount
markImmutable()
mark PO as immutablevoid
setAccount_ID(int Account_ID)
Set Account_IDvoid
setValueDescription()
Set Value and Description and Fully Qualified Flag for CombinationString
toString()
Return String representationstatic void
updateValueDescription(Properties ctx, String where, String trxName)
Update Value/Description after change of account element value/description.boolean
validate()
Validate combination-
Methods 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, 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_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 Detail
-
MAccount
public MAccount(Properties ctx, int C_ValidCombination_ID, String trxName)
Default constructor- Parameters:
ctx
- contextC_ValidCombination_ID
- combinationtrxName
- transaction
-
MAccount
public MAccount(Properties ctx, ResultSet rs, String trxName)
Load constructor- Parameters:
ctx
- contextrs
- result settrxName
- transaction
-
MAccount
public MAccount(MAcctSchema as)
Parent Constructor- Parameters:
as
- account schema
-
MAccount
public MAccount(MAccount copy)
- Parameters:
copy
-
-
MAccount
public MAccount(Properties ctx, MAccount copy)
- Parameters:
ctx
-copy
-
-
MAccount
public MAccount(Properties ctx, MAccount copy, String trxName)
- Parameters:
ctx
-copy
-trxName
-
-
-
Method Detail
-
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 or create it- 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
public static MAccount get(Properties ctx, int C_AcctSchema_ID, String alias)
Get first with Alias- Parameters:
ctx
- contextC_AcctSchema_ID
- asalias
- alias- Returns:
- account
-
get
public static MAccount get(X_Fact_Acct fa)
Get from existing Accounting fact- Parameters:
fa
- accounting fact- 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
public static MAccount getDefault(MAcctSchema acctSchema, boolean optionalNull)
Factory: default combination- Parameters:
acctSchema
- accounting schemaoptionalNull
- if true, the optional values are null- Returns:
- Account
-
get
public static MAccount get(int C_ValidCombination_ID)
Get Account from cache (immutable)- Parameters:
C_ValidCombination_ID
- combination- Returns:
- Account
-
get
public static MAccount get(Properties ctx, int C_ValidCombination_ID)
Get Account from cache (immutable)- Parameters:
ctx
- contextC_ValidCombination_ID
- combination- Returns:
- Immutable instance of Account
-
updateValueDescription
public static void updateValueDescription(Properties ctx, String where, String trxName)
Update Value/Description after change of account element value/description.- Parameters:
ctx
- contextwhere
- where clausetrxName
- transaction
-
toString
public String toString()
Return String representation- Overrides:
toString
in classX_C_ValidCombination
- Returns:
- String
-
setAccount_ID
public void setAccount_ID(int Account_ID)
Set Account_ID- Specified by:
setAccount_ID
in interfaceI_C_ValidCombination
- Overrides:
setAccount_ID
in classX_C_ValidCombination
- Parameters:
Account_ID
- id
-
getAccount
public MElementValue getAccount()
Set Account_ID- Specified by:
getAccount
in interfaceI_C_ValidCombination
- Overrides:
getAccount
in classX_C_ValidCombination
- Returns:
- element value
-
getAccountType
public String getAccountType()
Get Account Type- Returns:
- Account Type of Account Element
-
isBalanceSheet
public boolean isBalanceSheet()
Is this a Balance Sheet Account- Returns:
- boolean
-
isActiva
public boolean isActiva()
Is this an Activa Account- Returns:
- boolean
-
isPassiva
public boolean isPassiva()
Is this a Passiva Account- Returns:
- boolean
-
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
public MAccount markImmutable()
Description copied from interface:ImmutablePOSupport
mark PO as immutable- Specified by:
markImmutable
in interfaceImmutablePOSupport
- Returns:
- PO
-
main
public static void main(String[] args)
Test- Parameters:
args
-
-
-