Package org.compiere.model
Class MStorageOnHand
java.lang.Object
org.compiere.model.PO
org.compiere.model.X_M_StorageOnHand
org.compiere.model.MStorageOnHand
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparator<Object>
,I_M_StorageOnHand
,I_Persistent
,Evaluatee
Inventory On Hand Storage Model
- Version:
- $Id: MStorageOnHand.java,v 1.3 2006/07/30 00:51:05 jjanke Exp $
- Author:
- Jorg Janke
- See Also:
-
Field Summary
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, UUID_NEW_RECORD, XML_ATTRIBUTE_AD_Table_ID, XML_ATTRIBUTE_Record_ID
Fields inherited from interface org.compiere.model.I_M_StorageOnHand
accessLevel, COLUMNNAME_AD_Client_ID, COLUMNNAME_AD_Org_ID, COLUMNNAME_Created, COLUMNNAME_CreatedBy, COLUMNNAME_DateLastInventory, COLUMNNAME_DateMaterialPolicy, COLUMNNAME_IsActive, COLUMNNAME_M_AttributeSetInstance_ID, COLUMNNAME_M_Locator_ID, COLUMNNAME_M_Product_ID, COLUMNNAME_M_StorageOnHand_UU, COLUMNNAME_QtyOnHand, COLUMNNAME_Updated, COLUMNNAME_UpdatedBy, Model, Table_ID, Table_Name
-
Constructor Summary
ConstructorDescriptionMStorageOnHand
(Properties ctx, int ignored, String trxName) MStorageOnHand
(Properties ctx, String M_StorageOnHand_UU, String trxName) UUID based ConstructorMStorageOnHand
(Properties ctx, ResultSet rs, String trxName) Load Constructor -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
add
(Properties ctx, int M_Warehouse_ID, int M_Locator_ID, int M_Product_ID, int M_AttributeSetInstance_ID, BigDecimal diffQtyOnHand, String trxName) Deprecated.static boolean
add
(Properties ctx, int M_Warehouse_ID, int M_Locator_ID, int M_Product_ID, int M_AttributeSetInstance_ID, BigDecimal diffQtyOnHand, Timestamp dateMPolicy, String trxName) Deprecated.static boolean
add
(Properties ctx, int M_Locator_ID, int M_Product_ID, int M_AttributeSetInstance_ID, BigDecimal diffQtyOnHand, Timestamp dateMPolicy, String trxName) static boolean
add
(Properties ctx, int M_Locator_ID, int M_Product_ID, int M_AttributeSetInstance_ID, BigDecimal diffQtyOnHand, Timestamp dateMPolicy, Timestamp dateLastInventory, String trxName) Update On Hand Storage Called from MProjectIssuevoid
addQtyOnHand
(BigDecimal addition) Add addition to quantity on hand with direct SQL - not using cached value - solving IDEMPIERE-2629protected boolean
beforeSave
(boolean newRecord) Called before Save for Pre-Save Operation.
Default implementation is nop, to be implemented in sub-classes that needed it.static MStorageOnHand
get
(Properties ctx, int M_Locator_ID, int M_Product_ID, int M_AttributeSetInstance_ID, String trxName) Deprecated.static MStorageOnHand
get
(Properties ctx, int M_Locator_ID, int M_Product_ID, int M_AttributeSetInstance_ID, Timestamp dateMPolicy, String trxName) Get On Hand Storagestatic MStorageOnHand[]
getAll
(Properties ctx, int M_Product_ID, int M_Locator_ID, boolean locatorPriority, boolean fifo, String trxName, boolean forUpdate, int timeout) Get all Storages for Product where QtyOnHand !static MStorageOnHand[]
getAll
(Properties ctx, int M_Product_ID, int M_Locator_ID, int M_AttributeSetInstance_ID, Timestamp dateMPolicy, boolean ignoreZeroQty, String trxName) Get On Hand Storagestatic MStorageOnHand[]
getAll
(Properties ctx, int M_Product_ID, int M_Locator_ID, String trxName) Get all Storages for Product where QtyOnHand !static MStorageOnHand[]
getAll
(Properties ctx, int M_Product_ID, int M_Locator_ID, String trxName, boolean forUpdate, int timeout) Get all Storages for Product where QtyOnHand !static MStorageOnHand[]
getAllWithASI
(Properties ctx, int M_Product_ID, int M_Locator_ID, boolean FiFo, String trxName) Get all Storages for Product with ASI and QtyOnHand !static MStorageOnHand
getCreate
(Properties ctx, int M_Locator_ID, int M_Product_ID, int M_AttributeSetInstance_ID, Timestamp dateMPolicy, String trxName) Create or Get On Hand Storagestatic MStorageOnHand
getCreate
(Properties ctx, int M_Locator_ID, int M_Product_ID, int M_AttributeSetInstance_ID, Timestamp dateMPolicy, String trxName, boolean forUpdate) Create or Get On Hand Storagestatic MStorageOnHand
getCreate
(Properties ctx, int M_Locator_ID, int M_Product_ID, int M_AttributeSetInstance_ID, Timestamp dateMPolicy, String trxName, boolean forUpdate, int timeout) Create or Get On Hand Storagestatic Timestamp
getDateMaterialPolicy
(int M_Product_ID, int M_AttributeSetInstance_ID, int M_Locator_ID, String trxName) Get DateMaterialPolicy ORDER BY QtyOnHand DESCstatic Timestamp
getDateMaterialPolicy
(int M_Product_ID, int M_AttributeSetInstance_ID, String trxName) Get DateMaterialPolicy ORDER BY QtyOnHand DESCstatic int
getM_Locator_ID
(int M_Warehouse_ID, int M_Product_ID, int M_AttributeSetInstance_ID, BigDecimal Qty, String trxName) Get Locator with highest Locator Priority and a sufficient OnHand Qtyint
Get M_Warehouse_ID of Locatorstatic MStorageOnHand[]
getOfProduct
(Properties ctx, int M_Product_ID, String trxName) Get On Hand Storage for Product across warehousesstatic BigDecimal
getQtyOnHand
(int M_Product_ID, int M_Warehouse_ID, int M_AttributeSetInstance_ID, String trxName) Get Quantity On Hand of Warehousestatic BigDecimal
getQtyOnHandForLocator
(int M_Product_ID, int M_Locator_ID, int M_AttributeSetInstance_ID, String trxName) Get Quantity On Hand of Locatorstatic BigDecimal
getQtyOnHandForLocatorWithASIZero
(int M_Product_ID, int M_Locator_ID, String trxName) Get Quantity On Hand of Locator with ASI=0static BigDecimal
getQtyOnHandForReservation
(int M_Product_ID, int M_Warehouse_ID, int M_AttributeSetInstance_ID, String trxName) Get Quantity On Hand of Warehouse (only include Locator with Locator Type = Available for Reservation)static BigDecimal
getQtyOnHandForReservationWithASIZero
(int M_Product_ID, int M_Warehouse_ID, String trxName) Get Quantity On Hand of Warehouse with ASI=0 (only include Locator with Locator Type = Available for Reservation)static BigDecimal
getQtyOnHandForShipping
(int M_Product_ID, int M_Warehouse_ID, int M_AttributeSetInstance_ID, String trxName) Get Quantity On Hand of Warehouse (only include Locator with Locator Type = available for shipping)static BigDecimal
getQtyOnHandForShippingWithASIZero
(int M_Product_ID, int M_Warehouse_ID, String trxName) Get Quantity On Hand of Warehouse with ASI=0 (only include Locator with Locator Type = available for shipping)static BigDecimal
getQtyOnHandWithASIZero
(int M_Product_ID, int M_Warehouse_ID, String trxName) Get Quantity On Hand of Warehouse with ASI=0static MStorageOnHand[]
getWarehouse
(Properties ctx, int M_Warehouse_ID, int M_Product_ID, int M_AttributeSetInstance_ID, int M_AttributeSet_ID, boolean allAttributeInstances, Timestamp minGuaranteeDate, boolean FiFo, String trxName) Deprecated.static MStorageOnHand[]
getWarehouse
(Properties ctx, int M_Warehouse_ID, int M_Product_ID, int M_AttributeSetInstance_ID, Timestamp minGuaranteeDate, boolean FiFo, boolean positiveOnly, int M_Locator_ID, String trxName) Get On Hand Storage for Warehouse or locatorstatic MStorageOnHand[]
getWarehouse
(Properties ctx, int M_Warehouse_ID, int M_Product_ID, int M_AttributeSetInstance_ID, Timestamp minGuaranteeDate, boolean FiFo, boolean positiveOnly, int M_Locator_ID, String trxName, boolean forUpdate) Get On Hand Storage for Warehouse or locatorstatic MStorageOnHand[]
getWarehouse
(Properties ctx, int M_Warehouse_ID, int M_Product_ID, int M_AttributeSetInstance_ID, Timestamp minGuaranteeDate, boolean FiFo, boolean positiveOnly, int M_Locator_ID, String trxName, boolean forUpdate, int timeout) Get On Hand Storage for Warehouse or locatorstatic MStorageOnHand[]
getWarehouseNegative
(Properties ctx, int M_Warehouse_ID, int M_Product_ID, int M_AttributeSetInstance_ID, Timestamp minGuaranteeDate, boolean FiFo, int M_Locator_ID, String trxName) Get On Hand Storage for Warehouse or locatorstatic MStorageOnHand[]
getWarehouseNegative
(Properties ctx, int M_Warehouse_ID, int M_Product_ID, int M_AttributeSetInstance_ID, Timestamp minGuaranteeDate, boolean FiFo, int M_Locator_ID, String trxName, boolean forUpdate) Get On Hand Storage for Warehouse or locatorstatic MStorageOnHand[]
getWarehouseNegative
(Properties ctx, int M_Warehouse_ID, int M_Product_ID, int M_AttributeSetInstance_ID, Timestamp minGuaranteeDate, boolean FiFo, int M_Locator_ID, String trxName, boolean forUpdate, int timeout) Get On Hand Storage for Warehouse or locatortoString()
String Representationvoid
updateDateLastInventory
(Timestamp dateLastInv) Update Date Last Inventory of this record with direct SQLMethods inherited from class org.compiere.model.X_M_StorageOnHand
get_AccessLevel, getDateLastInventory, getDateMaterialPolicy, getM_AttributeSetInstance, getM_AttributeSetInstance_ID, getM_Locator, getM_Locator_ID, getM_Product, getM_Product_ID, getM_StorageOnHand_UU, getQtyOnHand, initPO, setDateLastInventory, setDateMaterialPolicy, setM_AttributeSetInstance_ID, setM_Locator_ID, setM_Product_ID, setM_StorageOnHand_UU, setQtyOnHand
Methods inherited from class org.compiere.model.PO
afterDelete, afterSave, beforeDelete, buildInsertSQL, 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_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_Immutable, is_new, 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_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, toInsertSQL, 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_StorageOnHand
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
-
Constructor Details
-
MStorageOnHand
UUID based Constructor- Parameters:
ctx
- ContextM_StorageOnHand_UU
- UUID keytrxName
- Transaction
-
MStorageOnHand
- Parameters:
ctx
- contextignored
- ignoredtrxName
- transaction
-
MStorageOnHand
Load Constructor- Parameters:
ctx
- contextrs
- result settrxName
- transaction
-
-
Method Details
-
get
@Deprecated public static MStorageOnHand get(Properties ctx, int M_Locator_ID, int M_Product_ID, int M_AttributeSetInstance_ID, String trxName) Deprecated.- Parameters:
ctx
-M_Locator_ID
-M_Product_ID
-M_AttributeSetInstance_ID
-trxName
-- Returns:
- MStorageOnHand
-
get
public static MStorageOnHand get(Properties ctx, int M_Locator_ID, int M_Product_ID, int M_AttributeSetInstance_ID, Timestamp dateMPolicy, String trxName) Get On Hand Storage- Parameters:
ctx
- contextM_Locator_ID
- locatorM_Product_ID
- productM_AttributeSetInstance_ID
- instancedateMPolicy
- optional DateMaterialPolicy filtertrxName
- transaction- Returns:
- existing MStorageOnHand or null
-
getAllWithASI
public static MStorageOnHand[] getAllWithASI(Properties ctx, int M_Product_ID, int M_Locator_ID, boolean FiFo, String trxName) Get all Storages for Product with ASI and QtyOnHand != 0- Parameters:
ctx
- contextM_Product_ID
- productM_Locator_ID
- locatorFiFo
- true for fifo, false for lifotrxName
- transaction- Returns:
- array of MStorageOnHand
-
getAll
public static MStorageOnHand[] getAll(Properties ctx, int M_Product_ID, int M_Locator_ID, String trxName) Get all Storages for Product where QtyOnHand != 0- Parameters:
ctx
- contextM_Product_ID
- productM_Locator_ID
- locator, 0 to match all locatortrxName
- transaction- Returns:
- array of MStorageOnHand
-
getAll
public static MStorageOnHand[] getAll(Properties ctx, int M_Product_ID, int M_Locator_ID, String trxName, boolean forUpdate, int timeout) Get all Storages for Product where QtyOnHand != 0- Parameters:
ctx
- contextM_Product_ID
- productM_Locator_ID
- locator, 0 to match all locatortrxName
- transactionforUpdate
- true to use For Update clausetimeout
- query timeout if forUpdate is true (0 for no timeout)- Returns:
- array of MStorageOnHand
-
getAll
public static MStorageOnHand[] getAll(Properties ctx, int M_Product_ID, int M_Locator_ID, boolean locatorPriority, boolean fifo, String trxName, boolean forUpdate, int timeout) Get all Storages for Product where QtyOnHand != 0- Parameters:
ctx
- contextM_Product_ID
- productM_Locator_ID
- locator, 0 to match all locatorlocatorPriority
- If true, sort descending by locator Priority Nofifo
- Sort ascending(FIFO) or descending(LIFO) by date material policy, m_attributesetinstance_idtrxName
- transactionforUpdate
- If true, acquire DB lock with FOR UPDATE clausetimeout
- query timeout if forUpdate is true (0 for no timeout)- Returns:
- array of MStorageOnHand
-
getAll
public static MStorageOnHand[] getAll(Properties ctx, int M_Product_ID, int M_Locator_ID, int M_AttributeSetInstance_ID, Timestamp dateMPolicy, boolean ignoreZeroQty, String trxName) Get On Hand Storage- Parameters:
ctx
- contextM_Product_ID
- productM_Locator_ID
- locatorM_AttributeSetInstance_ID
- instancedateMPolicy
- optional DateMaterialPolicy filterignoreZeroQty
- if true, only get storage record with on hand != 0trxName
- transaction- Returns:
- array of MStorageOnHand
-
getOfProduct
Get On Hand Storage for Product across warehouses- Parameters:
ctx
- contextM_Product_ID
- producttrxName
- transaction- Returns:
- array of MStorageOnHand
-
getWarehouse
@Deprecated public static MStorageOnHand[] getWarehouse(Properties ctx, int M_Warehouse_ID, int M_Product_ID, int M_AttributeSetInstance_ID, int M_AttributeSet_ID, boolean allAttributeInstances, Timestamp minGuaranteeDate, boolean FiFo, String trxName) Deprecated.Get On Hand Storage for Warehouse- Parameters:
ctx
- contextM_Warehouse_ID
-M_Product_ID
- productM_AttributeSetInstance_ID
- instanceM_AttributeSet_ID
- attribute set (NOT USED)allAttributeInstances
- if true, all attribute set instances (NOT USED)minGuaranteeDate
- optional minimum guarantee date filter. ignore if M_AttributeSetInstance_ID != 0FiFo
- first in-first-outtrxName
- transaction- Returns:
- existing - ordered by location priority (desc) and/or guarantee date
-
getWarehouse
public static MStorageOnHand[] getWarehouse(Properties ctx, int M_Warehouse_ID, int M_Product_ID, int M_AttributeSetInstance_ID, Timestamp minGuaranteeDate, boolean FiFo, boolean positiveOnly, int M_Locator_ID, String trxName) Get On Hand Storage for Warehouse or locator- Parameters:
ctx
- contextM_Warehouse_ID
- ignore if M_Locator_ID > 0M_Product_ID
- productM_AttributeSetInstance_ID
- instance id, 0 to retrieve all instanceminGuaranteeDate
- optional minimum guarantee date filter. ignore if M_AttributeSetInstance_ID != 0FiFo
- true first in-first-out, false for LIFOpositiveOnly
- if true, only return storage records with qtyOnHand > 0M_Locator_ID
- optional locator idtrxName
- transaction- Returns:
- array of MStorageOnHand - ordered by location priority (desc) and/or guarantee date
-
getWarehouse
public static MStorageOnHand[] getWarehouse(Properties ctx, int M_Warehouse_ID, int M_Product_ID, int M_AttributeSetInstance_ID, Timestamp minGuaranteeDate, boolean FiFo, boolean positiveOnly, int M_Locator_ID, String trxName, boolean forUpdate) Get On Hand Storage for Warehouse or locator- Parameters:
ctx
- contextM_Warehouse_ID
- ignore if M_Locator_ID > 0M_Product_ID
- productM_AttributeSetInstance_ID
- instance id, 0 to retrieve all instanceminGuaranteeDate
- optional minimum guarantee date filter. ignore if M_AttributeSetInstance_ID != 0FiFo
- true for first in-first-out, false for LIFOpositiveOnly
- if true, only return storage records with qtyOnHand > 0M_Locator_ID
- optional locator idtrxName
- transactionforUpdate
- true to acquire DB lock with FOR UPDATE clause- Returns:
- array of MStorageOnHand - ordered by location priority (desc) and/or guarantee date
-
getWarehouse
public static MStorageOnHand[] getWarehouse(Properties ctx, int M_Warehouse_ID, int M_Product_ID, int M_AttributeSetInstance_ID, Timestamp minGuaranteeDate, boolean FiFo, boolean positiveOnly, int M_Locator_ID, String trxName, boolean forUpdate, int timeout) Get On Hand Storage for Warehouse or locator- Parameters:
ctx
- contextM_Warehouse_ID
- ignore if M_Locator_ID > 0M_Product_ID
- productM_AttributeSetInstance_ID
- instance id, 0 to retrieve all instanceminGuaranteeDate
- optional minimum guarantee date filter. ignore if M_AttributeSetInstance_ID != 0FiFo
- true for first in-first-out, false for LIFOpositiveOnly
- if true, only return storage records with qtyOnHand > 0M_Locator_ID
- optional locator idtrxName
- transactionforUpdate
- true to acquire DB lock with FOR UPDATE clausetimeout
- if forUpdate is true, value for query timeout (0 for no timeout).- Returns:
- array of MStorageOnHand - ordered by location priority (desc) and/or guarantee date
-
getWarehouseNegative
public static MStorageOnHand[] getWarehouseNegative(Properties ctx, int M_Warehouse_ID, int M_Product_ID, int M_AttributeSetInstance_ID, Timestamp minGuaranteeDate, boolean FiFo, int M_Locator_ID, String trxName) Get On Hand Storage for Warehouse or locator- Parameters:
ctx
- contextM_Warehouse_ID
- ignore if M_Locator_ID > 0M_Product_ID
- productM_AttributeSetInstance_ID
- instance id, 0 to retrieve all instanceminGuaranteeDate
- optional minimum guarantee date filter. ignore if M_AttributeSetInstance_ID != 0FiFo
- true for first in-first-out, false for LIFOM_Locator_ID
- optional locator idtrxName
- transaction- Returns:
- array of MStorageOnHand - ordered by location priority (desc) and/or guarantee date
-
getWarehouseNegative
public static MStorageOnHand[] getWarehouseNegative(Properties ctx, int M_Warehouse_ID, int M_Product_ID, int M_AttributeSetInstance_ID, Timestamp minGuaranteeDate, boolean FiFo, int M_Locator_ID, String trxName, boolean forUpdate) Get On Hand Storage for Warehouse or locator- Parameters:
ctx
- contextM_Warehouse_ID
- ignore if M_Locator_ID > 0M_Product_ID
- productM_AttributeSetInstance_ID
- instance id, 0 to retrieve storages that don't have asi, -1 to retrieve all instanceminGuaranteeDate
- optional minimum guarantee date filter. ignore if M_AttributeSetInstance_ID != 0FiFo
- true for first in-first-out, false for LIFOM_Locator_ID
- optional locator idtrxName
- transactionforUpdate
- true to acquire DB lock with FOR UPDATE clause- Returns:
- array of MStorageOnHand - ordered by location priority (desc) and/or guarantee date
-
getWarehouseNegative
public static MStorageOnHand[] getWarehouseNegative(Properties ctx, int M_Warehouse_ID, int M_Product_ID, int M_AttributeSetInstance_ID, Timestamp minGuaranteeDate, boolean FiFo, int M_Locator_ID, String trxName, boolean forUpdate, int timeout) Get On Hand Storage for Warehouse or locator- Parameters:
ctx
- contextM_Warehouse_ID
- ignore if M_Locator_ID > 0M_Product_ID
- productM_AttributeSetInstance_ID
- instance id, 0 to retrieve storages that don't have asi, -1 to retrieve all instanceminGuaranteeDate
- optional minimum guarantee date filterFiFo
- true for first in-first-out, false for LIFOM_Locator_ID
- optional locator idtrxName
- transactionforUpdate
- true to acquire DB lock with FOR UPDATE clausetimeout
- if forUpdate is true, value for query timeout (0 for no timeout).- Returns:
- array of MStorageOnHand - ordered by location priority (desc) and/or guarantee date
-
getCreate
public static MStorageOnHand getCreate(Properties ctx, int M_Locator_ID, int M_Product_ID, int M_AttributeSetInstance_ID, Timestamp dateMPolicy, String trxName) Create or Get On Hand Storage- Parameters:
ctx
- contextM_Locator_ID
- locatorM_Product_ID
- productM_AttributeSetInstance_ID
- instancetrxName
- transaction- Returns:
- existing or new MStorageOnHand
-
getCreate
public static MStorageOnHand getCreate(Properties ctx, int M_Locator_ID, int M_Product_ID, int M_AttributeSetInstance_ID, Timestamp dateMPolicy, String trxName, boolean forUpdate) Create or Get On Hand Storage- Parameters:
ctx
- contextM_Locator_ID
- locatorM_Product_ID
- productM_AttributeSetInstance_ID
- instancedateMPolicy
- optional DateMaterialPolicy filtertrxName
- transactionforUpdate
- true to acquire DB lock with FOR UPDATE clause- Returns:
- existing or new MStorageOnHand
-
getCreate
public static MStorageOnHand getCreate(Properties ctx, int M_Locator_ID, int M_Product_ID, int M_AttributeSetInstance_ID, Timestamp dateMPolicy, String trxName, boolean forUpdate, int timeout) Create or Get On Hand Storage- Parameters:
ctx
- contextM_Locator_ID
- locatorM_Product_ID
- productM_AttributeSetInstance_ID
- instancedateMPolicy
- optional DateMaterialPolicy filtertrxName
- transactionforUpdate
- true to acquire DB lock with FOR UPDATE clausetimeout
- if forUpdate is true, value for query timeout (0 for no timeout).- Returns:
- existing or new MStorageOnHand
-
add
@Deprecated public static boolean add(Properties ctx, int M_Warehouse_ID, int M_Locator_ID, int M_Product_ID, int M_AttributeSetInstance_ID, BigDecimal diffQtyOnHand, String trxName) Deprecated.Update On Hand Storage Called from MProjectIssue- Parameters:
ctx
- contextM_Warehouse_ID
- warehouseM_Locator_ID
- locatorM_Product_ID
- productM_AttributeSetInstance_ID
- AS InstancediffQtyOnHand
- add on handtrxName
- transaction- Returns:
- true if updated
-
add
@Deprecated public static boolean add(Properties ctx, int M_Warehouse_ID, int M_Locator_ID, int M_Product_ID, int M_AttributeSetInstance_ID, BigDecimal diffQtyOnHand, Timestamp dateMPolicy, String trxName) Deprecated.Update On Hand Storage Called from MProjectIssue- Parameters:
ctx
- contextM_Warehouse_ID
- warehouse, not useM_Locator_ID
- locatorM_Product_ID
- productM_AttributeSetInstance_ID
- AS InstancediffQtyOnHand
- add on handdateMPolicy
-trxName
- transaction- Returns:
- true if updated
-
add
public static boolean add(Properties ctx, int M_Locator_ID, int M_Product_ID, int M_AttributeSetInstance_ID, BigDecimal diffQtyOnHand, Timestamp dateMPolicy, String trxName) -
add
public static boolean add(Properties ctx, int M_Locator_ID, int M_Product_ID, int M_AttributeSetInstance_ID, BigDecimal diffQtyOnHand, Timestamp dateMPolicy, Timestamp dateLastInventory, String trxName) Update On Hand Storage Called from MProjectIssue- Parameters:
ctx
- contextM_Locator_ID
- locatorM_Product_ID
- productM_AttributeSetInstance_ID
- AS InstancediffQtyOnHand
- difference to add to current on hand quantitydateMPolicy
- optional DateMaterialPolicy filtertrxName
- transaction- Returns:
- true if updated
-
addQtyOnHand
Add addition to quantity on hand with direct SQL - not using cached value - solving IDEMPIERE-2629- Parameters:
addition
-
-
updateDateLastInventory
Update Date Last Inventory of this record with direct SQL- Parameters:
dateLastInv
-
-
getM_Locator_ID
public static int getM_Locator_ID(int M_Warehouse_ID, int M_Product_ID, int M_AttributeSetInstance_ID, BigDecimal Qty, String trxName) Get Locator with highest Locator Priority and a sufficient OnHand Qty- Parameters:
M_Warehouse_ID
- warehouseM_Product_ID
- productM_AttributeSetInstance_ID
- asi id, use negative value (for e.g -1) to match all asi including 0Qty
- qtytrxName
- transaction- Returns:
- locator id (0 if no match found)
-
getM_Warehouse_ID
public int getM_Warehouse_ID()Get M_Warehouse_ID of Locator- Returns:
- warehouse
-
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 classPO
- Parameters:
newRecord
- true if it is a new record- Returns:
- true if record can be saved
-
getQtyOnHand
public static BigDecimal getQtyOnHand(int M_Product_ID, int M_Warehouse_ID, int M_AttributeSetInstance_ID, String trxName) Get Quantity On Hand of Warehouse- Parameters:
M_Product_ID
-M_Warehouse_ID
-M_AttributeSetInstance_ID
- M_AttributeSetInstance_ID filter, ignore if 0trxName
-- Returns:
- QtyOnHand
-
getQtyOnHandWithASIZero
public static BigDecimal getQtyOnHandWithASIZero(int M_Product_ID, int M_Warehouse_ID, String trxName) Get Quantity On Hand of Warehouse with ASI=0- Parameters:
M_Product_ID
-M_Warehouse_ID
-trxName
-- Returns:
- QtyOnHand
-
getQtyOnHandForReservation
public static BigDecimal getQtyOnHandForReservation(int M_Product_ID, int M_Warehouse_ID, int M_AttributeSetInstance_ID, String trxName) Get Quantity On Hand of Warehouse (only include Locator with Locator Type = Available for Reservation)- Parameters:
M_Product_ID
-M_Warehouse_ID
-M_AttributeSetInstance_ID
-trxName
-- Returns:
- QtyOnHand
-
getQtyOnHandForReservationWithASIZero
public static BigDecimal getQtyOnHandForReservationWithASIZero(int M_Product_ID, int M_Warehouse_ID, String trxName) Get Quantity On Hand of Warehouse with ASI=0 (only include Locator with Locator Type = Available for Reservation)- Parameters:
M_Product_ID
-M_Warehouse_ID
-trxName
-- Returns:
- QtyOnHand
-
getQtyOnHandForShipping
public static BigDecimal getQtyOnHandForShipping(int M_Product_ID, int M_Warehouse_ID, int M_AttributeSetInstance_ID, String trxName) Get Quantity On Hand of Warehouse (only include Locator with Locator Type = available for shipping)- Parameters:
M_Product_ID
-M_Warehouse_ID
-M_AttributeSetInstance_ID
-trxName
-- Returns:
- QtyOnHand
-
getQtyOnHandForShippingWithASIZero
public static BigDecimal getQtyOnHandForShippingWithASIZero(int M_Product_ID, int M_Warehouse_ID, String trxName) Get Quantity On Hand of Warehouse with ASI=0 (only include Locator with Locator Type = available for shipping)- Parameters:
M_Product_ID
-M_Warehouse_ID
-trxName
-- Returns:
- QtyOnHand
-
getQtyOnHandForLocator
public static BigDecimal getQtyOnHandForLocator(int M_Product_ID, int M_Locator_ID, int M_AttributeSetInstance_ID, String trxName) Get Quantity On Hand of Locator- Parameters:
M_Product_ID
-M_Locator_ID
-M_AttributeSetInstance_ID
-trxName
-- Returns:
- QtyOnHand
-
getQtyOnHandForLocatorWithASIZero
public static BigDecimal getQtyOnHandForLocatorWithASIZero(int M_Product_ID, int M_Locator_ID, String trxName) Get Quantity On Hand of Locator with ASI=0- Parameters:
M_Product_ID
-M_Locator_ID
-trxName
-- Returns:
- QtyOnHand
-
toString
String Representation- Overrides:
toString
in classX_M_StorageOnHand
- Returns:
- info
-
getDateMaterialPolicy
public static Timestamp getDateMaterialPolicy(int M_Product_ID, int M_AttributeSetInstance_ID, String trxName) Get DateMaterialPolicy ORDER BY QtyOnHand DESC- Parameters:
M_Product_ID
-M_AttributeSetInstance_ID
-trxName
-- Returns:
- DateMaterialPolicy time stamp
-
getDateMaterialPolicy
public static Timestamp getDateMaterialPolicy(int M_Product_ID, int M_AttributeSetInstance_ID, int M_Locator_ID, String trxName) Get DateMaterialPolicy ORDER BY QtyOnHand DESC- Parameters:
M_Product_ID
-M_AttributeSetInstance_ID
-M_Locator_ID
-trxName
-- Returns:
- DateMaterialPolicy time stamp
-