Package org.compiere.model
Class MAttributeSetInstance
java.lang.Object
org.compiere.model.PO
org.compiere.model.X_M_AttributeSetInstance
org.compiere.model.MAttributeSetInstance
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparator<Object>
,I_M_AttributeSetInstance
,I_Persistent
,Evaluatee
Product Attribute Set Instance
- Version:
- $Id: MAttributeSetInstance.java,v 1.3 2006/07/30 00:51:03 jjanke Exp $
- Author:
- Jorg Janke, Teo Sarca, www.arhipac.ro
- BF [ 2675699 ] MAttributeSetInstance.create should create Lot/Serial/Guaran
- 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_AttributeSetInstance
accessLevel, COLUMNNAME_AD_Client_ID, COLUMNNAME_AD_Org_ID, COLUMNNAME_Created, COLUMNNAME_CreatedBy, COLUMNNAME_Description, COLUMNNAME_GuaranteeDate, COLUMNNAME_IsActive, COLUMNNAME_Lot, COLUMNNAME_M_AttributeSet_ID, COLUMNNAME_M_AttributeSetInstance_ID, COLUMNNAME_M_AttributeSetInstance_UU, COLUMNNAME_M_Lot_ID, COLUMNNAME_SerNo, COLUMNNAME_Updated, COLUMNNAME_UpdatedBy, Model, Table_ID, Table_Name
-
Constructor Summary
ConstructorDescriptionMAttributeSetInstance
(Properties ctx, int M_AttributeSetInstance_ID, int M_AttributeSet_ID, String trxName) Standard ConstructorMAttributeSetInstance
(Properties ctx, int M_AttributeSetInstance_ID, String trxName) Standard ConstructorMAttributeSetInstance
(Properties ctx, String M_AttributeSetInstance_UU, String trxName) UUID based ConstructorMAttributeSetInstance
(Properties ctx, ResultSet rs, String trxName) Load Constructor -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
afterSave
(boolean newRecord, boolean success) Called after Save for Post-Save Operationstatic MAttributeSetInstance
create
(Properties ctx, MProduct product, String trxName) Create and save a new ASI for given product.createLot
(int M_Product_ID) Create Lotstatic MAttributeSetInstance
generateLot
(Properties ctx, MProduct product, String trxName) AutoGenerate and save a new ASI for given product.static MAttributeSetInstance
get
(Properties ctx, int M_AttributeSetInstance_ID, int M_Product_ID) Get Attribute Set Instance from M_AttributeSetInstance_ID or create new MAttributeSetInstance for M_Product_IDgetGuaranteeDate
(boolean getNew) Get Guarantee DategetLot
(boolean getNew, int M_Product_ID) Get Lot NoGet Attribute SetgetSerNo
(boolean getNew) Get Serial Noboolean
isExcludeLot
(int AD_Column_ID, boolean isSOTrx) Check is Lot creation excluded for a tableboolean
isExcludeSerNo
(int AD_Column_ID, boolean isSOTrx) Check is SerNo creation excluded for a tablevoid
Set Descriptionvoid
To find lot and set Lot/IDvoid
Set Attribute SetMethods inherited from class org.compiere.model.X_M_AttributeSetInstance
get_AccessLevel, getDescription, getGuaranteeDate, getKeyNamePair, getLot, getM_AttributeSet, getM_AttributeSet_ID, getM_AttributeSetInstance_ID, getM_AttributeSetInstance_UU, getM_Lot, getM_Lot_ID, getSerNo, initPO, setDescription, setGuaranteeDate, setLot, setM_AttributeSet_ID, setM_AttributeSetInstance_ID, setM_AttributeSetInstance_UU, setM_Lot_ID, setSerNo, toString
Methods inherited from class org.compiere.model.PO
afterDelete, beforeDelete, beforeSave, 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_AttributeSetInstance
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
-
MAttributeSetInstance
UUID based Constructor- Parameters:
ctx
- ContextM_AttributeSetInstance_UU
- UUID keytrxName
- Transaction
-
MAttributeSetInstance
Standard Constructor- Parameters:
ctx
- contextM_AttributeSetInstance_ID
- idtrxName
- transaction
-
MAttributeSetInstance
Load Constructor- Parameters:
ctx
- contextrs
- result settrxName
- transaction
-
MAttributeSetInstance
public MAttributeSetInstance(Properties ctx, int M_AttributeSetInstance_ID, int M_AttributeSet_ID, String trxName) Standard Constructor- Parameters:
ctx
- contextM_AttributeSetInstance_ID
- idM_AttributeSet_ID
- attribute settrxName
- transaction
-
-
Method Details
-
get
public static MAttributeSetInstance get(Properties ctx, int M_AttributeSetInstance_ID, int M_Product_ID) Get Attribute Set Instance from M_AttributeSetInstance_ID or create new MAttributeSetInstance for M_Product_ID- Parameters:
ctx
- contextM_AttributeSetInstance_ID
- M_AttributeSetInstance_ID or 0M_Product_ID
- required if M_AttributeSetInstance_ID is 0- Returns:
- Attribute Set Instance or null
-
setMAttributeSet
Set Attribute Set- Parameters:
mas
- attribute set
-
getMAttributeSet
Get Attribute Set- Returns:
- Attribute Set or null
-
setDescription
public void setDescription()Set Description. - Product Values - Instance Values - SerNo = #123 - Lot = «123» - GuaranteeDate = 10/25/2003
-
getGuaranteeDate
Get Guarantee Date- Parameters:
getNew
- if true calculates/sets guarantee date- Returns:
- guarantee date or null if days = 0
-
getLot
Get Lot No- Parameters:
getNew
- if true create/set new lotM_Product_ID
- product used if new- Returns:
- lot
-
createLot
Create Lot- Parameters:
M_Product_ID
- product- Returns:
- KeyNamePair(M_Lot_ID,Name)
-
setLot
To find lot and set Lot/ID- Parameters:
Lot
- lotM_Product_ID
- product
-
isExcludeLot
public boolean isExcludeLot(int AD_Column_ID, boolean isSOTrx) Check is Lot creation excluded for a table- Parameters:
AD_Column_ID
- column of table to checkisSOTrx
- true for sales transaction, false otherwise- Returns:
- true if excluded
-
getSerNo
Get Serial No- Parameters:
getNew
- if true create/set new Ser No- Returns:
- Serial Number
-
isExcludeSerNo
public boolean isExcludeSerNo(int AD_Column_ID, boolean isSOTrx) Check is SerNo creation excluded for a table- Parameters:
AD_Column_ID
- column of table to checkisSOTrx
- true for sales transaction, false otherwise- Returns:
- true if excluded
-
afterSave
protected boolean afterSave(boolean newRecord, boolean success) Description copied from class:PO
Called after Save for Post-Save Operation -
create
Create and save a new ASI for given product. Automatically creates Lot#, Serial# and Guarantee Date.- Parameters:
ctx
-product
-trxName
-- Returns:
- newly created ASI
-
generateLot
AutoGenerate and save a new ASI for given product. Automatically creates Lot#.- Parameters:
ctx
-product
-trxName
-- Returns:
- newly created ASI
-