Class MCostElement

All Implemented Interfaces:
Serializable, Cloneable, Comparator<Object>, I_M_CostElement, I_Persistent, Evaluatee, ImmutablePOSupport

public class MCostElement extends X_M_CostElement implements ImmutablePOSupport
Cost Element Model
Version:
$Id: MCostElement.java,v 1.2 2006/07/30 00:58:04 jjanke Exp $
Author:
Jorg Janke, Teo Sarca, www.arhipac.ro
  • BF [ 2664529 ] More then one Labor/Burden//Overhead is not allowed
  • BF [ 2667470 ] MCostElement.getMaterialCostElement should check only material, red1
  • FR: [ 2214883 ] Remove SQL code and Replace for Query -- JUnit tested
  • See Also:
    • Field Details

    • Constructor Details

      • MCostElement

        public MCostElement(Properties ctx, String M_CostElement_UU, String trxName)
        UUID based Constructor
        Parameters:
        ctx - Context
        M_CostElement_UU - UUID key
        trxName - Transaction
      • 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)
        Copy constructor
        Parameters:
        copy -
      • MCostElement

        public MCostElement(Properties ctx, MCostElement copy)
        Copy constructor
        Parameters:
        ctx -
        copy -
      • MCostElement

        public MCostElement(Properties ctx, MCostElement copy, String trxName)
        Copy constructor
        Parameters:
        ctx -
        copy -
        trxName -
    • Method Details

      • getMaterialCostElement

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

        public static MCostElement getMaterialCostElement(Properties ctx, String CostingMethod)
        Get first Material Cost Element for a costing method.
        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 for a costing method
        Parameters:
        ctx - context
        CostingMethod - costing method
        Returns:
        Cost Element or null
      • getCostElementsWithCostingMethods

        public static List<MCostElement> getCostElementsWithCostingMethods(PO po)
        Get active Material Cost Element (associated with costing method) for client
        Parameters:
        po - parent
        Returns:
        cost element list
      • getCostingMethods

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

        public static MCostElement[] getNonCostingMethods(PO po)
        Get active non Material Cost Element (i.e costing method is null) 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
      • getByCostingMethod

        public static List<MCostElement> getByCostingMethod(Properties ctx, String CostingMethod)
        Get All active Cost Elements for current AD_Client_ID
        Parameters:
        ctx - context
        CostingMethod -
        Returns:
        cost element list
      • 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 cost element is of type material and costing method is not null
      • isAverageInvoice

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

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

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

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

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

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

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

        public boolean isUserDefined()
        Is User Costing Method
        Returns:
        true if costing method is User Defined
      • toString

        public String toString()
        String Representation
        Overrides:
        toString in class X_M_CostElement
        Returns:
        info
      • markImmutable

        public MCostElement markImmutable()
        Description copied from interface: ImmutablePOSupport
        mark PO as immutable
        Specified by:
        markImmutable in interface ImmutablePOSupport
        Returns:
        PO