Class MDiscountSchema

    • Constructor Detail

      • MDiscountSchema

        public MDiscountSchema​(Properties ctx,
                               int M_DiscountSchema_ID,
                               String trxName)
        Standard Constructor
        Parameters:
        ctx - context
        M_DiscountSchema_ID - id
        trxName - transaction
      • MDiscountSchema

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

        public MDiscountSchema​(MDiscountSchema copy)
        Parameters:
        copy -
    • Method Detail

      • get

        public static MDiscountSchema get​(int M_DiscountSchema_ID)
        Get Discount Schema from Cache (immutable)
        Parameters:
        M_DiscountSchema_ID - id
        Returns:
        MDiscountSchema
      • get

        public static MDiscountSchema get​(Properties ctx,
                                          int M_DiscountSchema_ID)
        Get Discount Schema from Cache (immutable)
        Parameters:
        ctx - context
        M_DiscountSchema_ID - id
        Returns:
        MDiscountSchema
      • getBreaks

        public MDiscountSchemaBreak[] getBreaks​(boolean reload)
        Get Breaks
        Parameters:
        reload - reload
        Returns:
        breaks
      • getLines

        public MDiscountSchemaLine[] getLines​(boolean reload)
        Get Lines
        Parameters:
        reload - reload
        Returns:
        lines
      • calculatePrice

        public BigDecimal calculatePrice​(BigDecimal Qty,
                                         BigDecimal Price,
                                         int M_Product_ID,
                                         int M_Product_Category_ID,
                                         BigDecimal BPartnerFlatDiscount)
        Calculate Discounted Price
        Parameters:
        Qty - quantity
        Price - price
        M_Product_ID - product
        M_Product_Category_ID - category
        BPartnerFlatDiscount - flat discount
        Returns:
        discount or zero
      • calculateDiscount

        public BigDecimal calculateDiscount​(BigDecimal Qty,
                                            BigDecimal Price,
                                            int M_Product_ID,
                                            int M_Product_Category_ID,
                                            BigDecimal BPartnerFlatDiscount)
        Calculate Discount Percentage
        Parameters:
        Qty - quantity
        Price - price
        M_Product_ID - product
        M_Product_Category_ID - category
        BPartnerFlatDiscount - flat discount
        Returns:
        discount or zero
      • beforeSave

        protected boolean beforeSave​(boolean newRecord)
        Before Save
        Overrides:
        beforeSave in class PO
        Parameters:
        newRecord - new
        Returns:
        true
      • reSeq

        public int reSeq()
        Renumber
        Returns:
        lines updated