From e0a8637880d4abaedc75e1c263919ade538986cc Mon Sep 17 00:00:00 2001 From: Nicolas Micoud <58596990+nmicoud@users.noreply.github.com> Date: Wed, 15 Sep 2021 14:29:11 +0200 Subject: [PATCH] IDEMPIERE-4721 : Financial Report : exclude all adjustement periods (#872) * IDEMPIERE-4721 : Financial Report : exclude all adjustement periods * Change warning to info Co-authored-by: Carlos Ruiz --- .../oracle/202109111530_IDEMPIERE-4721.sql | 74 +++++++++++++++++++ .../202109111530_IDEMPIERE-4721.sql | 71 ++++++++++++++++++ .../src/org/compiere/model/I_PA_Report.java | 9 +++ .../src/org/compiere/model/X_PA_Report.java | 25 ++++++- .../src/org/compiere/report/FinReport.java | 15 ++-- 5 files changed, 186 insertions(+), 8 deletions(-) create mode 100644 migration/i8.2/oracle/202109111530_IDEMPIERE-4721.sql create mode 100644 migration/i8.2/postgresql/202109111530_IDEMPIERE-4721.sql diff --git a/migration/i8.2/oracle/202109111530_IDEMPIERE-4721.sql b/migration/i8.2/oracle/202109111530_IDEMPIERE-4721.sql new file mode 100644 index 0000000000..d8491607f0 --- /dev/null +++ b/migration/i8.2/oracle/202109111530_IDEMPIERE-4721.sql @@ -0,0 +1,74 @@ +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- IDEMPIERE-4721 +-- Sep 10, 2021, 3:34:07 PM CEST +INSERT INTO AD_Element (AD_Element_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,ColumnName,Name,PrintName,EntityType,AD_Element_UU) VALUES (203533,0,0,'Y',TO_DATE('2021-09-10 15:34:07','YYYY-MM-DD HH24:MI:SS'),0,TO_DATE('2021-09-10 15:34:07','YYYY-MM-DD HH24:MI:SS'),0,'ExcludeAdjustmentPeriods','Exclude Adjustment Periods','Exclude Adjustment Periods','D','67a3ab9c-51ab-4afd-b6d3-80294dafa526') +; + +-- Sep 10, 2021, 3:34:51 PM CEST +INSERT INTO AD_Reference (AD_Reference_ID,Name,ValidationType,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,EntityType,IsOrderByValue,AD_Reference_UU) VALUES (200198,'FinReport ExcludeAdjustmentPeriods','L',0,0,'Y',TO_DATE('2021-09-10 15:34:50','YYYY-MM-DD HH24:MI:SS'),0,TO_DATE('2021-09-10 15:34:50','YYYY-MM-DD HH24:MI:SS'),0,'D','Y','9a34172f-5f27-4819-84cc-7de43853e8c8') +; + +-- Sep 10, 2021, 3:35:00 PM CEST +INSERT INTO AD_Ref_List (AD_Ref_List_ID,Name,AD_Reference_ID,Value,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,EntityType,AD_Ref_List_UU) VALUES (200516,'No',200198,'0',0,0,'Y',TO_DATE('2021-09-10 15:35:00','YYYY-MM-DD HH24:MI:SS'),0,TO_DATE('2021-09-10 15:35:00','YYYY-MM-DD HH24:MI:SS'),0,'D','f04dfda3-2f17-4d27-83d2-696941a8a181') +; + +-- Sep 10, 2021, 3:35:07 PM CEST +INSERT INTO AD_Ref_List (AD_Ref_List_ID,Name,AD_Reference_ID,Value,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,EntityType,AD_Ref_List_UU) VALUES (200517,'Only Report Period',200198,'1',0,0,'Y',TO_DATE('2021-09-10 15:35:07','YYYY-MM-DD HH24:MI:SS'),0,TO_DATE('2021-09-10 15:35:07','YYYY-MM-DD HH24:MI:SS'),0,'D','540fdd4a-4c09-46ee-b1b1-92c6b79c2f76') +; + +-- Sep 10, 2021, 3:35:16 PM CEST +INSERT INTO AD_Ref_List (AD_Ref_List_ID,Name,AD_Reference_ID,Value,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,EntityType,AD_Ref_List_UU) VALUES (200518,'All Adjustment Periods',200198,'2',0,0,'Y',TO_DATE('2021-09-10 15:35:16','YYYY-MM-DD HH24:MI:SS'),0,TO_DATE('2021-09-10 15:35:16','YYYY-MM-DD HH24:MI:SS'),0,'D','3b897a74-e4c7-4832-87ee-936bf71cf182') +; + +-- Sep 10, 2021, 3:35:35 PM CEST +INSERT INTO AD_Column (AD_Column_ID,Version,Name,AD_Table_ID,ColumnName,DefaultValue,FieldLength,IsKey,IsParent,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsEncrypted,AD_Reference_ID,AD_Reference_Value_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Element_ID,IsUpdateable,IsSelectionColumn,EntityType,IsSyncDatabase,IsAlwaysUpdateable,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsAllowCopy,SeqNoSelection,IsToolbarButton,IsSecure,FKConstraintType,IsHtml) VALUES (214585,0,'Exclude Adjustment Periods',445,'ExcludeAdjustmentPeriods','1',1,'N','N','Y','N','N',0,'N',17,200198,0,0,'Y',TO_DATE('2021-09-10 15:35:35','YYYY-MM-DD HH24:MI:SS'),0,TO_DATE('2021-09-10 15:35:35','YYYY-MM-DD HH24:MI:SS'),0,203533,'Y','N','D','N','N','N','Y','754c9256-e9c0-4096-99f2-a9cb4f4cec44','Y',0,'N','N','N','N') +; + +-- Sep 10, 2021, 3:35:38 PM CEST +ALTER TABLE PA_Report ADD ExcludeAdjustmentPeriods CHAR(1) DEFAULT '1' NOT NULL +; + +-- Sep 10, 2021, 3:35:48 PM CEST +INSERT INTO AD_Field (AD_Field_ID,Name,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,ColumnSpan) VALUES (206747,'Exclude Adjustment Periods',372,214585,'Y',1,180,'N','N','N','N',0,0,'Y',TO_DATE('2021-09-10 15:35:48','YYYY-MM-DD HH24:MI:SS'),0,TO_DATE('2021-09-10 15:35:48','YYYY-MM-DD HH24:MI:SS'),0,'N','Y','D','7b4bcc01-71e2-4840-809e-5399e35f754e','Y',170,2) +; + +-- Sep 10, 2021, 3:36:10 PM CEST +UPDATE AD_Field SET IsDisplayed='Y', SeqNo=110, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, XPosition=4, IsToolbarButton=NULL,Updated=TO_DATE('2021-09-10 15:36:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=206747 +; + +-- Sep 10, 2021, 3:36:10 PM CEST +UPDATE AD_Field SET SeqNo=120, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2021-09-10 15:36:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=54234 +; + +-- Sep 10, 2021, 3:36:10 PM CEST +UPDATE AD_Field SET SeqNo=130, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2021-09-10 15:36:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=6268 +; + +-- Sep 10, 2021, 3:36:10 PM CEST +UPDATE AD_Field SET SeqNo=140, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2021-09-10 15:36:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=6267 +; + +-- Sep 10, 2021, 3:36:10 PM CEST +UPDATE AD_Field SET SeqNo=150, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2021-09-10 15:36:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=201867 +; + +-- Sep 10, 2021, 3:36:10 PM CEST +UPDATE AD_Field SET SeqNo=160, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2021-09-10 15:36:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=4737 +; + +-- Sep 10, 2021, 3:36:10 PM CEST +UPDATE AD_Field SET SeqNo=170, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2021-09-10 15:36:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=6265 +; + +-- Sep 10, 2021, 3:36:10 PM CEST +UPDATE AD_Field SET SeqNo=180, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2021-09-10 15:36:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=54235 +; + +-- Sep 10, 2021, 3:36:10 PM CEST +UPDATE AD_Field SET SeqNo=0, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2021-09-10 15:36:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=204992 +; + +SELECT register_migration_script('202109111530_IDEMPIERE-4721.sql') FROM dual +; diff --git a/migration/i8.2/postgresql/202109111530_IDEMPIERE-4721.sql b/migration/i8.2/postgresql/202109111530_IDEMPIERE-4721.sql new file mode 100644 index 0000000000..29d1b90802 --- /dev/null +++ b/migration/i8.2/postgresql/202109111530_IDEMPIERE-4721.sql @@ -0,0 +1,71 @@ +-- IDEMPIERE-4721 +-- Sep 10, 2021, 3:34:07 PM CEST +INSERT INTO AD_Element (AD_Element_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,ColumnName,Name,PrintName,EntityType,AD_Element_UU) VALUES (203533,0,0,'Y',TO_TIMESTAMP('2021-09-10 15:34:07','YYYY-MM-DD HH24:MI:SS'),0,TO_TIMESTAMP('2021-09-10 15:34:07','YYYY-MM-DD HH24:MI:SS'),0,'ExcludeAdjustmentPeriods','Exclude Adjustment Periods','Exclude Adjustment Periods','D','67a3ab9c-51ab-4afd-b6d3-80294dafa526') +; + +-- Sep 10, 2021, 3:34:51 PM CEST +INSERT INTO AD_Reference (AD_Reference_ID,Name,ValidationType,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,EntityType,IsOrderByValue,AD_Reference_UU) VALUES (200198,'FinReport ExcludeAdjustmentPeriods','L',0,0,'Y',TO_TIMESTAMP('2021-09-10 15:34:50','YYYY-MM-DD HH24:MI:SS'),0,TO_TIMESTAMP('2021-09-10 15:34:50','YYYY-MM-DD HH24:MI:SS'),0,'D','Y','9a34172f-5f27-4819-84cc-7de43853e8c8') +; + +-- Sep 10, 2021, 3:35:00 PM CEST +INSERT INTO AD_Ref_List (AD_Ref_List_ID,Name,AD_Reference_ID,Value,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,EntityType,AD_Ref_List_UU) VALUES (200516,'No',200198,'0',0,0,'Y',TO_TIMESTAMP('2021-09-10 15:35:00','YYYY-MM-DD HH24:MI:SS'),0,TO_TIMESTAMP('2021-09-10 15:35:00','YYYY-MM-DD HH24:MI:SS'),0,'D','f04dfda3-2f17-4d27-83d2-696941a8a181') +; + +-- Sep 10, 2021, 3:35:07 PM CEST +INSERT INTO AD_Ref_List (AD_Ref_List_ID,Name,AD_Reference_ID,Value,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,EntityType,AD_Ref_List_UU) VALUES (200517,'Only Report Period',200198,'1',0,0,'Y',TO_TIMESTAMP('2021-09-10 15:35:07','YYYY-MM-DD HH24:MI:SS'),0,TO_TIMESTAMP('2021-09-10 15:35:07','YYYY-MM-DD HH24:MI:SS'),0,'D','540fdd4a-4c09-46ee-b1b1-92c6b79c2f76') +; + +-- Sep 10, 2021, 3:35:16 PM CEST +INSERT INTO AD_Ref_List (AD_Ref_List_ID,Name,AD_Reference_ID,Value,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,EntityType,AD_Ref_List_UU) VALUES (200518,'All Adjustment Periods',200198,'2',0,0,'Y',TO_TIMESTAMP('2021-09-10 15:35:16','YYYY-MM-DD HH24:MI:SS'),0,TO_TIMESTAMP('2021-09-10 15:35:16','YYYY-MM-DD HH24:MI:SS'),0,'D','3b897a74-e4c7-4832-87ee-936bf71cf182') +; + +-- Sep 10, 2021, 3:35:35 PM CEST +INSERT INTO AD_Column (AD_Column_ID,Version,Name,AD_Table_ID,ColumnName,DefaultValue,FieldLength,IsKey,IsParent,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsEncrypted,AD_Reference_ID,AD_Reference_Value_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Element_ID,IsUpdateable,IsSelectionColumn,EntityType,IsSyncDatabase,IsAlwaysUpdateable,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsAllowCopy,SeqNoSelection,IsToolbarButton,IsSecure,FKConstraintType,IsHtml) VALUES (214585,0,'Exclude Adjustment Periods',445,'ExcludeAdjustmentPeriods','1',1,'N','N','Y','N','N',0,'N',17,200198,0,0,'Y',TO_TIMESTAMP('2021-09-10 15:35:35','YYYY-MM-DD HH24:MI:SS'),0,TO_TIMESTAMP('2021-09-10 15:35:35','YYYY-MM-DD HH24:MI:SS'),0,203533,'Y','N','D','N','N','N','Y','754c9256-e9c0-4096-99f2-a9cb4f4cec44','Y',0,'N','N','N','N') +; + +-- Sep 10, 2021, 3:35:38 PM CEST +ALTER TABLE PA_Report ADD COLUMN ExcludeAdjustmentPeriods CHAR(1) DEFAULT '1' NOT NULL +; + +-- Sep 10, 2021, 3:35:48 PM CEST +INSERT INTO AD_Field (AD_Field_ID,Name,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,ColumnSpan) VALUES (206747,'Exclude Adjustment Periods',372,214585,'Y',1,180,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2021-09-10 15:35:48','YYYY-MM-DD HH24:MI:SS'),0,TO_TIMESTAMP('2021-09-10 15:35:48','YYYY-MM-DD HH24:MI:SS'),0,'N','Y','D','7b4bcc01-71e2-4840-809e-5399e35f754e','Y',170,2) +; + +-- Sep 10, 2021, 3:36:10 PM CEST +UPDATE AD_Field SET IsDisplayed='Y', SeqNo=110, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, XPosition=4, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2021-09-10 15:36:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=206747 +; + +-- Sep 10, 2021, 3:36:10 PM CEST +UPDATE AD_Field SET SeqNo=120, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2021-09-10 15:36:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=54234 +; + +-- Sep 10, 2021, 3:36:10 PM CEST +UPDATE AD_Field SET SeqNo=130, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2021-09-10 15:36:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=6268 +; + +-- Sep 10, 2021, 3:36:10 PM CEST +UPDATE AD_Field SET SeqNo=140, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2021-09-10 15:36:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=6267 +; + +-- Sep 10, 2021, 3:36:10 PM CEST +UPDATE AD_Field SET SeqNo=150, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2021-09-10 15:36:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=201867 +; + +-- Sep 10, 2021, 3:36:10 PM CEST +UPDATE AD_Field SET SeqNo=160, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2021-09-10 15:36:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=4737 +; + +-- Sep 10, 2021, 3:36:10 PM CEST +UPDATE AD_Field SET SeqNo=170, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2021-09-10 15:36:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=6265 +; + +-- Sep 10, 2021, 3:36:10 PM CEST +UPDATE AD_Field SET SeqNo=180, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2021-09-10 15:36:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=54235 +; + +-- Sep 10, 2021, 3:36:10 PM CEST +UPDATE AD_Field SET SeqNo=0, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2021-09-10 15:36:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=204992 +; + +SELECT register_migration_script('202109111530_IDEMPIERE-4721.sql') FROM dual +; diff --git a/org.adempiere.base/src/org/compiere/model/I_PA_Report.java b/org.adempiere.base/src/org/compiere/model/I_PA_Report.java index 8d3215b904..849e47078e 100644 --- a/org.adempiere.base/src/org/compiere/model/I_PA_Report.java +++ b/org.adempiere.base/src/org/compiere/model/I_PA_Report.java @@ -136,6 +136,15 @@ public interface I_PA_Report */ public String getDescription(); + /** Column name ExcludeAdjustmentPeriods */ + public static final String COLUMNNAME_ExcludeAdjustmentPeriods = "ExcludeAdjustmentPeriods"; + + /** Set Exclude Adjustment Periods */ + public void setExcludeAdjustmentPeriods (String ExcludeAdjustmentPeriods); + + /** Get Exclude Adjustment Periods */ + public String getExcludeAdjustmentPeriods(); + /** Column name IsActive */ public static final String COLUMNNAME_IsActive = "IsActive"; diff --git a/org.adempiere.base/src/org/compiere/model/X_PA_Report.java b/org.adempiere.base/src/org/compiere/model/X_PA_Report.java index ff5896aaed..58adea7060 100644 --- a/org.adempiere.base/src/org/compiere/model/X_PA_Report.java +++ b/org.adempiere.base/src/org/compiere/model/X_PA_Report.java @@ -30,7 +30,7 @@ public class X_PA_Report extends PO implements I_PA_Report, I_Persistent /** * */ - private static final long serialVersionUID = 20201220L; + private static final long serialVersionUID = 20210910L; /** Standard Constructor */ public X_PA_Report (Properties ctx, int PA_Report_ID, String trxName) @@ -40,6 +40,8 @@ public class X_PA_Report extends PO implements I_PA_Report, I_Persistent { setC_AcctSchema_ID (0); setC_Calendar_ID (0); + setExcludeAdjustmentPeriods (null); +// 1 setListSources (false); setListTrx (false); setName (null); @@ -179,6 +181,27 @@ public class X_PA_Report extends PO implements I_PA_Report, I_Persistent return (String)get_Value(COLUMNNAME_Description); } + /** No = 0 */ + public static final String EXCLUDEADJUSTMENTPERIODS_No = "0"; + /** Only Report Period = 1 */ + public static final String EXCLUDEADJUSTMENTPERIODS_OnlyReportPeriod = "1"; + /** All adjustment periods = 2 */ + public static final String EXCLUDEADJUSTMENTPERIODS_AllAdjustmentPeriods = "2"; + /** Set Exclude Adjustment Periods. + @param ExcludeAdjustmentPeriods Exclude Adjustment Periods */ + public void setExcludeAdjustmentPeriods (String ExcludeAdjustmentPeriods) + { + + set_Value (COLUMNNAME_ExcludeAdjustmentPeriods, ExcludeAdjustmentPeriods); + } + + /** Get Exclude Adjustment Periods. + @return Exclude Adjustment Periods */ + public String getExcludeAdjustmentPeriods () + { + return (String)get_Value(COLUMNNAME_ExcludeAdjustmentPeriods); + } + public org.compiere.model.I_AD_Process getJasperProcess() throws RuntimeException { return (org.compiere.model.I_AD_Process)MTable.get(getCtx(), org.compiere.model.I_AD_Process.Table_Name) diff --git a/org.adempiere.base/src/org/compiere/report/FinReport.java b/org.adempiere.base/src/org/compiere/report/FinReport.java index 3db4345196..d290f7e1bc 100644 --- a/org.adempiere.base/src/org/compiere/report/FinReport.java +++ b/org.adempiere.base/src/org/compiere/report/FinReport.java @@ -196,11 +196,8 @@ public class FinReport extends SvrProcess m_report = new MReport (getCtx(), getRecord_ID(), null); sb.append(" - ").append(m_report); - /* Exclude adjustment period - * - if the report period is standard - * - and there is an adjustment period with the same end date (on the same year) - */ - if (p_C_Period_ID > 0) { + // 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); if (MPeriod.PERIODTYPE_StandardCalendarPeriod.equals(per.getPeriodType())) { int adjPeriodToExclude_ID = DB.getSQLValue(get_TrxName(), @@ -208,11 +205,15 @@ public class FinReport extends SvrProcess MPeriod.PERIODTYPE_AdjustmentPeriod, per.getEndDate(), per.getC_Year_ID()); if (adjPeriodToExclude_ID > 0) { p_AdjPeriodToExclude = " C_Period_ID!=" + adjPeriodToExclude_ID + " AND "; - log.warning("Will Exclude Adjustment Period -> " + p_AdjPeriodToExclude); + log.info("Will Exclude Adjustment Period -> " + p_AdjPeriodToExclude); } } } - + else if (m_report.getExcludeAdjustmentPeriods().equals(MReport.EXCLUDEADJUSTMENTPERIODS_AllAdjustmentPeriods)) { + p_AdjPeriodToExclude = new StringBuilder(" C_Period_ID NOT IN (SELECT C_Period_ID FROM C_Period p, C_Year y WHERE p.C_Year_ID = y.C_Year_ID AND y.C_Calendar_ID = ") + .append(m_report.getC_Calendar_ID()).append(" AND PeriodType = 'A') AND ").toString(); + } + // setPeriods(); sb.append(" - C_Period_ID=").append(p_C_Period_ID)