Package org.compiere.model
Class MCostElement
- java.lang.Object
- 
- org.compiere.model.PO
- 
- org.compiere.model.X_M_CostElement
- 
- org.compiere.model.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:
- Serialized Form
 
- 
- 
Field SummaryFields Modifier and Type Field Description protected static ImmutableIntPOCache<Integer,MCostElement>s_cacheCache- 
Fields inherited from class org.compiere.model.X_M_CostElementCOSTELEMENTTYPE_AD_Reference_ID, COSTELEMENTTYPE_BurdenMOverhead, COSTELEMENTTYPE_Material, COSTELEMENTTYPE_OutsideProcessing, COSTELEMENTTYPE_Overhead, COSTELEMENTTYPE_Resource, COSTINGMETHOD__, COSTINGMETHOD_AD_Reference_ID, COSTINGMETHOD_AverageInvoice, COSTINGMETHOD_AveragePO, COSTINGMETHOD_Fifo, COSTINGMETHOD_LastInvoice, COSTINGMETHOD_LastPOPrice, COSTINGMETHOD_Lifo, COSTINGMETHOD_StandardCosting, COSTINGMETHOD_UserDefined
 - 
Fields inherited from class org.compiere.model.POACCESSLEVEL_ALL, ACCESSLEVEL_CLIENT, ACCESSLEVEL_CLIENTORG, ACCESSLEVEL_ORG, ACCESSLEVEL_SYSTEM, ACCESSLEVEL_SYSTEMCLIENT, ENTITYTYPE_Dictionary, ENTITYTYPE_UserMaintained, I_ZERO, LOCAL_TRX_PREFIX, log, p_ctx, p_info, XML_ATTRIBUTE_AD_Table_ID, XML_ATTRIBUTE_Record_ID
 - 
Fields inherited from interface org.compiere.model.I_M_CostElementaccessLevel, COLUMNNAME_AD_Client_ID, COLUMNNAME_AD_Org_ID, COLUMNNAME_CostElementType, COLUMNNAME_CostingMethod, COLUMNNAME_Created, COLUMNNAME_CreatedBy, COLUMNNAME_Description, COLUMNNAME_IsActive, COLUMNNAME_IsCalculated, COLUMNNAME_M_CostElement_ID, COLUMNNAME_M_CostElement_UU, COLUMNNAME_Name, COLUMNNAME_Updated, COLUMNNAME_UpdatedBy, Model, Table_ID, Table_Name
 
- 
 - 
Constructor SummaryConstructors Constructor Description MCostElement(Properties ctx, int M_CostElement_ID, String trxName)Standard ConstructorMCostElement(Properties ctx, ResultSet rs, String trxName)Load ConstructorMCostElement(Properties ctx, MCostElement copy)MCostElement(Properties ctx, MCostElement copy, String trxName)MCostElement(MCostElement copy)
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanbeforeDelete()Before Deleteprotected booleanbeforeSave(boolean newRecord)Before Savestatic MCostElementget(int M_CostElement_ID)Get Cost Element from Cache (immutable)static MCostElementget(Properties ctx, int M_CostElement_ID)Get Cost Element from Cache (immutable)static List<MCostElement>getByCostingMethod(Properties ctx, String CostingMethod)static MCostElementgetCopy(Properties ctx, int M_CostElement_ID, String trxName)Get updateable copy of MCostElement from cachestatic List<MCostElement>getCostElementsWithCostingMethods(PO po)Get active Material Cost Element for clientstatic MCostElement[]getCostingMethods(PO po)Get active Material Cost Element for clientstatic MCostElement[]getElements(Properties ctx, String trxName)Get All Cost Elements for current AD_Client_IDstatic MCostElementgetMaterialCostElement(Properties ctx, String CostingMethod)Get first Material Cost Elementstatic MCostElementgetMaterialCostElement(Properties ctx, String CostingMethod, int AD_Org_ID)Get first Material Cost Elementstatic MCostElementgetMaterialCostElement(PO po, String CostingMethod)Get Material Cost Element or create itstatic MCostElement[]getNonCostingMethods(PO po)Get active non Material Cost Element for clientbooleanisAverageInvoice()Is Avg Invoice Costing MethodbooleanisAveragePO()Is Avg PO Costing MethodbooleanisCostingMethod()Is this a Costing MethodbooleanisFifo()Is FiFo Costing MethodbooleanisLastInvoice()Is Last Invoice Costing MethodbooleanisLastPOPrice()Is Last PO Costing MethodbooleanisLifo()Is LiFo Costing MethodbooleanisStandardCosting()Is Std Costing MethodbooleanisUserDefined()Is User Costing MethodMCostElementmarkImmutable()mark PO as immutableStringtoString()String Representation- 
Methods inherited from class org.compiere.model.X_M_CostElementget_AccessLevel, getCostElementType, getCostingMethod, getDescription, getKeyNamePair, getM_CostElement_ID, getM_CostElement_UU, getName, initPO, isCalculated, setCostElementType, setCostingMethod, setDescription, setIsCalculated, setM_CostElement_ID, setM_CostElement_UU, setName
 - 
Methods inherited from class org.compiere.model.POafterDelete, afterSave, checkImmutable, clearCrossTenantSafe, clone, columnExists, columnExists, compare, copyPO, copyValues, copyValues, createAttachment, delete, delete, delete_Accounting, delete_Tree, deleteEx, deleteEx, dump, dump, equals, get_Attribute, get_Attributes, get_ColumnCount, get_ColumnDescription, get_ColumnDisplayType, get_ColumnIndex, get_ColumnLabel, get_ColumnLookup, get_ColumnName, get_DisplayValue, get_HashMap, get_ID, get_IDOld, get_KeyColumns, get_Logger, get_OptimisticLockingColumns, get_Table_ID, get_TableName, get_Translation, get_Translation, get_Translation, get_Translation, get_Translation, get_TrxName, get_Value, get_Value, get_ValueAsBoolean, get_ValueAsInt, get_ValueAsInt, get_ValueAsString, get_ValueDifference, get_ValueDifference, get_ValueE, get_ValueOfColumn, get_ValueOld, get_ValueOld, get_ValueOldAsInt, get_WhereClause, get_WhereClause, get_xmlDocument, get_xmlString, getAD_Client_ID, getAD_Org_ID, getAllIDs, getAttachment, getAttachment, getAttachmentData, getCreated, getCreatedBy, getCtx, getDoc, getFindParameter, getPdfAttachment, getUpdated, getUpdatedBy, getUUIDColumnName, getUUIDColumnName, hashCode, insert_Accounting, insert_Tree, insert_Tree, is_Changed, is_Immutable, is_new, is_UseOptimisticLocking, is_ValueChanged, is_ValueChanged, isActive, isAttachment, isColumnMandatory, isColumnUpdateable, isMandatoryOK, isPdfAttachment, isReplication, load, load, load, load, load, loadByUU, loadComplete, loadDefaults, loadSpecial, lock, makeImmutable, postDelete, retrieveIdOfParentValue, retrieveIdOfParentValue, save, save, saveEx, saveEx, saveNew_afterSetID, saveNew_getID, saveNewSpecial, saveReplica, saveUpdate, set_Attribute, set_ColumnUpdateable, set_CustomColumn, set_CustomColumnReturningBoolean, set_OptimisticLockingColumns, set_TrxName, set_TrxName, set_UseOptimisticLocking, set_Value, set_Value, set_Value, set_Value, set_ValueE, set_ValueNoCheck, set_ValueNoCheckE, set_ValueOfColumn, set_ValueOfColumn, set_ValueOfColumnReturningBoolean, set_ValueOfColumnReturningBoolean, setAD_Client_ID, setAD_Org_ID, setClientOrg, setClientOrg, setCrossTenantSafe, setDoc, setDocWorkflowMgr, setIsActive, setProcessedOn, setReplication, setStandardDefaults, setUpdateable, setUpdatedBy, unlock, update_Tree, validForeignKeys
 - 
Methods inherited from class java.lang.Objectfinalize, getClass, notify, notifyAll, wait, wait, wait
 - 
Methods inherited from interface java.util.Comparatorreversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
 - 
Methods inherited from interface org.compiere.model.I_M_CostElementgetAD_Client_ID, getAD_Org_ID, getCreated, getCreatedBy, getUpdated, getUpdatedBy, isActive, setAD_Org_ID, setIsActive
 - 
Methods inherited from interface org.compiere.model.I_Persistentsave
 
- 
 
- 
- 
- 
Field Detail- 
s_cacheprotected static ImmutableIntPOCache<Integer,MCostElement> s_cache Cache
 
- 
 - 
Constructor Detail- 
MCostElementpublic MCostElement(Properties ctx, int M_CostElement_ID, String trxName) Standard Constructor- Parameters:
- ctx- context
- M_CostElement_ID- id
- trxName- trx
 
 - 
MCostElementpublic MCostElement(Properties ctx, ResultSet rs, String trxName) Load Constructor- Parameters:
- ctx- context
- rs- result set
- trxName- trx
 
 - 
MCostElementpublic MCostElement(MCostElement copy) - Parameters:
- copy-
 
 - 
MCostElementpublic MCostElement(Properties ctx, MCostElement copy) - Parameters:
- ctx-
- copy-
 
 - 
MCostElementpublic MCostElement(Properties ctx, MCostElement copy, String trxName) - Parameters:
- ctx-
- copy-
- trxName-
 
 
- 
 - 
Method Detail- 
getMaterialCostElementpublic static MCostElement getMaterialCostElement(PO po, String CostingMethod) Get Material Cost Element or create it- Parameters:
- po- parent
- CostingMethod- method
- Returns:
- cost element
 
 - 
getMaterialCostElementpublic static MCostElement getMaterialCostElement(Properties ctx, String CostingMethod) Get first Material Cost Element- Parameters:
- ctx- context
- CostingMethod- costing method
- Returns:
- Cost Element or null
 
 - 
getMaterialCostElementpublic 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
 
 - 
getCostElementsWithCostingMethodspublic static List<MCostElement> getCostElementsWithCostingMethods(PO po) Get active Material Cost Element for client- Parameters:
- po- parent
- Returns:
- cost element array
 
 - 
getCostingMethodspublic static MCostElement[] getCostingMethods(PO po) Get active Material Cost Element for client- Parameters:
- po- parent
- Returns:
- cost element array
 
 - 
getNonCostingMethodspublic static MCostElement[] getNonCostingMethods(PO po) Get active non Material Cost Element for client- Parameters:
- po- parent
- Returns:
- cost element array
 
 - 
getpublic static MCostElement get(int M_CostElement_ID) Get Cost Element from Cache (immutable)- Parameters:
- M_CostElement_ID- id
- Returns:
- Cost Element
 
 - 
getpublic 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
 
 - 
getCopypublic 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
 
 - 
getElementspublic 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
 
 - 
getByCostingMethodpublic static List<MCostElement> getByCostingMethod(Properties ctx, String CostingMethod) - Returns:
 
 - 
beforeSaveprotected boolean beforeSave(boolean newRecord) Before Save- Overrides:
- beforeSavein class- PO
- Parameters:
- newRecord- new
- Returns:
- true
 
 - 
beforeDeleteprotected boolean beforeDelete() Before Delete- Overrides:
- beforeDeletein class- PO
- Returns:
- true if can be deleted
 
 - 
isCostingMethodpublic boolean isCostingMethod() Is this a Costing Method- Returns:
- true if not Material cost or no costing method.
 
 - 
isAverageInvoicepublic boolean isAverageInvoice() Is Avg Invoice Costing Method- Returns:
- true if AverageInvoice
 
 - 
isAveragePOpublic boolean isAveragePO() Is Avg PO Costing Method- Returns:
- true if AveragePO
 
 - 
isFifopublic boolean isFifo() Is FiFo Costing Method- Returns:
- true if Fifo
 
 - 
isLastInvoicepublic boolean isLastInvoice() Is Last Invoice Costing Method- Returns:
- true if LastInvoice
 
 - 
isLastPOPricepublic boolean isLastPOPrice() Is Last PO Costing Method- Returns:
- true if LastPOPrice
 
 - 
isLifopublic boolean isLifo() Is LiFo Costing Method- Returns:
- true if Lifo
 
 - 
isStandardCostingpublic boolean isStandardCosting() Is Std Costing Method- Returns:
- true if StandardCosting
 
 - 
isUserDefinedpublic boolean isUserDefined() Is User Costing Method- Returns:
- true if User Defined
 
 - 
toStringpublic String toString() String Representation- Overrides:
- toStringin class- X_M_CostElement
- Returns:
- info
 
 - 
markImmutablepublic MCostElement markImmutable() Description copied from interface:ImmutablePOSupportmark PO as immutable- Specified by:
- markImmutablein interface- ImmutablePOSupport
- Returns:
- PO
 
 
- 
 
-