Class MInvoiceLine

    • Field Detail

      • s_log

        protected static CLogger s_log
        Static Logger
      • m_tax

        protected MTax m_tax
        Tax
      • m_M_PriceList_ID

        protected int m_M_PriceList_ID
      • m_DateInvoiced

        protected Timestamp m_DateInvoiced
      • m_C_BPartner_ID

        protected int m_C_BPartner_ID
      • m_C_BPartner_Location_ID

        protected int m_C_BPartner_Location_ID
      • m_IsSOTrx

        protected boolean m_IsSOTrx
      • m_priceSet

        protected boolean m_priceSet
      • m_product

        protected MProduct m_product
      • m_charge

        protected MCharge m_charge
        Charge
      • m_name

        protected String m_name
        Cached Name of the line
      • m_precision

        protected Integer m_precision
        Cached Precision
      • m_productPricing

        protected IProductPricing m_productPricing
        Product Pricing
      • m_parent

        protected MInvoice m_parent
        Parent
    • Constructor Detail

      • MInvoiceLine

        public MInvoiceLine​(Properties ctx,
                            int C_InvoiceLine_ID,
                            String trxName)
        Invoice Line Constructor
        Parameters:
        ctx - context
        C_InvoiceLine_ID - invoice line or 0
        trxName - transaction name
      • MInvoiceLine

        public MInvoiceLine​(MInvoice invoice)
        Parent Constructor
        Parameters:
        invoice - parent
      • MInvoiceLine

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

        public MInvoiceLine​(MInvoiceLine copy)
        Parameters:
        copy -
    • Method Detail

      • getOfInOutLine

        public static MInvoiceLine getOfInOutLine​(MInOutLine sLine)
        Get Invoice Line referencing InOut Line
        Parameters:
        sLine - shipment line
        Returns:
        (first) invoice line
      • getOfInOutLineFromMatchInv

        public static MInvoiceLine getOfInOutLineFromMatchInv​(MInOutLine sLine)
        Get Invoice Line referencing InOut Line - from MatchInv
        Parameters:
        sLine - shipment line
        Returns:
        (first) invoice line
      • setInvoice

        public void setInvoice​(MInvoice invoice)
        Set Defaults from Order. Called also from copy lines from invoice Does not set Parent !!
        Parameters:
        invoice - invoice
      • getParent

        public MInvoice getParent()
        Get Parent
        Returns:
        parent
      • setOrderLine

        public void setOrderLine​(MOrderLine oLine)
        Set values from Order Line. Does not set quantity!
        Parameters:
        oLine - line
      • setShipLine

        public void setShipLine​(MInOutLine sLine)
        Set values from Shipment Line. Does not set quantity!
        Parameters:
        sLine - ship line
      • addDescription

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

        public void setPrice()
        Set Price for Product and PriceList. Uses standard SO price list of not set by invoice constructor
      • setPrice

        public void setPrice​(int M_PriceList_ID,
                             int C_BPartner_ID)
        Set Price for Product and PriceList
        Parameters:
        M_PriceList_ID - price list
        C_BPartner_ID - business partner
      • setPrice

        public void setPrice​(BigDecimal PriceActual)
        Set Price Entered/Actual. Use this Method if the Line UOM is the Product UOM
        Parameters:
        PriceActual - price
      • setTax

        public boolean setTax()
        Set Tax - requires Warehouse
        Returns:
        true if found
      • setTaxAmt

        public void setTaxAmt()
        Calculate Tax Amt. Assumes Line Net is calculated
      • setLineNetAmt

        public void setLineNetAmt()
        Calculate Extended Amt. May or may not include tax
      • getCharge

        public MCharge getCharge()
        Get Charge
        Returns:
        product or null
      • getTax

        protected MTax getTax()
        Get Tax (immutable)
        Returns:
        tax
      • setQty

        public void setQty​(int Qty)
        Set Qty Invoiced/Entered.
        Parameters:
        Qty - Invoiced/Ordered
      • setQty

        public void setQty​(BigDecimal Qty)
        Set Qty Invoiced
        Parameters:
        Qty - Invoiced/Entered
      • setProduct

        public void setProduct​(MProduct product)
        Set Product
        Parameters:
        product - product
      • setM_Product_ID

        public void setM_Product_ID​(int M_Product_ID,
                                    boolean setUOM)
        Set M_Product_ID
        Parameters:
        M_Product_ID - product
        setUOM - set UOM from product
      • setM_Product_ID

        public void setM_Product_ID​(int M_Product_ID,
                                    int C_UOM_ID)
        Set Product and UOM
        Parameters:
        M_Product_ID - product
        C_UOM_ID - uom
      • getProduct

        public MProduct getProduct()
        Get Product
        Returns:
        product or null
      • getName

        public String getName()
        Get (Product/Charge) Name
        Returns:
        name
      • setName

        public void setName​(String tempName)
        Set Temporary (cached) Name
        Parameters:
        tempName - Cached Name
      • getDescriptionText

        public String getDescriptionText()
        Get Description Text. For jsp access (vs. isDescription)
        Returns:
        description
      • getPrecision

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

        public boolean isTaxIncluded()
        Is Tax Included in Amount
        Returns:
        true if tax is included
      • beforeSave

        protected boolean beforeSave​(boolean newRecord)
        Before Save
        Overrides:
        beforeSave in class PO
        Parameters:
        newRecord -
        Returns:
        true if save
      • updateInvoiceTax

        protected boolean updateInvoiceTax​(boolean oldTax)
        Recalculate invoice tax
        Parameters:
        oldTax - true if the old C_Tax_ID should be used
        Returns:
        true if success, false otherwise author teo_sarca [ 1583825 ]
      • afterSave

        protected boolean afterSave​(boolean newRecord,
                                    boolean success)
        After Save
        Overrides:
        afterSave in class PO
        Parameters:
        newRecord - new
        success - success
        Returns:
        saved
      • afterDelete

        protected boolean afterDelete​(boolean success)
        After Delete
        Overrides:
        afterDelete in class PO
        Parameters:
        success - success
        Returns:
        deleted
      • updateHeaderTax

        public boolean updateHeaderTax()
        Update Tax and Header
        Returns:
        true if header updated with tax
      • allocateLandedCosts

        public String allocateLandedCosts()
        Allocate Landed Costs
        Returns:
        error message or ""
      • allocateLandedCostRounding

        protected void allocateLandedCostRounding()
        Allocate Landed Cost - Enforce Rounding
      • getLandedCost

        public MLandedCost[] getLandedCost​(String whereClause)
        Get LandedCost of InvoiceLine
        Parameters:
        whereClause - starting with AND
        Returns:
        landedCost
      • copyLandedCostFrom

        public int copyLandedCostFrom​(MInvoiceLine otherInvoiceLine)
        Copy LandedCost From other InvoiceLine.
        Parameters:
        otherInvoiceLine - invoiceline
        Returns:
        number of lines copied
      • setRMALine

        public void setRMALine​(MRMALine rmaLine)
        Parameters:
        rmaLine -
      • getMatchedQty

        public BigDecimal getMatchedQty()
        Returns:
        matched qty
      • clearParent

        public void clearParent()