Class MCostElement

    • Constructor Detail

      • MCostElement

        public MCostElement​(Properties ctx,
                            int M_CostElement_ID,
                            String trxName)
        Standard Constructor
        Parameters:
        ctx - context
        M_CostElement_ID - id
        trxName - trx
      • MCostElement

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

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

      • getMaterialCostElement

        public static MCostElement getMaterialCostElement​(PO po,
                                                          String CostingMethod)
        Get Material Cost Element or create it
        Parameters:
        po - parent
        CostingMethod - method
        Returns:
        cost element
      • getMaterialCostElement

        public static MCostElement getMaterialCostElement​(Properties ctx,
                                                          String CostingMethod)
        Get first Material Cost Element
        Parameters:
        ctx - context
        CostingMethod - costing method
        Returns:
        Cost Element or null
      • getMaterialCostElement

        public static MCostElement getMaterialCostElement​(Properties ctx,
                                                          String CostingMethod,
                                                          int AD_Org_ID)
        Get first Material Cost Element
        Parameters:
        ctx - context
        CostingMethod - costing method
        Returns:
        Cost Element or null
      • getCostElementsWithCostingMethods

        public static List<MCostElement> getCostElementsWithCostingMethods​(PO po)
        Get active Material Cost Element for client
        Parameters:
        po - parent
        Returns:
        cost element array
      • getCostingMethods

        public static MCostElement[] getCostingMethods​(PO po)
        Get active Material Cost Element for client
        Parameters:
        po - parent
        Returns:
        cost element array
      • getNonCostingMethods

        public static MCostElement[] getNonCostingMethods​(PO po)
        Get active non Material Cost Element for client
        Parameters:
        po - parent
        Returns:
        cost element array
      • get

        public static MCostElement get​(int M_CostElement_ID)
        Get Cost Element from Cache (immutable)
        Parameters:
        M_CostElement_ID - id
        Returns:
        Cost Element
      • get

        public static MCostElement get​(Properties ctx,
                                       int M_CostElement_ID)
        Get Cost Element from Cache (immutable)
        Parameters:
        ctx - context
        M_CostElement_ID - id
        Returns:
        Cost Element
      • getCopy

        public static MCostElement getCopy​(Properties ctx,
                                           int M_CostElement_ID,
                                           String trxName)
        Get updateable copy of MCostElement from cache
        Parameters:
        ctx -
        M_CostElement_ID -
        trxName -
        Returns:
        MCostElement
      • getElements

        public static MCostElement[] getElements​(Properties ctx,
                                                 String trxName)
        Get All Cost Elements for current AD_Client_ID
        Parameters:
        ctx - context
        trxName - transaction
        Returns:
        array cost elements
      • beforeSave

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

        protected boolean beforeDelete()
        Before Delete
        Overrides:
        beforeDelete in class PO
        Returns:
        true if can be deleted
      • isCostingMethod

        public boolean isCostingMethod()
        Is this a Costing Method
        Returns:
        true if not Material cost or no costing method.
      • isAverageInvoice

        public boolean isAverageInvoice()
        Is Avg Invoice Costing Method
        Returns:
        true if AverageInvoice
      • isAveragePO

        public boolean isAveragePO()
        Is Avg PO Costing Method
        Returns:
        true if AveragePO
      • isFifo

        public boolean isFifo()
        Is FiFo Costing Method
        Returns:
        true if Fifo
      • isLastInvoice

        public boolean isLastInvoice()
        Is Last Invoice Costing Method
        Returns:
        true if LastInvoice
      • isLastPOPrice

        public boolean isLastPOPrice()
        Is Last PO Costing Method
        Returns:
        true if LastPOPrice
      • isLifo

        public boolean isLifo()
        Is LiFo Costing Method
        Returns:
        true if Lifo
      • isStandardCosting

        public boolean isStandardCosting()
        Is Std Costing Method
        Returns:
        true if StandardCosting
      • isUserDefined

        public boolean isUserDefined()
        Is User Costing Method
        Returns:
        true if User Defined