Class MAttributeSetInstance

    • Constructor Detail

      • 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 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 - context
        M_AttributeSetInstance_ID - id or 0
        M_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 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 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 - lot
        M_Product_ID - product
      • isExcludeLot

        public boolean isExcludeLot​(int AD_Column_ID,
                                    boolean isSOTrx)
        Exclude Lot creation
        Parameters:
        AD_Column_ID - column
        isSOTrx - 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 - column
        isSOTrx - 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
        Overrides:
        afterSave in class PO
        Parameters:
        newRecord - 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