From 0a779db755325c6dbf51ac07519d3642dcd36776 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Sat, 17 Feb 2024 12:17:35 +0100 Subject: [PATCH] IDEMPIERE-5790 Improve Report Refresh functionality (#2246) --- org.adempiere.base/src/org/compiere/report/FinReport.java | 4 +++- .../src/org/adempiere/webui/window/ZkReportViewer.java | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/report/FinReport.java b/org.adempiere.base/src/org/compiere/report/FinReport.java index bb0c9ab0dc..2440eb1cd1 100644 --- a/org.adempiere.base/src/org/compiere/report/FinReport.java +++ b/org.adempiere.base/src/org/compiere/report/FinReport.java @@ -267,8 +267,10 @@ public class FinReport extends SvrProcess FinReportPeriod frp = new FinReportPeriod (rs.getInt(1), rs.getString(2), rs.getTimestamp(3), rs.getTimestamp(4), rs.getTimestamp(5)); list.add(frp); - if (p_C_Period_ID == 0 && frp.inPeriod(today)) + if (p_C_Period_ID == 0 && frp.inPeriod(today)) { p_C_Period_ID = frp.getC_Period_ID(); + break; + } } } catch (Exception e) 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 b42a68c770..eddf6bd277 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 @@ -1615,7 +1615,7 @@ public class ZkReportViewer extends Window implements EventListener, IRep */ private void cmd_refresh() { int AD_Process_ID = m_reportEngine.getPrintInfo() != null ? m_reportEngine.getPrintInfo().getAD_Process_ID() : 0; - if(AD_Process_ID <= 0) + if(AD_Process_ID <= 0 || m_reportEngine.getPrintInfo().getRecord_ID() > 0) this.cmd_report(); else this.cmd_reRun(MProcess.SHOWHELP_RunSilently_TakeDefaults);