IDEMPIERE-4721 : Financial Report : exclude all adjustment periods - … (#904)

* 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 <carg67@gmail.com>

Co-authored-by: Carlos Ruiz <carg67@gmail.com>
This commit is contained in:
Nicolas Micoud 2021-10-07 10:53:43 +02:00 committed by GitHub
parent 222837abb4
commit 631e25b599
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 6 deletions

View File

@ -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);