Class MCash

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

public class MCash extends X_C_Cash implements DocAction
Cash Journal Model
Version:
$Id: MCash.java,v 1.3 2006/07/30 00:51:03 jjanke Exp $
Author:
Jorg Janke, victor.perez@e-evolution.com, e-Evolution http://www.e-evolution.com
  • FR [ 1866214 ], Teo Sarca, SC ARHIPAC SERVICE SRL
  • BF [ 1831997 ] Cash journal allocation reversed
  • BF [ 1894524 ] Pay an reversed invoice
  • BF [ 1899477 ] MCash.getLines should return only active lines
  • BF [ 2588326 ] Cash Lines are not correctly updated on voiding
  • See Also:
    • Field Details

      • m_lines

        protected MCashLine[] m_lines
        Lines
      • m_book

        protected MCashBook m_book
        CashBook
      • m_processMsg

        protected String m_processMsg
        Process Message
      • m_justPrepared

        protected boolean m_justPrepared
        Just Prepared Flag
    • Constructor Details

      • MCash

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

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

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

        public MCash(MCashBook cb, Timestamp today)
        Parent Constructor
        Parameters:
        cb - cash book
        today - date - if null today
      • MCash

        public MCash(Properties ctx, int C_Cash_ID, String trxName, String... virtualColumns)
        Parameters:
        ctx -
        C_Cash_ID -
        trxName -
        virtualColumns -
    • Method Details

      • get

        public static MCash get(Properties ctx, int AD_Org_ID, Timestamp dateAcct, int C_Currency_ID, String trxName)
        Get or create new Cash Journal for currency, org and date
        Parameters:
        ctx - context
        C_Currency_ID - currency
        AD_Org_ID - org
        dateAcct - date
        trxName - transaction
        Returns:
        MCash
      • get

        public static MCash get(Properties ctx, int C_CashBook_ID, Timestamp dateAcct, String trxName)
        Get or create new Cash Journal for CashBook and date
        Parameters:
        ctx - context
        C_CashBook_ID - cashbook
        dateAcct - date
        trxName - transaction
        Returns:
        cash
      • getLines

        public MCashLine[] getLines(boolean requery)
        Get Lines
        Parameters:
        requery - true to reload from DB
        Returns:
        lines
      • getCashBook

        public MCashBook getCashBook()
        Get Cash Book
        Returns:
        cash book
      • getDocumentNo

        public String getDocumentNo()
        Get Document No
        Specified by:
        getDocumentNo in interface DocAction
        Returns:
        name
      • 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:
        PDF File or null
      • createPDF

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

        protected boolean beforeSave(boolean newRecord)
        Before Save
        Overrides:
        beforeSave in class PO
        Parameters:
        newRecord -
        Returns:
        true
      • 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 ..)
      • voidIt

        public boolean voidIt()
        Void Document. Same as Close.
        Specified by:
        voidIt in interface DocAction
        Returns:
        true if successfully voided
      • reverseIt

        protected boolean reverseIt()
        Reverse Cash Period needs to be open
        Returns:
        true if reversed
      • addDescription

        public void addDescription(String description)
        Add to Description
        Parameters:
        description - text
      • closeIt

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

        public boolean reverseCorrectIt()
        Reverse Correction
        Specified by:
        reverseCorrectIt in interface DocAction
        Returns:
        true if success
      • reverseAccrualIt

        public boolean reverseAccrualIt()
        Reverse Accrual - none
        Specified by:
        reverseAccrualIt in interface DocAction
        Returns:
        true if success
      • reActivateIt

        public boolean reActivateIt()
        Re-activate
        Specified by:
        reActivateIt in interface DocAction
        Returns:
        true if success
      • setProcessed

        public void setProcessed(boolean processed)
        Set Processed
        Specified by:
        setProcessed in interface I_C_Cash
        Overrides:
        setProcessed in class X_C_Cash
        Parameters:
        processed - processed
      • toString

        public String toString()
        String Representation
        Overrides:
        toString in class X_C_Cash
        Returns:
        info
      • getSummary

        public String getSummary()
        Get Summary
        Specified by:
        getSummary in interface DocAction
        Returns:
        Summary of Document
      • 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
      • getApprovalAmt

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

        public int getC_Currency_ID()
        Get Currency
        Specified by:
        getC_Currency_ID in interface DocAction
        Returns:
        Currency
      • isComplete

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