Class MOrderLine

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

    public class MOrderLine
    extends X_C_OrderLine
    Order Line Model. MOrderLine ol = new MOrderLine(m_order); ol.setM_Product_ID(wbl.getM_Product_ID()); ol.setQtyOrdered(wbl.getQuantity()); ol.setPrice(); ol.setPriceActual(wbl.getPrice()); ol.setTax(); ol.saveEx();
    Version:
    $Id: MOrderLine.java,v 1.6 2006/10/02 05:18:39 jjanke Exp $
    Author:
    Jorg Janke, Teo Sarca, SC ARHIPAC SERVICE SRL
  • BF [ 2588043 ] Insufficient message ProductNotOnPriceList
  • See Also:
    Serialized Form
    • Field Detail

      • s_log

        protected static CLogger s_log
        Logger
      • m_M_PriceList_ID

        protected int m_M_PriceList_ID
      • m_IsSOTrx

        protected boolean m_IsSOTrx
      • m_tax

        protected MTax m_tax
        Tax
      • m_precision

        protected Integer m_precision
        Cached Currency Precision
      • m_product

        protected MProduct m_product
        Product
      • m_charge

        protected MCharge m_charge
        Charge
      • m_parent

        protected MOrder m_parent
        Parent
    • Constructor Detail

      • MOrderLine

        public MOrderLine​(Properties ctx,
                          int C_OrderLine_ID,
                          String trxName)
        Default Constructor
        Parameters:
        ctx - context
        C_OrderLine_ID - order line to load
        trxName - trx name
      • MOrderLine

        public MOrderLine​(MOrder order)
        Parent Constructor. ol.setM_Product_ID(wbl.getM_Product_ID()); ol.setQtyOrdered(wbl.getQuantity()); ol.setPrice(); ol.setPriceActual(wbl.getPrice()); ol.setTax(); ol.saveEx();
        Parameters:
        order - parent order
      • MOrderLine

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

      • getNotReserved

        public static BigDecimal getNotReserved​(Properties ctx,
                                                int M_Warehouse_ID,
                                                int M_Product_ID,
                                                int M_AttributeSetInstance_ID,
                                                int excludeC_OrderLine_ID)
        Get Order Unreserved Qty
        Parameters:
        ctx - context
        M_Warehouse_ID - wh
        M_Product_ID - product
        M_AttributeSetInstance_ID - asi
        excludeC_OrderLine_ID - exclude C_OrderLine_ID
        Returns:
        Unreserved Qty
      • setOrder

        public void setOrder​(MOrder order)
        Set Defaults from Order. Does not set Parent !!
        Parameters:
        order - order
      • setHeaderInfo

        public void setHeaderInfo​(MOrder order)
        Set Header Info
        Parameters:
        order - order
      • getParent

        public MOrder getParent()
        Get Parent
        Returns:
        parent
      • setPrice

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

        public void setPrice()
        Set Price for Product and PriceList. Use only if newly created. Uses standard price list of not set by order constructor
      • setPrice

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

        protected IProductPricing getProductPricing​(int M_PriceList_ID)
        Get and calculate Product Pricing
        Parameters:
        M_PriceList_ID - id
        Returns:
        product pricing
      • setTax

        public boolean setTax()
        Set Tax
        Returns:
        true if tax is set
      • 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
      • getPrecision

        public int getPrecision()
        Get Currency Precision from Currency
        Returns:
        precision
      • 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 also UOM
      • 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
      • canChangeWarehouse

        public boolean canChangeWarehouse()
        Can Change Warehouse
        Returns:
        true if warehouse can be changed
      • addDescription

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

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

        public String getName()
        Get Name
        Returns:
        get the name of the line (from Product)
      • setDiscount

        public void setDiscount()
        Set Discount
      • isTaxIncluded

        public boolean isTaxIncluded()
        Is Tax Included in Amount
        Returns:
        true if tax calculated
      • setQty

        public void setQty​(BigDecimal Qty)
        Set Qty Entered/Ordered. Use this Method if the Line UOM is the Product UOM
        Parameters:
        Qty - QtyOrdered/Entered
      • getBase

        public BigDecimal getBase​(String CostDistribution)
        Get Base value for Cost Distribution
        Parameters:
        CostDistribution - cost Distribution
        Returns:
        base number
      • beforeSave

        protected boolean beforeSave​(boolean newRecord)
        Before Save
        Overrides:
        beforeSave in class PO
        Parameters:
        newRecord -
        Returns:
        true if it can be saved
      • beforeDelete

        protected boolean beforeDelete()
        Before Delete
        Overrides:
        beforeDelete in class PO
        Returns:
        true if it can be deleted
      • 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
      • updateOrderTax

        public boolean updateOrderTax​(boolean oldTax)
        Recalculate order tax
        Parameters:
        oldTax - true if the old C_Tax_ID should be used
        Returns:
        true if success, false otherwise author teo_sarca [ 1583825 ]
      • updateHeaderTax

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

        public void clearParent()