Package org.eevolution.model
Class MPPProductBOMLine
- java.lang.Object
-
- org.compiere.model.PO
-
- org.eevolution.model.X_PP_Product_BOMLine
-
- org.eevolution.model.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:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.eevolution.model.X_PP_Product_BOMLine
COMPONENTTYPE_AD_Reference_ID, COMPONENTTYPE_By_Product, COMPONENTTYPE_Co_Product, COMPONENTTYPE_Component, COMPONENTTYPE_Option, COMPONENTTYPE_Packing, COMPONENTTYPE_Phantom, COMPONENTTYPE_Planning, COMPONENTTYPE_Tools, COMPONENTTYPE_Variant, ISSUEMETHOD_AD_Reference_ID, ISSUEMETHOD_Backflush, ISSUEMETHOD_FloorStock, ISSUEMETHOD_Issue
-
Fields inherited from class org.compiere.model.PO
ACCESSLEVEL_ALL, ACCESSLEVEL_CLIENT, ACCESSLEVEL_CLIENTORG, ACCESSLEVEL_ORG, ACCESSLEVEL_SYSTEM, ACCESSLEVEL_SYSTEMCLIENT, ENTITYTYPE_Dictionary, ENTITYTYPE_UserMaintained, I_ZERO, LOCAL_TRX_PREFIX, log, p_ctx, p_info, XML_ATTRIBUTE_AD_Table_ID, XML_ATTRIBUTE_Record_ID
-
Fields inherited from interface org.eevolution.model.I_PP_Product_BOMLine
accessLevel, COLUMNNAME_AD_Client_ID, COLUMNNAME_AD_Org_ID, COLUMNNAME_Assay, COLUMNNAME_BackflushGroup, COLUMNNAME_C_UOM_ID, COLUMNNAME_ComponentType, COLUMNNAME_CostAllocationPerc, COLUMNNAME_Created, COLUMNNAME_CreatedBy, COLUMNNAME_Description, COLUMNNAME_Feature, COLUMNNAME_Forecast, COLUMNNAME_Help, COLUMNNAME_IsActive, COLUMNNAME_IsCritical, COLUMNNAME_IsQtyPercentage, COLUMNNAME_IssueMethod, COLUMNNAME_LeadTimeOffset, COLUMNNAME_Line, COLUMNNAME_M_AttributeSetInstance_ID, COLUMNNAME_M_ChangeNotice_ID, COLUMNNAME_M_Product_ID, COLUMNNAME_PP_Product_BOM_ID, COLUMNNAME_PP_Product_BOMLine_ID, COLUMNNAME_PP_Product_BOMLine_UU, COLUMNNAME_QtyBatch, COLUMNNAME_QtyBOM, COLUMNNAME_Scrap, COLUMNNAME_Updated, COLUMNNAME_UpdatedBy, COLUMNNAME_ValidFrom, COLUMNNAME_ValidTo, Model, Table_ID, Table_Name
-
-
Constructor Summary
Constructors Constructor Description MPPProductBOMLine(Properties ctx, int PP_Product_BOMLine, String trxName)Default ConstructorMPPProductBOMLine(Properties ctx, ResultSet rs, String trxName)Load ConstructorMPPProductBOMLine(Properties ctx, MPPProductBOMLine copy)MPPProductBOMLine(Properties ctx, MPPProductBOMLine copy, String trxName)MPPProductBOMLine(MPPProductBOM bom)Parent Constructor.MPPProductBOMLine(MPPProductBOMLine copy)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanafterSave(boolean newRecord, boolean success)Called after Save for Post-Save Operationprotected booleanbeforeSave(boolean newRecord)Called before Save for Pre-Save Operationstatic MPPProductBOMLine[]getBOMLines(MProduct product)Get all the BOM lines for a Productstatic List<MPPProductBOMLine>getByProduct(MProduct product)Get all the Product BOM line for a ComponentBigDecimalgetCostAllocationPerc(boolean fallback)intgetLowLevel()Get Low Level of a Productstatic intgetLowLevel(Properties ctx, int M_Product_ID, String trxName)Calculate Low Level of a ProductMPPProductBOMgetParent()get Parent BOMintgetPrecision()MProductgetProduct()BigDecimalgetQty()LikegetQty(boolean), includeScrapQty = falseBigDecimalgetQty(boolean includeScrapQty)Return absolute (unified) quantity value.booleanisByProduct()booleanisCoProduct()booleanisValidFromTo(Timestamp date)MPPProductBOMLinemarkImmutable()mark PO as immutable-
Methods inherited from class org.eevolution.model.X_PP_Product_BOMLine
get_AccessLevel, getAssay, getBackflushGroup, getC_UOM, getC_UOM_ID, getComponentType, getCostAllocationPerc, getDescription, getFeature, getForecast, getHelp, getIssueMethod, getKeyNamePair, getLeadTimeOffset, getLine, getM_AttributeSetInstance, getM_AttributeSetInstance_ID, getM_ChangeNotice, getM_ChangeNotice_ID, getM_Product, getM_Product_ID, getPP_Product_BOM, getPP_Product_BOM_ID, getPP_Product_BOMLine_ID, getPP_Product_BOMLine_UU, getQtyBatch, getQtyBOM, getScrap, getValidFrom, getValidTo, initPO, isCritical, isQtyPercentage, setAssay, setBackflushGroup, setC_UOM_ID, setComponentType, setCostAllocationPerc, setDescription, setFeature, setForecast, setHelp, setIsCritical, setIsQtyPercentage, setIssueMethod, setLeadTimeOffset, setLine, setM_AttributeSetInstance_ID, setM_ChangeNotice_ID, setM_Product_ID, setPP_Product_BOM_ID, setPP_Product_BOMLine_ID, setPP_Product_BOMLine_UU, setQtyBatch, setQtyBOM, setScrap, setValidFrom, setValidTo, toString
-
Methods inherited from class org.compiere.model.PO
afterDelete, beforeDelete, checkImmutable, clearCrossTenantSafe, clone, columnExists, columnExists, compare, copyPO, copyValues, copyValues, createAttachment, delete, delete, delete_Accounting, delete_Tree, deleteEx, deleteEx, dump, dump, equals, get_Attribute, get_Attributes, get_ColumnCount, get_ColumnDescription, get_ColumnDisplayType, get_ColumnIndex, get_ColumnLabel, get_ColumnLookup, get_ColumnName, get_DisplayValue, get_HashMap, get_ID, get_IDOld, get_KeyColumns, get_Logger, get_OptimisticLockingColumns, get_Table_ID, get_TableName, get_Translation, get_Translation, get_Translation, get_Translation, get_Translation, get_TrxName, get_Value, get_Value, get_ValueAsBoolean, get_ValueAsInt, get_ValueAsInt, get_ValueAsString, get_ValueDifference, get_ValueDifference, get_ValueE, get_ValueOfColumn, get_ValueOld, get_ValueOld, get_ValueOldAsInt, get_WhereClause, get_WhereClause, get_xmlDocument, get_xmlString, getAD_Client_ID, getAD_Org_ID, getAllIDs, getAttachment, getAttachment, getAttachmentData, getCreated, getCreatedBy, getCtx, getDoc, getFindParameter, getPdfAttachment, getUpdated, getUpdatedBy, getUUIDColumnName, getUUIDColumnName, hashCode, insert_Accounting, insert_Tree, insert_Tree, is_Changed, is_Immutable, is_new, is_UseOptimisticLocking, is_ValueChanged, is_ValueChanged, isActive, isAttachment, isColumnMandatory, isColumnUpdateable, isMandatoryOK, isPdfAttachment, isReplication, load, load, load, load, load, loadByUU, loadComplete, loadDefaults, loadSpecial, lock, makeImmutable, postDelete, retrieveIdOfParentValue, retrieveIdOfParentValue, save, save, saveEx, saveEx, saveNew_afterSetID, saveNew_getID, saveNewSpecial, saveReplica, saveUpdate, set_Attribute, set_ColumnUpdateable, set_CustomColumn, set_CustomColumnReturningBoolean, set_OptimisticLockingColumns, set_TrxName, set_TrxName, set_UseOptimisticLocking, set_Value, set_Value, set_Value, set_Value, set_ValueE, set_ValueNoCheck, set_ValueNoCheckE, set_ValueOfColumn, set_ValueOfColumn, set_ValueOfColumnReturningBoolean, set_ValueOfColumnReturningBoolean, setAD_Client_ID, setAD_Org_ID, setClientOrg, setClientOrg, setCrossTenantSafe, setDoc, setDocWorkflowMgr, setIsActive, setProcessedOn, setReplication, setStandardDefaults, setUpdateable, setUpdatedBy, unlock, update_Tree, validForeignKeys
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Comparator
reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Methods inherited from interface org.compiere.model.I_Persistent
save
-
Methods inherited from interface org.eevolution.model.I_PP_Product_BOMLine
getAD_Client_ID, getAD_Org_ID, getCreated, getCreatedBy, getUpdated, getUpdatedBy, isActive, setAD_Org_ID, setIsActive
-
-
-
-
Constructor Detail
-
MPPProductBOMLine
public MPPProductBOMLine(Properties ctx, int PP_Product_BOMLine, String trxName)
Default Constructor- Parameters:
ctx- contextPP_Product_BOMLine- BOM line to loadtrxName-
-
MPPProductBOMLine
public MPPProductBOMLine(MPPProductBOM bom)
Parent Constructor.- Parameters:
bom- parent BOM
-
MPPProductBOMLine
public MPPProductBOMLine(Properties ctx, ResultSet rs, String trxName)
Load Constructor- Parameters:
ctx- contextrs- 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-
-
-
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 IDtrxName-- Returns:
- int low level
-
beforeSave
protected boolean beforeSave(boolean newRecord)
Description copied from class:POCalled before Save for Pre-Save Operation- Overrides:
beforeSavein classPO- Parameters:
newRecord- new record- Returns:
- true if record can be saved
-
afterSave
protected boolean afterSave(boolean newRecord, boolean success)Description copied from class:POCalled after Save for Post-Save Operation
-
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()
LikegetQty(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:ImmutablePOSupportmark PO as immutable- Specified by:
markImmutablein interfaceImmutablePOSupport- Returns:
- PO
-
-