Package org.compiere.model
Class MUOM
java.lang.Object
org.compiere.model.PO
org.compiere.model.X_C_UOM
org.compiere.model.MUOM
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparator<Object>
,I_C_UOM
,I_Persistent
,Evaluatee
,ImmutablePOSupport
Unit Of Measure Model
- Version:
- $Id: MUOM.java,v 1.3 2006/07/30 00:51:05 jjanke Exp $
- Author:
- Jorg Janke
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected static ImmutableIntPOCache<Integer,
MUOM> UOM Cachestatic final String
X12 Element 355 Code Daystatic final String
X12 Element 355 Code Work Day (8 hours / 5days)static final String
X12 Element 355 Code Hourstatic final String
X12 Element 355 Code Minutestatic final String
X12 Element 355 Code Monthstatic final String
X12 Element 355 Code Work Month (20 days / 4 weeks)static final String
X12 Element 355 Code Secondstatic final String
X12 Element 355 Code Weekstatic final String
X12 Element 355 Code YearFields inherited from class org.compiere.model.X_C_UOM
UOMTYPE_AD_Reference_ID, UOMTYPE_Angle, UOMTYPE_Area, UOMTYPE_Currency, UOMTYPE_DataSpeed, UOMTYPE_DataStorage, UOMTYPE_Density, UOMTYPE_Energy, UOMTYPE_Force, UOMTYPE_Frequency, UOMTYPE_KitchenMeasures, UOMTYPE_Length, UOMTYPE_Other, UOMTYPE_Power, UOMTYPE_Pressure, UOMTYPE_Temperature, UOMTYPE_Time, UOMTYPE_Torque, UOMTYPE_Velocity, UOMTYPE_VolumeDry, UOMTYPE_VolumeLiquid, UOMTYPE_Weight
Fields inherited from class org.compiere.model.PO
ACCESSLEVEL_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, UUID_NEW_RECORD, XML_ATTRIBUTE_AD_Table_ID, XML_ATTRIBUTE_Record_ID
Fields inherited from interface org.compiere.model.I_C_UOM
accessLevel, COLUMNNAME_AD_Client_ID, COLUMNNAME_AD_Org_ID, COLUMNNAME_C_UOM_ID, COLUMNNAME_C_UOM_UU, COLUMNNAME_CostingPrecision, COLUMNNAME_Created, COLUMNNAME_CreatedBy, COLUMNNAME_Description, COLUMNNAME_IsActive, COLUMNNAME_IsDefault, COLUMNNAME_Name, COLUMNNAME_StdPrecision, COLUMNNAME_UNCEFACT, COLUMNNAME_UOMSymbol, COLUMNNAME_UOMType, COLUMNNAME_Updated, COLUMNNAME_UpdatedBy, COLUMNNAME_X12DE355, Model, Table_ID, Table_Name
-
Constructor Summary
ConstructorDescriptionMUOM
(Properties ctx, int C_UOM_ID, String trxName) Constructor.MUOM
(Properties ctx, String C_UOM_UU, String trxName) UUID based ConstructorMUOM
(Properties ctx, ResultSet rs, String trxName) Load Constructor.MUOM
(Properties ctx, MUOM copy) MUOM
(Properties ctx, MUOM copy, String trxName) -
Method Summary
Modifier and TypeMethodDescriptionstatic MUOM
get
(int C_UOM_ID) Get UOM from Cache (immutable)static MUOM
get
(Properties ctx, int C_UOM_ID) Get UOM from Cache (immutable)static MUOM
get
(Properties ctx, String name, String trxName) Get UOM by namestatic int
Get Default C_UOM_IDstatic int
Get Minute C_UOM_IDstatic int
getPrecision
(Properties ctx, int C_UOM_ID) Get Precisionboolean
isDay()
Dayboolean
isHour()
Hourboolean
isMinute()
Minuteboolean
isMonth()
Monthboolean
isSecond()
Secondboolean
isWeek()
Weekboolean
WorkDayboolean
WorkMonthboolean
isYear()
Yearprotected static void
loadUOMs
(Properties ctx) Load All UOMsmark PO as immutableround
(BigDecimal qty, boolean stdPrecision) Round qtytoString()
String RepresentationMethods inherited from class org.compiere.model.X_C_UOM
get_AccessLevel, getC_UOM_ID, getC_UOM_UU, getCostingPrecision, getDescription, getKeyNamePair, getName, getStdPrecision, getUNCEFACT, getUOMSymbol, getUOMType, getX12DE355, initPO, isDefault, setC_UOM_ID, setC_UOM_UU, setCostingPrecision, setDescription, setIsDefault, setName, setStdPrecision, setUNCEFACT, setUOMSymbol, setUOMType, setX12DE355
Methods inherited from class org.compiere.model.PO
afterDelete, afterSave, beforeDelete, beforeSave, buildInsertSQL, 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_UUID, get_Value, get_Value, get_ValueAsBoolean, get_ValueAsInt, get_ValueAsInt, get_ValueAsString, 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, loadByUU, loadComplete, loadDefaults, loadPO, loadSpecial, lock, makeImmutable, postDelete, retrieveIdOfParentValue, retrieveIdOfParentValue, save, save, saveCrossTenantSafe, saveCrossTenantSafeEx, saveCrossTenantSafeEx, 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, toInsertSQL, unlock, update_Tree, validForeignKeys
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Comparator
reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
Methods inherited from interface org.compiere.model.I_C_UOM
getAD_Client_ID, getAD_Org_ID, getCreated, getCreatedBy, getUpdated, getUpdatedBy, isActive, setAD_Org_ID, setIsActive
Methods inherited from interface org.compiere.model.I_Persistent
save
-
Field Details
-
X12_SECOND
X12 Element 355 Code Second- See Also:
-
X12_MINUTE
X12 Element 355 Code Minute- See Also:
-
X12_HOUR
X12 Element 355 Code Hour- See Also:
-
X12_DAY
X12 Element 355 Code Day- See Also:
-
X12_DAY_WORK
X12 Element 355 Code Work Day (8 hours / 5days)- See Also:
-
X12_WEEK
X12 Element 355 Code Week- See Also:
-
X12_MONTH
X12 Element 355 Code Month- See Also:
-
X12_MONTH_WORK
X12 Element 355 Code Work Month (20 days / 4 weeks)- See Also:
-
X12_YEAR
X12 Element 355 Code Year- See Also:
-
s_cache
UOM Cache
-
-
Constructor Details
-
MUOM
UUID based Constructor- Parameters:
ctx
- ContextC_UOM_UU
- UUID keytrxName
- Transaction
-
MUOM
Constructor.- Parameters:
ctx
- contextC_UOM_ID
- UOM IDtrxName
- transaction
-
MUOM
Load Constructor.- Parameters:
ctx
- contextrs
- result settrxName
- transaction
-
MUOM
- Parameters:
copy
-
-
MUOM
- Parameters:
ctx
-copy
-
-
MUOM
- Parameters:
ctx
-copy
-trxName
-
-
-
Method Details
-
getMinute_UOM_ID
Get Minute C_UOM_ID- Parameters:
ctx
- context- Returns:
- C_UOM_ID for Minute
-
getDefault_UOM_ID
Get Default C_UOM_ID- Parameters:
ctx
- context for AD_Client- Returns:
- C_UOM_ID
-
get
Get UOM from Cache (immutable)- Parameters:
C_UOM_ID
- ID- Returns:
- UOM
-
get
Get UOM from Cache (immutable)- Parameters:
ctx
- contextC_UOM_ID
- ID- Returns:
- UOM
-
get
Get UOM by name- Parameters:
ctx
-name
-trxName
-- Returns:
- MUOM if found, null if not found
-
getPrecision
Get Precision- Parameters:
ctx
- contextC_UOM_ID
- ID- Returns:
- Precision
-
loadUOMs
Load All UOMs- Parameters:
ctx
- context
-
toString
String Representation -
round
Round qty- Parameters:
qty
- quantitystdPrecision
- true if std precisison- Returns:
- rounded quantity
-
isSecond
public boolean isSecond()Second- Returns:
- true if UOM is second
-
isMinute
public boolean isMinute()Minute- Returns:
- true if UOM is minute
-
isHour
public boolean isHour()Hour- Returns:
- true if UOM is hour
-
isDay
public boolean isDay()Day- Returns:
- true if UOM is Day
-
isWorkDay
public boolean isWorkDay()WorkDay- Returns:
- true if UOM is work day
-
isWeek
public boolean isWeek()Week- Returns:
- true if UOM is Week
-
isMonth
public boolean isMonth()Month- Returns:
- true if UOM is Month
-
isWorkMonth
public boolean isWorkMonth()WorkMonth- Returns:
- true if UOM is Work Month
-
isYear
public boolean isYear()Year- Returns:
- true if UOM is year
-
markImmutable
Description copied from interface:ImmutablePOSupport
mark PO as immutable- Specified by:
markImmutable
in interfaceImmutablePOSupport
- Returns:
- PO
-