Class MInventoryLine

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

public class MInventoryLine extends X_M_InventoryLine
Inventory Document Line Model
Version:
$Id: MInventoryLine.java,v 1.3 2006/07/30 00:51:02 jjanke Exp $
Author:
Jorg Janke, Teo Sarca, SC ARHIPAC SERVICE SRL
  • BF [ 1817757 ] Error on saving MInventoryLine in a custom environment
  • BF [ 1722982 ] Error with inventory when you enter count qty in negative
  • See Also:
    • Field Details

      • m_parent

        protected MInventory m_parent
        Parent
      • m_product

        protected MProduct m_product
        Product
    • Constructor Details

      • MInventoryLine

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

        public MInventoryLine(Properties ctx, int M_InventoryLine_ID, String trxName)
        Default Constructor
        Parameters:
        ctx - context
        M_InventoryLine_ID - line
        trxName - transaction
      • MInventoryLine

        public MInventoryLine(Properties ctx, int M_InventoryLine_ID, String trxName, String... virtualColumns)
        Parameters:
        ctx -
        M_InventoryLine_ID -
        trxName -
        virtualColumns -
      • MInventoryLine

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

        public MInventoryLine(MInventory inventory, int M_Locator_ID, int M_Product_ID, int M_AttributeSetInstance_ID, BigDecimal QtyBook, BigDecimal QtyCount, BigDecimal QtyInternalUse)
        Detail Constructor. Locator/Product/AttributeSetInstance must be unique.
        Parameters:
        inventory - parent
        M_Locator_ID - locator
        M_Product_ID - product
        M_AttributeSetInstance_ID - instance
        QtyBook - book value
        QtyCount - count value
        QtyInternalUse - internal use value
      • MInventoryLine

        public MInventoryLine(MInventory inventory, int M_Locator_ID, int M_Product_ID, int M_AttributeSetInstance_ID, BigDecimal QtyBook, BigDecimal QtyCount)
        Parameters:
        inventory -
        M_Locator_ID -
        M_Product_ID -
        M_AttributeSetInstance_ID -
        QtyBook -
        QtyCount -
      • MInventoryLine

        public MInventoryLine(MInventoryLine copy)
        Copy constructor
        Parameters:
        copy -
      • MInventoryLine

        public MInventoryLine(Properties ctx, MInventoryLine copy)
        Copy constructor
        Parameters:
        ctx -
        copy -
      • MInventoryLine

        public MInventoryLine(Properties ctx, MInventoryLine copy, String trxName)
        Copy constructor
        Parameters:
        ctx -
        copy -
        trxName -
    • Method Details

      • get

        public static MInventoryLine get(MInventory inventory, int M_Locator_ID, int M_Product_ID, int M_AttributeSetInstance_ID)
        Get Inventory Line with parameters
        Parameters:
        inventory - inventory
        M_Locator_ID - locator
        M_Product_ID - product
        M_AttributeSetInstance_ID - asi
        Returns:
        line or null
      • getProduct

        public MProduct getProduct()
        Get Product
        Returns:
        product or null if not defined
      • setQtyCount

        public void setQtyCount(BigDecimal QtyCount)
        Set Count Qty - enforce product UOM precision
        Specified by:
        setQtyCount in interface I_M_InventoryLine
        Overrides:
        setQtyCount in class X_M_InventoryLine
        Parameters:
        QtyCount - qty
      • setQtyInternalUse

        public void setQtyInternalUse(BigDecimal QtyInternalUse)
        Set Internal Use Qty - enforce product UOM precision
        Specified by:
        setQtyInternalUse in interface I_M_InventoryLine
        Overrides:
        setQtyInternalUse in class X_M_InventoryLine
        Parameters:
        QtyInternalUse - qty
      • addDescription

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

        protected void setParent(MInventory parent)
        Set Parent
        Parameters:
        parent - parent
      • getParent

        public MInventory getParent()
        Get Parent
        Returns:
        parent
      • toString

        public String toString()
        String Representation
        Overrides:
        toString in class X_M_InventoryLine
        Returns:
        info
      • beforeSave

        protected boolean beforeSave(boolean newRecord)
        Set Line (if not set yet).
        Check mandatory fields by document type.
        Cost adjustment document: set current cost price.
        Overrides:
        beforeSave in class PO
        Parameters:
        newRecord - new
        Returns:
        true if can be saved
      • isInternalUseInventory

        public boolean isInternalUseInventory()
        Is Internal Use Inventory
        Returns:
        true if this is an internal use inventory document
      • getMovementQty

        public BigDecimal getMovementQty()
        Get Movement Qty
      • negative value means outgoing trx
      • positive value means incoming trx
      • Returns:
        movement qty
      • isSOTrx

        public boolean isSOTrx()
        Returns:
        true if is an outgoing transaction (movement qty < 0)