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
public class MAttributeSetInstance extends X_M_AttributeSetInstance
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:
- Serialized Form
-
-
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, 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
Constructors Constructor Description MAttributeSetInstance(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, ResultSet rs, String trxName)
Load Constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected 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.KeyNamePair
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 ID or ProductTimestamp
getGuaranteeDate(boolean getNew)
Get Guarantee DateString
getLot(boolean getNew, int M_Product_ID)
Get Lot NoMAttributeSet
getMAttributeSet()
Get Attribute SetString
getSerNo(boolean getNew)
Get Serial Noboolean
isExcludeLot(int AD_Column_ID, boolean isSOTrx)
Exclude Lot creationboolean
isExcludeSerNo(int AD_Column_ID, boolean isSOTrx)
Exclude SerNo creationvoid
setDescription()
Set Descriptionvoid
setLot(String Lot, int M_Product_ID)
To to find lot and set Lot/IDvoid
setMAttributeSet(MAttributeSet mas)
Set Attribute Set-
Methods 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, 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_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 Detail
-
MAttributeSetInstance
public MAttributeSetInstance(Properties ctx, int M_AttributeSetInstance_ID, String trxName)
Standard Constructor- Parameters:
ctx
- contextM_AttributeSetInstance_ID
- idtrxName
- transaction
-
MAttributeSetInstance
public MAttributeSetInstance(Properties ctx, ResultSet rs, String trxName)
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 Detail
-
get
public static MAttributeSetInstance get(Properties ctx, int M_AttributeSetInstance_ID, int M_Product_ID)
Get Attribute Set Instance from ID or Product- Parameters:
ctx
- contextM_AttributeSetInstance_ID
- id or 0M_Product_ID
- required if id is 0- Returns:
- Attribute Set Instance or null if error
-
setMAttributeSet
public void setMAttributeSet(MAttributeSet mas)
Set Attribute Set- Parameters:
mas
- attribute set
-
getMAttributeSet
public MAttributeSet getMAttributeSet()
Get Attribute Set- Returns:
- Attrbute Set or null
-
setDescription
public void setDescription()
Set Description. - Product Values - Instance Values - SerNo = #123 - Lot = «123» - GuaranteeDate = 10/25/2003
-
getGuaranteeDate
public Timestamp getGuaranteeDate(boolean getNew)
Get Guarantee Date- Parameters:
getNew
- if true calculates/sets guarantee date- Returns:
- guarantee date or null if days = 0
-
getLot
public String getLot(boolean getNew, int M_Product_ID)
Get Lot No- Parameters:
getNew
- if true create/set new lotM_Product_ID
- product used if new- Returns:
- lot
-
createLot
public KeyNamePair createLot(int M_Product_ID)
Create Lot- Parameters:
M_Product_ID
- product used if new- Returns:
- lot info
-
setLot
public void setLot(String Lot, int M_Product_ID)
To to find lot and set Lot/ID- Parameters:
Lot
- lotM_Product_ID
- product
-
isExcludeLot
public boolean isExcludeLot(int AD_Column_ID, boolean isSOTrx)
Exclude Lot creation- Parameters:
AD_Column_ID
- columnisSOTrx
- SO- Returns:
- true if excluded
-
getSerNo
public String getSerNo(boolean getNew)
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)
Exclude SerNo creation- Parameters:
AD_Column_ID
- columnisSOTrx
- SO- 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
public static MAttributeSetInstance create(Properties ctx, MProduct product, String trxName)
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
public static MAttributeSetInstance generateLot(Properties ctx, MProduct product, String trxName)
AutoGenerate and save a new ASI for given product. Automatically creates Lot#- Parameters:
ctx
-product
-trxName
-- Returns:
- newly created ASI
-
-