From d421dba94e83573cf54b61f998b10be201fbb1ad Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Sun, 16 Oct 2022 11:29:12 +0200 Subject: [PATCH] IDEMPIERE-5445 Implement multiplier and rounding for financial reports (#1524) * IDEMPIERE-5445 Implement multiplier and rounding for financial reports * - Improve loop --- .../i9/oracle/202210111720_IDEMPIERE-5445.sql | 238 ++++++++++++++++++ .../202210111720_IDEMPIERE-5445.sql | 235 +++++++++++++++++ .../org/compiere/model/I_PA_ReportColumn.java | 44 +++- .../org/compiere/model/I_PA_ReportLine.java | 36 ++- .../org/compiere/model/X_PA_ReportColumn.java | 53 +++- .../org/compiere/model/X_PA_ReportLine.java | 47 +++- .../src/org/compiere/report/FinReport.java | 58 +++-- 7 files changed, 664 insertions(+), 47 deletions(-) create mode 100644 migration/i9/oracle/202210111720_IDEMPIERE-5445.sql create mode 100644 migration/i9/postgresql/202210111720_IDEMPIERE-5445.sql diff --git a/migration/i9/oracle/202210111720_IDEMPIERE-5445.sql b/migration/i9/oracle/202210111720_IDEMPIERE-5445.sql new file mode 100644 index 0000000000..59fe3cb5b5 --- /dev/null +++ b/migration/i9/oracle/202210111720_IDEMPIERE-5445.sql @@ -0,0 +1,238 @@ +-- IDEMPIERE-5445 Fin Report - Percentage lines - Rounding +SELECT register_migration_script('202210111720_IDEMPIERE-5445.sql') FROM dual; + +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- Oct 11, 2022, 5:20:53 PM CEST +INSERT INTO AD_Column (AD_Column_ID,Version,Name,Description,AD_Table_ID,ColumnName,FieldLength,IsKey,IsParent,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsEncrypted,AD_Reference_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 (215623,0,'Multiplier','Type Multiplier (Credit = -1)',446,'Multiplier',14,'N','N','N','N','N',0,'N',22,0,0,'Y',TO_TIMESTAMP('2022-10-11 17:20:52','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2022-10-11 17:20:52','YYYY-MM-DD HH24:MI:SS'),100,1525,'N','N','D','N','N','N','Y','5aadeabd-11a2-4c72-816d-b29742744481','Y',0,'N','N','N','N') +; + +-- Oct 11, 2022, 5:21:04 PM CEST +INSERT INTO AD_Column (AD_Column_ID,Version,Name,Description,AD_Table_ID,ColumnName,FieldLength,IsKey,IsParent,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsEncrypted,AD_Reference_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 (215624,0,'Multiplier','Type Multiplier (Credit = -1)',448,'Multiplier',14,'N','N','N','N','N',0,'N',22,0,0,'Y',TO_TIMESTAMP('2022-10-11 17:21:04','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2022-10-11 17:21:04','YYYY-MM-DD HH24:MI:SS'),100,1525,'N','N','D','N','N','N','Y','714062d2-e95a-41e1-af63-3b61c2a7c3c3','Y',0,'N','N','N','N') +; + +-- Oct 11, 2022, 5:21:18 PM CEST +INSERT INTO AD_Column (AD_Column_ID,Version,Name,AD_Table_ID,ColumnName,FieldLength,IsKey,IsParent,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsEncrypted,AD_Reference_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,IsHtml) VALUES (215625,0,'Round Factor',446,'RoundFactor',14,'N','N','N','N','N',0,'N',11,0,0,'Y',TO_TIMESTAMP('2022-10-11 17:21:17','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2022-10-11 17:21:17','YYYY-MM-DD HH24:MI:SS'),100,200145,'Y','N','D','N','N','N','Y','4afbd87d-edf2-4dea-932e-9b9fabd13fed','Y',0,'N','N','N') +; + +-- Oct 11, 2022, 5:21:25 PM CEST +INSERT INTO AD_Column (AD_Column_ID,Version,Name,AD_Table_ID,ColumnName,FieldLength,IsKey,IsParent,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsEncrypted,AD_Reference_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 (215626,0,'Round Factor',448,'RoundFactor',14,'N','N','N','N','N',0,'N',11,0,0,'Y',TO_TIMESTAMP('2022-10-11 17:21:24','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2022-10-11 17:21:24','YYYY-MM-DD HH24:MI:SS'),100,200145,'Y','N','D','N','N','N','Y','827ddc6d-2b3c-42b3-a921-2f3d13c34c35','Y',0,'N','N','N','N') +; + +-- Oct 11, 2022, 5:21:32 PM CEST +ALTER TABLE PA_ReportColumn ADD RoundFactor NUMBER(10) DEFAULT NULL +; + +-- Oct 11, 2022, 5:21:44 PM CEST +ALTER TABLE PA_ReportColumn ADD Multiplier NUMBER DEFAULT NULL +; + +-- Oct 11, 2022, 5:21:52 PM CEST +ALTER TABLE PA_ReportLine ADD RoundFactor NUMBER(10) DEFAULT NULL +; + +-- Oct 11, 2022, 5:21:59 PM CEST +ALTER TABLE PA_ReportLine ADD Multiplier NUMBER DEFAULT NULL +; + +-- Oct 11, 2022, 5:22:43 PM CEST +INSERT INTO AD_Field (AD_Field_ID,Name,Description,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 (207399,'Multiplier','Type Multiplier (Credit = -1)',374,215623,'Y',14,470,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2022-10-11 17:22:43','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2022-10-11 17:22:43','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','5b2a762b-7aa1-4c1e-be69-8bbaa80d44f9','Y',490,2) +; + +-- Oct 11, 2022, 5:22:44 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 (207400,'Round Factor',374,215625,'Y',14,480,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2022-10-11 17:22:43','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2022-10-11 17:22:43','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','abf762bb-a4f7-4e44-b824-36de7ce06649','Y',500,2) +; + +-- Oct 11, 2022, 5:23:53 PM CEST +UPDATE AD_Field SET IsDisplayed='N', IsActive='N', IsDisplayedGrid='N',Updated=TO_TIMESTAMP('2022-10-11 17:23:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56376 +; + +-- Oct 11, 2022, 5:24:28 PM CEST +UPDATE AD_Field SET SeqNo=150,Updated=TO_TIMESTAMP('2022-10-11 17:24:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=206213 +; + +-- Oct 11, 2022, 5:24:28 PM CEST +UPDATE AD_Field SET SeqNo=160,Updated=TO_TIMESTAMP('2022-10-11 17:24:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4759 +; + +-- Oct 11, 2022, 5:24:28 PM CEST +UPDATE AD_Field SET SeqNo=170,Updated=TO_TIMESTAMP('2022-10-11 17:24:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4761 +; + +-- Oct 11, 2022, 5:24:28 PM CEST +UPDATE AD_Field SET SeqNo=180,Updated=TO_TIMESTAMP('2022-10-11 17:24:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4762 +; + +-- Oct 11, 2022, 5:24:28 PM CEST +UPDATE AD_Field SET SeqNo=190,Updated=TO_TIMESTAMP('2022-10-11 17:24:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=201868 +; + +-- Oct 11, 2022, 5:24:28 PM CEST +UPDATE AD_Field SET SeqNo=200,Updated=TO_TIMESTAMP('2022-10-11 17:24:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4763 +; + +-- Oct 11, 2022, 5:24:28 PM CEST +UPDATE AD_Field SET SeqNo=210,Updated=TO_TIMESTAMP('2022-10-11 17:24:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4764 +; + +-- Oct 11, 2022, 5:24:28 PM CEST +UPDATE AD_Field SET SeqNo=220,Updated=TO_TIMESTAMP('2022-10-11 17:24:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56301 +; + +-- Oct 11, 2022, 5:24:28 PM CEST +UPDATE AD_Field SET SeqNo=230,Updated=TO_TIMESTAMP('2022-10-11 17:24:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56518 +; + +-- Oct 11, 2022, 5:24:28 PM CEST +UPDATE AD_Field SET SeqNo=240,Updated=TO_TIMESTAMP('2022-10-11 17:24:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56517 +; + +-- Oct 11, 2022, 5:24:28 PM CEST +UPDATE AD_Field SET SeqNo=250,Updated=TO_TIMESTAMP('2022-10-11 17:24:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4765 +; + +-- Oct 11, 2022, 5:24:28 PM CEST +UPDATE AD_Field SET SeqNo=260,Updated=TO_TIMESTAMP('2022-10-11 17:24:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56296 +; + +-- Oct 11, 2022, 5:24:28 PM CEST +UPDATE AD_Field SET SeqNo=270,Updated=TO_TIMESTAMP('2022-10-11 17:24:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4766 +; + +-- Oct 11, 2022, 5:24:28 PM CEST +UPDATE AD_Field SET SeqNo=280,Updated=TO_TIMESTAMP('2022-10-11 17:24:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56302 +; + +-- Oct 11, 2022, 5:24:28 PM CEST +UPDATE AD_Field SET SeqNo=290,Updated=TO_TIMESTAMP('2022-10-11 17:24:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4777 +; + +-- Oct 11, 2022, 5:24:28 PM CEST +UPDATE AD_Field SET SeqNo=300,Updated=TO_TIMESTAMP('2022-10-11 17:24:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56299 +; + +-- Oct 11, 2022, 5:24:28 PM CEST +UPDATE AD_Field SET SeqNo=310,Updated=TO_TIMESTAMP('2022-10-11 17:24:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4776 +; + +-- Oct 11, 2022, 5:24:28 PM CEST +UPDATE AD_Field SET SeqNo=320,Updated=TO_TIMESTAMP('2022-10-11 17:24:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56298 +; + +-- Oct 11, 2022, 5:24:28 PM CEST +UPDATE AD_Field SET SeqNo=330,Updated=TO_TIMESTAMP('2022-10-11 17:24:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4775 +; + +-- Oct 11, 2022, 5:24:28 PM CEST +UPDATE AD_Field SET SeqNo=340,Updated=TO_TIMESTAMP('2022-10-11 17:24:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56303 +; + +-- Oct 11, 2022, 5:24:28 PM CEST +UPDATE AD_Field SET SeqNo=350,Updated=TO_TIMESTAMP('2022-10-11 17:24:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4767 +; + +-- Oct 11, 2022, 5:24:28 PM CEST +UPDATE AD_Field SET SeqNo=360,Updated=TO_TIMESTAMP('2022-10-11 17:24:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56300 +; + +-- Oct 11, 2022, 5:24:28 PM CEST +UPDATE AD_Field SET SeqNo=370,Updated=TO_TIMESTAMP('2022-10-11 17:24:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4768 +; + +-- Oct 11, 2022, 5:24:28 PM CEST +UPDATE AD_Field SET SeqNo=380,Updated=TO_TIMESTAMP('2022-10-11 17:24:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56304 +; + +-- Oct 11, 2022, 5:24:28 PM CEST +UPDATE AD_Field SET SeqNo=390,Updated=TO_TIMESTAMP('2022-10-11 17:24:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4769 +; + +-- Oct 11, 2022, 5:24:28 PM CEST +UPDATE AD_Field SET SeqNo=400,Updated=TO_TIMESTAMP('2022-10-11 17:24:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56297 +; + +-- Oct 11, 2022, 5:24:28 PM CEST +UPDATE AD_Field SET SeqNo=410,Updated=TO_TIMESTAMP('2022-10-11 17:24:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56281 +; + +-- Oct 11, 2022, 5:24:28 PM CEST +UPDATE AD_Field SET SeqNo=420,Updated=TO_TIMESTAMP('2022-10-11 17:24:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56305 +; + +-- Oct 11, 2022, 5:24:28 PM CEST +UPDATE AD_Field SET SeqNo=430,Updated=TO_TIMESTAMP('2022-10-11 17:24:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56282 +; + +-- Oct 11, 2022, 5:24:28 PM CEST +UPDATE AD_Field SET SeqNo=440,Updated=TO_TIMESTAMP('2022-10-11 17:24:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56306 +; + +-- Oct 11, 2022, 5:24:28 PM CEST +UPDATE AD_Field SET SeqNo=450,Updated=TO_TIMESTAMP('2022-10-11 17:24:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56375 +; + +-- Oct 11, 2022, 5:24:28 PM CEST +UPDATE AD_Field SET IsDisplayed='Y', SeqNo=460, XPosition=5,Updated=TO_TIMESTAMP('2022-10-11 17:24:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=206181 +; + +-- Oct 11, 2022, 5:24:28 PM CEST +UPDATE AD_Field SET IsDisplayed='Y', SeqNo=480, XPosition=4,Updated=TO_TIMESTAMP('2022-10-11 17:24:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=207400 +; + +-- Oct 11, 2022, 5:24:28 PM CEST +UPDATE AD_Field SET SeqNo=0,Updated=TO_TIMESTAMP('2022-10-11 17:24:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=204993 +; + +-- Oct 11, 2022, 5:24:51 PM CEST +INSERT INTO AD_Field (AD_Field_ID,Name,Description,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 (207401,'Multiplier','Type Multiplier (Credit = -1)',376,215624,'Y',14,220,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2022-10-11 17:24:51','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2022-10-11 17:24:51','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','149a6131-75df-4214-9707-d4c515c4d507','Y',235,2) +; + +-- Oct 11, 2022, 5:24:52 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 (207402,'Round Factor',376,215626,'Y',14,230,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2022-10-11 17:24:51','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2022-10-11 17:24:51','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','54046543-2dda-423b-9dcf-8a695bf29936','Y',245,2) +; + +-- Oct 11, 2022, 5:25:08 PM CEST +UPDATE AD_Field SET SeqNo=180,Updated=TO_TIMESTAMP('2022-10-11 17:25:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=206182 +; + +-- Oct 11, 2022, 5:25:08 PM CEST +UPDATE AD_Field SET SeqNo=190,Updated=TO_TIMESTAMP('2022-10-11 17:25:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=206214 +; + +-- Oct 11, 2022, 5:25:08 PM CEST +UPDATE AD_Field SET SeqNo=200,Updated=TO_TIMESTAMP('2022-10-11 17:25:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=206215 +; + +-- Oct 11, 2022, 5:25:08 PM CEST +UPDATE AD_Field SET SeqNo=210,Updated=TO_TIMESTAMP('2022-10-11 17:25:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=207401 +; + +-- Oct 11, 2022, 5:25:08 PM CEST +UPDATE AD_Field SET IsDisplayed='Y', SeqNo=220, XPosition=4,Updated=TO_TIMESTAMP('2022-10-11 17:25:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=207402 +; + +-- Oct 11, 2022, 5:25:08 PM CEST +UPDATE AD_Field SET SeqNo=0,Updated=TO_TIMESTAMP('2022-10-11 17:25:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=204996 +; + +-- Oct 11, 2022, 5:58:30 PM CEST +UPDATE AD_Column SET DefaultValue='NULL', IsUpdateable='Y',Updated=TO_TIMESTAMP('2022-10-11 17:58:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=215623 +; + +-- Oct 11, 2022, 5:58:44 PM CEST +UPDATE AD_Column SET DefaultValue='NULL',Updated=TO_TIMESTAMP('2022-10-11 17:58:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=215625 +; + +-- Oct 11, 2022, 5:59:19 PM CEST +UPDATE AD_Column SET DefaultValue='NULL', IsUpdateable='Y',Updated=TO_TIMESTAMP('2022-10-11 17:59:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=215624 +; + +-- Oct 11, 2022, 5:59:34 PM CEST +UPDATE AD_Column SET DefaultValue='NULL',Updated=TO_TIMESTAMP('2022-10-11 17:59:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=215626 +; + +UPDATE pa_reportcolumn SET multiplier=0.001 WHERE factor='k'; + +UPDATE pa_reportcolumn SET multiplier=0.000001 WHERE factor='M'; + diff --git a/migration/i9/postgresql/202210111720_IDEMPIERE-5445.sql b/migration/i9/postgresql/202210111720_IDEMPIERE-5445.sql new file mode 100644 index 0000000000..8228c941a8 --- /dev/null +++ b/migration/i9/postgresql/202210111720_IDEMPIERE-5445.sql @@ -0,0 +1,235 @@ +-- IDEMPIERE-5445 Fin Report - Percentage lines - Rounding +SELECT register_migration_script('202210111720_IDEMPIERE-5445.sql') FROM dual; + +-- Oct 11, 2022, 5:20:53 PM CEST +INSERT INTO AD_Column (AD_Column_ID,Version,Name,Description,AD_Table_ID,ColumnName,FieldLength,IsKey,IsParent,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsEncrypted,AD_Reference_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 (215623,0,'Multiplier','Type Multiplier (Credit = -1)',446,'Multiplier',14,'N','N','N','N','N',0,'N',22,0,0,'Y',TO_TIMESTAMP('2022-10-11 17:20:52','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2022-10-11 17:20:52','YYYY-MM-DD HH24:MI:SS'),100,1525,'N','N','D','N','N','N','Y','5aadeabd-11a2-4c72-816d-b29742744481','Y',0,'N','N','N','N') +; + +-- Oct 11, 2022, 5:21:04 PM CEST +INSERT INTO AD_Column (AD_Column_ID,Version,Name,Description,AD_Table_ID,ColumnName,FieldLength,IsKey,IsParent,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsEncrypted,AD_Reference_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 (215624,0,'Multiplier','Type Multiplier (Credit = -1)',448,'Multiplier',14,'N','N','N','N','N',0,'N',22,0,0,'Y',TO_TIMESTAMP('2022-10-11 17:21:04','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2022-10-11 17:21:04','YYYY-MM-DD HH24:MI:SS'),100,1525,'N','N','D','N','N','N','Y','714062d2-e95a-41e1-af63-3b61c2a7c3c3','Y',0,'N','N','N','N') +; + +-- Oct 11, 2022, 5:21:18 PM CEST +INSERT INTO AD_Column (AD_Column_ID,Version,Name,AD_Table_ID,ColumnName,FieldLength,IsKey,IsParent,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsEncrypted,AD_Reference_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,IsHtml) VALUES (215625,0,'Round Factor',446,'RoundFactor',14,'N','N','N','N','N',0,'N',11,0,0,'Y',TO_TIMESTAMP('2022-10-11 17:21:17','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2022-10-11 17:21:17','YYYY-MM-DD HH24:MI:SS'),100,200145,'Y','N','D','N','N','N','Y','4afbd87d-edf2-4dea-932e-9b9fabd13fed','Y',0,'N','N','N') +; + +-- Oct 11, 2022, 5:21:25 PM CEST +INSERT INTO AD_Column (AD_Column_ID,Version,Name,AD_Table_ID,ColumnName,FieldLength,IsKey,IsParent,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsEncrypted,AD_Reference_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 (215626,0,'Round Factor',448,'RoundFactor',14,'N','N','N','N','N',0,'N',11,0,0,'Y',TO_TIMESTAMP('2022-10-11 17:21:24','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2022-10-11 17:21:24','YYYY-MM-DD HH24:MI:SS'),100,200145,'Y','N','D','N','N','N','Y','827ddc6d-2b3c-42b3-a921-2f3d13c34c35','Y',0,'N','N','N','N') +; + +-- Oct 11, 2022, 5:21:32 PM CEST +ALTER TABLE PA_ReportColumn ADD COLUMN RoundFactor NUMERIC(10) DEFAULT NULL +; + +-- Oct 11, 2022, 5:21:44 PM CEST +ALTER TABLE PA_ReportColumn ADD COLUMN Multiplier NUMERIC DEFAULT NULL +; + +-- Oct 11, 2022, 5:21:52 PM CEST +ALTER TABLE PA_ReportLine ADD COLUMN RoundFactor NUMERIC(10) DEFAULT NULL +; + +-- Oct 11, 2022, 5:21:59 PM CEST +ALTER TABLE PA_ReportLine ADD COLUMN Multiplier NUMERIC DEFAULT NULL +; + +-- Oct 11, 2022, 5:22:43 PM CEST +INSERT INTO AD_Field (AD_Field_ID,Name,Description,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 (207399,'Multiplier','Type Multiplier (Credit = -1)',374,215623,'Y',14,470,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2022-10-11 17:22:43','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2022-10-11 17:22:43','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','5b2a762b-7aa1-4c1e-be69-8bbaa80d44f9','Y',490,2) +; + +-- Oct 11, 2022, 5:22:44 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 (207400,'Round Factor',374,215625,'Y',14,480,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2022-10-11 17:22:43','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2022-10-11 17:22:43','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','abf762bb-a4f7-4e44-b824-36de7ce06649','Y',500,2) +; + +-- Oct 11, 2022, 5:23:53 PM CEST +UPDATE AD_Field SET IsDisplayed='N', IsActive='N', IsDisplayedGrid='N',Updated=TO_TIMESTAMP('2022-10-11 17:23:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56376 +; + +-- Oct 11, 2022, 5:24:28 PM CEST +UPDATE AD_Field SET SeqNo=150,Updated=TO_TIMESTAMP('2022-10-11 17:24:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=206213 +; + +-- Oct 11, 2022, 5:24:28 PM CEST +UPDATE AD_Field SET SeqNo=160,Updated=TO_TIMESTAMP('2022-10-11 17:24:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4759 +; + +-- Oct 11, 2022, 5:24:28 PM CEST +UPDATE AD_Field SET SeqNo=170,Updated=TO_TIMESTAMP('2022-10-11 17:24:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4761 +; + +-- Oct 11, 2022, 5:24:28 PM CEST +UPDATE AD_Field SET SeqNo=180,Updated=TO_TIMESTAMP('2022-10-11 17:24:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4762 +; + +-- Oct 11, 2022, 5:24:28 PM CEST +UPDATE AD_Field SET SeqNo=190,Updated=TO_TIMESTAMP('2022-10-11 17:24:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=201868 +; + +-- Oct 11, 2022, 5:24:28 PM CEST +UPDATE AD_Field SET SeqNo=200,Updated=TO_TIMESTAMP('2022-10-11 17:24:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4763 +; + +-- Oct 11, 2022, 5:24:28 PM CEST +UPDATE AD_Field SET SeqNo=210,Updated=TO_TIMESTAMP('2022-10-11 17:24:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4764 +; + +-- Oct 11, 2022, 5:24:28 PM CEST +UPDATE AD_Field SET SeqNo=220,Updated=TO_TIMESTAMP('2022-10-11 17:24:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56301 +; + +-- Oct 11, 2022, 5:24:28 PM CEST +UPDATE AD_Field SET SeqNo=230,Updated=TO_TIMESTAMP('2022-10-11 17:24:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56518 +; + +-- Oct 11, 2022, 5:24:28 PM CEST +UPDATE AD_Field SET SeqNo=240,Updated=TO_TIMESTAMP('2022-10-11 17:24:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56517 +; + +-- Oct 11, 2022, 5:24:28 PM CEST +UPDATE AD_Field SET SeqNo=250,Updated=TO_TIMESTAMP('2022-10-11 17:24:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4765 +; + +-- Oct 11, 2022, 5:24:28 PM CEST +UPDATE AD_Field SET SeqNo=260,Updated=TO_TIMESTAMP('2022-10-11 17:24:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56296 +; + +-- Oct 11, 2022, 5:24:28 PM CEST +UPDATE AD_Field SET SeqNo=270,Updated=TO_TIMESTAMP('2022-10-11 17:24:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4766 +; + +-- Oct 11, 2022, 5:24:28 PM CEST +UPDATE AD_Field SET SeqNo=280,Updated=TO_TIMESTAMP('2022-10-11 17:24:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56302 +; + +-- Oct 11, 2022, 5:24:28 PM CEST +UPDATE AD_Field SET SeqNo=290,Updated=TO_TIMESTAMP('2022-10-11 17:24:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4777 +; + +-- Oct 11, 2022, 5:24:28 PM CEST +UPDATE AD_Field SET SeqNo=300,Updated=TO_TIMESTAMP('2022-10-11 17:24:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56299 +; + +-- Oct 11, 2022, 5:24:28 PM CEST +UPDATE AD_Field SET SeqNo=310,Updated=TO_TIMESTAMP('2022-10-11 17:24:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4776 +; + +-- Oct 11, 2022, 5:24:28 PM CEST +UPDATE AD_Field SET SeqNo=320,Updated=TO_TIMESTAMP('2022-10-11 17:24:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56298 +; + +-- Oct 11, 2022, 5:24:28 PM CEST +UPDATE AD_Field SET SeqNo=330,Updated=TO_TIMESTAMP('2022-10-11 17:24:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4775 +; + +-- Oct 11, 2022, 5:24:28 PM CEST +UPDATE AD_Field SET SeqNo=340,Updated=TO_TIMESTAMP('2022-10-11 17:24:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56303 +; + +-- Oct 11, 2022, 5:24:28 PM CEST +UPDATE AD_Field SET SeqNo=350,Updated=TO_TIMESTAMP('2022-10-11 17:24:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4767 +; + +-- Oct 11, 2022, 5:24:28 PM CEST +UPDATE AD_Field SET SeqNo=360,Updated=TO_TIMESTAMP('2022-10-11 17:24:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56300 +; + +-- Oct 11, 2022, 5:24:28 PM CEST +UPDATE AD_Field SET SeqNo=370,Updated=TO_TIMESTAMP('2022-10-11 17:24:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4768 +; + +-- Oct 11, 2022, 5:24:28 PM CEST +UPDATE AD_Field SET SeqNo=380,Updated=TO_TIMESTAMP('2022-10-11 17:24:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56304 +; + +-- Oct 11, 2022, 5:24:28 PM CEST +UPDATE AD_Field SET SeqNo=390,Updated=TO_TIMESTAMP('2022-10-11 17:24:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4769 +; + +-- Oct 11, 2022, 5:24:28 PM CEST +UPDATE AD_Field SET SeqNo=400,Updated=TO_TIMESTAMP('2022-10-11 17:24:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56297 +; + +-- Oct 11, 2022, 5:24:28 PM CEST +UPDATE AD_Field SET SeqNo=410,Updated=TO_TIMESTAMP('2022-10-11 17:24:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56281 +; + +-- Oct 11, 2022, 5:24:28 PM CEST +UPDATE AD_Field SET SeqNo=420,Updated=TO_TIMESTAMP('2022-10-11 17:24:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56305 +; + +-- Oct 11, 2022, 5:24:28 PM CEST +UPDATE AD_Field SET SeqNo=430,Updated=TO_TIMESTAMP('2022-10-11 17:24:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56282 +; + +-- Oct 11, 2022, 5:24:28 PM CEST +UPDATE AD_Field SET SeqNo=440,Updated=TO_TIMESTAMP('2022-10-11 17:24:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56306 +; + +-- Oct 11, 2022, 5:24:28 PM CEST +UPDATE AD_Field SET SeqNo=450,Updated=TO_TIMESTAMP('2022-10-11 17:24:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56375 +; + +-- Oct 11, 2022, 5:24:28 PM CEST +UPDATE AD_Field SET IsDisplayed='Y', SeqNo=460, XPosition=5,Updated=TO_TIMESTAMP('2022-10-11 17:24:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=206181 +; + +-- Oct 11, 2022, 5:24:28 PM CEST +UPDATE AD_Field SET IsDisplayed='Y', SeqNo=480, XPosition=4,Updated=TO_TIMESTAMP('2022-10-11 17:24:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=207400 +; + +-- Oct 11, 2022, 5:24:28 PM CEST +UPDATE AD_Field SET SeqNo=0,Updated=TO_TIMESTAMP('2022-10-11 17:24:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=204993 +; + +-- Oct 11, 2022, 5:24:51 PM CEST +INSERT INTO AD_Field (AD_Field_ID,Name,Description,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 (207401,'Multiplier','Type Multiplier (Credit = -1)',376,215624,'Y',14,220,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2022-10-11 17:24:51','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2022-10-11 17:24:51','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','149a6131-75df-4214-9707-d4c515c4d507','Y',235,2) +; + +-- Oct 11, 2022, 5:24:52 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 (207402,'Round Factor',376,215626,'Y',14,230,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2022-10-11 17:24:51','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2022-10-11 17:24:51','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','54046543-2dda-423b-9dcf-8a695bf29936','Y',245,2) +; + +-- Oct 11, 2022, 5:25:08 PM CEST +UPDATE AD_Field SET SeqNo=180,Updated=TO_TIMESTAMP('2022-10-11 17:25:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=206182 +; + +-- Oct 11, 2022, 5:25:08 PM CEST +UPDATE AD_Field SET SeqNo=190,Updated=TO_TIMESTAMP('2022-10-11 17:25:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=206214 +; + +-- Oct 11, 2022, 5:25:08 PM CEST +UPDATE AD_Field SET SeqNo=200,Updated=TO_TIMESTAMP('2022-10-11 17:25:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=206215 +; + +-- Oct 11, 2022, 5:25:08 PM CEST +UPDATE AD_Field SET SeqNo=210,Updated=TO_TIMESTAMP('2022-10-11 17:25:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=207401 +; + +-- Oct 11, 2022, 5:25:08 PM CEST +UPDATE AD_Field SET IsDisplayed='Y', SeqNo=220, XPosition=4,Updated=TO_TIMESTAMP('2022-10-11 17:25:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=207402 +; + +-- Oct 11, 2022, 5:25:08 PM CEST +UPDATE AD_Field SET SeqNo=0,Updated=TO_TIMESTAMP('2022-10-11 17:25:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=204996 +; + +-- Oct 11, 2022, 5:58:30 PM CEST +UPDATE AD_Column SET DefaultValue='NULL', IsUpdateable='Y',Updated=TO_TIMESTAMP('2022-10-11 17:58:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=215623 +; + +-- Oct 11, 2022, 5:58:44 PM CEST +UPDATE AD_Column SET DefaultValue='NULL',Updated=TO_TIMESTAMP('2022-10-11 17:58:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=215625 +; + +-- Oct 11, 2022, 5:59:19 PM CEST +UPDATE AD_Column SET DefaultValue='NULL', IsUpdateable='Y',Updated=TO_TIMESTAMP('2022-10-11 17:59:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=215624 +; + +-- Oct 11, 2022, 5:59:34 PM CEST +UPDATE AD_Column SET DefaultValue='NULL',Updated=TO_TIMESTAMP('2022-10-11 17:59:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=215626 +; + +UPDATE pa_reportcolumn SET multiplier=0.001 WHERE factor='k'; + +UPDATE pa_reportcolumn SET multiplier=0.000001 WHERE factor='M'; + diff --git a/org.adempiere.base/src/org/compiere/model/I_PA_ReportColumn.java b/org.adempiere.base/src/org/compiere/model/I_PA_ReportColumn.java index 70258bcc82..46e7296cd2 100644 --- a/org.adempiere.base/src/org/compiere/model/I_PA_ReportColumn.java +++ b/org.adempiere.base/src/org/compiere/model/I_PA_ReportColumn.java @@ -22,7 +22,7 @@ import org.compiere.util.KeyNamePair; /** Generated Interface for PA_ReportColumn * @author iDempiere (generated) - * @version Release 9 + * @version Release 10 */ public interface I_PA_ReportColumn { @@ -44,8 +44,8 @@ public interface I_PA_ReportColumn /** Column name AD_Client_ID */ public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID"; - /** Get Client. - * Client/Tenant for this installation. + /** Get Tenant. + * Tenant for this installation. */ public int getAD_Client_ID(); @@ -53,12 +53,12 @@ public interface I_PA_ReportColumn public static final String COLUMNNAME_AD_Org_ID = "AD_Org_ID"; /** Set Organization. - * Organizational entity within client + * Organizational entity within tenant */ public void setAD_Org_ID (int AD_Org_ID); /** Get Organization. - * Organizational entity within client + * Organizational entity within tenant */ public int getAD_Org_ID(); @@ -321,12 +321,12 @@ public interface I_PA_ReportColumn /** Column name IsAdhocConversion */ public static final String COLUMNNAME_IsAdhocConversion = "IsAdhocConversion"; - /** Set Adhoc Conversion. + /** Set Ad hoc Conversion. * Perform conversion for all amounts to currency */ public void setIsAdhocConversion (boolean IsAdhocConversion); - /** Get Adhoc Conversion. + /** Get Ad hoc Conversion. * Perform conversion for all amounts to currency */ public boolean isAdhocConversion(); @@ -528,6 +528,19 @@ public interface I_PA_ReportColumn public org.compiere.model.I_M_Product getM_Product() throws RuntimeException; + /** Column name Multiplier */ + public static final String COLUMNNAME_Multiplier = "Multiplier"; + + /** Set Multiplier. + * Type Multiplier (Credit = -1) + */ + public void setMultiplier (BigDecimal Multiplier); + + /** Get Multiplier. + * Type Multiplier (Credit = -1) + */ + public BigDecimal getMultiplier(); + /** Column name Name */ public static final String COLUMNNAME_Name = "Name"; @@ -588,12 +601,12 @@ public interface I_PA_ReportColumn public static final String COLUMNNAME_Org_ID = "Org_ID"; /** Set Organization. - * Organizational entity within client + * Organizational entity within tenant */ public void setOrg_ID (int Org_ID); /** Get Organization. - * Organizational entity within client + * Organizational entity within tenant */ public int getOrg_ID(); @@ -663,12 +676,12 @@ public interface I_PA_ReportColumn /** Column name PostingType */ public static final String COLUMNNAME_PostingType = "PostingType"; - /** Set PostingType. + /** Set Posting Type. * The type of posted amount for the transaction */ public void setPostingType (String PostingType); - /** Get PostingType. + /** Get Posting Type. * The type of posted amount for the transaction */ public String getPostingType(); @@ -699,6 +712,15 @@ public interface I_PA_ReportColumn */ public BigDecimal getRelativePeriodTo(); + /** Column name RoundFactor */ + public static final String COLUMNNAME_RoundFactor = "RoundFactor"; + + /** Set Round Factor */ + public void setRoundFactor (int RoundFactor); + + /** Get Round Factor */ + public int getRoundFactor(); + /** Column name SeqNo */ public static final String COLUMNNAME_SeqNo = "SeqNo"; diff --git a/org.adempiere.base/src/org/compiere/model/I_PA_ReportLine.java b/org.adempiere.base/src/org/compiere/model/I_PA_ReportLine.java index 056517a434..8df3371831 100644 --- a/org.adempiere.base/src/org/compiere/model/I_PA_ReportLine.java +++ b/org.adempiere.base/src/org/compiere/model/I_PA_ReportLine.java @@ -22,7 +22,7 @@ import org.compiere.util.KeyNamePair; /** Generated Interface for PA_ReportLine * @author iDempiere (generated) - * @version Release 9 + * @version Release 10 */ public interface I_PA_ReportLine { @@ -44,8 +44,8 @@ public interface I_PA_ReportLine /** Column name AD_Client_ID */ public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID"; - /** Get Client. - * Client/Tenant for this installation. + /** Get Tenant. + * Tenant for this installation. */ public int getAD_Client_ID(); @@ -53,12 +53,12 @@ public interface I_PA_ReportLine public static final String COLUMNNAME_AD_Org_ID = "AD_Org_ID"; /** Set Organization. - * Organizational entity within client + * Organizational entity within tenant */ public void setAD_Org_ID (int AD_Org_ID); /** Get Organization. - * Organizational entity within client + * Organizational entity within tenant */ public int getAD_Org_ID(); @@ -176,6 +176,19 @@ public interface I_PA_ReportLine /** Get Line Type */ public String getLineType(); + /** Column name Multiplier */ + public static final String COLUMNNAME_Multiplier = "Multiplier"; + + /** Set Multiplier. + * Type Multiplier (Credit = -1) + */ + public void setMultiplier (BigDecimal Multiplier); + + /** Get Multiplier. + * Type Multiplier (Credit = -1) + */ + public BigDecimal getMultiplier(); + /** Column name Name */ public static final String COLUMNNAME_Name = "Name"; @@ -286,16 +299,25 @@ public interface I_PA_ReportLine /** Column name PostingType */ public static final String COLUMNNAME_PostingType = "PostingType"; - /** Set PostingType. + /** Set Posting Type. * The type of posted amount for the transaction */ public void setPostingType (String PostingType); - /** Get PostingType. + /** Get Posting Type. * The type of posted amount for the transaction */ public String getPostingType(); + /** Column name RoundFactor */ + public static final String COLUMNNAME_RoundFactor = "RoundFactor"; + + /** Set Round Factor */ + public void setRoundFactor (int RoundFactor); + + /** Get Round Factor */ + public int getRoundFactor(); + /** Column name SeqNo */ public static final String COLUMNNAME_SeqNo = "SeqNo"; diff --git a/org.adempiere.base/src/org/compiere/model/X_PA_ReportColumn.java b/org.adempiere.base/src/org/compiere/model/X_PA_ReportColumn.java index 7c59f28ed9..d0ccc05d3e 100644 --- a/org.adempiere.base/src/org/compiere/model/X_PA_ReportColumn.java +++ b/org.adempiere.base/src/org/compiere/model/X_PA_ReportColumn.java @@ -25,7 +25,7 @@ import org.compiere.util.KeyNamePair; /** Generated Model for PA_ReportColumn * @author iDempiere (generated) - * @version Release 9 - $Id$ */ + * @version Release 10 - $Id$ */ @org.adempiere.base.Model(table="PA_ReportColumn") public class X_PA_ReportColumn extends PO implements I_PA_ReportColumn, I_Persistent { @@ -33,7 +33,7 @@ public class X_PA_ReportColumn extends PO implements I_PA_ReportColumn, I_Persis /** * */ - private static final long serialVersionUID = 20220116L; + private static final long serialVersionUID = 20221011L; /** Standard Constructor */ public X_PA_ReportColumn (Properties ctx, int PA_ReportColumn_ID, String trxName) @@ -605,7 +605,7 @@ public class X_PA_ReportColumn extends PO implements I_PA_ReportColumn, I_Persis return ii.intValue(); } - /** Set Adhoc Conversion. + /** Set Ad hoc Conversion. @param IsAdhocConversion Perform conversion for all amounts to currency */ public void setIsAdhocConversion (boolean IsAdhocConversion) @@ -613,7 +613,7 @@ public class X_PA_ReportColumn extends PO implements I_PA_ReportColumn, I_Persis set_Value (COLUMNNAME_IsAdhocConversion, Boolean.valueOf(IsAdhocConversion)); } - /** Get Adhoc Conversion. + /** Get Ad hoc Conversion. @return Perform conversion for all amounts to currency */ public boolean isAdhocConversion() @@ -978,6 +978,25 @@ public class X_PA_ReportColumn extends PO implements I_PA_ReportColumn, I_Persis return ii.intValue(); } + /** Set Multiplier. + @param Multiplier Type Multiplier (Credit = -1) + */ + public void setMultiplier (BigDecimal Multiplier) + { + set_ValueNoCheck (COLUMNNAME_Multiplier, Multiplier); + } + + /** Get Multiplier. + @return Type Multiplier (Credit = -1) + */ + public BigDecimal getMultiplier() + { + BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_Multiplier); + if (bd == null) + return Env.ZERO; + return bd; + } + /** Set Name. @param Name Alphanumeric identifier of the entity */ @@ -1075,7 +1094,7 @@ public class X_PA_ReportColumn extends PO implements I_PA_ReportColumn, I_Persis } /** Set Organization. - @param Org_ID Organizational entity within client + @param Org_ID Organizational entity within tenant */ public void setOrg_ID (int Org_ID) { @@ -1086,7 +1105,7 @@ public class X_PA_ReportColumn extends PO implements I_PA_ReportColumn, I_Persis } /** Get Organization. - @return Organizational entity within client + @return Organizational entity within tenant */ public int getOrg_ID() { @@ -1231,7 +1250,7 @@ public class X_PA_ReportColumn extends PO implements I_PA_ReportColumn, I_Persis public static final String POSTINGTYPE_Reservation = "R"; /** Statistical = S */ public static final String POSTINGTYPE_Statistical = "S"; - /** Set PostingType. + /** Set Posting Type. @param PostingType The type of posted amount for the transaction */ public void setPostingType (String PostingType) @@ -1240,7 +1259,7 @@ public class X_PA_ReportColumn extends PO implements I_PA_ReportColumn, I_Persis set_Value (COLUMNNAME_PostingType, PostingType); } - /** Get PostingType. + /** Get Posting Type. @return The type of posted amount for the transaction */ public String getPostingType() @@ -1286,6 +1305,24 @@ public class X_PA_ReportColumn extends PO implements I_PA_ReportColumn, I_Persis return bd; } + /** Set Round Factor. + @param RoundFactor Round Factor + */ + public void setRoundFactor (int RoundFactor) + { + set_Value (COLUMNNAME_RoundFactor, Integer.valueOf(RoundFactor)); + } + + /** Get Round Factor. + @return Round Factor */ + public int getRoundFactor() + { + Integer ii = (Integer)get_Value(COLUMNNAME_RoundFactor); + if (ii == null) + return 0; + return ii.intValue(); + } + /** Set Sequence. @param SeqNo Method of ordering records; lowest number comes first */ diff --git a/org.adempiere.base/src/org/compiere/model/X_PA_ReportLine.java b/org.adempiere.base/src/org/compiere/model/X_PA_ReportLine.java index 91d6b5c398..063c905a67 100644 --- a/org.adempiere.base/src/org/compiere/model/X_PA_ReportLine.java +++ b/org.adempiere.base/src/org/compiere/model/X_PA_ReportLine.java @@ -17,13 +17,15 @@ /** Generated Model - DO NOT CHANGE */ package org.compiere.model; +import java.math.BigDecimal; import java.sql.ResultSet; import java.util.Properties; +import org.compiere.util.Env; import org.compiere.util.KeyNamePair; /** Generated Model for PA_ReportLine * @author iDempiere (generated) - * @version Release 9 - $Id$ */ + * @version Release 10 - $Id$ */ @org.adempiere.base.Model(table="PA_ReportLine") public class X_PA_ReportLine extends PO implements I_PA_ReportLine, I_Persistent { @@ -31,7 +33,7 @@ public class X_PA_ReportLine extends PO implements I_PA_ReportLine, I_Persistent /** * */ - private static final long serialVersionUID = 20220116L; + private static final long serialVersionUID = 20221011L; /** Standard Constructor */ public X_PA_ReportLine (Properties ctx, int PA_ReportLine_ID, String trxName) @@ -262,6 +264,25 @@ public class X_PA_ReportLine extends PO implements I_PA_ReportLine, I_Persistent return (String)get_Value(COLUMNNAME_LineType); } + /** Set Multiplier. + @param Multiplier Type Multiplier (Credit = -1) + */ + public void setMultiplier (BigDecimal Multiplier) + { + set_ValueNoCheck (COLUMNNAME_Multiplier, Multiplier); + } + + /** Get Multiplier. + @return Type Multiplier (Credit = -1) + */ + public BigDecimal getMultiplier() + { + BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_Multiplier); + if (bd == null) + return Env.ZERO; + return bd; + } + /** Set Name. @param Name Alphanumeric identifier of the entity */ @@ -505,7 +526,7 @@ public class X_PA_ReportLine extends PO implements I_PA_ReportLine, I_Persistent public static final String POSTINGTYPE_Reservation = "R"; /** Statistical = S */ public static final String POSTINGTYPE_Statistical = "S"; - /** Set PostingType. + /** Set Posting Type. @param PostingType The type of posted amount for the transaction */ public void setPostingType (String PostingType) @@ -514,7 +535,7 @@ public class X_PA_ReportLine extends PO implements I_PA_ReportLine, I_Persistent set_Value (COLUMNNAME_PostingType, PostingType); } - /** Get PostingType. + /** Get Posting Type. @return The type of posted amount for the transaction */ public String getPostingType() @@ -522,6 +543,24 @@ public class X_PA_ReportLine extends PO implements I_PA_ReportLine, I_Persistent return (String)get_Value(COLUMNNAME_PostingType); } + /** Set Round Factor. + @param RoundFactor Round Factor + */ + public void setRoundFactor (int RoundFactor) + { + set_Value (COLUMNNAME_RoundFactor, Integer.valueOf(RoundFactor)); + } + + /** Get Round Factor. + @return Round Factor */ + public int getRoundFactor() + { + Integer ii = (Integer)get_Value(COLUMNNAME_RoundFactor); + if (ii == null) + return 0; + return ii.intValue(); + } + /** Set Sequence. @param SeqNo Method of ordering records; lowest number comes first */ diff --git a/org.adempiere.base/src/org/compiere/report/FinReport.java b/org.adempiere.base/src/org/compiere/report/FinReport.java index ce114718e1..4bd9fe3e44 100644 --- a/org.adempiere.base/src/org/compiere/report/FinReport.java +++ b/org.adempiere.base/src/org/compiere/report/FinReport.java @@ -1770,26 +1770,50 @@ public class FinReport extends SvrProcess private void scaleResults() { - for (int column = 0; column < m_columns.length; column++) - { - String factor = m_columns[column].getFactor(); - if ( factor != null ) - { - int divisor = 1; - if ( factor.equals("k") ) - divisor = 1000; - else if (factor.equals("M")) - divisor = 1000000; - else - break; - - String sql = "UPDATE T_Report SET Col_" + column - + "=Col_" + column + "/" + divisor - + " WHERE AD_PInstance_ID=" + getAD_PInstance_ID(); - int no = DB.executeUpdateEx(sql, get_TrxName()); + for (int column = 0; column < m_columns.length; column++) { + BigDecimal multiplier = (BigDecimal) m_columns[column].get_Value(MReportColumn.COLUMNNAME_Multiplier); + if ( multiplier != null ) { + String sql = "UPDATE T_Report SET Col_" + column + "=Col_" + column + "*" + multiplier + " WHERE AD_PInstance_ID=?"; + int no = DB.executeUpdateEx(sql, new Object[] {getAD_PInstance_ID()}, get_TrxName()); if (no > 0) if (log.isLoggable(Level.FINE)) log.fine(m_columns[column].getName() + " - #" + no); } + Integer roundFactor = (Integer) m_columns[column].get_Value(MReportColumn.COLUMNNAME_RoundFactor); + if ( roundFactor != null ) { + String sql = "UPDATE T_Report SET Col_" + column + "=ROUND(Col_" + column + "," + roundFactor + ")" + " WHERE AD_PInstance_ID=?"; + int no = DB.executeUpdateEx(sql, new Object[] {getAD_PInstance_ID()}, get_TrxName()); + if (no > 0) + if (log.isLoggable(Level.FINE)) log.fine(m_columns[column].getName() + " - #" + no); + } + } + + for (int line = 0; line < m_lines.length; line++) { + BigDecimal multiplier = (BigDecimal) m_lines[line].get_Value(MReportColumn.COLUMNNAME_Multiplier); + if ( multiplier != null ) { + StringBuilder cols = new StringBuilder(); + for (int column = 0; column < m_columns.length; column++) { + if (cols.length() > 0) + cols.append(","); + cols.append("Col_").append(column).append("=Col_").append(column).append("*").append(multiplier); + } + String sql = "UPDATE T_Report SET " + cols.toString() + " WHERE AD_PInstance_ID=? AND PA_ReportLine_ID=?"; + int no = DB.executeUpdateEx(sql, new Object[] {getAD_PInstance_ID(), m_lines[line].getPA_ReportLine_ID()}, get_TrxName()); + if (no > 0) + if (log.isLoggable(Level.FINE)) log.fine(m_lines[line].getName() + " - #" + no); + } + Integer roundFactor = (Integer) m_lines[line].get_Value(MReportColumn.COLUMNNAME_RoundFactor); + if ( roundFactor != null ) { + StringBuilder cols = new StringBuilder(); + for (int column = 0; column < m_columns.length; column++) { + if (cols.length() > 0) + cols.append(","); + cols.append("Col_").append(column).append("=ROUND(Col_").append(column).append(",").append(roundFactor).append(")"); + } + String sql = "UPDATE T_Report SET " + cols.toString() + " WHERE AD_PInstance_ID=? AND PA_ReportLine_ID=?"; + int no = DB.executeUpdateEx(sql, new Object[] {getAD_PInstance_ID(), m_lines[line].getPA_ReportLine_ID()}, get_TrxName()); + if (no > 0) + if (log.isLoggable(Level.FINE)) log.fine(m_lines[line].getName() + " - #" + no); + } } }