Adempiere 3.1.2

This commit is contained in:
vpj-cd 2006-12-07 03:28:03 +00:00
parent d087054d12
commit 8f6ccfed70
2 changed files with 1447 additions and 1460 deletions

View File

@ -162,7 +162,7 @@ public class MQuery implements Serializable
else // P_Number_To != null else // P_Number_To != null
{ {
if (P_Number == null) if (P_Number == null)
query.addRestriction("TRUNC("+ParameterName+",'DD')", MQuery.LESS_EQUAL, query.addRestriction("TRUNC("+ParameterName+")", MQuery.LESS_EQUAL,
P_Number_To, Name, Info); P_Number_To, Name, Info);
else else
query.addRangeRestriction(ParameterName, query.addRangeRestriction(ParameterName,
@ -175,19 +175,19 @@ public class MQuery implements Serializable
if (P_Date_To == null) if (P_Date_To == null)
{ {
if (isRange) if (isRange)
query.addRestriction("TRUNC("+ParameterName+",'DD')", MQuery.GREATER_EQUAL, query.addRestriction("TRUNC("+ParameterName+")", MQuery.GREATER_EQUAL,
P_Date, Name, Info); P_Date, Name, Info);
else else
query.addRestriction("TRUNC("+ParameterName+",'DD')", MQuery.EQUAL, query.addRestriction("TRUNC("+ParameterName+")", MQuery.EQUAL,
P_Date, Name, Info); P_Date, Name, Info);
} }
else // P_Date_To != null else // P_Date_To != null
{ {
if (P_Date == null) if (P_Date == null)
query.addRestriction("TRUNC("+ParameterName+",'DD')", MQuery.LESS_EQUAL, query.addRestriction("TRUNC("+ParameterName+")", MQuery.LESS_EQUAL,
P_Date_To, Name, Info); P_Date_To, Name, Info);
else else
query.addRangeRestriction("TRUNC("+ParameterName+",'DD')", query.addRangeRestriction("TRUNC("+ParameterName+")",
P_Date, P_Date_To, Name, Info, Info_To); P_Date, P_Date_To, Name, Info, Info_To);
} }
} }
@ -912,26 +912,14 @@ class Restriction implements Serializable
} }
else else
sb.append(ColumnName); sb.append(ColumnName);
//jz fix col=null in where
if ((Operator.equals("=") || Operator.equals("!="))&&
Code instanceof String &&
(((String) Code).equals("null") ||((String) Code).equals("NULL") || Code == null))
if (Operator.equals("=") )
sb.append(" IS NULL ");
else
sb.append(" IS NOT NULL ");
else
{
// //
sb.append(Operator); sb.append(Operator);
if (Code instanceof String) if (Code instanceof String)
sb.append(DB.TO_STRING(Code.toString())); sb.append(DB.TO_STRING(Code.toString()));
else if (Code instanceof Timestamp) else if (Code instanceof Timestamp)
sb.append(DB.TO_DATE((Timestamp)Code)); sb.append(DB.TO_DATE((Timestamp)Code));
else else
sb.append(Code); sb.append(Code);
// Between // Between
// if (Code_to != null && InfoDisplay_to != null) // if (Code_to != null && InfoDisplay_to != null)
if (MQuery.BETWEEN.equals(Operator)) if (MQuery.BETWEEN.equals(Operator))
@ -944,7 +932,6 @@ class Restriction implements Serializable
else else
sb.append(Code_to); sb.append(Code_to);
} }
}
return sb.toString(); return sb.toString();
} // getSQL } // getSQL
@ -954,7 +941,7 @@ class Restriction implements Serializable
*/ */
public String toString() public String toString()
{ {
return getSQL(null); //jz will it be used to generate update set clause??? return getSQL(null);
} // toString } // toString
/** /**