From 631e25b599c74d481484ff62384b2e0d0c23bcbb Mon Sep 17 00:00:00 2001 From: Nicolas Micoud <58596990+nmicoud@users.noreply.github.com> Date: Thu, 7 Oct 2021 10:53:43 +0200 Subject: [PATCH] =?UTF-8?q?IDEMPIERE-4721=20:=20Financial=20Report=20:=20e?= =?UTF-8?q?xclude=20all=20adjustment=20periods=20-=20=E2=80=A6=20(#904)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * IDEMPIERE-4721 : Financial Report : exclude all adjustment periods - fix NPE reported by @CarlosRuiz-globalqss ; see https://idempiere.atlassian.net/browse/IDEMPIERE-4721?focusedCommentId=47539 * IDEMPIERE-4721 : Financial Report : exclude all adjustment periods - fix NPE Using Carlos's suggestion Co-Authored-By: Carlos Ruiz Co-authored-by: Carlos Ruiz --- .../src/org/compiere/report/FinReport.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/report/FinReport.java b/org.adempiere.base/src/org/compiere/report/FinReport.java index d290f7e1bc..5771384624 100644 --- a/org.adempiere.base/src/org/compiere/report/FinReport.java +++ b/org.adempiere.base/src/org/compiere/report/FinReport.java @@ -196,6 +196,9 @@ public class FinReport extends SvrProcess m_report = new MReport (getCtx(), getRecord_ID(), null); sb.append(" - ").append(m_report); + setPeriods(); + sb.append(" - C_Period_ID=").append(p_C_Period_ID).append(" - ").append(m_parameterWhere); + // Exclude adjustment period(s) ? if (m_report.getExcludeAdjustmentPeriods().equals(MReport.EXCLUDEADJUSTMENTPERIODS_OnlyReportPeriod)) { // if the report period is standard and there is an adjustment period with the same end date (on the same year) MPeriod per = MPeriod.get(getCtx(), p_C_Period_ID); @@ -214,12 +217,6 @@ public class FinReport extends SvrProcess .append(m_report.getC_Calendar_ID()).append(" AND PeriodType = 'A') AND ").toString(); } - // - setPeriods(); - sb.append(" - C_Period_ID=").append(p_C_Period_ID) - .append(" - ").append(m_parameterWhere); - // - if ( p_PA_ReportCube_ID > 0) m_parameterWhere.append(" AND PA_ReportCube_ID=").append(p_PA_ReportCube_ID);