FR [ 1985321 ] CalloutEngine introduce NO_ERROR constant

This commit is contained in:
teo_sarca 2008-06-05 11:43:21 +00:00
parent 626546f3f2
commit 72a2978dcf
1 changed files with 8 additions and 5 deletions

View File

@ -31,6 +31,9 @@ import org.compiere.util.*;
*/ */
public class CalloutEngine implements Callout public class CalloutEngine implements Callout
{ {
/** No error return value. Use this when you are returning from a callout without error */
public static final String NO_ERROR = "";
/** /**
* Constructor * Constructor
*/ */
@ -215,11 +218,11 @@ public class CalloutEngine implements Callout
public String dateAcct (Properties ctx, int WindowNo, GridTab mTab, GridField mField, Object value) public String dateAcct (Properties ctx, int WindowNo, GridTab mTab, GridField mField, Object value)
{ {
if (isCalloutActive()) // assuming it is resetting value if (isCalloutActive()) // assuming it is resetting value
return ""; return NO_ERROR;
if (value == null || !(value instanceof Timestamp)) if (value == null || !(value instanceof Timestamp))
return ""; return NO_ERROR;
mTab.setValue("DateAcct", value); mTab.setValue("DateAcct", value);
return ""; return NO_ERROR;
} // dateAcct } // dateAcct
/** /**
@ -235,7 +238,7 @@ public class CalloutEngine implements Callout
public String rate (Properties ctx, int WindowNo, GridTab mTab, GridField mField, Object value) public String rate (Properties ctx, int WindowNo, GridTab mTab, GridField mField, Object value)
{ {
if (isCalloutActive() || value == null) // assuming it is Conversion_Rate if (isCalloutActive() || value == null) // assuming it is Conversion_Rate
return ""; return NO_ERROR;
BigDecimal rate1 = (BigDecimal)value; BigDecimal rate1 = (BigDecimal)value;
BigDecimal rate2 = Env.ZERO; BigDecimal rate2 = Env.ZERO;
@ -249,7 +252,7 @@ public class CalloutEngine implements Callout
else else
mTab.setValue("MultiplyRate", rate2); mTab.setValue("MultiplyRate", rate2);
log.info(mField.getColumnName() + "=" + rate1 + " => " + rate2); log.info(mField.getColumnName() + "=" + rate1 + " => " + rate2);
return ""; return NO_ERROR;
} // rate } // rate
/** /**