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
FieldsModifier and TypeFieldDescriptionprotected static ImmutableIntPOCache<Integer,MUOM> UOM Cachestatic final StringX12 Element 355 Code Daystatic final StringX12 Element 355 Code Work Day (8 hours / 5days)static final StringX12 Element 355 Code Hourstatic final StringX12 Element 355 Code Minutestatic final StringX12 Element 355 Code Monthstatic final StringX12 Element 355 Code Work Month (20 days / 4 weeks)static final StringX12 Element 355 Code Secondstatic final StringX12 Element 355 Code Weekstatic final StringX12 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_WeightFields 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_IDFields 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
ConstructorsConstructorDescriptionMUOM(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) Copy constructorMUOM(Properties ctx, MUOM copy, String trxName) Copy constructorCopy constructor -
Method Summary
Modifier and TypeMethodDescriptionstatic MUOMget(int C_UOM_ID) Get UOM from Cache (immutable)static MUOMget(Properties ctx, int C_UOM_ID) Get UOM from Cache (immutable)static MUOMget(Properties ctx, String name, String trxName) Get UOM by namestatic intGet Default C_UOM_IDstatic intGet Minute C_UOM_IDstatic intgetPrecision(Properties ctx, int C_UOM_ID) Get PrecisionbooleanisDay()Is DaybooleanisHour()Is HourbooleanisMinute()Is MinutebooleanisMonth()Is MonthbooleanisSecond()Is SecondbooleanisWeek()Is WeekbooleanIs Working DaybooleanIs Working MonthbooleanisYear()Is Yearprotected static voidloadUOMs(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, setX12DE355Methods 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_TableAttribute, get_TableAttributeAsBoolean, get_TableAttributeAsInt, get_TableAttributes, 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, validForeignKeysExMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Comparator
reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLongMethods inherited from interface org.compiere.model.I_C_UOM
getAD_Client_ID, getAD_Org_ID, getCreated, getCreatedBy, getUpdated, getUpdatedBy, isActive, setAD_Org_ID, setIsActiveMethods 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
Copy constructor- Parameters:
copy-
-
MUOM
Copy constructor- Parameters:
ctx-copy-
-
MUOM
Copy constructor- 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 to use std precision for rounding- Returns:
- rounded quantity
-
isSecond
public boolean isSecond()Is Second- Returns:
- true if UOM is second
-
isMinute
public boolean isMinute()Is Minute- Returns:
- true if UOM is minute
-
isHour
public boolean isHour()Is Hour- Returns:
- true if UOM is hour
-
isDay
public boolean isDay()Is Day- Returns:
- true if UOM is Day
-
isWorkDay
public boolean isWorkDay()Is Working Day- Returns:
- true if UOM is work day
-
isWeek
public boolean isWeek()Is Week- Returns:
- true if UOM is Week
-
isMonth
public boolean isMonth()Is Month- Returns:
- true if UOM is Month
-
isWorkMonth
public boolean isWorkMonth()Is Working Month- Returns:
- true if UOM is Work Month
-
isYear
public boolean isYear()Is Year- Returns:
- true if UOM is year
-
markImmutable
Description copied from interface:ImmutablePOSupportmark PO as immutable- Specified by:
markImmutablein interfaceImmutablePOSupport- Returns:
- PO
-