Class MMatchPO

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

public class MMatchPO extends X_M_MatchPO
Match PO Model.
  Created when processing Shipment or Order
  - Updates Order (delivered, invoiced)
  - Creates PPV acct
        
Version:
$Id: MMatchPO.java,v 1.3 2006/07/30 00:51:03 jjanke Exp $
Author:
Jorg Janke, Bayu Cahya, Sistematika
  • BF [ 2240484 ] Re MatchingPO, MMatchPO doesn't contains Invoice info, Teo Sarca, www.arhipac.ro
  • BF [ 2314749 ] MatchPO not considering currency PriceMatchDifference, Armen Rizal, Goodwill Consulting
  • BF [ 2215840 ] MatchPO Bug Collection
  • BF [ 2858043 ] Correct Included Tax in Average Costing, victor.perez@e-evolution.com, e-Evolution http://www.e-evolution.com
  • FR [ 2520591 ] Support multiples calendar for Org
  • See Also:
    • Field Details

      • m_matchInv

        protected MMatchInv m_matchInv
      • m_isInvoiceLineChange

        protected boolean m_isInvoiceLineChange
        Invoice Line Changed
      • m_isInOutLineChange

        protected boolean m_isInOutLineChange
        InOut Line Changed
      • m_oLine

        protected MOrderLine m_oLine
        Order Line
      • m_iLine

        protected MInvoiceLine m_iLine
        Invoice Line
    • Constructor Details

      • MMatchPO

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

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

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

        public MMatchPO(MInOutLine sLine, Timestamp dateTrx, BigDecimal qty)
        Shipment Line Constructor
        Parameters:
        sLine - shipment line
        dateTrx - optional date
        qty - matched quantity
      • MMatchPO

        public MMatchPO(MInvoiceLine iLine, Timestamp dateTrx, BigDecimal qty)
        Invoice Line Constructor
        Parameters:
        iLine - invoice line
        dateTrx - optional date
        qty - matched quantity
    • Method Details

      • get

        public static MMatchPO[] get(Properties ctx, int C_OrderLine_ID, int C_InvoiceLine_ID, String trxName)
        Get PO Match with order/invoice
        Parameters:
        ctx - context
        C_OrderLine_ID - order
        C_InvoiceLine_ID - invoice
        trxName - transaction
        Returns:
        array of matches
      • get

        public static MMatchPO[] get(Properties ctx, int M_InOutLine_ID, String trxName)
        Get PO Match of Receipt Line
        Parameters:
        ctx - context
        M_InOutLine_ID - receipt
        trxName - transaction
        Returns:
        array of matches
      • getInOut

        public static MMatchPO[] getInOut(Properties ctx, int M_InOut_ID, String trxName)
        Get PO Matches of receipt
        Parameters:
        ctx - context
        M_InOut_ID - receipt
        trxName - transaction
        Returns:
        array of matches
      • getInvoice

        public static MMatchPO[] getInvoice(Properties ctx, int C_Invoice_ID, String trxName)
        Get PO Matches of Invoice
        Parameters:
        ctx - context
        C_Invoice_ID - invoice
        trxName - transaction
        Returns:
        array of matches
      • getOrderLine

        public static MMatchPO[] getOrderLine(Properties ctx, int C_OrderLine_ID, String trxName)
        Get PO Matches for OrderLine
        Parameters:
        ctx - context
        C_OrderLine_ID - order
        trxName - transaction
        Returns:
        array of matches
      • create

        public static MMatchPO create(MInvoiceLine iLine, MInOutLine sLine, Timestamp dateTrx, BigDecimal qty)
        Update or Create Match PO record
        Parameters:
        iLine - invoice line
        sLine - receipt line
        dateTrx - transaction date
        qty - qty to match
        Returns:
        Match PO Record
      • create

        protected static MMatchPO create(Properties ctx, MInvoiceLine iLine, MInOutLine sLine, int C_OrderLine_ID, Timestamp dateTrx, BigDecimal qty, String trxName)
        Update or create MatchPO record (if needed, create MatchInv too).
        Parameters:
        ctx -
        iLine -
        sLine -
        C_OrderLine_ID -
        dateTrx -
        qty -
        trxName -
        Returns:
        Match PO record
      • createMatchInv

        protected static MMatchInv createMatchInv(MMatchPO mpo, int C_InvoiceLine_ID, int M_InOutLine_ID, BigDecimal qty, Timestamp dateTrx, String trxName)
        Create MatchInv record
        Parameters:
        mpo -
        C_InvoiceLine_ID -
        M_InOutLine_ID -
        qty -
        dateTrx -
        trxName -
        Returns:
        Match Inv record
      • setMatchInvCreated

        protected void setMatchInvCreated(MMatchInv matchInv)
        Register the match inv created for immediate accounting posting
        Parameters:
        matchInv -
      • getMatchInvCreated

        public MMatchInv getMatchInvCreated()
        Get the match inv created for immediate accounting posting.
        The Match Inv record reference is set to null after call, so if you call this method twice, the second call will returns null.
        Returns:
        Match Inv record or null
      • setC_InvoiceLine_ID

        public void setC_InvoiceLine_ID(MInvoiceLine line)
        Set C_InvoiceLine_ID
        Parameters:
        line - line
      • setC_InvoiceLine_ID

        public void setC_InvoiceLine_ID(int C_InvoiceLine_ID)
        Set C_InvoiceLine_ID
        Specified by:
        setC_InvoiceLine_ID in interface I_M_MatchPO
        Overrides:
        setC_InvoiceLine_ID in class X_M_MatchPO
        Parameters:
        C_InvoiceLine_ID - id
      • getInvoiceLine

        public MInvoiceLine getInvoiceLine()
        Get Invoice Line
        Returns:
        invoice line or null
      • setM_InOutLine_ID

        public void setM_InOutLine_ID(int M_InOutLine_ID)
        Set M_InOutLine_ID
        Specified by:
        setM_InOutLine_ID in interface I_M_MatchPO
        Overrides:
        setM_InOutLine_ID in class X_M_MatchPO
        Parameters:
        M_InOutLine_ID - id
      • setC_OrderLine_ID

        public void setC_OrderLine_ID(MOrderLine line)
        Set C_OrderLine_ID
        Parameters:
        line - line
      • getOrderLine

        public MOrderLine getOrderLine()
        Get Order Line
        Returns:
        order line or null
      • getInvoicePriceActual

        public BigDecimal getInvoicePriceActual()
        Get PriceActual from Invoice and convert it to Order Currency.
        Returns:
        Price Actual in Order Currency
      • 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
      • getNewerDateAcct

        public Timestamp getNewerDateAcct()
        Get the newer Date Acct between invoice and shipment
        Returns:
        date or null
      • beforeDelete

        protected boolean beforeDelete()
        Description copied from class: PO
        Execute before Delete operations.
        Default implementation is nop, to be implemented in sub-classes that needed it.
        Overrides:
        beforeDelete in class PO
        Returns:
        true if record can be deleted
      • 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
      • toString

        public String toString()
        String Representation
        Overrides:
        toString in class X_M_MatchPO
        Returns:
        info
      • reverse

        public boolean reverse(Timestamp reversalDate)
        Reverse this MatchPO document.
        Parameters:
        reversalDate -
        Returns:
        true if reversed
        Throws:
        Exception
      • reverse

        public boolean reverse(Timestamp reversalDate, boolean reverseMatchingOnly)
        Reverse this MatchPO document.
        Parameters:
        reversalDate -
        reverseMatchingOnly - true if MR is not reverse
        Returns:
        true if reversed
        Throws:
        Exception
      • isReversal

        public boolean isReversal()
        Returns:
        true if this is created to reverse another match po document
      • getOrCreate

        public static MMatchPO getOrCreate(int C_OrderLine_ID, BigDecimal qty, MInOutLine sLine, String trxName)
        Get or create Match PO record for order line.
        Parameters:
        C_OrderLine_ID -
        qty -
        sLine -
        trxName -
        Returns:
        new or existing MMatchPO record