Compiere 3.1

org.compiere.model
Class MGoal

java.lang.Object
  extended by org.compiere.framework.PO
      extended by org.compiere.model.X_PA_Goal
          extended by org.compiere.model.MGoal
All Implemented Interfaces:
Serializable, Cloneable, Comparator<PO>, Evaluatee

public class MGoal
extends X_PA_Goal

Performance Goal

Version:
$Id: MGoal.java,v 1.2 2006/07/30 00:51:03 jjanke Exp $
Author:
Jorg Janke
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.compiere.model.X_PA_Goal
accessLevel, MEASUREDISPLAY_AD_Reference_ID, MEASUREDISPLAY_Day, MEASUREDISPLAY_Month, MEASUREDISPLAY_Quarter, MEASUREDISPLAY_Total, MEASUREDISPLAY_Week, MEASUREDISPLAY_Year, MEASURESCOPE_AD_Reference_ID, MEASURESCOPE_Day, MEASURESCOPE_Month, MEASURESCOPE_Quarter, MEASURESCOPE_Total, MEASURESCOPE_Week, MEASURESCOPE_Year, Model, PA_GOALPARENT_ID_AD_Reference_ID, Table_ID, Table_Name, updatedMS
 
Fields inherited from class org.compiere.framework.PO
ACCESSLEVEL_ALL, ACCESSLEVEL_CLIENT, ACCESSLEVEL_CLIENTORG, ACCESSLEVEL_ORG, ACCESSLEVEL_SYSTEM, ACCESSLEVEL_SYSTEMCLIENT, ENTITYTYPE_Dictionary, ENTITYTYPE_UserMaintained, I_ZERO, log, p_changeVO, p_info, XML_ATTRIBUTE_AD_Table_ID, XML_ATTRIBUTE_Record_ID
 
Constructor Summary
MGoal(Ctx ctx, int PA_Goal_ID, String trxName)
          Standard Constructor
MGoal(Ctx ctx, ResultSet rs, String trxName)
          Load Constructor
MGoal(Ctx ctx, String Name, String Description, BigDecimal MeasureTarget, String trxName)
          Base Constructor
 
Method Summary
protected  boolean afterSave(boolean newRecord, boolean success)
          After Save
protected  boolean beforeSave(boolean newRecord)
          Before Save
 Color getColor()
          Get Color
 MColorSchema getColorSchema()
          Get the color schema for this goal.
 double getGoalPerformanceDouble()
          Get Goal Performance as Double
static MGoal[] getGoals(Ctx ctx)
          Get Accessible Goals
 MMeasure getMeasure()
          Get Measure
 String getMeasureDisplay()
          Get Measure Display
static MGoal[] getMeasureGoals(Ctx ctx, int PA_Measure_ID)
          Get Goals with Measure
static BigDecimal getMultiplier(MGoal goal)
          Get Multiplier from Scope to Display
 int getPercent()
          Get Goal Performance in Percent
 MGoalRestriction[] getRestrictions(boolean reload)
          Get Restriction Lines
static MGoal[] getTestGoals(Ctx ctx)
          Create Test Goals
static MGoal[] getUserGoals(Ctx ctx)
          Get User Goals
 String getXAxisText()
          Get Measure Display Text
 boolean isTarget()
          Goal has Target
 void setGoalPerformance()
          Calculate Performance Goal as multiplier
 void setMeasureActual(BigDecimal MeasureActual)
          Set Measure Actual
 String toString()
          String Representation
 boolean updateGoal(boolean force)
          Update/save Goals for the same measure
 
Methods inherited from class org.compiere.model.X_PA_Goal
get_AccessLevel, getAD_Role_ID, getAD_User_ID, getDateFrom, getDateLastRun, getDateTo, getDescription, getGoalPerformance, getKeyNamePair, getMeasureActual, getMeasureScope, getMeasureTarget, getName, getNote, getPA_ColorSchema_ID, getPA_Goal_ID, getPA_GoalParent_ID, getPA_Measure_ID, getRelativeWeight, getSeqNo, initPO, isMeasureDisplayValid, isMeasureScopeValid, isSummary, setAD_Role_ID, setAD_User_ID, setDateFrom, setDateLastRun, setDateTo, setDescription, setGoalPerformance, setIsSummary, setMeasureDisplay, setMeasureScope, setMeasureTarget, setName, setNote, setPA_ColorSchema_ID, setPA_Goal_ID, setPA_GoalParent_ID, setPA_Measure_ID, setRelativeWeight, setSeqNo
 
Methods inherited from class org.compiere.framework.PO
addAttachment, addAttachment, addError, afterDelete, beforeDelete, compare, convertToBigDecimal, convertToBoolean, convertToInt, convertToTimestamp, copy, copyValues, copyValues, createAttachment, delete_Accounting, delete, delete, dump, dump, equals, get_ChangeVO, get_ColumnCount, get_ColumnDescription, get_ColumnDisplayType, get_ColumnIndex, get_ColumnLabel, get_ColumnLookup, get_ColumnName, get_DisplayValue, get_EntityType, get_HashMap, get_ID, get_IDOld, get_Info, get_KeyColumns, get_Logger, get_Table_ID, get_Table_ID, get_TableName, get_Translation, get_TrxName, get_Value, get_Value, get_ValueAsInt, get_ValueAsInt, get_ValueAsString, get_ValueDifference, get_ValueDifference, get_ValueOfColumn, get_ValueOld, get_ValueOld, get_ValueOldAsInt, get_ValuesAsString, get_WhereClause, get_xmlDocument, get_xmlString, get_xmlString, getAD_Client_ID, getAD_Org_ID, getAllIDs, getAttachment, getAttachment, getAttachmentData, getCreated, getCreatedBy, getCtx, getFindParameter, getPdfAttachment, getUpdated, getUpdatedBy, getVO, hashCode, insert_Accounting, is_Changed, is_KeyColumn, is_new, is_ValueChanged, is_ValueChanged, isActive, isAttachment, isColumnMandatory, isColumnUpdateable, isMandatoryOK, isPdfAttachment, load, load, load, load, loadComplete, loadDefaults, loadSpecial, lock, save, save, saveNew_getID, saveNewInsertSQL, saveNewSpecial, saveUpdate, set_ChangeVO, set_ColumnUpdateable, set_CustomColumn, set_TrxName, set_Value, set_Value, set_ValueE, set_ValueNoCheck, set_ValueNoCheckE, set_ValueOfColumn, set_ValueString, setAD_Client_ID, setAD_Org_ID, setClientOrg, setClientOrg, setContext, setCtx, setDocWorkflowMgr, setIsActive, setStandardDefaults, setUpdateable, setUpdatedBy, toStringX, unlock, update
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MGoal

public MGoal(Ctx ctx,
             int PA_Goal_ID,
             String trxName)
Standard Constructor

Parameters:
ctx - context
PA_Goal_ID - id
trxName - trx

MGoal

public MGoal(Ctx ctx,
             ResultSet rs,
             String trxName)
Load Constructor

Parameters:
ctx - context
rs - result set
trxName - trx

MGoal

public MGoal(Ctx ctx,
             String Name,
             String Description,
             BigDecimal MeasureTarget,
             String trxName)
Base Constructor

Parameters:
ctx - context
Name - Name
Description - Decsription
MeasureTarget - target
trxName - trx
Method Detail

getUserGoals

public static MGoal[] getUserGoals(Ctx ctx)
Get User Goals

Parameters:
ctx - context
AD_User_ID - user
Returns:
array of goals

getGoals

public static MGoal[] getGoals(Ctx ctx)
Get Accessible Goals

Parameters:
ctx - context
Returns:
array of goals

getTestGoals

public static MGoal[] getTestGoals(Ctx ctx)
Create Test Goals

Parameters:
ctx - context
Returns:
array of goals

getMeasureGoals

public static MGoal[] getMeasureGoals(Ctx ctx,
                                      int PA_Measure_ID)
Get Goals with Measure

Parameters:
ctx - context
PA_Measure_ID - measure
Returns:
goals

getMultiplier

public static BigDecimal getMultiplier(MGoal goal)
Get Multiplier from Scope to Display

Parameters:
goal - goal
Returns:
null if error or multiplier

getRestrictions

public MGoalRestriction[] getRestrictions(boolean reload)
Get Restriction Lines

Parameters:
reload - reload data
Returns:
array of lines

getMeasure

public MMeasure getMeasure()
Get Measure

Returns:
measure or null

updateGoal

public boolean updateGoal(boolean force)
Update/save Goals for the same measure

Parameters:
force - force to update goal (default once per day)
Returns:
true if updated

setMeasureActual

public void setMeasureActual(BigDecimal MeasureActual)
Set Measure Actual

Overrides:
setMeasureActual in class X_PA_Goal
Parameters:
MeasureActual - actual

setGoalPerformance

public void setGoalPerformance()
Calculate Performance Goal as multiplier


getGoalPerformanceDouble

public double getGoalPerformanceDouble()
Get Goal Performance as Double

Returns:
performance as multipier

getPercent

public int getPercent()
Get Goal Performance in Percent

Returns:
performance in percent

getColor

public Color getColor()
Get Color

Returns:
color - white if no target

getColorSchema

public MColorSchema getColorSchema()
Get the color schema for this goal.

Returns:
the color schema, or null if the measure targer is 0

getMeasureDisplay

public String getMeasureDisplay()
Get Measure Display

Overrides:
getMeasureDisplay in class X_PA_Goal
Returns:
Measure Display

getXAxisText

public String getXAxisText()
Get Measure Display Text

Returns:
Measure Display Text

isTarget

public boolean isTarget()
Goal has Target

Returns:
true if target

toString

public String toString()
String Representation

Overrides:
toString in class X_PA_Goal
Returns:
info

beforeSave

protected boolean beforeSave(boolean newRecord)
Before Save

Overrides:
beforeSave in class PO
Parameters:
newRecord - new
Returns:
true

afterSave

protected boolean afterSave(boolean newRecord,
                            boolean success)
After Save

Overrides:
afterSave in class PO
Parameters:
newRecord - new
success - success
Returns:
true

Compiere 3.1

Compiere® is a registered trademark of ComPiere, Inc. ©2004-2008 HumanFlash.com All rights reserved.