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
public class MInventoryLine extends X_M_InventoryLine
Physical Inventory 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:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected MInventory
m_parent
Parentprotected MProduct
m_product
Product-
Fields inherited from class org.compiere.model.X_M_InventoryLine
INVENTORYTYPE_AD_Reference_ID, INVENTORYTYPE_ChargeAccount, INVENTORYTYPE_InventoryDifference
-
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.compiere.model.I_M_InventoryLine
accessLevel, COLUMNNAME_AD_Client_ID, COLUMNNAME_AD_Org_ID, COLUMNNAME_C_Charge_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
Constructors Constructor Description MInventoryLine(Properties ctx, int M_InventoryLine_ID, String trxName)
Default ConstructorMInventoryLine(Properties ctx, ResultSet rs, String trxName)
Load ConstructorMInventoryLine(Properties ctx, MInventoryLine copy)
MInventoryLine(Properties ctx, MInventoryLine copy, String trxName)
MInventoryLine(MInventoryLine copy)
MInventoryLine(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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addDescription(String description)
Add to Descriptionprotected boolean
beforeSave(boolean newRecord)
Before Savestatic MInventoryLine
get(MInventory inventory, int M_Locator_ID, int M_Product_ID, int M_AttributeSetInstance_ID)
Get Inventory Line with parametersBigDecimal
getMovementQty()
Get Movement Qty (absolute value) negative value means outgoing trx positive value means incoming trxMInventory
getParent()
Get ParentMProduct
getProduct()
Get Productboolean
isInternalUseInventory()
Is Internal Use Inventoryboolean
isSOTrx()
protected void
setParent(MInventory parent)
Get Parentvoid
setQtyCount(BigDecimal QtyCount)
Set Count Qty - enforce UOMvoid
setQtyInternalUse(BigDecimal QtyInternalUse)
Set Internal Use Qty - enforce UOMString
toString()
String Representation-
Methods inherited from class org.compiere.model.X_M_InventoryLine
get_AccessLevel, getC_Charge, getC_Charge_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, 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, setValue
-
Methods inherited from class org.compiere.model.PO
afterDelete, afterSave, 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_M_InventoryLine
getAD_Client_ID, getAD_Org_ID, getCreated, getCreatedBy, getUpdated, getUpdatedBy, isActive, setAD_Org_ID, setIsActive
-
Methods inherited from interface org.compiere.model.I_Persistent
save
-
-
-
-
Field Detail
-
m_parent
protected MInventory m_parent
Parent
-
m_product
protected MProduct m_product
Product
-
-
Constructor Detail
-
MInventoryLine
public MInventoryLine(Properties ctx, int M_InventoryLine_ID, String trxName)
Default Constructor- Parameters:
ctx
- contextM_InventoryLine_ID
- linetrxName
- transaction
-
MInventoryLine
public MInventoryLine(Properties ctx, ResultSet rs, String trxName)
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)
-
MInventoryLine
public MInventoryLine(MInventoryLine copy)
- Parameters:
copy
-
-
MInventoryLine
public MInventoryLine(Properties ctx, MInventoryLine copy)
- Parameters:
ctx
-copy
-
-
MInventoryLine
public MInventoryLine(Properties ctx, MInventoryLine copy, String trxName)
- Parameters:
ctx
-copy
-trxName
-
-
-
Method Detail
-
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
public MProduct getProduct()
Get Product- Returns:
- product or null if not defined
-
setQtyCount
public void setQtyCount(BigDecimal QtyCount)
Set Count Qty - enforce UOM- Specified by:
setQtyCount
in interfaceI_M_InventoryLine
- Overrides:
setQtyCount
in classX_M_InventoryLine
- Parameters:
QtyCount
- qty
-
setQtyInternalUse
public void setQtyInternalUse(BigDecimal QtyInternalUse)
Set Internal Use Qty - enforce UOM- Specified by:
setQtyInternalUse
in interfaceI_M_InventoryLine
- Overrides:
setQtyInternalUse
in classX_M_InventoryLine
- Parameters:
QtyInternalUse
- qty
-
addDescription
public void addDescription(String description)
Add to Description- Parameters:
description
- text
-
setParent
protected void setParent(MInventory parent)
Get Parent- Parameters:
parent
- parent
-
getParent
public MInventory getParent()
Get Parent- Returns:
- parent
-
toString
public String toString()
String Representation- Overrides:
toString
in classX_M_InventoryLine
- Returns:
- info
-
beforeSave
protected boolean beforeSave(boolean newRecord)
Before Save- Overrides:
beforeSave
in classPO
- Parameters:
newRecord
- new- Returns:
- true if can be saved
-
isInternalUseInventory
public boolean isInternalUseInventory()
Is Internal Use Inventory- Returns:
- true if is internal use inventory
-
getMovementQty
public BigDecimal getMovementQty()
Get Movement Qty (absolute value)- negative value means outgoing trx
- positive value means incoming trx
- Returns:
- movement qty
-
isSOTrx
public boolean isSOTrx()
- Returns:
- true if is an outgoing transaction
-
-