Class 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:
    • Constructor Details

      • MAttributeSetInstance

        public MAttributeSetInstance(Properties ctx, String M_AttributeSetInstance_UU, String trxName)
        UUID based Constructor
        Parameters:
        ctx - Context
        M_AttributeSetInstance_UU - UUID key
        trxName - Transaction
      • MAttributeSetInstance

        public MAttributeSetInstance(Properties ctx, int M_AttributeSetInstance_ID, String trxName)
        Standard Constructor
        Parameters:
        ctx - context
        M_AttributeSetInstance_ID - id
        trxName - transaction
      • MAttributeSetInstance

        public MAttributeSetInstance(Properties ctx, ResultSet rs, String trxName)
        Load Constructor
        Parameters:
        ctx - context
        rs - result set
        trxName - transaction
      • MAttributeSetInstance

        public MAttributeSetInstance(Properties ctx, int M_AttributeSetInstance_ID, int M_AttributeSet_ID, String trxName)
        Standard Constructor
        Parameters:
        ctx - context
        M_AttributeSetInstance_ID - id
        M_AttributeSet_ID - attribute set
        trxName - 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 - context
        M_AttributeSetInstance_ID - M_AttributeSetInstance_ID or 0
        M_Product_ID - required if M_AttributeSetInstance_ID is 0
        Returns:
        Attribute Set Instance or null
      • getWithProductAttributeKeyNamePairs

        public static KeyNamePair[] getWithProductAttributeKeyNamePairs(int M_AttributeSet_ID, boolean withEmptyElement)
        Get attribute set instance records with product attribute (M_Attribute.IsInstanceAttribute=N).
        Parameters:
        M_AttributeSet_ID -
        withEmptyElement - if true, first element of the return array is an empty element with (-1,"")
        Returns:
        attribute set instance records (M_AttributeSetInstance_ID, Description)
      • setMAttributeSet

        public void setMAttributeSet(MAttributeSet mas)
        Set Attribute Set
        Parameters:
        mas - attribute set
      • getMAttributeSet

        public MAttributeSet 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

        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 lot
        M_Product_ID - product used if new
        Returns:
        lot
      • createLot

        public KeyNamePair createLot(int M_Product_ID)
        Create Lot
        Parameters:
        M_Product_ID - product
        Returns:
        KeyNamePair(M_Lot_ID,Name)
      • setLot

        public void setLot(String Lot, int M_Product_ID)
        To find lot and set Lot/ID
        Parameters:
        Lot - lot
        M_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 check
        isSOTrx - true for sales transaction, false otherwise
        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)
        Check is SerNo creation excluded for a table
        Parameters:
        AD_Column_ID - column of table to check
        isSOTrx - 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.
        Default implementation is nop, to be implemented in sub-classes that needed it.
        Overrides:
        afterSave in class PO
        Parameters:
        newRecord - true if it is a new record
        success - true if save operation was success
        Returns:
        if save was a success
      • 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