From c6b0e769d0972c9b0c07f00c0927a36d6f4a2693 Mon Sep 17 00:00:00 2001 From: hieplq Date: Wed, 28 May 2014 00:29:49 +0700 Subject: [PATCH] IDEMPIERE-1878:Printformat name in login language --- org.adempiere.base/src/org/compiere/print/MPrintFormat.java | 3 ++- .../src/org/adempiere/webui/window/ZkReportViewer.java | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/print/MPrintFormat.java b/org.adempiere.base/src/org/compiere/print/MPrintFormat.java index bff499bbdd..27e1569d13 100644 --- a/org.adempiere.base/src/org/compiere/print/MPrintFormat.java +++ b/org.adempiere.base/src/org/compiere/print/MPrintFormat.java @@ -1166,7 +1166,6 @@ public class MPrintFormat extends X_AD_PrintFormat String sqlWhere = " WHERE AD_Table_ID=? AND IsTableBased='Y' "; if (AD_Window_ID > 0) sqlWhere += "AND (AD_Window_ID=? OR AD_Window_ID IS NULL) "; - sqlWhere = sqlWhere + "ORDER BY AD_Client_ID DESC, IsDefault DESC, Name"; // Own First // sqlWhere = MRole.getDefault().addAccessSQL ( sqlWhere, "AD_PrintFormat", MRole.SQL_NOTQUALIFIED, MRole.SQL_RO); @@ -1186,6 +1185,8 @@ public class MPrintFormat extends X_AD_PrintFormat query.setParameters(lsParameter); + query.setOrderBy(" ORDER BY AD_Client_ID DESC, IsDefault DESC, Name "); + // query print fomart just in this client List lsPrintFormat = query.setClient_ID().list(); MPrintFormat newPrintFormat = null; diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/ZkReportViewer.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/ZkReportViewer.java index af0e7c703d..a47dcced8c 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/ZkReportViewer.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/ZkReportViewer.java @@ -598,7 +598,7 @@ public class ZkReportViewer extends Window implements EventListener, ITab // fill Report Options String sql = MRole.getDefault().addAccessSQL( - "SELECT AD_PrintFormat_ID, Name, Description " + "SELECT * " + "FROM AD_PrintFormat " + "WHERE AD_Table_ID=? " //Added Lines by Armen @@ -619,7 +619,9 @@ public class ZkReportViewer extends Window implements EventListener, ITab rs = pstmt.executeQuery(); while (rs.next()) { - KeyNamePair pp = new KeyNamePair(rs.getInt(1), rs.getString(2)); + MPrintFormat printFormat = new MPrintFormat (Env.getCtx(), rs, null); + + KeyNamePair pp = new KeyNamePair(printFormat.get_ID(), printFormat.get_Translation(MPrintFormat.COLUMNNAME_Name)); Listitem li = comboReport.appendItem(pp.getName(), pp.getKey()); if (rs.getInt(1) == AD_PrintFormat_ID) {