IDEMPIERE-2322 Cannot search Date+Time with time portion

This commit is contained in:
Carlos Ruiz 2014-11-18 18:45:28 -05:00
parent 54a5e2dbd3
commit 06bc792db5
2 changed files with 14 additions and 8 deletions

View File

@ -1145,7 +1145,7 @@ class Restriction implements Serializable
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, false));
else else
sb.append(Code); sb.append(Code);
@ -1157,7 +1157,7 @@ class Restriction implements Serializable
if (Code_to instanceof String) if (Code_to instanceof String)
sb.append(DB.TO_STRING(Code_to.toString())); sb.append(DB.TO_STRING(Code_to.toString()));
else if (Code_to instanceof Timestamp) else if (Code_to instanceof Timestamp)
sb.append(DB.TO_DATE((Timestamp)Code_to)); sb.append(DB.TO_DATE((Timestamp)Code_to, false));
else else
sb.append(Code_to); sb.append(Code_to);
} }

View File

@ -1662,8 +1662,10 @@ public class FindWindow extends Window implements EventListener<Event>, ValueCha
{ {
if (valueTo != null && valueTo.toString().length() > 0) { if (valueTo != null && valueTo.toString().length() > 0) {
// range // range
StringBuilder msglog = new StringBuilder(ColumnName).append(">=").append(value).append("<=").append(valueTo); if (log.isLoggable(Level.FINE)) {
if (log.isLoggable(Level.FINE)) log.fine(msglog.toString()); StringBuilder msglog = new StringBuilder(ColumnName).append(">=").append(value).append("<=").append(valueTo);
log.fine(msglog.toString());
}
GridField field = getTargetMField(ColumnName); GridField field = getTargetMField(ColumnName);
StringBuilder ColumnSQL = new StringBuilder(field.getColumnSQL(false)); StringBuilder ColumnSQL = new StringBuilder(field.getColumnSQL(false));
@ -1671,8 +1673,10 @@ public class FindWindow extends Window implements EventListener<Event>, ValueCha
ColumnName, wed.getDisplay(), wedTo.getDisplay(), true, 0); ColumnName, wed.getDisplay(), wedTo.getDisplay(), true, 0);
appendCode(code, ColumnName, MQuery.BETWEEN, value.toString(), valueTo.toString(), "AND", "", ""); appendCode(code, ColumnName, MQuery.BETWEEN, value.toString(), valueTo.toString(), "AND", "", "");
} else { } else {
StringBuilder msglog = new StringBuilder(ColumnName).append("=").append(value); if (log.isLoggable(Level.FINE)) {
if (log.isLoggable(Level.FINE)) log.fine(msglog.toString()); StringBuilder msglog = new StringBuilder(ColumnName).append("=").append(value);
log.fine(msglog.toString());
}
// globalqss - Carlos Ruiz - 20060711 // globalqss - Carlos Ruiz - 20060711
// fix a bug with virtualColumn + isSelectionColumn not yielding results // fix a bug with virtualColumn + isSelectionColumn not yielding results
@ -1723,8 +1727,10 @@ public class FindWindow extends Window implements EventListener<Event>, ValueCha
} }
} else if (valueTo != null && valueTo.toString().length() > 0) { } else if (valueTo != null && valueTo.toString().length() > 0) {
// filled upper limit without filling lower limit // filled upper limit without filling lower limit
StringBuilder msglog = new StringBuilder(ColumnName).append("<=").append(valueTo); if (log.isLoggable(Level.FINE)) {
if (log.isLoggable(Level.FINE)) log.fine(msglog.toString()); StringBuilder msglog = new StringBuilder(ColumnName).append("<=").append(valueTo);
log.fine(msglog.toString());
}
GridField field = getTargetMField(ColumnName); GridField field = getTargetMField(ColumnName);
StringBuilder ColumnSQL = new StringBuilder(field.getColumnSQL(false)); StringBuilder ColumnSQL = new StringBuilder(field.getColumnSQL(false));