From a577c1a343de7fbd9e9309b0f3d7cc2cf119eab6 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Tue, 6 Aug 2024 11:13:43 +0200 Subject: [PATCH] IDEMPIERE-6206 Shortcut for Payment not working with there are different windows for Receipt/Payment (#2432) * IDEMPIERE-6206 Shortcut for Payment not working with there are different windows for Receipt/Payment * - remove unnecessary commented code --- .../webui/apps/DocumentSearchController.java | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/DocumentSearchController.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/DocumentSearchController.java index 6cc82161fa..6dd12f4afc 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/DocumentSearchController.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/DocumentSearchController.java @@ -29,6 +29,7 @@ import org.compiere.model.MColumn; import org.compiere.model.MLookup; import org.compiere.model.MLookupFactory; import org.compiere.model.MLookupInfo; +import org.compiere.model.MPayment; import org.compiere.model.MQuery; import org.compiere.model.MRole; import org.compiere.model.MSearchDefinition; @@ -282,14 +283,27 @@ public class DocumentSearchController implements EventListener{ if (sql != null) { if (powindow != null) { - if (window != null) { - doRetrieval(msd, sql, params, lookup, window, table.getTableName(), " AND IsSOTrx='Y' ", list); + String whereCol = null; + if (table.columnExistsInDictionary("IsSOTrx")) { + whereCol = " AND IsSOTrx="; + } else { + if (MPayment.Table_Name.equals(table.getTableName())) { + whereCol = " AND IsReceipt="; + } + } + if (whereCol == null) { + doRetrieval(msd, sql, params, lookup, powindow, table.getTableName(), null, list); + } else { + if (window != null) { + String soWhereTrx = whereCol + "'Y' "; + doRetrieval(msd, sql, params, lookup, window, table.getTableName(), soWhereTrx, list); + } + String poWhereTrx = whereCol + "'N' "; + doRetrieval(msd, sql, params, lookup, powindow, table.getTableName(), poWhereTrx, list); } - doRetrieval(msd, sql, params, lookup, powindow, table.getTableName(), " AND IsSOTrx='N' ", list); } else if (window != null) { doRetrieval(msd, sql, params, lookup, window, table.getTableName(), null, list); } - } } return list;