BF [ 1797687 ] Find Form: boolean is not working ok
Revert rev. 3376
This commit is contained in:
parent
ea00e8044e
commit
fadbae72f0
|
@ -38,9 +38,6 @@ import org.compiere.util.*;
|
|||
*
|
||||
* @author Jorg Janke
|
||||
* @version $Id: Find.java,v 1.3 2006/07/30 00:51:27 jjanke Exp $
|
||||
*
|
||||
* @author Teo Sarca, SC ARHIPAC SERVICE SRL
|
||||
* <li>FR [ 1797687 ] Find Form: boolean is not working ok
|
||||
*/
|
||||
public final class Find extends CDialog
|
||||
implements ActionListener, ChangeListener, DataStatusListener
|
||||
|
@ -728,10 +725,12 @@ public final class Find extends CDialog
|
|||
|
||||
// Value ******
|
||||
Object value = advancedTable.getValueAt(row, INDEX_VALUE);
|
||||
if (value == null)
|
||||
continue;
|
||||
Object parsedValue = parseValue(field, value);
|
||||
if (parsedValue == null)
|
||||
continue;
|
||||
String infoDisplay = value != null ? value.toString() : parsedValue.toString();
|
||||
String infoDisplay = value.toString();
|
||||
if (field.isLookup())
|
||||
infoDisplay = field.getLookup().getDisplay(value);
|
||||
else if (field.getDisplayType() == DisplayType.YesNo)
|
||||
|
@ -740,10 +739,12 @@ public final class Find extends CDialog
|
|||
if (MQuery.OPERATORS[MQuery.BETWEEN_INDEX].equals(op))
|
||||
{
|
||||
Object value2 = advancedTable.getValueAt(row, INDEX_VALUE2);
|
||||
if (value2 == null)
|
||||
continue;
|
||||
Object parsedValue2 = parseValue(field, value2);
|
||||
String infoDisplay_to = value2.toString();
|
||||
if (parsedValue2 == null)
|
||||
continue;
|
||||
String infoDisplay_to = value2 != null ? value2.toString() : parsedValue2.toString();
|
||||
m_query.addRangeRestriction(ColumnSQL, parsedValue, parsedValue2,
|
||||
infoName, infoDisplay, infoDisplay_to);
|
||||
}
|
||||
|
@ -751,7 +752,9 @@ public final class Find extends CDialog
|
|||
if (!(parsedValue instanceof Integer)) {
|
||||
continue;
|
||||
}
|
||||
m_query.addRestriction(getSubCategoryWhereClause(((Integer) parsedValue).intValue()));
|
||||
m_query
|
||||
|
||||
.addRestriction(getSubCategoryWhereClause(((Integer) parsedValue).intValue()));
|
||||
}
|
||||
else
|
||||
m_query.addRestriction(ColumnSQL, Operator, parsedValue,
|
||||
|
@ -865,6 +868,8 @@ public final class Find extends CDialog
|
|||
*/
|
||||
private Object parseValue (GridField field, Object in)
|
||||
{
|
||||
if (in == null)
|
||||
return null;
|
||||
int dt = field.getDisplayType();
|
||||
try
|
||||
{
|
||||
|
@ -872,8 +877,6 @@ public final class Find extends CDialog
|
|||
if (dt == DisplayType.Integer
|
||||
|| (DisplayType.isID(dt) && field.getColumnName().endsWith("_ID")))
|
||||
{
|
||||
if (in == null)
|
||||
return null;
|
||||
if (in instanceof Integer)
|
||||
return in;
|
||||
int i = Integer.parseInt(in.toString());
|
||||
|
@ -882,8 +885,6 @@ public final class Find extends CDialog
|
|||
// Return BigDecimal
|
||||
else if (DisplayType.isNumeric(dt))
|
||||
{
|
||||
if (in == null)
|
||||
return null;
|
||||
if (in instanceof BigDecimal)
|
||||
return in;
|
||||
return DisplayType.getNumberFormat(dt).parse(in.toString());
|
||||
|
@ -891,8 +892,6 @@ public final class Find extends CDialog
|
|||
// Return Timestamp
|
||||
else if (DisplayType.isDate(dt))
|
||||
{
|
||||
if (in == null)
|
||||
return null;
|
||||
if (in instanceof Timestamp)
|
||||
return in;
|
||||
long time = 0;
|
||||
|
@ -909,13 +908,8 @@ public final class Find extends CDialog
|
|||
return new Timestamp(time);
|
||||
}
|
||||
// Return Y/N for Boolean
|
||||
else if (DisplayType.YesNo == dt)
|
||||
{
|
||||
if (in == null)
|
||||
return "N";
|
||||
else if (in instanceof Boolean)
|
||||
return ((Boolean)in).booleanValue() ? "Y" : "N";
|
||||
}
|
||||
else if (in instanceof Boolean)
|
||||
return ((Boolean)in).booleanValue() ? "Y" : "N";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue