Package org.compiere.model
Class MInventoryLine
java.lang.Object
org.compiere.model.PO
org.compiere.model.X_M_InventoryLine
org.compiere.model.MInventoryLine
- All Implemented Interfaces:
Serializable,Cloneable,Comparator<Object>,I_M_InventoryLine,I_Persistent,Evaluatee
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 Summary
FieldsFields inherited from class org.compiere.model.X_M_InventoryLine
INVENTORYTYPE_AD_Reference_ID, INVENTORYTYPE_ChargeAccount, INVENTORYTYPE_InventoryDifferenceFields 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, UUID_NEW_RECORD, XML_ATTRIBUTE_AD_Table_ID, XML_ATTRIBUTE_Record_IDFields inherited from interface org.compiere.model.I_M_InventoryLine
accessLevel, COLUMNNAME_AD_Client_ID, COLUMNNAME_AD_Org_ID, COLUMNNAME_C_Charge_ID, COLUMNNAME_C_CostCenter_ID, COLUMNNAME_C_Department_ID, COLUMNNAME_Created, COLUMNNAME_CreatedBy, COLUMNNAME_CurrentCostPrice, COLUMNNAME_Description, COLUMNNAME_InventoryType, COLUMNNAME_IsActive, COLUMNNAME_Line, COLUMNNAME_M_AttributeSetInstance_ID, COLUMNNAME_M_Inventory_ID, COLUMNNAME_M_InventoryLine_ID, COLUMNNAME_M_InventoryLine_UU, COLUMNNAME_M_Locator_ID, COLUMNNAME_M_Product_ID, COLUMNNAME_NewCostPrice, COLUMNNAME_Processed, COLUMNNAME_QtyBook, COLUMNNAME_QtyCount, COLUMNNAME_QtyCsv, COLUMNNAME_QtyInternalUse, COLUMNNAME_ReversalLine_ID, COLUMNNAME_UPC, COLUMNNAME_Updated, COLUMNNAME_UpdatedBy, COLUMNNAME_Value, Model, Table_ID, Table_Name -
Constructor Summary
ConstructorsConstructorDescriptionMInventoryLine(Properties ctx, int M_InventoryLine_ID, String trxName) Default ConstructorMInventoryLine(Properties ctx, int M_InventoryLine_ID, String trxName, String... virtualColumns) MInventoryLine(Properties ctx, String M_InventoryLine_UU, String trxName) UUID based ConstructorMInventoryLine(Properties ctx, ResultSet rs, String trxName) Load ConstructorMInventoryLine(Properties ctx, MInventoryLine copy) Copy constructorMInventoryLine(Properties ctx, MInventoryLine copy, String trxName) Copy constructorMInventoryLine(MInventoryLine copy) Copy constructorMInventoryLine(MInventory inventory, int M_Locator_ID, int M_Product_ID, int M_AttributeSetInstance_ID, BigDecimal QtyBook, BigDecimal QtyCount) MInventoryLine(MInventory inventory, int M_Locator_ID, int M_Product_ID, int M_AttributeSetInstance_ID, BigDecimal QtyBook, BigDecimal QtyCount, BigDecimal QtyInternalUse) Detail Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDescription(String description) Add to Descriptionprotected booleanbeforeSave(boolean newRecord) Set Line (if not set yet).
Check mandatory fields by document type.
Cost adjustment document: set current cost price.static MInventoryLineget(MInventory inventory, int M_Locator_ID, int M_Product_ID, int M_AttributeSetInstance_ID) Get Inventory Line with parametersstatic intgetImportLine_ID(int M_InventoryLine_ID, String trxName) Check is inventory line is import inventory lineGet Movement Qty negative value means outgoing trx positive value means incoming trxGet ParentGet ProductbooleanIs Internal Use InventorybooleanisSOTrx()protected voidsetParent(MInventory parent) Set ParentvoidsetQtyCount(BigDecimal QtyCount) Set Count Qty - enforce product UOM precisionvoidsetQtyInternalUse(BigDecimal QtyInternalUse) Set Internal Use Qty - enforce product UOM precisiontoString()String RepresentationMethods inherited from class org.compiere.model.X_M_InventoryLine
get_AccessLevel, getC_Charge, getC_Charge_ID, getC_CostCenter, getC_CostCenter_ID, getC_Department, getC_Department_ID, getCurrentCostPrice, getDescription, getInventoryType, getKeyNamePair, getLine, getM_AttributeSetInstance, getM_AttributeSetInstance_ID, getM_Inventory, getM_Inventory_ID, getM_InventoryLine_ID, getM_InventoryLine_UU, getM_Locator, getM_Locator_ID, getM_Product, getM_Product_ID, getNewCostPrice, getQtyBook, getQtyCount, getQtyCsv, getQtyInternalUse, getReversalLine, getReversalLine_ID, getUPC, getValue, initPO, isProcessed, setC_Charge_ID, setC_CostCenter_ID, setC_Department_ID, setCurrentCostPrice, setDescription, setInventoryType, setLine, setM_AttributeSetInstance_ID, setM_Inventory_ID, setM_InventoryLine_ID, setM_InventoryLine_UU, setM_Locator_ID, setM_Product_ID, setNewCostPrice, setProcessed, setQtyBook, setQtyCsv, setReversalLine_ID, setUPC, setValueMethods inherited from class org.compiere.model.PO
afterDelete, afterSave, beforeDelete, buildInsertSQL, buildUUIDSubquery, 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_QueryTimeout, get_Table_ID, get_TableAttribute, get_TableAttributeAsBoolean, get_TableAttributeAsInt, get_TableAttributes, get_TableName, get_Translation, get_Translation, get_Translation, get_Translation, get_Translation, get_TrxName, get_UUID, get_Value, get_Value, get_ValueAsBoolean, get_ValueAsInt, get_ValueAsInt, get_ValueAsString, 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_ColumnLoaded, is_Immutable, is_new, is_Partial, is_UseOptimisticLocking, is_ValueChanged, is_ValueChanged, isActive, isAttachment, isColumnMandatory, isColumnUpdateable, isMandatoryOK, isPdfAttachment, isReplication, load, load, load, load, loadByUU, loadComplete, loadDefaults, loadPO, loadSpecial, lock, makeImmutable, postDelete, retrieveIdOfParentValue, retrieveIdOfParentValue, save, save, saveCrossTenantSafe, saveCrossTenantSafeEx, saveCrossTenantSafeEx, saveEx, saveEx, saveNew_afterSetID, saveNew_getID, saveNewSpecial, saveReplica, saveUpdate, set_Attribute, set_ColumnLoaded, set_ColumnUpdateable, set_CustomColumn, set_CustomColumnReturningBoolean, set_OptimisticLockingColumns, set_Partial, set_QueryTimeout, 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, toInsertSQL, unlock, update_Tree, validForeignKeys, validForeignKeysExMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Comparator
reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLongMethods inherited from interface org.compiere.model.I_M_InventoryLine
getAD_Client_ID, getAD_Org_ID, getCreated, getCreatedBy, getUpdated, getUpdatedBy, isActive, setAD_Org_ID, setIsActiveMethods inherited from interface org.compiere.model.I_Persistent
save
-
Field Details
-
m_parent
Parent -
m_product
Product
-
-
Constructor Details
-
MInventoryLine
UUID based Constructor- Parameters:
ctx- ContextM_InventoryLine_UU- UUID keytrxName- Transaction
-
MInventoryLine
Default Constructor- Parameters:
ctx- contextM_InventoryLine_ID- linetrxName- transaction
-
MInventoryLine
public MInventoryLine(Properties ctx, int M_InventoryLine_ID, String trxName, String... virtualColumns) - Parameters:
ctx-M_InventoryLine_ID-trxName-virtualColumns-
-
MInventoryLine
Load Constructor- Parameters:
ctx- contextrs- result settrxName- 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- parentM_Locator_ID- locatorM_Product_ID- productM_AttributeSetInstance_ID- instanceQtyBook- book valueQtyCount- count valueQtyInternalUse- 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
Copy constructor- Parameters:
copy-
-
MInventoryLine
Copy constructor- Parameters:
ctx-copy-
-
MInventoryLine
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- inventoryM_Locator_ID- locatorM_Product_ID- productM_AttributeSetInstance_ID- asi- Returns:
- line or null
-
getProduct
Get Product- Returns:
- product or null if not defined
-
setQtyCount
Set Count Qty - enforce product UOM precision- Specified by:
setQtyCountin interfaceI_M_InventoryLine- Overrides:
setQtyCountin classX_M_InventoryLine- Parameters:
QtyCount- qty
-
setQtyInternalUse
Set Internal Use Qty - enforce product UOM precision- Specified by:
setQtyInternalUsein interfaceI_M_InventoryLine- Overrides:
setQtyInternalUsein classX_M_InventoryLine- Parameters:
QtyInternalUse- qty
-
addDescription
Add to Description- Parameters:
description- text
-
setParent
Set Parent- Parameters:
parent- parent
-
getParent
Get Parent- Returns:
- parent
-
toString
String Representation- Overrides:
toStringin classX_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:
beforeSavein classPO- 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
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)
-
getImportLine_ID
Check is inventory line is import inventory line- Parameters:
M_InventoryLine_ID-trxName-- Returns:
- I_Inventory_ID
-
getCurrentCostPriceForCostAdjustment
-