From ac94565b3b97bf329acc8561a7ad14e0f827180e Mon Sep 17 00:00:00 2001 From: Deepak Pansheriya Date: Mon, 6 Jan 2020 22:27:57 +0530 Subject: [PATCH 1/2] IDEMPIERE-4142: Info window do no show any records if there is virtual column of type Search, Table direct or list (#7) --- .../webui/panel/InfoGeneralPanel.java | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoGeneralPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoGeneralPanel.java index 60280942b4..f9bc142498 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoGeneralPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoGeneralPanel.java @@ -38,6 +38,7 @@ import org.adempiere.webui.window.FDialog; import org.compiere.minigrid.ColumnInfo; import org.compiere.minigrid.IDColumn; import org.compiere.model.I_C_ElementValue; +import org.compiere.model.MColumn; import org.compiere.model.MLookupFactory; import org.compiere.model.MTable; import org.compiere.util.DB; @@ -513,9 +514,9 @@ public class InfoGeneralPanel extends InfoPanel implements EventListener list.add(new ColumnInfo(Msg.translate(Env.getCtx(), columnName), colSql.toString(), colClass)); if (log.isLoggable(Level.FINEST)) log.finest("Added Column=" + columnName); } - else if (DisplayType.isLookup(displayType)) + else if (isDisplayed && DisplayType.isLookup(displayType)) { - ColumnInfo colInfo = createLookupColumnInfo(Msg.translate(Env.getCtx(), columnName), columnName, displayType, AD_Reference_Value_ID, AD_Column_ID); + ColumnInfo colInfo = createLookupColumnInfo(Msg.translate(Env.getCtx(), columnName), columnName, displayType, AD_Reference_Value_ID, AD_Column_ID, colSql.toString()); if (colInfo != null) { list.add(colInfo); @@ -630,18 +631,25 @@ public class InfoGeneralPanel extends InfoPanel implements EventListener } } - protected ColumnInfo createLookupColumnInfo(String name, String columnName, int AD_Reference_ID, int AD_Reference_Value_ID, int AD_Column_ID) { + protected ColumnInfo createLookupColumnInfo(String name, String columnName, int AD_Reference_ID, int AD_Reference_Value_ID, int AD_Column_ID, String columnSql) { // MLookupInfo lookupInfo = MLookupFactory.getLookupInfo(Env.getCtx(), p_WindowNo, AD_Column_ID, AD_Reference_ID, Env.getLanguage(Env.getCtx()), columnName, // AD_Reference_Value_ID, false, null); // String displayColumn = lookupInfo.DisplayColumn; // String keyColumn = lookupInfo.KeyColumn; + + MTable table = MTable.get(Env.getCtx(), p_tableName); + MColumn column = table.getColumn(columnName); + String baseColumn = column.isVirtualColumn() ? columnSql : columnName; String embedded = AD_Reference_Value_ID > 0 ? MLookupFactory.getLookup_TableEmbed(Env.getLanguage(Env.getCtx()), columnName, p_tableName, AD_Reference_Value_ID) - : MLookupFactory.getLookup_TableDirEmbed(Env.getLanguage(Env.getCtx()), columnName, p_tableName); + : MLookupFactory.getLookup_TableDirEmbed(Env.getLanguage(Env.getCtx()), columnName, p_tableName, baseColumn); embedded = "(" + embedded + ")"; + if (embedded.contains("@")) + embedded = "NULL"; + ColumnInfo columnInfo = null; - if (columnName.endsWith("_ID")) + if (columnName.endsWith("_ID") && !column.isVirtualColumn()) columnInfo = new ColumnInfo(name, embedded, KeyNamePair.class, p_tableName+"."+columnName); else columnInfo = new ColumnInfo(name, embedded, String.class, null); From 0d239fbacf88d88b38022f37013fb742fc075232 Mon Sep 17 00:00:00 2001 From: Deepak Pansheriya Date: Wed, 8 Jan 2020 17:54:56 +0530 Subject: [PATCH 2/2] IDEMPIERE-3388: Manual posting for reversed invoice throwing posting error (#8) --- org.adempiere.base/src/org/compiere/model/MMatchInv.java | 1 + 1 file changed, 1 insertion(+) diff --git a/org.adempiere.base/src/org/compiere/model/MMatchInv.java b/org.adempiere.base/src/org/compiere/model/MMatchInv.java index d1ee2ed0c6..f73101924b 100644 --- a/org.adempiere.base/src/org/compiere/model/MMatchInv.java +++ b/org.adempiere.base/src/org/compiere/model/MMatchInv.java @@ -129,6 +129,7 @@ public class MMatchInv extends X_M_MatchInv +" WHERE M_MatchInv.C_InvoiceLine_ID=il.C_InvoiceLine_ID AND il.C_Invoice_ID=?)"; List list = new Query(ctx, I_M_MatchInv.Table_Name, whereClause, trxName) .setParameters(C_Invoice_ID) + .setOrderBy(COLUMNNAME_ProcessedOn) .list(); return list.toArray (new MMatchInv[list.size()]); } // getInvoice