Class MAccount

All Implemented Interfaces:
Serializable, Cloneable, Comparator<Object>, I_C_ValidCombination, I_Persistent, Evaluatee, ImmutablePOSupport

public class MAccount extends X_C_ValidCombination implements 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:
    • Constructor Details

      • MAccount

        public MAccount(Properties ctx, String C_ValidCombination_UU, String trxName)
        UUID based Constructor
        Parameters:
        ctx - Context
        C_ValidCombination_UU - UUID key
        trxName - Transaction
      • MAccount

        public MAccount(Properties ctx, int C_ValidCombination_ID, String trxName)
        Default constructor
        Parameters:
        ctx - context
        C_ValidCombination_ID - combination
        trxName - transaction
      • MAccount

        public MAccount(Properties ctx, ResultSet rs, String trxName)
        Load constructor
        Parameters:
        ctx - context
        rs - result set
        trxName - 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 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 - context
        AD_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 - context
        C_AcctSchema_ID - as
        alias - alias
        Returns:
        account
      • get

        public static MAccount get(X_Fact_Acct fa)
        Get from existing Accounting fact
        Parameters:
        fa - accounting fact
        Returns:
        account
      • get

        public static MAccount get(X_Fact_Acct fa, String trxName)
        Get from existing Accounting fact
        Parameters:
        fa - accounting fact
        trxName -
        Returns:
        account
      • getDefault

        public static MAccount getDefault(Properties ctx, int C_AcctSchema_ID, boolean optionalNull, String trxName)
        Factory: default combination
        Parameters:
        ctx - context
        C_AcctSchema_ID - accounting schema
        optionalNull - if true the optional values are null
        trxName - transaction
        Returns:
        Account
      • getDefault

        public static MAccount getDefault(MAcctSchema acctSchema, boolean optionalNull)
        Factory: create new account with default combination
        Parameters:
        acctSchema - accounting schema
        optionalNull - if true, the optional values are null
        Returns:
        new MAccount record
      • 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 - context
        C_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 - context
        where - where clause
        trxName - transaction
      • toString

        public String toString()
        Return String representation
        Overrides:
        toString in class X_C_ValidCombination
        Returns:
        String
      • setAccount_ID

        public void setAccount_ID(int Account_ID)
        Set account element id
        Specified by:
        setAccount_ID in interface I_C_ValidCombination
        Overrides:
        setAccount_ID in class X_C_ValidCombination
        Parameters:
        Account_ID - id
      • getAccount

        public MElementValue getAccount()
        Specified by:
        getAccount in interface I_C_ValidCombination
        Overrides:
        getAccount in class X_C_ValidCombination
        Returns:
        account 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:
        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(Combination) and Description and Fully Qualified Flag for Combination
      • validate

        public boolean validate()
        Validate combination
        Returns:
        true if valid
      • 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 class PO
        Parameters:
        newRecord - true if it is a new record
        Returns:
        true if record can be saved
      • markImmutable

        public MAccount markImmutable()
        Description copied from interface: ImmutablePOSupport
        mark PO as immutable
        Specified by:
        markImmutable in interface ImmutablePOSupport
        Returns:
        PO