Package com.storedobject.core
Class InventoryLedger
java.lang.Object
com.storedobject.core.StoredObject
com.storedobject.core.InventoryLedger
- All Implemented Interfaces:
Displayable
,StringFiller
,HasId
,HasInventoryItem
,HasInventoryItemType
public final class InventoryLedger
extends StoredObject
implements HasInventoryItem, HasInventoryItemType
-
Field Summary
Fields inherited from class com.storedobject.core.StoredObject
logger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
static QuantityWithCost
getClosingStock
(InventoryItemType itemType, Date date, InventoryLocation location) getCost()
getDate()
Returns the InventoryItemType (P/N) associated with this object.getItem()
Retrieves the inventory item associated with this entity.static QuantityWithCost
getOpeningStock
(InventoryItemType itemType, Date date, InventoryLocation location) Retrieves the quantity of the inventory item associated with this entity.static void
void
void
void
void
void
setItem
(InventoryItem item) void
setItem
(BigDecimal idValue) void
setItemType
(Id itemTypeId) void
setItemType
(InventoryItemType itemType) void
setItemType
(BigDecimal idValue) void
setLocationFrom
(Id locationId) void
setLocationFrom
(InventoryLocation location) void
setLocationFrom
(BigDecimal idValue) void
setLocationTo
(Id locationId) void
setLocationTo
(InventoryLocation location) void
setLocationTo
(BigDecimal idValue) void
setQuantity
(Quantity quantity) void
setQuantity
(Object value) void
setReference
(String reference) void
updateCost
(TransactionManager tm, Money newCost) void
updateReference
(TransactionManager tm, String newReference) void
The system will invoke this whenever the object is saved to the DB.Methods inherited from class com.storedobject.core.StoredObject
addLink, addLink, addLink, addLink, addLink, addLink, addLink, addLink, checkCurrency, checkCurrency, checkForDuplicate, checkForDuplicate, checkTimeZone, checkTransaction, clearObjectLinks, contemporary, copy, copy, count, count, count, count, count, count, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, create, created, delete, delete, delete, deleted, directUpdate, equals, exists, exists, exists, exists, exists, existsFileData, existsLink, existsLink, existsLink, existsLink, existsLink, existsLink, existsLink, existsLink, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsMaster, existsMaster, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, family, family, family, family, fill, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, getAttachment, getAttachmentId, getChildren, getContemporaryOf, getDeleted, getDeleted, getExistsCondition, getExistsCondition, getFileData, getFileData, getHistorical, getId, getKeyIndex, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getNotExistsCondition, getNotExistsCondition, getParent, getParent, getParent, getParentId, getParentId, getParentId, getRelated, getRelated, getTransaction, getTransactionId, getTransactionIP, getUnique, getUniqueCondition, hashCode, inserted, isModified, isVirtual, list, list, list, list, list, list, list, list, list, list, list, list, list, listDeletedIds, listFileData, listFileData, listHistory, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listTree, listTree, listTree, listTree, listViaQuery, listViaQuery, load, load, load, load, loadAttributesFrom, loaded, loading, makeNew, makeVirtual, migrate, moduleName, nextVersion, objectLink, objectLink, objectLink, objectLinks, objectLinks, old, person, previousVersion, previousVersion, query, query, query, query, query, query, query, query, query, query, query, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, reload, reload, reloaded, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeReverseLinks, removeReverseLinks, save, save, save, save, save, save, save, save, save, save, save, save, save, save, save, saved, saving, setMaster, setRawValue, setTransaction, stringify, tableName, timestamp, toCode, toDisplay, toString, transacting, undelete, undelete, undeleted, updated, user, userId, validate, validateChildAttach, validateChildDetach, validateChildUpdate, validateDelete, validateInsert, validateParentAttach, validateParentDetach, validateParentUpdate, validateUndelete, validateUpdate, valueEquals
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.storedobject.core.HasInventoryItem
getInventoryItem, getItemFromHistory
-
Constructor Details
-
InventoryLedger
public InventoryLedger()
-
-
Method Details
-
columns
-
indices
-
setDate
-
getDate
-
setItem
-
setItem
-
setItem
-
getItemId
-
getItem
Description copied from interface:HasInventoryItem
Retrieves the inventory item associated with this entity.- Specified by:
getItem
in interfaceHasInventoryItem
- Returns:
- the associated InventoryItem instance
-
setItemType
-
setItemType
-
setItemType
-
getItemTypeId
-
getItemType
-
getItemTypeFromHistory
-
setQuantity
-
setQuantity
-
getQuantity
Description copied from interface:HasInventoryItem
Retrieves the quantity of the inventory item associated with this entity.- Specified by:
getQuantity
in interfaceHasInventoryItem
- Returns:
- the quantity of the associated inventory item
-
setCost
-
setCost
-
getCost
-
setLocationFrom
-
setLocationFrom
-
setLocationFrom
-
getLocationFromId
-
getLocationFrom
-
setLocationTo
-
setLocationTo
-
setLocationTo
-
getLocationToId
-
getLocationTo
-
getReference
-
setReference
-
updateReference
- Throws:
Exception
-
updateCost
- Throws:
Exception
-
validateData
Description copied from class:StoredObject
The system will invoke this whenever the object is saved to the DB. It will be invoked in all cases while creating new objects and updating/deleting/undeleting existing objects. If any exception is raised by this method, the process of saving to the DB will be abandoned.
Note: This method is mainly used to validate the data of all attributes of the object, and it may be used by others for validating the object. For example, front-end data-entry systems can use this method for validating the object.
- Overrides:
validateData
in classStoredObject
- Parameters:
tm
- Current transaction manager.- Throws:
Exception
- If data is invalid.
-
getOpeningStock
public static QuantityWithCost getOpeningStock(InventoryItemType itemType, Date date, InventoryLocation location) -
getClosingStock
public static QuantityWithCost getClosingStock(InventoryItemType itemType, Date date, InventoryLocation location) -
getInventoryItemType
Description copied from interface:HasInventoryItemType
Returns the InventoryItemType (P/N) associated with this object.- Specified by:
getInventoryItemType
in interfaceHasInventoryItem
- Specified by:
getInventoryItemType
in interfaceHasInventoryItemType
- Returns:
- the InventoryItemType representing the type of the inventory item (P/N).
-