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:
    Serialized Form
    • Field Detail

      • m_isInvoiceLineChange

        protected boolean m_isInvoiceLineChange
        Invoice Changed
      • m_isInOutLineChange

        protected boolean m_isInOutLineChange
        InOut Changed
      • m_oLine

        protected MOrderLine m_oLine
        Order Line
    • Constructor Detail

      • 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 Detail

      • 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)
        Find/Create PO(Inv) Match
        Parameters:
        iLine - invoice line
        sLine - receipt line
        dateTrx - date
        qty - qty
        Returns:
        Match Record
      • setMatchInvCreated

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

        public MMatchInv getMatchInvCreated()
        Get the match inv created for immediate accounting purposes Is cleared after read, so if you read twice second time it returns null
      • setC_InvoiceLine_ID

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

        public MInvoiceLine getInvoiceLine()
        Get Invoice Line
        Returns:
        invoice line or null
      • 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
        Overrides:
        beforeSave in class PO
        Parameters:
        newRecord - new record
        Returns:
        true if record can be saved
      • afterSave

        protected boolean afterSave​(boolean newRecord,
                                    boolean success)
        After Save. Set Order Qty Delivered/Invoiced
        Overrides:
        afterSave in class PO
        Parameters:
        newRecord - new
        success - success
        Returns:
        success
      • getNewerDateAcct

        public Timestamp getNewerDateAcct()
        Get the later Date Acct from invoice or shipment
        Returns:
        date or null
      • beforeDelete

        protected boolean beforeDelete()
        Before Delete
        Overrides:
        beforeDelete in class PO
        Returns:
        true if acct was deleted
      • afterDelete

        protected boolean afterDelete​(boolean success)
        After Delete. Set Order Qty Delivered/Invoiced
        Overrides:
        afterDelete in class PO
        Parameters:
        success - success
        Returns:
        success
      • reverse

        public boolean reverse​(Timestamp reversalDate)
        Reverse MatchPO.
        Parameters:
        reversalDate -
        Returns:
        boolean
        Throws:
        Exception
      • reverse

        public boolean reverse​(Timestamp reversalDate,
                               boolean reverseMatchingOnly)
        Reverse MatchPO.
        Parameters:
        reversalDate -
        reverseMatchingOnly - true if MR is not reverse
        Returns:
        boolean
        Throws:
        Exception