diff --git a/base/src/org/compiere/model/MRequestType.java b/base/src/org/compiere/model/MRequestType.java index 51bfdd1976..d58510897f 100644 --- a/base/src/org/compiere/model/MRequestType.java +++ b/base/src/org/compiere/model/MRequestType.java @@ -160,10 +160,10 @@ public class MRequestType extends X_R_RequestType + "(SELECT COUNT(*) FROM R_Request r " + "WHERE r.R_RequestType_ID=x.R_RequestType_ID) AS TotalNo, " + "(SELECT COUNT(*) FROM R_Request r " - + "WHERE r.R_RequestType_ID=x.R_RequestType_ID AND Created>SysDate-30) AS New30No, " + + "WHERE r.R_RequestType_ID=x.R_RequestType_ID AND Created>addDays(SysDate,-30)) AS New30No, " + "(SELECT COUNT(*) FROM R_Request r" + " INNER JOIN R_Status s ON (r.R_Status_ID=s.R_Status_ID AND s.IsClosed='Y') " - + "WHERE r.R_RequestType_ID=x.R_RequestType_ID AND r.Updated>SysDate-30) AS Closed30No " + + "WHERE r.R_RequestType_ID=x.R_RequestType_ID AND r.Updated>addDays(SysDate,-30)) AS Closed30No " // + "FROM R_RequestType x WHERE R_RequestType_ID=?"; PreparedStatement pstmt = null; @@ -438,7 +438,7 @@ public class MRequestType extends X_R_RequestType // else if (MGoal.MEASUREDISPLAY_Day.equals(MeasureDisplay)) // ; orderBy = "TRUNC(" + dateColumn + ",'" + trunc + "')"; - groupBy = orderBy + ", StatusID "; + groupBy = orderBy + ", 3 "; sb.append(orderBy) .append(", 0 as StatusID ") .append("FROM R_Request "); @@ -446,7 +446,7 @@ public class MRequestType extends X_R_RequestType else { orderBy = "s.SeqNo"; - groupBy = "COALESCE(s.Name,'-'), s.R_Status_ID, s.SeqNo "; + groupBy = "COALESCE(s.Name,TO_NCHAR('-')), s.R_Status_ID, s.SeqNo "; sb.append(groupBy) .append("FROM R_Request LEFT OUTER JOIN R_Status s ON (R_Request.R_Status_ID=s.R_Status_ID) "); } diff --git a/dbPort/src/org/compiere/dbPort/ConvertMap_PostgreSQL.java b/dbPort/src/org/compiere/dbPort/ConvertMap_PostgreSQL.java index f22ddac38d..5b48473e16 100644 --- a/dbPort/src/org/compiere/dbPort/ConvertMap_PostgreSQL.java +++ b/dbPort/src/org/compiere/dbPort/ConvertMap_PostgreSQL.java @@ -59,6 +59,7 @@ public final class ConvertMap_PostgreSQL { s_pg.put("\\bTO_DATE\\b", "TO_TIMESTAMP"); // s_pg.put("\\bDBMS_OUTPUT.PUT_LINE\\b", "RAISE NOTICE"); + s_pg.put("\\bTO_NCHAR\\b", ""); // Temporary s_pg.put("\\bGLOBAL TEMPORARY\\b", "TEMPORARY"); diff --git a/dbPort/src/org/compiere/dbPort/Convert_PostgreSQLTest.java b/dbPort/src/org/compiere/dbPort/Convert_PostgreSQLTest.java index 886e6b06a0..45efb780c0 100644 --- a/dbPort/src/org/compiere/dbPort/Convert_PostgreSQLTest.java +++ b/dbPort/src/org/compiere/dbPort/Convert_PostgreSQLTest.java @@ -31,7 +31,7 @@ public final class Convert_PostgreSQLTest { // Line 407 of ImportProduct.java sql = "ALTER TABLE LPI_Publication MODIFY AD_Client_ID NUMERIC(10) DEFAULT NULL"; - sqe = "ALTER TABLE LPI_Publication MODIFY COLUMN AD_Client_ID TYPE NUMERIC(10); ALTER TABLE LPI_Publication ALTER COLUMN AD_Client_ID SET DEFAULT 'NULL'; "; + sqe = "ALTER TABLE LPI_Publication ALTER COLUMN AD_Client_ID TYPE NUMERIC(10); ALTER TABLE LPI_Publication ALTER COLUMN AD_Client_ID SET DEFAULT NULL; "; r = convert.convert(sql); verify(sql, r, sqe);