Class 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
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:
    • Constructor Details

      • MAcctSchema

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

        public MAcctSchema(Properties ctx, int C_AcctSchema_ID, String trxName)
        Standard Constructor
        Parameters:
        ctx - context
        C_AcctSchema_ID - id
        trxName - transaction
      • MAcctSchema

        public MAcctSchema(Properties ctx, ResultSet rs, String trxName)
        Load Constructor
        Parameters:
        ctx - context
        rs - result set
        trxName - transaction
      • MAcctSchema

        public MAcctSchema(MClient client, KeyNamePair currency)
        Parent Constructor
        Parameters:
        client - client
        currency - currency
      • MAcctSchema

        public MAcctSchema(MAcctSchema copy)
        Copy constructor
        Parameters:
        copy -
      • MAcctSchema

        public MAcctSchema(Properties ctx, MAcctSchema copy)
        Copy constructor
        Parameters:
        ctx -
        copy -
      • MAcctSchema

        public MAcctSchema(Properties ctx, MAcctSchema copy, String trxName)
        Copy constructor
        Parameters:
        ctx -
        copy -
        trxName -
    • Method Details

      • 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 - context
        C_AcctSchema_ID - schema id
        Returns:
        Accounting schema
      • get

        public static MAcctSchema get(Properties ctx, int C_AcctSchema_ID, String trxName)
        Get AccountSchema
        Parameters:
        ctx - context
        C_AcctSchema_ID - schema id
        trxName - 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 - context
        AD_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 - context
        AD_Client_ID - client or 0 for all
        trxName - optional trx
        Returns:
        Array of AcctSchema of Client
      • getAcctSchemaElements

        public MAcctSchemaElement[] getAcctSchemaElements()
        AcctSchema Elements
        Returns:
        Array of AcctSchemaElement
      • getAcctSchemaElement

        public MAcctSchemaElement getAcctSchemaElement(String elementType)
        Get AcctSchema Element via element type
        Parameters:
        elementType - segment type - AcctSchemaElement.ELEMENTTYPE_
        Returns:
        AcctSchemaElement
      • isAcctSchemaElement

        public boolean isAcctSchemaElement(String segmentType)
        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:
        toString in class X_C_AcctSchema
        Returns:
        String representation
      • isSuspenseBalancing

        public boolean isSuspenseBalancing()
        Is Suspense Balancing active
        Returns:
        true if schema is using suspense balancing account
      • getSuspenseBalancing_Acct

        public MAccount 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

        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 automatically
        Set 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 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

        public String getTaxCorrectionType()
        Get Tax Correction Type
        Specified by:
        getTaxCorrectionType in interface I_C_AcctSchema
        Overrides:
        getTaxCorrectionType in class X_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)
        Before Save
        Overrides:
        beforeSave in class PO
        Parameters:
        newRecord - new
        Returns:
        true
      • markImmutable

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