Class MPPProductBOMLine

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

public class MPPProductBOMLine extends X_PP_Product_BOMLine implements ImmutablePOSupport
PP Product BOM Line Model. MPPProductBOMLine l = new MPPProductBOMLine(bom); l.setM_Product_ID(wbl.getM_Product_ID()); l.setQty(wbl.getQuantity()); l.saveEx();
Author:
Victor Perez www.e-evolution.com, Teo Sarca, www.arhipac.ro
See Also:
  • Constructor Details

    • MPPProductBOMLine

      public MPPProductBOMLine(Properties ctx, String PP_Product_BOMLine_UU, String trxName)
      UUID based Constructor
      Parameters:
      ctx - Context
      PP_Product_BOMLine_UU - UUID key
      trxName - Transaction
    • 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 -
    • MPPProductBOMLine

      public MPPProductBOMLine(Properties ctx, MPPProductBOMLine copy)
      Parameters:
      ctx -
      copy -
    • MPPProductBOMLine

      public MPPProductBOMLine(Properties ctx, MPPProductBOMLine copy, String trxName)
      Parameters:
      ctx -
      copy -
      trxName -
    • MPPProductBOMLine

      public MPPProductBOMLine(Properties ctx, int PP_Product_BOMLine_ID, String trxName, String... virtualColumns)
  • Method Details

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

      public BigDecimal getQty()
      Like getQty(boolean), includeScrapQty = false
    • 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)
    • markImmutable

      public MPPProductBOMLine markImmutable()
      Description copied from interface: ImmutablePOSupport
      mark PO as immutable
      Specified by:
      markImmutable in interface ImmutablePOSupport
      Returns:
      PO