/**
  * Set Amount (Callout)
  *
  * @param windowNo window
  * @param columnName changed column
  */
 private void setAmt(int windowNo, String columnName) {
   //	get values
   BigDecimal ExpenseAmt = getExpenseAmt();
   int C_Currency_From_ID = getC_Currency_ID();
   int C_Currency_To_ID = getCtx().getContextAsInt("$C_Currency_ID");
   Timestamp DateExpense = getDateExpense();
   //
   log.fine("Amt=" + ExpenseAmt + ", C_Currency_ID=" + C_Currency_From_ID);
   //	Converted Amount = Unit price
   BigDecimal ConvertedAmt = ExpenseAmt;
   //	convert if required
   if (ConvertedAmt.signum() != 0 && C_Currency_To_ID != C_Currency_From_ID) {
     ConvertedAmt =
         MConversionRate.convert(
             getCtx(),
             ConvertedAmt,
             C_Currency_From_ID,
             C_Currency_To_ID,
             DateExpense,
             0,
             getAD_Client_ID(),
             getAD_Org_ID());
   }
   setConvertedAmt(ConvertedAmt);
   log.fine("ConvertedAmt=" + ConvertedAmt);
 } //	setAmt
Example #2
0
 /** Calculate Performance Goal as multiplier */
 public void setGoalPerformance() {
   BigDecimal MeasureTarget = getMeasureTarget();
   BigDecimal MeasureActual = getMeasureActual();
   BigDecimal GoalPerformance = Env.ZERO;
   if (MeasureTarget.signum() != 0)
     GoalPerformance = MeasureActual.divide(MeasureTarget, 6, BigDecimal.ROUND_HALF_UP);
   super.setGoalPerformance(GoalPerformance);
 } //	setGoalPerformance
Example #3
0
 /**
  * Get Goal Performance in Percent
  *
  * @return performance in percent
  */
 public int getPercent() {
   BigDecimal bd = getGoalPerformance().multiply(Env.ONEHUNDRED);
   return bd.intValue();
 } //	getPercent
Example #4
0
 /**
  * Get Goal Performance as Double
  *
  * @return performance as multipier
  */
 public double getGoalPerformanceDouble() {
   BigDecimal bd = getGoalPerformance();
   return bd.doubleValue();
 } //	getGoalPerformanceDouble