Class MPPProductBOMLine

    • Constructor Detail

      • MPPProductBOMLine

        public MPPProductBOMLine​(Properties ctx,
                                 int PP_Product_BOMLine,
                                 String trxName)
        Default Constructor
        Parameters:
        ctx - context
        PP_Product_BOMLine - BOM line to load
        trxName -
      • MPPProductBOMLine

        public MPPProductBOMLine​(MPPProductBOM bom)
        Parent Constructor.
        Parameters:
        bom - parent BOM
      • MPPProductBOMLine

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

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

      • getByProduct

        public static List<MPPProductBOMLine> getByProduct​(MProduct product)
        Get all the Product BOM line for a Component
        Parameters:
        product - Product
        Returns:
        list of MPPProductBOMLine
      • getBOMLines

        public static MPPProductBOMLine[] getBOMLines​(MProduct product)
        Get all the BOM lines for a Product
        Parameters:
        product - Product
        Returns:
        list of MPPProductBOMLine
      • getLowLevel

        public int getLowLevel()
        Get Low Level of a Product
        Returns:
        int low level
      • getParent

        public MPPProductBOM getParent()
        get Parent BOM
        Returns:
      • getProduct

        public MProduct getProduct()
      • getLowLevel

        public static int getLowLevel​(Properties ctx,
                                      int M_Product_ID,
                                      String trxName)
        Calculate Low Level of a Product
        Parameters:
        ctx -
        M_Product_ID - Product ID
        trxName -
        Returns:
        int low level
      • 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)
        Description copied from class: PO
        Called after Save for Post-Save Operation
        Overrides:
        afterSave in class PO
        Parameters:
        newRecord - new record
        success - true if save operation was success
        Returns:
        if save was a success
      • isValidFromTo

        public boolean isValidFromTo​(Timestamp date)
      • isByProduct

        public boolean isByProduct()
      • isCoProduct

        public boolean isCoProduct()
      • getQty

        public BigDecimal getQty​(boolean includeScrapQty)
        Return absolute (unified) quantity value. If IsQtyPercentage then QtyBatch / 100 will be returned. Else QtyBOM will be returned.
        Parameters:
        includeScrapQty - if true, scrap qty will be used for calculating qty
        Returns:
        qty
      • getPrecision

        public int getPrecision()
        Returns:
        UOM precision
      • getCostAllocationPerc

        public BigDecimal getCostAllocationPerc​(boolean fallback)
        Parameters:
        fallback - use QtyBOM/QtyPercentage if CostAllocationPerc is zero
        Returns:
        co-product cost allocation percent (i.e. -1/qty)