Class MAcctSchema

    • Constructor Detail

      • 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)
        Parameters:
        copy -
    • Method Detail

      • 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:
        ArrayList of AcctSchemaElement
      • getAcctSchemaElement

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

        public boolean isAcctSchemaElement​(String segmentType)
        Has AcctSchema Element
        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
      • isSuspenseBalancing

        public boolean isSuspenseBalancing()
        Is Suspense Balancing active
        Returns:
        suspense balancing
      • getSuspenseBalancing_Acct

        public MAccount getSuspenseBalancing_Acct()
        Get Suspense Error Account
        Returns:
        suspense error account
      • isCurrencyBalancing

        public boolean isCurrencyBalancing()
        Is Currency Balancing active
        Returns:
        suspense balancing
      • 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
      • 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 Client
      • isCostingLevelOrg

        public boolean isCostingLevelOrg()
        Is Org Costing Level
        Returns:
        true if Org
      • isCostingLevelBatch

        public boolean isCostingLevelBatch()
        Is Batch Costing Level
        Returns:
        true if Batch
      • isCreatePOCommitment

        public boolean isCreatePOCommitment()
        Create PO Commitment Accounting
        Returns:
        true if creaet commitments
      • isCreateSOCommitment

        public boolean isCreateSOCommitment()
        Create SO Commitment Accounting
        Returns:
        true if creaet commitments
      • isCreateReservation

        public boolean isCreateReservation()
        Create Commitment/Reservation Accounting
        Returns:
        true if create reservations
      • isTaxCorrection

        public boolean isTaxCorrection()
        Tax Correction
        Returns:
        true if not none
      • isTaxCorrectionDiscount

        public boolean isTaxCorrectionDiscount()
        Tax Correction for Discount
        Returns:
        true if tax is corrected for Discount
      • isTaxCorrectionWriteOff

        public boolean isTaxCorrectionWriteOff()
        Tax Correction for WriteOff
        Returns:
        true if tax is corrected for WriteOff
      • beforeSave

        protected boolean beforeSave​(boolean newRecord)
        Before Save
        Overrides:
        beforeSave in class PO
        Parameters:
        newRecord - new
        Returns:
        true