Class InventoryPO
- All Implemented Interfaces:
Displayable
,StringFiller
,HasChildren
,HasId
,HasReference
,TradeType
getGRNType()
) should be returned.- Author:
- Syam
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.storedobject.core.HasReference
HasReference.Amend<T extends StoredObject>
-
Field Summary
Fields inherited from class com.storedobject.core.StoredObject
logger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
amendOrder
(Transaction transaction) Amend this PO.static String[]
boolean
canClose()
boolean
void
closeOrder
(Transaction transaction) static void
createGRN
(Transaction transaction, Map<Id, Quantity> quantities, InventoryGRN grn, String invoiceNumber, Date invoiceDate) Create a GRN for this PO.final <O extends StoredObject>
HasReference.Amend<O> getAmend()
boolean
getDate()
int
Get the GRN type.int
getNo()
final String
Deprecated.int
static String
getStatusValue
(int value) static String[]
getStore()
Get the prefix of the tag to be used for generating the reference.static void
boolean
isApplicable
(LandedCostType landedCostType, InventoryGRN grn) Is a specific type of landed cost is applicable to this PO?boolean
isClosed()
static String[]
links()
final ObjectIterator
<InventoryPOItem> void
placeOrder
(Transaction transaction) static String[]
void
recallOrder
(Transaction transaction) static String[]
void
setApprovalRequired
(boolean approvalRequired) void
void
setNo
(int no) void
setReferenceNumber
(String referenceNumber) Deprecated.void
setStatus
(int status) void
void
setStore
(InventoryStore store) void
setStore
(BigDecimal idValue) void
setSupplier
(Entity supplier) void
setSupplier
(Id supplierId) void
setSupplier
(BigDecimal idValue) Display representation of the instance used for human-friendly display.void
validate()
This method is invoked internally by the system whenever the object gets saved to the DB (that means, while doing transactions).void
validateChildAttach
(StoredObject child, int linkType) Do validation when a child is attached.void
validateChildUpdate
(StoredObject child, int linkType) Do validation when a child is updated.void
This will be invoked by the system whenever the object is saved to the DB.void
This method will be invoked whenever an existing instance is deleted from the database.void
This method will be invoked whenever an existing instance is updated in the database.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, fill, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, getAttachment, getAttachmentId, getChildren, 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, 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, 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, saved, saving, setMaster, setRawValue, setTransaction, stringify, tableName, timestamp, toCode, toString, transacting, undelete, undelete, undeleted, updated, user, userId, validateChildDetach, validateInsert, validateParentAttach, validateParentDetach, validateParentUpdate, validateUndelete, valueEquals
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.storedobject.core.HasReference
getSystemEntityId, getTagSuffix, serialTag
-
Constructor Details
-
InventoryPO
public InventoryPO()
-
-
Method Details
-
columns
-
protectedColumns
-
browseColumns
-
indices
-
searchColumns
-
links
-
setNo
public void setNo(int no) -
getNo
- Specified by:
getNo
in interfaceHasReference
-
getTagPrefix
Description copied from interface:HasReference
Get the prefix of the tag to be used for generating the reference.Warning: This should be a fixed string value.
- Specified by:
getTagPrefix
in interfaceHasReference
- Returns:
- A fixed tag value to be used as the prefix.
-
getSystemEntity
- Specified by:
getSystemEntity
in interfaceHasReference
-
getReference
- Specified by:
getReference
in interfaceHasReference
-
setDate
-
getDate
- Specified by:
getDate
in interfaceHasReference
-
setReferenceNumber
Deprecated. -
getReferenceNumber
-
setStore
-
setStore
-
setStore
-
getStoreId
-
getStore
-
setSupplier
-
setSupplier
-
setSupplier
-
getSupplierId
-
getSupplier
-
getStatusValues
-
setStatus
public void setStatus(int status) -
getStatus
-
getStatusValue
-
getStatusValue
-
setApprovalRequired
public void setApprovalRequired(boolean approvalRequired) -
getApprovalRequired
-
isClosed
public boolean isClosed() -
validateData
Description copied from class:StoredObject
This will be invoked by the system whenever the object is saved to the DB. It will be invoked in all cases, while creating new objects and updating/deleting/un-deleting 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.
-
validate
Description copied from class:StoredObject
This method is invoked internally by the system whenever the object gets saved to the DB (that means, while doing transactions). It will be invoked in all cases (while creating new objects and updating/deleting/un-deleting existing objects). If this method raises any exceptions, the process of saving to the DB will be abandoned.
This method is not usually used for validating data (For that purpose,
StoredObject.validateData(TransactionManager)
is recommended). It is mainly used for validating state of the object. Methods such asStoredObject.created()
,StoredObject.updated()
,StoredObject.deleted()
,StoredObject.undeleted()
etc. are used to check the specific states but overridden methods may check for other "application-specific"/"business-specific" states.This method is invoked only after one of the other operation-specific validate method is invoked depending on the save operation -
StoredObject.validateInsert()
,StoredObject.validateUpdate()
,StoredObject.validateDelete()
,StoredObject.validateUndelete()
.Note: When overridden "super" should be called, otherwise, a "design error" will occur.
- Overrides:
validate
in classStoredObject
- Throws:
Exception
- By raising an exception from this method the current transaction can be abandoned.
-
validateDelete
Description copied from class:StoredObject
This method will be invoked whenever an existing instance is deleted from the database. So, it will be called within an active transaction. Child classes can override this method to do validation when an existing instance is deleted from the database.Note: When overridden "super" should be called, otherwise, a "design error" will occur.
Also, see
StoredObject.validate()
.- Overrides:
validateDelete
in classStoredObject
- Throws:
Exception
- By raising an exception from this method the current transaction can be abandoned.
-
validateUpdate
Description copied from class:StoredObject
This method will be invoked whenever an existing instance is updated in the database. So, it will be called within an active transaction. Child classes can override this method to do validation when an existing instance is updated in the database.Note: When overridden "super" should be called, otherwise, a "design error" will occur.
Also, see
StoredObject.validate()
.- Overrides:
validateUpdate
in classStoredObject
- Throws:
Exception
- By raising an exception from this method the current transaction can be abandoned.
-
validateChildAttach
Description copied from class:StoredObject
Do validation when a child is attached.Note: This method will be invoked only if this class implements
HasChildren
.- Overrides:
validateChildAttach
in classStoredObject
- Parameters:
child
- Child to validate.linkType
- Link type.- Throws:
Exception
- By raising an exception from this method the current transaction can be abandoned.
-
validateChildUpdate
Description copied from class:StoredObject
Do validation when a child is updated. Default implementation of this invokesStoredObject.validateChildAttach(StoredObject, int)
.Note: This method will be invoked only if this class implements
HasChildren
.- Overrides:
validateChildUpdate
in classStoredObject
- Parameters:
child
- Child to validate.linkType
- Link type.- Throws:
Exception
- By raising an exception from this method the current transaction can be abandoned.
-
amendOrder
Amend this PO. This PO will be foreclosed and another PO will be created with the balance items to receive.- Parameters:
transaction
- Transaction.- Returns:
- The id of the newly created (and saved) PO with balance items to receive.
- Throws:
Exception
- If any exception occurs while carrying out the transaction.
-
recallOrder
- Throws:
Exception
-
placeOrder
- Throws:
Exception
-
closeOrder
- Throws:
Exception
-
canClose
public boolean canClose() -
canForeclose
public boolean canForeclose() -
createGRN
public InventoryGRN createGRN(Transaction transaction, Map<Id, Quantity> quantities, InventoryGRN grn, String invoiceNumber, Date invoiceDate) throws ExceptionCreate a GRN for this PO.- Parameters:
transaction
- Current transaction.quantities
- Received quantity values to process. TheId
(key of the map) must theId
of the respective line item entry in the PO.grn
- A GRN to which the entries to be added. Ifnull
is passed, a new GRN is created.invoiceNumber
- Invoice number (of the supplier) if applicable. For existing GRNs,null
could be passed.invoiceDate
- Invoice date (of the supplier) if applicable. For existing GRNs,null
could be passed.- Returns:
- The GRN that is created/modified.
- Throws:
Exception
- If the GRN can't be created.
-
listItems
-
getGRNType
public int getGRNType()Get the GRN type. One of the GRN type values: 0, 1 or 2.- Returns:
- Type of GRN. Default is 0.
-
isApplicable
Is a specific type of landed cost is applicable to this PO?- Parameters:
landedCostType
- Type of landed cost.grn
- Associated GRN.- Returns:
- True/false.
-
toDisplay
Description copied from class:StoredObject
Display representation of the instance used for human-friendly display.- Specified by:
toDisplay
in interfaceDisplayable
- Overrides:
toDisplay
in classStoredObject
- Returns:
- Display representation of the instance.
-
getAmend
- Specified by:
getAmend
in interfaceHasReference
-
actionPrefixForUI
-