Class MJournalLine

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

public class MJournalLine extends X_GL_JournalLine
GL Journal Line Model
Version:
$Id: MJournalLine.java,v 1.3 2006/07/30 00:51:05 jjanke Exp $
Author:
Jorg Janke, Cristina Ghita
  • BF [ 2855807 ] AD_Org_ID from account https://sourceforge.net/p/adempiere/bugs/2084/
  • See Also:
    • Field Details

      • m_parent

        protected MJournal m_parent
        Parent
      • m_precision

        protected int m_precision
        Currency Precision
      • m_account

        protected MAccount m_account
        Account Combination
      • m_accountElement

        protected MElementValue m_accountElement
        Account Element
    • Constructor Details

      • MJournalLine

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

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

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

        public MJournalLine(MJournal parent)
        Parent Constructor
        Parameters:
        parent - journal
    • Method Details

      • getParent

        public MJournal getParent()
        Get Parent
        Returns:
        parent
      • setCurrency

        public void setCurrency(int C_Currency_ID, int C_ConversionType_ID, BigDecimal CurrencyRate)
        Set Currency Info
        Parameters:
        C_Currency_ID - currency
        C_ConversionType_ID - type
        CurrencyRate - rate
      • setC_Currency_ID

        public void setC_Currency_ID(int C_Currency_ID)
        Set C_Currency_ID and precision
        Specified by:
        setC_Currency_ID in interface I_GL_JournalLine
        Overrides:
        setC_Currency_ID in class X_GL_JournalLine
        Parameters:
        C_Currency_ID - currency
      • getPrecision

        public int getPrecision()
        Get Currency Precision
        Returns:
        precision
      • setCurrencyRate

        public void setCurrencyRate(BigDecimal CurrencyRate)
        Set Currency Rate
        Specified by:
        setCurrencyRate in interface I_GL_JournalLine
        Overrides:
        setCurrencyRate in class X_GL_JournalLine
        Parameters:
        CurrencyRate - check for null or negative value (->one)
      • setAmtAcct

        public void setAmtAcct(BigDecimal AmtAcctDr, BigDecimal AmtAcctCr)
        Set Accounted Amounts only if not 0. Amounts overwritten in beforeSave - set conversion rate.
        Parameters:
        AmtAcctDr - Dr
        AmtAcctCr - Cr
      • setC_ValidCombination_ID

        public void setC_ValidCombination_ID(int C_ValidCombination_ID)
        Set C_ValidCombination_ID
        Specified by:
        setC_ValidCombination_ID in interface I_GL_JournalLine
        Overrides:
        setC_ValidCombination_ID in class X_GL_JournalLine
        Parameters:
        C_ValidCombination_ID - id
      • setC_ValidCombination_ID

        public void setC_ValidCombination_ID(MAccount acct)
        Set C_ValidCombination_ID
        Parameters:
        acct - account
      • getAccount_Combi

        public MAccount getAccount_Combi()
        Get Account (Valid Combination)
        Returns:
        combination or null
      • getAccountElementValue

        public MElementValue getAccountElementValue()
        Get Natural Account Element Value
        Returns:
        account
      • isDocControlled

        public boolean isDocControlled()
        Is it posting to a Control Acct
        Returns:
        true if control acct
      • beforeSave

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

        protected boolean afterSave(boolean newRecord, boolean success)
        After Save. Update Journal/Batch Total
        Overrides:
        afterSave in class PO
        Parameters:
        newRecord - true if new record
        success - true if success
        Returns:
        success
      • afterDelete

        protected boolean afterDelete(boolean success)
        After Delete
        Overrides:
        afterDelete in class PO
        Parameters:
        success - true if deleted
        Returns:
        true if success
      • updateJournalTotal

        protected boolean updateJournalTotal()
        Update Journal and Batch Total
        Returns:
        true if success
      • getOrCreateCombination

        protected boolean getOrCreateCombination()
        Get or create new valid combination record. Set C_ValidCombination_ID.
      • fillDimensionsFromCombination

        protected void fillDimensionsFromCombination()
        Fill Accounting Dimensions from line valid combination.