hg merge release-6.2 (merge release6.2 into default)

This commit is contained in:
Carlos Ruiz 2019-08-02 20:21:35 +02:00
commit fa73cc1fd3
20 changed files with 452 additions and 19 deletions

View File

@ -0,0 +1,51 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- IDEMPIERE-4014 - Aging - some lines are hidden if using C_Currency_ID as parameter
-- 07/29/2019 06:17:48
INSERT INTO AD_Element (AD_Element_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,ColumnName,Name,Description,Help,PrintName,EntityType,AD_Element_UU) VALUES (203350,0,0,'Y',TO_DATE('2019-07-29 18:17:35','YYYY-MM-DD HH24:MI:SS'),0,TO_DATE('2019-07-29 18:17:35','YYYY-MM-DD HH24:MI:SS'),0,'ConvertAmountsInCurrency_ID','Convert Amounts in Currency',NULL,NULL,'Convert Amounts in Currency','D','3ff194dd-160e-4362-b4e5-d0e41221c1c5')
;
-- 07/29/2019 06:18:26
INSERT INTO AD_Process_Para (AD_Process_Para_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,Name,AD_Process_ID,SeqNo,AD_Reference_ID,AD_Reference_Value_ID,IsRange,FieldLength,IsMandatory,ColumnName,IsCentrallyMaintained,EntityType,AD_Element_ID,AD_Process_Para_UU,IsEncrypted) VALUES (200280,0,0,'Y',TO_DATE('2019-07-29 18:18:26','YYYY-MM-DD HH24:MI:SS'),0,TO_DATE('2019-07-29 18:18:26','YYYY-MM-DD HH24:MI:SS'),0,'Convert Amounts in Currency',238,45,18,112,'N',0,'N','ConvertAmountsInCurrency_ID','Y','D',203350,'a4cc6ea2-103f-4389-bf39-cda71c73028c','N')
;
-- 07/29/2019 06:18:51
UPDATE AD_Process SET Help='The aging report allows you to report on Open Items (Invoices). Select the aging buckets, you want to have in your report. If you select a currency, you get only invoices of that currency.
If you fill the "Convert Amounts in Currency", all amounts will be converted in that currency. If you do not select a Statement Date, the system date is used to calculate the buckets. If you do not list the individual invoices, the Due Date is the earliest due date for the business partner and the Due Days are the average due days of all invoices.<br>
<br>
If you select an Account Date the report will generate the Aging as of that date. The report will exclude documents after the selected date.<br>
<br>
For example: A customer has one invoice for $100 with the Account Date of 03/31/08 and one payment for $100 with the Account Date of 05/01/08. The report will show the following balances based on the Account Date selected: 03/15/08= 0; 04/15/08=100; 05/15/08 = 0.
',Updated=TO_DATE('2019-07-29 18:18:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Process_ID=238
;
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_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 (213969,0,'Convert Amounts in Currency',631,'ConvertAmountsInCurrency_ID',10,'N','N','N','N','N',0,'N',30,112,0,0,'Y',TO_DATE('2019-07-29 18:34:22','YYYY-MM-DD HH24:MI:SS'),0,TO_DATE('2019-07-29 18:34:22','YYYY-MM-DD HH24:MI:SS'),0,203350,'Y','N','D','N','N','N','Y','c34b0911-52ef-4a30-a04c-b2739de87f5d','N',0,'N','N','N','N')
;
-- 07/29/2019 06:34:24
UPDATE AD_Column SET FKConstraintName='ConvertAmountsInCurrency_TAgin', FKConstraintType='N',Updated=TO_DATE('2019-07-29 18:34:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Column_ID=213969
;
-- 07/29/2019 06:34:24
ALTER TABLE T_Aging ADD ConvertAmountsInCurrency_ID NUMBER(10) DEFAULT NULL
;
-- 07/29/2019 06:34:24
ALTER TABLE T_Aging ADD CONSTRAINT ConvertAmountsInCurrency_TAgin FOREIGN KEY (ConvertAmountsInCurrency_ID) REFERENCES c_currency(c_currency_id) DEFERRABLE INITIALLY DEFERRED
;
-- 07/29/2019 06:34:28
UPDATE AD_Column SET FKConstraintType='D',Updated=TO_DATE('2019-07-29 18:34:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Column_ID=213969
;
-- 07/29/2019 06:34:29
ALTER TABLE T_Aging MODIFY ConvertAmountsInCurrency_ID NUMBER(10) DEFAULT NULL
;
-- 07/29/2019 06:34:29
ALTER TABLE T_Aging DROP CONSTRAINT convertamountsincurrency_tagin
;
SELECT register_migration_script('201907291830_IDEMPIERE-4014.sql') FROM dual
;

View File

@ -0,0 +1,83 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- IDEMPIERE-4017 Create a Unique Key case/accent insensitive to AD_Table.TableName (FHCA-1005)
-- Aug 1, 2019, 10:56:57 AM CEST
UPDATE AD_Column SET IsUpdateable='Y',Updated=TO_DATE('2019-08-01 10:56:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=210545
;
-- Aug 1, 2019, 10:57:57 AM CEST
UPDATE AD_IndexColumn SET AD_Column_ID=NULL, ColumnSQL='UPPER(TableName)',Updated=TO_DATE('2019-08-01 10:57:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_IndexColumn_ID=200242
;
-- Aug 1, 2019, 10:58:35 AM CEST
DROP INDEX ad_table_name
;
-- Aug 1, 2019, 10:58:35 AM CEST
CREATE UNIQUE INDEX ad_table_name ON AD_Table (UPPER(TableName))
;
-- Aug 1, 2019, 11:44:05 AM CEST
INSERT INTO AD_Message (MsgType,MsgText,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Message_ID,Value,EntityType,AD_Message_UU) VALUES ('E','Invalid identifier: empty',0,0,'Y',TO_DATE('2019-08-01 11:44:04','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2019-08-01 11:44:04','YYYY-MM-DD HH24:MI:SS'),100,200515,'InvalidIdentifierEmpty','D','b590389d-3397-40be-9b8d-46546c50ba47')
;
-- Aug 1, 2019, 11:44:26 AM CEST
INSERT INTO AD_Message (MsgType,MsgText,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Message_ID,Value,EntityType,AD_Message_UU) VALUES ('E','Invalid identifier: must not contain spaces',0,0,'Y',TO_DATE('2019-08-01 11:44:25','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2019-08-01 11:44:25','YYYY-MM-DD HH24:MI:SS'),100,200516,'InvalidIdentifierSpaces','D','6c46585b-8a0d-410e-a0d8-5eb588bdfee5')
;
-- Aug 1, 2019, 11:44:39 AM CEST
INSERT INTO AD_Message (MsgType,MsgText,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Message_ID,Value,EntityType,AD_Message_UU) VALUES ('E','Invalid identifier: first character must be alphabetic',0,0,'Y',TO_DATE('2019-08-01 11:44:39','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2019-08-01 11:44:39','YYYY-MM-DD HH24:MI:SS'),100,200517,'InvalidIdentifierFirstCharAlpha','D','c83578cb-5af4-427b-aab2-224b45b65620')
;
-- Aug 1, 2019, 11:45:06 AM CEST
INSERT INTO AD_Message (MsgType,MsgText,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Message_ID,Value,EntityType,AD_Message_UU) VALUES ('E','Invalid identifier: just alphanumeric and underscore characters are allowed',0,0,'Y',TO_DATE('2019-08-01 11:45:06','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2019-08-01 11:45:06','YYYY-MM-DD HH24:MI:SS'),100,200518,'InvalidIdentifierJustAlpha','D','f87e4c12-ce8d-464f-a1f7-201529ffa7a8')
;
-- Aug 1, 2019, 11:59:00 AM CEST
UPDATE AD_IndexColumn SET AD_Column_ID=NULL, ColumnSQL='UPPER(ColumnName)',Updated=TO_DATE('2019-08-01 11:59:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_IndexColumn_ID=200068
;
-- Aug 1, 2019, 11:59:04 AM CEST
DROP INDEX ad_column_name
;
-- Aug 1, 2019, 11:59:04 AM CEST
CREATE UNIQUE INDEX ad_column_name ON AD_Column (AD_Table_ID,UPPER(ColumnName))
;
-- Aug 1, 2019, 12:00:09 PM CEST
INSERT INTO AD_TableIndex (AD_Client_ID,AD_Org_ID,AD_TableIndex_ID,AD_TableIndex_UU,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,AD_Table_ID,IsCreateConstraint,IsUnique,Processing,IsKey) VALUES (0,0,201073,'f4182255-8184-4cfd-9fc1-fb8b19d3aaf6',TO_DATE('2019-08-01 12:00:09','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','ad_column_fkconstraintname',TO_DATE('2019-08-01 12:00:09','YYYY-MM-DD HH24:MI:SS'),100,101,'N','Y','N','N')
;
-- Aug 1, 2019, 12:00:37 PM CEST
INSERT INTO AD_IndexColumn (AD_Client_ID,AD_Org_ID,AD_IndexColumn_ID,AD_IndexColumn_UU,Created,CreatedBy,EntityType,IsActive,Updated,UpdatedBy,AD_TableIndex_ID,ColumnSQL,SeqNo) VALUES (0,0,201388,'928de5aa-4a1c-4aed-aaea-86109ba81219',TO_DATE('2019-08-01 12:00:36','YYYY-MM-DD HH24:MI:SS'),100,'D','Y',TO_DATE('2019-08-01 12:00:36','YYYY-MM-DD HH24:MI:SS'),100,201073,'UPPER(FKConstraintName)',1)
;
-- Aug 1, 2019, 12:00:44 PM CEST
CREATE UNIQUE INDEX ad_column_fkconstraintname ON AD_Column (UPPER(FKConstraintName))
;
-- Aug 1, 2019, 12:32:28 PM CEST
UPDATE AD_Tab SET IsSingleRow='Y',Updated=TO_DATE('2019-08-01 12:32:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=200096
;
-- Aug 1, 2019, 12:32:31 PM CEST
UPDATE AD_Tab SET IsSingleRow='Y',Updated=TO_DATE('2019-08-01 12:32:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=200097
;
-- Aug 1, 2019, 12:33:20 PM CEST
INSERT INTO AD_TableIndex (AD_Client_ID,AD_Org_ID,AD_TableIndex_ID,AD_TableIndex_UU,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,AD_Table_ID,IsCreateConstraint,IsUnique,Processing,TableIndexDrop,IsKey) VALUES (0,0,201074,'ed01f300-0824-4497-84b5-4bcfd4c88db9',TO_DATE('2019-08-01 12:33:20','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','ad_tableindex_name',TO_DATE('2019-08-01 12:33:20','YYYY-MM-DD HH24:MI:SS'),100,200085,'N','Y','N','N','N')
;
-- Aug 1, 2019, 12:33:35 PM CEST
INSERT INTO AD_IndexColumn (AD_Client_ID,AD_Org_ID,AD_IndexColumn_ID,AD_IndexColumn_UU,Created,CreatedBy,EntityType,IsActive,Updated,UpdatedBy,AD_TableIndex_ID,ColumnSQL,SeqNo) VALUES (0,0,201389,'a163915d-a5ba-45f9-9411-144d499af1fd',TO_DATE('2019-08-01 12:33:35','YYYY-MM-DD HH24:MI:SS'),100,'D','Y',TO_DATE('2019-08-01 12:33:35','YYYY-MM-DD HH24:MI:SS'),100,201074,'UPPER(Name)',1)
;
-- Aug 1, 2019, 12:33:43 PM CEST
CREATE UNIQUE INDEX ad_tableindex_name ON AD_TableIndex (UPPER(Name))
;
SELECT register_migration_script('201908011127_IDEMPIERE-4017.sql') FROM dual
;

View File

@ -0,0 +1,48 @@
-- IDEMPIERE-4014 - Aging - some lines are hidden if using C_Currency_ID as parameter
-- 07/29/2019 06:17:48
INSERT INTO AD_Element (AD_Element_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,ColumnName,Name,Description,Help,PrintName,EntityType,AD_Element_UU) VALUES (203350,0,0,'Y',TO_TIMESTAMP('2019-07-29 18:17:35','YYYY-MM-DD HH24:MI:SS'),0,TO_TIMESTAMP('2019-07-29 18:17:35','YYYY-MM-DD HH24:MI:SS'),0,'ConvertAmountsInCurrency_ID','Convert Amounts in Currency',NULL,NULL,'Convert Amounts in Currency','D','3ff194dd-160e-4362-b4e5-d0e41221c1c5')
;
-- 07/29/2019 06:18:26
INSERT INTO AD_Process_Para (AD_Process_Para_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,Name,AD_Process_ID,SeqNo,AD_Reference_ID,AD_Reference_Value_ID,IsRange,FieldLength,IsMandatory,ColumnName,IsCentrallyMaintained,EntityType,AD_Element_ID,AD_Process_Para_UU,IsEncrypted) VALUES (200280,0,0,'Y',TO_TIMESTAMP('2019-07-29 18:18:26','YYYY-MM-DD HH24:MI:SS'),0,TO_TIMESTAMP('2019-07-29 18:18:26','YYYY-MM-DD HH24:MI:SS'),0,'Convert Amounts in Currency',238,45,18,112,'N',0,'N','ConvertAmountsInCurrency_ID','Y','D',203350,'a4cc6ea2-103f-4389-bf39-cda71c73028c','N')
;
-- 07/29/2019 06:18:51
UPDATE AD_Process SET Help='The aging report allows you to report on Open Items (Invoices). Select the aging buckets, you want to have in your report. If you select a currency, you get only invoices of that currency.
If you fill the "Convert Amounts in Currency", all amounts will be converted in that currency. If you do not select a Statement Date, the system date is used to calculate the buckets. If you do not list the individual invoices, the Due Date is the earliest due date for the business partner and the Due Days are the average due days of all invoices.<br>
<br>
If you select an Account Date the report will generate the Aging as of that date. The report will exclude documents after the selected date.<br>
<br>
For example: A customer has one invoice for $100 with the Account Date of 03/31/08 and one payment for $100 with the Account Date of 05/01/08. The report will show the following balances based on the Account Date selected: 03/15/08= 0; 04/15/08=100; 05/15/08 = 0.
',Updated=TO_TIMESTAMP('2019-07-29 18:18:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Process_ID=238
;
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_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 (213969,0,'Convert Amounts in Currency',631,'ConvertAmountsInCurrency_ID',10,'N','N','N','N','N',0,'N',30,112,0,0,'Y',TO_TIMESTAMP('2019-07-29 18:34:22','YYYY-MM-DD HH24:MI:SS'),0,TO_TIMESTAMP('2019-07-29 18:34:22','YYYY-MM-DD HH24:MI:SS'),0,203350,'Y','N','D','N','N','N','Y','c34b0911-52ef-4a30-a04c-b2739de87f5d','N',0,'N','N','N','N')
;
-- 07/29/2019 06:34:24
UPDATE AD_Column SET FKConstraintName='ConvertAmountsInCurrency_TAgin', FKConstraintType='N',Updated=TO_TIMESTAMP('2019-07-29 18:34:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Column_ID=213969
;
-- 07/29/2019 06:34:24
ALTER TABLE T_Aging ADD COLUMN ConvertAmountsInCurrency_ID NUMERIC(10) DEFAULT NULL
;
-- 07/29/2019 06:34:24
ALTER TABLE T_Aging ADD CONSTRAINT ConvertAmountsInCurrency_TAgin FOREIGN KEY (ConvertAmountsInCurrency_ID) REFERENCES c_currency(c_currency_id) DEFERRABLE INITIALLY DEFERRED
;
-- 07/29/2019 06:34:28
UPDATE AD_Column SET FKConstraintType='D',Updated=TO_TIMESTAMP('2019-07-29 18:34:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Column_ID=213969
;
-- 07/29/2019 06:34:29
INSERT INTO t_alter_column values('t_aging','ConvertAmountsInCurrency_ID','NUMERIC(10)',null,'NULL')
;
-- 07/29/2019 06:34:29
ALTER TABLE T_Aging DROP CONSTRAINT convertamountsincurrency_tagin
;
SELECT register_migration_script('201907291830_IDEMPIERE-4014.sql') FROM dual
;

View File

@ -0,0 +1,80 @@
-- IDEMPIERE-4017 Create a Unique Key case/accent insensitive to AD_Table.TableName (FHCA-1005)
-- Aug 1, 2019, 10:56:57 AM CEST
UPDATE AD_Column SET IsUpdateable='Y',Updated=TO_TIMESTAMP('2019-08-01 10:56:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=210545
;
-- Aug 1, 2019, 10:57:57 AM CEST
UPDATE AD_IndexColumn SET AD_Column_ID=NULL, ColumnSQL='UPPER(TableName)',Updated=TO_TIMESTAMP('2019-08-01 10:57:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_IndexColumn_ID=200242
;
-- Aug 1, 2019, 10:58:35 AM CEST
DROP INDEX ad_table_name
;
-- Aug 1, 2019, 10:58:35 AM CEST
CREATE UNIQUE INDEX ad_table_name ON AD_Table (UPPER(TableName))
;
-- Aug 1, 2019, 11:44:05 AM CEST
INSERT INTO AD_Message (MsgType,MsgText,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Message_ID,Value,EntityType,AD_Message_UU) VALUES ('E','Invalid identifier: empty',0,0,'Y',TO_TIMESTAMP('2019-08-01 11:44:04','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2019-08-01 11:44:04','YYYY-MM-DD HH24:MI:SS'),100,200515,'InvalidIdentifierEmpty','D','b590389d-3397-40be-9b8d-46546c50ba47')
;
-- Aug 1, 2019, 11:44:26 AM CEST
INSERT INTO AD_Message (MsgType,MsgText,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Message_ID,Value,EntityType,AD_Message_UU) VALUES ('E','Invalid identifier: must not contain spaces',0,0,'Y',TO_TIMESTAMP('2019-08-01 11:44:25','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2019-08-01 11:44:25','YYYY-MM-DD HH24:MI:SS'),100,200516,'InvalidIdentifierSpaces','D','6c46585b-8a0d-410e-a0d8-5eb588bdfee5')
;
-- Aug 1, 2019, 11:44:39 AM CEST
INSERT INTO AD_Message (MsgType,MsgText,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Message_ID,Value,EntityType,AD_Message_UU) VALUES ('E','Invalid identifier: first character must be alphabetic',0,0,'Y',TO_TIMESTAMP('2019-08-01 11:44:39','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2019-08-01 11:44:39','YYYY-MM-DD HH24:MI:SS'),100,200517,'InvalidIdentifierFirstCharAlpha','D','c83578cb-5af4-427b-aab2-224b45b65620')
;
-- Aug 1, 2019, 11:45:06 AM CEST
INSERT INTO AD_Message (MsgType,MsgText,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Message_ID,Value,EntityType,AD_Message_UU) VALUES ('E','Invalid identifier: just alphanumeric and underscore characters are allowed',0,0,'Y',TO_TIMESTAMP('2019-08-01 11:45:06','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2019-08-01 11:45:06','YYYY-MM-DD HH24:MI:SS'),100,200518,'InvalidIdentifierJustAlpha','D','f87e4c12-ce8d-464f-a1f7-201529ffa7a8')
;
-- Aug 1, 2019, 11:59:00 AM CEST
UPDATE AD_IndexColumn SET AD_Column_ID=NULL, ColumnSQL='UPPER(ColumnName)',Updated=TO_TIMESTAMP('2019-08-01 11:59:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_IndexColumn_ID=200068
;
-- Aug 1, 2019, 11:59:04 AM CEST
DROP INDEX ad_column_name
;
-- Aug 1, 2019, 11:59:04 AM CEST
CREATE UNIQUE INDEX ad_column_name ON AD_Column (AD_Table_ID,UPPER(ColumnName))
;
-- Aug 1, 2019, 12:00:09 PM CEST
INSERT INTO AD_TableIndex (AD_Client_ID,AD_Org_ID,AD_TableIndex_ID,AD_TableIndex_UU,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,AD_Table_ID,IsCreateConstraint,IsUnique,Processing,IsKey) VALUES (0,0,201073,'f4182255-8184-4cfd-9fc1-fb8b19d3aaf6',TO_TIMESTAMP('2019-08-01 12:00:09','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','ad_column_fkconstraintname',TO_TIMESTAMP('2019-08-01 12:00:09','YYYY-MM-DD HH24:MI:SS'),100,101,'N','Y','N','N')
;
-- Aug 1, 2019, 12:00:37 PM CEST
INSERT INTO AD_IndexColumn (AD_Client_ID,AD_Org_ID,AD_IndexColumn_ID,AD_IndexColumn_UU,Created,CreatedBy,EntityType,IsActive,Updated,UpdatedBy,AD_TableIndex_ID,ColumnSQL,SeqNo) VALUES (0,0,201388,'928de5aa-4a1c-4aed-aaea-86109ba81219',TO_TIMESTAMP('2019-08-01 12:00:36','YYYY-MM-DD HH24:MI:SS'),100,'D','Y',TO_TIMESTAMP('2019-08-01 12:00:36','YYYY-MM-DD HH24:MI:SS'),100,201073,'UPPER(FKConstraintName)',1)
;
-- Aug 1, 2019, 12:00:44 PM CEST
CREATE UNIQUE INDEX ad_column_fkconstraintname ON AD_Column (UPPER(FKConstraintName))
;
-- Aug 1, 2019, 12:32:28 PM CEST
UPDATE AD_Tab SET IsSingleRow='Y',Updated=TO_TIMESTAMP('2019-08-01 12:32:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=200096
;
-- Aug 1, 2019, 12:32:31 PM CEST
UPDATE AD_Tab SET IsSingleRow='Y',Updated=TO_TIMESTAMP('2019-08-01 12:32:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=200097
;
-- Aug 1, 2019, 12:33:20 PM CEST
INSERT INTO AD_TableIndex (AD_Client_ID,AD_Org_ID,AD_TableIndex_ID,AD_TableIndex_UU,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,AD_Table_ID,IsCreateConstraint,IsUnique,Processing,TableIndexDrop,IsKey) VALUES (0,0,201074,'ed01f300-0824-4497-84b5-4bcfd4c88db9',TO_TIMESTAMP('2019-08-01 12:33:20','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','ad_tableindex_name',TO_TIMESTAMP('2019-08-01 12:33:20','YYYY-MM-DD HH24:MI:SS'),100,200085,'N','Y','N','N','N')
;
-- Aug 1, 2019, 12:33:35 PM CEST
INSERT INTO AD_IndexColumn (AD_Client_ID,AD_Org_ID,AD_IndexColumn_ID,AD_IndexColumn_UU,Created,CreatedBy,EntityType,IsActive,Updated,UpdatedBy,AD_TableIndex_ID,ColumnSQL,SeqNo) VALUES (0,0,201389,'a163915d-a5ba-45f9-9411-144d499af1fd',TO_TIMESTAMP('2019-08-01 12:33:35','YYYY-MM-DD HH24:MI:SS'),100,'D','Y',TO_TIMESTAMP('2019-08-01 12:33:35','YYYY-MM-DD HH24:MI:SS'),100,201074,'UPPER(Name)',1)
;
-- Aug 1, 2019, 12:33:43 PM CEST
CREATE UNIQUE INDEX ad_tableindex_name ON AD_TableIndex (UPPER(Name))
;
SELECT register_migration_script('201908011127_IDEMPIERE-4017.sql') FROM dual
;

View File

@ -46,7 +46,7 @@ public class Aging extends SvrProcess
//FR 1933937
private boolean p_DateAcct = false;
private boolean p_IsSOTrx = false;
private int p_C_Currency_ID = 0;
private int p_ConvertCurrencyTo_ID = 0;
private int p_AD_Org_ID = 0;
private int p_C_BP_Group_ID = 0;
private int p_C_BPartner_ID = 0;
@ -72,7 +72,9 @@ public class Aging extends SvrProcess
else if (name.equals("IsSOTrx"))
p_IsSOTrx = "Y".equals(para[i].getParameter());
else if (name.equals("C_Currency_ID"))
p_C_Currency_ID = ((BigDecimal)para[i].getParameter()).intValue();
;
else if (name.equals("ConvertAmountsInCurrency_ID"))
p_ConvertCurrencyTo_ID = para[i].getParameterAsInt();
else if (name.equals("AD_Org_ID"))
p_AD_Org_ID = ((BigDecimal)para[i].getParameter()).intValue();
else if (name.equals("C_BP_Group_ID"))
@ -99,7 +101,7 @@ public class Aging extends SvrProcess
protected String doIt() throws Exception
{
if (log.isLoggable(Level.INFO)) log.info("StatementDate=" + p_StatementDate + ", IsSOTrx=" + p_IsSOTrx
+ ", C_Currency_ID=" + p_C_Currency_ID + ", AD_Org_ID=" + p_AD_Org_ID
+ ", ConvertAmountsInCurrency_ID=" + p_ConvertCurrencyTo_ID + ", AD_Org_ID=" + p_AD_Org_ID
+ ", C_BP_Group_ID=" + p_C_BP_Group_ID + ", C_BPartner_ID=" + p_C_BPartner_ID
+ ", IsListInvoices=" + p_IsListInvoices);
//FR 1933937
@ -109,7 +111,7 @@ public class Aging extends SvrProcess
sql.append("SELECT bp.C_BP_Group_ID, oi.C_BPartner_ID,oi.C_Invoice_ID,oi.C_InvoicePaySchedule_ID, " // 1..4
+ "oi.C_Currency_ID, oi.IsSOTrx, " // 5..6
+ "oi.DateInvoiced, oi.NetDays,oi.DueDate,oi.DaysDue, "); // 7..10
if (p_C_Currency_ID == 0)
if (p_ConvertCurrencyTo_ID == 0)
{
if (!p_DateAcct)//FR 1933937
{
@ -122,7 +124,7 @@ public class Aging extends SvrProcess
}
else
{
String s = ",oi.C_Currency_ID," + p_C_Currency_ID + ",oi.DateAcct,oi.C_ConversionType_ID,oi.AD_Client_ID,oi.AD_Org_ID)";
String s = ",oi.C_Currency_ID," + p_ConvertCurrencyTo_ID + ",oi.DateAcct,oi.C_ConversionType_ID,oi.AD_Client_ID,oi.AD_Org_ID)";
sql.append("currencyConvert(oi.GrandTotal").append(s); // 11
if (!p_DateAcct)
{
@ -231,6 +233,7 @@ public class Aging extends SvrProcess
aging.setC_Campaign_ID(C_Campaign_ID);
aging.setC_Project_ID(C_Project_ID);
aging.setDateAcct(p_DateAcct);
aging.setConvertAmountsInCurrency_ID(p_ConvertCurrencyTo_ID);
}
// Fill Buckets
aging.add (DueDate, DaysDue, GrandTotal, OpenAmt);

View File

@ -22,6 +22,7 @@ import java.util.List;
import org.adempiere.base.Service;
import org.adempiere.base.ServiceQuery;
import org.compiere.util.CLogger;
import org.compiere.util.Util;
/**
* General Database Constants and Utilities
@ -94,4 +95,25 @@ public class Database
return null;
}
/**
* Apply common validations for database object names
* @param String identifier
* @return String error-code - null if not error
*/
public static String isValidIdentifier(String identifier)
{
if (Util.isEmpty(identifier))
return "InvalidIdentifierEmpty";
// unquoted identifiers cannot contain spaces
if (identifier.contains(" "))
return "InvalidIdentifierSpaces";
// first character of identifier must be alphabetic
if (! identifier.substring(0, 1).matches("[a-zA-Z]"))
return "InvalidIdentifierFirstCharAlpha";
// names must contain just alphanumeric and underscore
if (! identifier.matches("^[a-zA-Z0-9_]*$"))
return "InvalidIdentifierJustAlpha";
return null;
}
} // Database

View File

@ -197,6 +197,17 @@ public interface I_T_Aging
public org.compiere.model.I_C_Project getC_Project() throws RuntimeException;
/** Column name ConvertAmountsInCurrency_ID */
public static final String COLUMNNAME_ConvertAmountsInCurrency_ID = "ConvertAmountsInCurrency_ID";
/** Set Convert Amounts in Currency */
public void setConvertAmountsInCurrency_ID (int ConvertAmountsInCurrency_ID);
/** Get Convert Amounts in Currency */
public int getConvertAmountsInCurrency_ID();
public org.compiere.model.I_C_Currency getConvertAmountsInCurrency() throws RuntimeException;
/** Column name Created */
public static final String COLUMNNAME_Created = "Created";

View File

@ -47,7 +47,7 @@ public class MBPartner extends X_C_BPartner
/**
*
*/
private static final long serialVersionUID = -3098526308112073395L;
private static final long serialVersionUID = -255154524310324997L;
/**
* Get Empty Template Business Partner
@ -135,6 +135,23 @@ public class MBPartner extends X_C_BPartner
.firstOnly();
return retValue;
} // get
/**
* Get BPartner with taxID in a transaction
* @param ctx context
* @param taxID taxID
* @param trxName transaction
* @return BPartner or null
*/
public static MBPartner getFirstWithTaxID (Properties ctx, String taxID, String trxName)
{
final String whereClause = "TaxID=? AND AD_Client_ID=?";
MBPartner retValue = new Query(ctx, Table_Name, whereClause, trxName)
.setParameters(taxID, Env.getAD_Client_ID(ctx))
.setOrderBy(COLUMNNAME_C_BPartner_ID)
.first();
return retValue;
} // getFirstWithTaxID
/**
* Get BPartner with Value

View File

@ -32,6 +32,7 @@ import java.util.Properties;
import java.util.logging.Level;
import org.adempiere.exceptions.DBException;
import org.compiere.db.Database;
import org.compiere.util.CCache;
import org.compiere.util.CLogger;
import org.compiere.util.DB;
@ -254,6 +255,20 @@ public class MColumn extends X_AD_Column
*/
protected boolean beforeSave (boolean newRecord)
{
String error = Database.isValidIdentifier(getColumnName());
if (!Util.isEmpty(error)) {
log.saveError("Error", Msg.getMsg(getCtx(), error) + " [ColumnName]");
return false;
}
if (! Util.isEmpty(getFKConstraintName())) {
error = Database.isValidIdentifier(getFKConstraintName());
if (!Util.isEmpty(error)) {
log.saveError("Error", Msg.getMsg(getCtx(), error) + " [FKConstraintName]");
return false;
}
}
int displayType = getAD_Reference_ID();
if (DisplayType.isLOB(displayType)) // LOBs are 0
{

View File

@ -33,6 +33,7 @@ import org.compiere.util.DB;
import org.compiere.util.DisplayType;
import org.compiere.util.Env;
import org.compiere.util.Msg;
import org.compiere.util.TimeUtil;
import org.compiere.util.Trx;
/**
@ -236,7 +237,7 @@ public class MConversionRate extends X_C_Conversion_Rate
C_ConversionType_ID = MConversionType.getDefault(AD_Client_ID);
// Conversion Date
if (ConvDate == null)
ConvDate = new Timestamp (System.currentTimeMillis());
ConvDate = TimeUtil.getDay(null);
// Get Rate
String sql = "SELECT MultiplyRate "

View File

@ -21,11 +21,14 @@ import java.util.Properties;
import java.util.logging.Level;
import org.adempiere.model.IInfoColumn;
import org.compiere.db.Database;
import org.compiere.model.AccessSqlParser.TableInfo;
import org.compiere.util.DB;
import org.compiere.util.Env;
import org.compiere.util.Evaluatee;
import org.compiere.util.Evaluator;
import org.compiere.util.Msg;
import org.compiere.util.Util;
/**
* Info Window Column Model
@ -137,6 +140,11 @@ public class MInfoColumn extends X_AD_InfoColumn implements IInfoColumn
@Override
protected boolean beforeSave(boolean newRecord) {
String error = Database.isValidIdentifier(getColumnName());
if (!Util.isEmpty(error)) {
log.saveError("Error", Msg.getMsg(getCtx(), error) + " [ColumnName]");
return false;
}
// Sync Terminology
if ((newRecord || is_ValueChanged ("AD_Element_ID"))
&& getAD_Element_ID() != 0 && isCentrallyMaintained())

View File

@ -32,10 +32,13 @@ import java.util.logging.Level;
import org.adempiere.base.IModelFactory;
import org.adempiere.base.Service;
import org.adempiere.model.GenericPO;
import org.compiere.db.Database;
import org.compiere.util.CCache;
import org.compiere.util.CLogger;
import org.compiere.util.DB;
import org.compiere.util.KeyNamePair;
import org.compiere.util.Msg;
import org.compiere.util.Util;
/**
* Persistent Table Model
@ -525,6 +528,11 @@ public class MTable extends X_AD_Table
if (isView() && isDeleteable())
setIsDeleteable(false);
//
String error = Database.isValidIdentifier(getTableName());
if (!Util.isEmpty(error)) {
log.saveError("Error", Msg.getMsg(getCtx(), error) + " [TableName]");
return false;
}
return true;
} // beforeSave

View File

@ -21,13 +21,15 @@ import java.util.List;
import java.util.Properties;
import org.adempiere.exceptions.AdempiereException;
import org.compiere.db.Database;
import org.compiere.util.Msg;
import org.compiere.util.Util;
public class MTableIndex extends X_AD_TableIndex {
/**
*
*/
private static final long serialVersionUID = 5312095272014146977L;
private static final long serialVersionUID = 1433937879086456196L;
/**
* Get active indexes from table
@ -218,6 +220,21 @@ public class MTableIndex extends X_AD_TableIndex {
return sql;
}
/**
* Before Save
* @param newRecord new
* @return true
*/
@Override
protected boolean beforeSave(boolean newRecord) {
String error = Database.isValidIdentifier(getName());
if (!Util.isEmpty(error)) {
log.saveError("Error", Msg.getMsg(getCtx(), error) + " [Name]");
return false;
}
return true;
}
/**
* String representation
* @return info

View File

@ -19,13 +19,16 @@ package org.compiere.model;
import java.sql.ResultSet;
import java.util.Properties;
import org.compiere.db.Database;
import org.compiere.util.Msg;
import org.compiere.util.Util;
public class MViewColumn extends X_AD_ViewColumn {
/**
*
*/
private static final long serialVersionUID = 1497519704377959238L;
private static final long serialVersionUID = -7325808411400037317L;
/**
* Standard constructor
@ -73,4 +76,20 @@ public class MViewColumn extends X_AD_ViewColumn {
.append("]");
return sb.toString();
}
/**
* Before Save
* @param newRecord new
* @return true
*/
@Override
protected boolean beforeSave(boolean newRecord) {
String error = Database.isValidIdentifier(getColumnName());
if (!Util.isEmpty(error)) {
log.saveError("Error", Msg.getMsg(getCtx(), error) + " [ColumnName]");
return false;
}
return true;
}
}

View File

@ -20,6 +20,8 @@ import java.sql.ResultSet;
import java.util.List;
import java.util.Properties;
import org.adempiere.exceptions.AdempiereException;
public class MViewComponent extends X_AD_ViewComponent {
@ -115,6 +117,9 @@ public class MViewComponent extends X_AD_ViewComponent {
break;
}
}
if (vc == null) {
throw new AdempiereException("Cannot find element for " + colName + ". Tip: all components must have the same number and names of columns");
}
if (i>0)
sb.append(", ");
String colSQL = vc.getColumnSQL();

View File

@ -21,9 +21,11 @@ import java.util.Properties;
import java.util.logging.Level;
import org.adempiere.exceptions.DBException;
import org.compiere.db.Database;
import org.compiere.util.DB;
import org.compiere.util.Env;
import org.compiere.util.Msg;
import org.compiere.util.Util;
/**
@ -197,6 +199,11 @@ public class M_Element extends X_AD_Element
return false;
}
}
String error = Database.isValidIdentifier(getColumnName());
if (!Util.isEmpty(error)) {
log.saveError("Error", Msg.getMsg(getCtx(), error) + " [ColumnName]");
return false;
}
return true;
}

View File

@ -2721,12 +2721,24 @@ public abstract class PO
ok = lobSave();
else
{
if (m_trxName == null)
log.saveError("SaveError", "Update return " + no + " instead of 1"
+ " - " + p_info.getTableName() + "." + where);
else
log.saveError("SaveError", "Update return " + no + " instead of 1"
+ " - [" + m_trxName + "] - " + p_info.getTableName() + "." + where);
if (CLogger.peekError() == null) {
if (m_trxName == null)
log.saveError("SaveError", "Update return " + no + " instead of 1"
+ " - " + p_info.getTableName() + "." + where);
else
log.saveError("SaveError", "Update return " + no + " instead of 1"
+ " - [" + m_trxName + "] - " + p_info.getTableName() + "." + where);
} else {
String msg = "Not updated - ";
if (CLogMgt.isLevelFiner())
msg += sql.toString();
else
msg += get_TableName();
if (m_trxName == null)
log.log(Level.WARNING, msg);
else
log.log(Level.WARNING, "[" + m_trxName + "]" + msg);
}
}
return ok;
}

View File

@ -32,7 +32,7 @@ public class X_T_Aging extends PO implements I_T_Aging, I_Persistent
/**
*
*/
private static final long serialVersionUID = 20190106L;
private static final long serialVersionUID = 20190729L;
/** Standard Constructor */
public X_T_Aging (Properties ctx, int T_Aging_ID, String trxName)
@ -353,6 +353,31 @@ public class X_T_Aging extends PO implements I_T_Aging, I_Persistent
return ii.intValue();
}
public org.compiere.model.I_C_Currency getConvertAmountsInCurrency() throws RuntimeException
{
return (org.compiere.model.I_C_Currency)MTable.get(getCtx(), org.compiere.model.I_C_Currency.Table_Name)
.getPO(getConvertAmountsInCurrency_ID(), get_TrxName()); }
/** Set Convert Amounts in Currency.
@param ConvertAmountsInCurrency_ID Convert Amounts in Currency */
public void setConvertAmountsInCurrency_ID (int ConvertAmountsInCurrency_ID)
{
if (ConvertAmountsInCurrency_ID < 1)
set_Value (COLUMNNAME_ConvertAmountsInCurrency_ID, null);
else
set_Value (COLUMNNAME_ConvertAmountsInCurrency_ID, Integer.valueOf(ConvertAmountsInCurrency_ID));
}
/** Get Convert Amounts in Currency.
@return Convert Amounts in Currency */
public int getConvertAmountsInCurrency_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_ConvertAmountsInCurrency_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Account Date.
@param DateAcct
Accounting Date

View File

@ -730,7 +730,7 @@ public class InfoWindow extends InfoPanel implements ValueChangeListener, EventL
//Xolali - add embeddedTbl to list, add m_sqlembedded to list
EmbedWinInfo ewinInfo = new EmbedWinInfo(embedInfo,embeddedTbl,m_sqlEmbedded,relatedInfo.getLinkColumnName(), relatedInfo.getLinkInfoColumn(), relatedInfo.getParentRelatedColumn_ID());
embeddedWinList.add(ewinInfo);
RelatedInfoWindow relatedInfoWindow = new RelatedInfoWindow(ewinInfo, this, embeddedPaging, s_sqlCount, s_layoutEmbedded);
RelatedInfoWindow relatedInfoWindow = new RelatedInfoWindow(ewinInfo, this, embeddedPaging, s_sqlCount, s_layoutEmbedded, editorMap);
relatedMap.put(embedInfo.getAD_InfoWindow_ID(), relatedInfoWindow);
MInfoWindow riw = (MInfoWindow) relatedInfo.getRelatedInfo();

View File

@ -87,7 +87,8 @@ public class RelatedInfoWindow implements EventListener<Event>, Sortable<Object>
* @param layoutEmbedded
*
*/
public RelatedInfoWindow(EmbedWinInfo info, InfoWindow infoWindow, Paging embeddedPaging, String infoSqlCount, ColumnInfo[] layoutEmbedded) {
public RelatedInfoWindow(EmbedWinInfo info, InfoWindow infoWindow, Paging embeddedPaging, String infoSqlCount, ColumnInfo[] layoutEmbedded, Map<String, WEditor> editorMap) {
this.editorMap = editorMap;
this.info = info;
parentInfoWindow = infoWindow;
this.paging = embeddedPaging;