Class MJournal

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

public class MJournal extends X_GL_Journal implements DocAction
GL Journal Model
Version:
$Id: MJournal.java,v 1.3 2006/07/30 00:51:03 jjanke Exp $
Author:
Jorg Janke, Teo Sarca, SC ARHIPAC SERVICE SRL
  • BF [ 1619150 ] Usability/Consistency: reversed gl journal description
  • BF [ 1775358 ] GL Journal DateAcct/C_Period_ID issue
  • FR [ 1776045 ] Add ReActivate action to GL Journal, victor.perez@e-evolution.com, e-Evolution http://www.e-evolution.com
  • FR [ 1948157 ] Is necessary the reference for document reverse
  • See Also:
    • Field Details

      • m_processMsg

        protected String m_processMsg
        Process Message
      • m_justPrepared

        protected boolean m_justPrepared
        Just Prepared Flag
    • Constructor Details

      • MJournal

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

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

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

        public MJournal(MJournalBatch parent)
        Parent Constructor.
        Parameters:
        parent - batch
      • MJournal

        public MJournal(MJournal original)
        Copy Constructor. Does not copy: Dates/Period.
        Parameters:
        original - original journal document
    • Method Details

      • setClientOrg

        public void setClientOrg(int AD_Client_ID, int AD_Org_ID)
        Overwrite Client/Org if required
        Overrides:
        setClientOrg in class PO
        Parameters:
        AD_Client_ID - client
        AD_Org_ID - org
      • setDateAcct

        public void setDateAcct(Timestamp DateAcct)
        Set Accounting Date. Set also Period if not set earlier.
        Specified by:
        setDateAcct in interface I_GL_Journal
        Overrides:
        setDateAcct in class X_GL_Journal
        Parameters:
        DateAcct - date
      • 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
      • addDescription

        public void addDescription(String description)
        Add to Description
        Parameters:
        description - text
        Since:
        3.1.4
      • getLines

        public MJournalLine[] getLines(boolean requery)
        Get Journal Lines
        Parameters:
        requery - ignore
        Returns:
        Array of lines
      • copyLinesFrom

        public int copyLinesFrom(MJournal fromJournal, Timestamp dateAcct, char typeCR)
        Copy Lines from other Journal
        Parameters:
        fromJournal - Journal
        dateAcct - date used - if null original
        typeCR - type of copying (C)orrect=negate - (R)everse=flip dr/cr - otherwise just copy
        Returns:
        number of lines copied
      • setProcessed

        public void setProcessed(boolean processed)
        Set Processed. Propagate to Lines/Taxes
        Specified by:
        setProcessed in interface I_GL_Journal
        Overrides:
        setProcessed in class X_GL_Journal
        Parameters:
        processed - processed
      • 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
      • afterSave

        protected boolean afterSave(boolean newRecord, boolean success)
        Description copied from class: PO
        Called after Save for Post-Save Operation.
        Default implementation is nop, to be implemented in sub-classes that needed it.
        Overrides:
        afterSave in class PO
        Parameters:
        newRecord - true if it is a new record
        success - true if save operation was success
        Returns:
        if save was a success
      • afterDelete

        protected boolean afterDelete(boolean success)
        Description copied from class: PO
        Execute after Delete operations.
        Default implementation is nop, to be implemented in sub-classes that needed it.
        Overrides:
        afterDelete in class PO
        Parameters:
        success - true if record deleted
        Returns:
        true if delete is a success
      • updateBatch

        protected boolean updateBatch()
        Update Total DR and Total CR of journal batch
        Returns:
        true if ok
      • processIt

        public boolean processIt(String processAction)
        Process document
        Specified by:
        processIt in interface DocAction
        Parameters:
        processAction - document action
        Returns:
        true if performed
      • unlockIt

        public boolean unlockIt()
        Unlock Document.
        Specified by:
        unlockIt in interface DocAction
        Returns:
        true if success
      • invalidateIt

        public boolean invalidateIt()
        Invalidate Document
        Specified by:
        invalidateIt in interface DocAction
        Returns:
        true if success
      • prepareIt

        public String prepareIt()
        Prepare Document
        Specified by:
        prepareIt in interface DocAction
        Returns:
        new status (In Progress or Invalid)
      • approveIt

        public boolean approveIt()
        Approve Document
        Specified by:
        approveIt in interface DocAction
        Returns:
        true if success
      • rejectIt

        public boolean rejectIt()
        Reject Approval
        Specified by:
        rejectIt in interface DocAction
        Returns:
        true if success
      • completeIt

        public String completeIt()
        Complete Document
        Specified by:
        completeIt in interface DocAction
        Returns:
        new status (Complete, In Progress, Invalid, Waiting ..)
      • setDefiniteDocumentNo

        protected void setDefiniteDocumentNo()
        Set the definite document number after completed
      • voidIt

        public boolean voidIt()
        Void Document.
        Specified by:
        voidIt in interface DocAction
        Returns:
        true if success
      • closeIt

        public boolean closeIt()
        Close Document. Cancel not delivered Qunatities
        Specified by:
        closeIt in interface DocAction
        Returns:
        true if success
      • reverseCorrectIt

        public boolean reverseCorrectIt()
        Reverse Correction (in same batch if using batch). Flip Dr/Cr - Use date of this document.
        Specified by:
        reverseCorrectIt in interface DocAction
        Returns:
        true if success
      • reverseCorrectIt

        public MJournal reverseCorrectIt(int GL_JournalBatch_ID)
        Reverse Correction. Flip Dr/Cr - Use date of this document.
        Parameters:
        GL_JournalBatch_ID - optional reversal batch
        Returns:
        reversed Journal or null
      • reverseAccrualIt

        public boolean reverseAccrualIt()
        Reverse Accrual (in same batch if using batch). Flip Dr/Cr - Use Today's date.
        Specified by:
        reverseAccrualIt in interface DocAction
        Returns:
        true if success
      • reverseAccrualIt

        public MJournal reverseAccrualIt(int GL_JournalBatch_ID)
        Reverse Accrual. Flip Dr/Cr - Use Today's date.
        Parameters:
        GL_JournalBatch_ID - optional reversal batch
        Returns:
        reversed journal or null
      • reActivateIt

        public boolean reActivateIt()
        Re-activate document and delete Fact_Acct entries.
        Specified by:
        reActivateIt in interface DocAction
        Returns:
        true if success
      • getSummary

        public String getSummary()
        Get Summary
        Specified by:
        getSummary in interface DocAction
        Returns:
        Summary of Document
      • toString

        public String toString()
        String Representation
        Overrides:
        toString in class X_GL_Journal
        Returns:
        info
      • getDocumentInfo

        public String getDocumentInfo()
        Get Document Info
        Specified by:
        getDocumentInfo in interface DocAction
        Returns:
        document info (untranslated)
      • createPDF

        public File createPDF()
        Create PDF
        Specified by:
        createPDF in interface DocAction
        Returns:
        File or null
      • createPDF

        public File createPDF(File file)
        Create PDF file
        Parameters:
        file - output file
        Returns:
        not implemented, always return null
      • getProcessMsg

        public String getProcessMsg()
        Get Process Message
        Specified by:
        getProcessMsg in interface DocAction
        Returns:
        clear text error message
      • getDoc_User_ID

        public int getDoc_User_ID()
        Get Document Owner (Responsible)
        Specified by:
        getDoc_User_ID in interface DocAction
        Returns:
        AD_User_ID (Created)
      • getApprovalAmt

        public BigDecimal getApprovalAmt()
        Get Document Approval Amount
        Specified by:
        getApprovalAmt in interface DocAction
        Returns:
        DR amount
      • isComplete

        public boolean isComplete()
        Document Status is Complete or Closed
        Returns:
        true if CO, CL or RE
      • getDocStatusName

        public String getDocStatusName()
        Get Document Status Name
        Returns:
        Document Status Name