From ce0c6197eaa0675db6071950978ecf9c0605693e Mon Sep 17 00:00:00 2001 From: hieplq Date: Wed, 11 Mar 2020 13:28:46 +0700 Subject: [PATCH 1/5] IDEMPIERE-4204:update.sh fail after run for one reposiotry for 3 time --- org.idempiere.equinox.p2.director-feature/update-prd.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/org.idempiere.equinox.p2.director-feature/update-prd.sh b/org.idempiere.equinox.p2.director-feature/update-prd.sh index a8aa4e76b5..8ea34aacaf 100644 --- a/org.idempiere.equinox.p2.director-feature/update-prd.sh +++ b/org.idempiere.equinox.p2.director-feature/update-prd.sh @@ -5,5 +5,5 @@ cd $(dirname "${0}") DESTINATION=$(pwd) VMOPTS="-Dorg.eclipse.ecf.provider.filetransfer.excludeContributors=org.eclipse.ecf.provider.filetransfer.httpclient4 -Djava.net.preferIPv4Stack=true" -java $VMOPTS -jar plugins/org.eclipse.equinox.launcher_1.*.jar -install director -configuration director/configuration -application org.eclipse.equinox.p2.director -consoleLog -profileProperties org.eclipse.update.install.features=true -destination $DESTINATION -repository $1 -u $2 -java $VMOPTS -jar plugins/org.eclipse.equinox.launcher_1.*.jar -install director -configuration director/configuration -application org.eclipse.equinox.p2.director -consoleLog -profileProperties org.eclipse.update.install.features=true -destination $DESTINATION -repository $1 -i $2 \ No newline at end of file +java $VMOPTS -jar plugins/org.eclipse.equinox.launcher_1.*.jar -install director -profile DefaultProfile -configuration director/configuration -application org.eclipse.equinox.p2.director -consoleLog -profileProperties org.eclipse.update.install.features=true -destination $DESTINATION -repository $1 -u $2 +java $VMOPTS -jar plugins/org.eclipse.equinox.launcher_1.*.jar -install director -profile DefaultProfile -configuration director/configuration -application org.eclipse.equinox.p2.director -consoleLog -profileProperties org.eclipse.update.install.features=true -destination $DESTINATION -repository $1 -i $2 \ No newline at end of file From 8737d8a9ea351ff97d1e7999a6b9693ccaa146eb Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Thu, 12 Mar 2020 13:16:42 +0100 Subject: [PATCH 2/5] IDEMPIERE-4204:update.sh fail after run for one reposiotry for 3 time / apply same patch for windows .bat --- org.idempiere.equinox.p2.director-feature/update-prd.bat | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/org.idempiere.equinox.p2.director-feature/update-prd.bat b/org.idempiere.equinox.p2.director-feature/update-prd.bat index dfdcffea4c..0feca56ba7 100644 --- a/org.idempiere.equinox.p2.director-feature/update-prd.bat +++ b/org.idempiere.equinox.p2.director-feature/update-prd.bat @@ -11,5 +11,5 @@ cd %~dp0 @FOR %%c in (plugins\org.eclipse.equinox.launcher_1.*.jar) DO set JARFILE=%%c @echo JARFILE = %JARFILE% -java -Dorg.eclipse.ecf.provider.filetransfer.excludeContributors=org.eclipse.ecf.provider.filetransfer.httpclient4 -Djava.net.preferIPv4Stack=true -jar %JARFILE% -install director -configuration director/configuration -application org.eclipse.equinox.p2.director -consoleLog -profileProperties org.eclipse.update.install.features=true -destination %DESTINATION% -repository %REPO% -u %PACK% -java -Dorg.eclipse.ecf.provider.filetransfer.excludeContributors=org.eclipse.ecf.provider.filetransfer.httpclient4 -Djava.net.preferIPv4Stack=true -jar %JARFILE% -install director -configuration director/configuration -application org.eclipse.equinox.p2.director -consoleLog -profileProperties org.eclipse.update.install.features=true -destination %DESTINATION% -repository %REPO% -i %PACK% +java -Dorg.eclipse.ecf.provider.filetransfer.excludeContributors=org.eclipse.ecf.provider.filetransfer.httpclient4 -Djava.net.preferIPv4Stack=true -jar %JARFILE% -install director -profile DefaultProfile -configuration director/configuration -application org.eclipse.equinox.p2.director -consoleLog -profileProperties org.eclipse.update.install.features=true -destination %DESTINATION% -repository %REPO% -u %PACK% +java -Dorg.eclipse.ecf.provider.filetransfer.excludeContributors=org.eclipse.ecf.provider.filetransfer.httpclient4 -Djava.net.preferIPv4Stack=true -jar %JARFILE% -install director -profile DefaultProfile -configuration director/configuration -application org.eclipse.equinox.p2.director -consoleLog -profileProperties org.eclipse.update.install.features=true -destination %DESTINATION% -repository %REPO% -i %PACK% From a1a0aad1253afb9e908081403bf6f04d47c75449 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Fri, 13 Mar 2020 13:37:45 +0100 Subject: [PATCH 3/5] IDEMPIERE-3862 ORACLE - Update datatype NVARCHAR2 and CHAR(>1) to VARCHAR2 Fix Column Encryption broken in oracle - it was changing the column to NVARCHAR - modified to preserve the type, and fixed an error when encrypting columns from AD_Client --- .../compiere/process/ColumnEncryption.java | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/org.adempiere.base.process/src/org/compiere/process/ColumnEncryption.java b/org.adempiere.base.process/src/org/compiere/process/ColumnEncryption.java index fefb3c228b..fe688a8d93 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ColumnEncryption.java +++ b/org.adempiere.base.process/src/org/compiere/process/ColumnEncryption.java @@ -26,10 +26,12 @@ package org.compiere.process; import java.sql.Connection; +import java.sql.DatabaseMetaData; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.util.logging.Level; +import org.compiere.db.AdempiereDatabase; import org.compiere.model.MColumn; import org.compiere.model.MTable; import org.compiere.util.AdempiereUserError; @@ -308,7 +310,7 @@ public class ColumnEncryption extends SvrProcess { StringBuilder selectSql = new StringBuilder(); selectSql.append("SELECT ").append(idColumnName).append(",").append(columnName).append(",AD_Client_ID"); selectSql.append(" FROM ").append(tableName); - selectSql.append(" ORDER BY ").append(idColumnName); + selectSql.append(" ORDER BY 1"); StringBuilder updateSql = new StringBuilder(); updateSql.append("UPDATE ").append(tableName); @@ -464,11 +466,29 @@ public class ColumnEncryption extends SvrProcess { // Select SQL String selectSql = "SELECT FieldLength FROM AD_Column WHERE AD_Column_ID=?"; + String dataType = "NVARCHAR2"; + if (DB.isOracle()) { + Connection conn = Trx.get(get_TrxName(), false).getConnection(); + AdempiereDatabase db = DB.getDatabase(); + DatabaseMetaData md = conn.getMetaData(); + String catalog = db.getCatalog(); + String schema = db.getSchema(); + ResultSet rs = null; + try { + rs = md.getColumns(catalog, schema, tableName.toUpperCase(), columnName.toUpperCase()); + if (rs.next()) { + dataType = rs.getString ("TYPE_NAME"); + } + } finally { + DB.close(rs); + } + } + // Alter SQL StringBuilder alterSql = new StringBuilder(); alterSql.append("ALTER TABLE ").append(tableName); alterSql.append(" MODIFY ").append(columnName); - alterSql.append(" NVARCHAR2("); + alterSql.append(" ").append(dataType).append("("); alterSql.append(length).append(") "); // Update SQL From d2399416662a5759fc81e78c27c0a60db23f95d8 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Fri, 13 Mar 2020 14:49:10 +0100 Subject: [PATCH 4/5] Fixes for IDEMPIERE-674 and IDEMPIERE-4032 IDEMPIERE-674 Financial Report: Percentage of column against line total IDEMPIERE-4032 Financial Report Translation (lines & column) --- .../src/org/compiere/report/FinReport.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/report/FinReport.java b/org.adempiere.base/src/org/compiere/report/FinReport.java index a45a9e4374..1695c61b2f 100644 --- a/org.adempiere.base/src/org/compiere/report/FinReport.java +++ b/org.adempiere.base/src/org/compiere/report/FinReport.java @@ -313,12 +313,12 @@ public class FinReport extends SvrProcess int PA_ReportLineSet_ID = m_report.getLineSet().getPA_ReportLineSet_ID(); StringBuffer sql = new StringBuffer ("INSERT INTO T_Report " + "(AD_PInstance_ID, PA_ReportLine_ID, Record_ID,Fact_Acct_ID, SeqNo,LevelNo, Name,Description) " - + "SELECT ").append(getAD_PInstance_ID()).append(", rl.PA_ReportLine_ID, 0,0, rl.SeqNo,0, COALESCE(trl.Name, rl.Name) as Name, COALESCE(trl.Description,rl.Description) as Description " + + "SELECT ").append(getAD_PInstance_ID()).append(", rl.PA_ReportLine_ID, 0,0, rl.SeqNo,0, NVL(trl.Name, rl.Name) as Name, NVL(trl.Description,rl.Description) as Description " + "FROM PA_ReportLine rl " + "LEFT JOIN PA_ReportLine_Trl trl ON trl.PA_ReportLine_ID = rl.PA_ReportLine_ID AND trl.AD_Language = '" + Env.getAD_Language(Env.getCtx()) + "' " + "WHERE rl.IsActive='Y' AND rl.PA_ReportLineSet_ID=").append(PA_ReportLineSet_ID); - int no = DB.executeUpdate(sql.toString(), get_TrxName()); + int no = DB.executeUpdateEx(sql.toString(), get_TrxName()); if (log.isLoggable(Level.FINE)) log.fine("Report Lines = " + no); // ** Get Data ** Segment Values @@ -890,10 +890,10 @@ public class FinReport extends SvrProcess continue; String colsql = "SELECT a." + oper2col + " FROM T_Report a " + " INNER JOIN PA_ReportLine b ON a.PA_ReportLine_ID = b.PA_ReportLine_ID " + - " LEFT JOIN PA_ReportLine trlb ON trlb.PA_ReportLine_ID = b.PA_ReportLine_ID AND trlb.AD_Language = '" + Env.getLanguage(Env.getCtx()) + "' " + + " LEFT JOIN PA_ReportLine_Trl trlb ON trlb.PA_ReportLine_ID = b.PA_ReportLine_ID AND trlb.AD_Language = ? " + " WHERE a.AD_PInstance_ID = " + getAD_PInstance_ID() + - " AND COALESCE(trlb.Name, b.Name) = ?"; - BigDecimal value2 = DB.getSQLValueBD(get_TrxName(), colsql, oper2Line); + " AND (trlb.Name = ? OR b.Name = ?)"; + BigDecimal value2 = DB.getSQLValueBDEx(get_TrxName(), colsql, Env.getAD_Language(Env.getCtx()), oper2Line, oper2Line); if (value2 != null && value2.signum() != 0) oper2 = value2.toPlainString(); @@ -997,16 +997,16 @@ public class FinReport extends SvrProcess boolean lteq = true; //less than or equal to String seqsql = "SELECT b.seqNo FROM T_Report a " + " INNER JOIN PA_ReportLine b ON a.PA_ReportLine_ID = b.PA_ReportLine_ID " + - " LEFT JOIN PA_ReportLine trlb ON trlb.PA_ReportLine_ID = b.PA_ReportLine_ID AND trlb.AD_Language = '" + Env.getLanguage(Env.getCtx()) + "' " + + " LEFT JOIN PA_ReportLine_Trl trlb ON trlb.PA_ReportLine_ID = b.PA_ReportLine_ID AND trlb.AD_Language = ? " + " WHERE a.AD_PInstance_ID = " + getAD_PInstance_ID() + - " AND COALESCE(trlb.Name,b.Name) = ?"; + " AND (trlb.Name = ? OR b.Name = ?)"; int seqNo = -1; try { seqNo = Integer.parseInt(multi[0].trim()); } catch (Exception e) {} if (seqNo == -1) { - seqNo = DB.getSQLValue(get_TrxName(), seqsql, multi[0].trim()); + seqNo = DB.getSQLValueEx(get_TrxName(), seqsql, Env.getAD_Language(Env.getCtx()), multi[0].trim(), multi[0].trim()); } if (seqNo < 0) continue; @@ -1030,7 +1030,7 @@ public class FinReport extends SvrProcess } catch (Exception e) {} if (seqNo == -1) { - seqNo = DB.getSQLValue(get_TrxName(), seqsql, multi[i].trim()); + seqNo = DB.getSQLValueEx(get_TrxName(), seqsql, Env.getAD_Language(Env.getCtx()), multi[i].trim(), multi[i].trim()); } if (seqNo < 0) continue; From aecd058f25bf498b9cdff3b0961f6e3f369ad752 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Fri, 13 Mar 2020 15:18:44 +0100 Subject: [PATCH 5/5] IDEMPIERE-4198 Icon duplicated on report dialog when using Font icon --- .../adempiere/webui/apps/ProcessDialog.java | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/ProcessDialog.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/ProcessDialog.java index 281f85a737..3cb0b98746 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/ProcessDialog.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/ProcessDialog.java @@ -341,13 +341,20 @@ public class ProcessDialog extends AbstractProcessDialog implements EventListene appendRecordLogInfo(pi.getLogs(), infoResultContent); bOK.setLabel(Msg.getMsg(Env.getCtx(), "Parameter")); - bOK.setImage(ThemeManager.getThemeResource("images/Reset16.png")); bOK.setDisabled(false); bCancel.setLabel(Msg.getMsg(Env.getCtx(), "Close")); - bCancel.setImage(ThemeManager.getThemeResource("images/Cancel16.png")); bCancel.setDisabled(false); + if (ThemeManager.isUseFontIconForImage()) { + String iconSclass = "z-icon-Reset"; + bOK.setIconSclass(iconSclass); + LayoutUtils.addSclass("font-icon-toolbar-button", bOK); + } else { + bOK.setImage(ThemeManager.getThemeResource("images/Reset16.png")); + bCancel.setImage(ThemeManager.getThemeResource("images/Cancel16.png")); + } + isParameterPage = false; m_ids = pi.getIDs(); @@ -458,10 +465,17 @@ public class ProcessDialog extends AbstractProcessDialog implements EventListene isParameterPage = true; bOK.setLabel(Msg.getMsg(Env.getCtx(), "Start")); - bOK.setImage(ThemeManager.getThemeResource("images/Ok16.png")); bCancel.setLabel(Util.cleanAmp(Msg.translate(Env.getCtx(), ConfirmPanel.A_CANCEL))); - bCancel.setImage(ThemeManager.getThemeResource("images/Cancel16.png")); + + if (ThemeManager.isUseFontIconForImage()) { + String iconSclass = "z-icon-Ok"; + bOK.setIconSclass(iconSclass); + LayoutUtils.addSclass("font-icon-toolbar-button", bOK); + } else { + bOK.setImage(ThemeManager.getThemeResource("images/Ok16.png")); + bCancel.setImage(ThemeManager.getThemeResource("images/Cancel16.png")); + } //recreate process info ProcessInfo m_pi = new WProcessInfo(getName(), getAD_Process_ID());