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:
  • Field Details

  • 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)
      Copy constructor
      Parameters:
      copy -
    • MPPProductBOMLine

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

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

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

    • getByProduct

      public static List<MPPProductBOMLine> getByProduct(MProduct product)
      Get all the Product BOM line for a Component Product
      Parameters:
      product - Component 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 parent Product
      Returns:
      low level
    • getParent

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

      public MProduct getProduct()
      Get updateable copy of component product
      Returns:
    • 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.
      Default implementation is nop, to be implemented in sub-classes that needed it.
      Overrides:
      beforeSave in class PO
      Parameters:
      newRecord - true if it is a 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.
      Default implementation is nop, to be implemented in sub-classes that needed it.
      Overrides:
      afterSave in class PO
      Parameters:
      newRecord - true if it is a new record
      success - true if save operation was success
      Returns:
      if save was a success
    • isValidFromTo

      public boolean isValidFromTo(Timestamp date)
      Is BOM line valid for date
      Parameters:
      date -
      Returns:
      true if BOM line is valid for date
    • isByProduct

      public boolean isByProduct()
      Is COMPONENTTYPE_By_Product
      Returns:
      true if it is COMPONENTTYPE_By_Product
    • isCoProduct

      public boolean isCoProduct()
      Is COMPONENTTYPE_Co_Product
      Returns:
      true if it is COMPONENTTYPE_Co_Product
    • 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()
      Get UOM precision
      Returns:
      UOM precision
    • getCostAllocationPerc

      public BigDecimal getCostAllocationPerc(boolean fallback)
      Get cost allocation percentage
      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