IDEMPIERE-4435 : GL Distribution - add ValidFrom / ValidTo (#238)

* IDEMPIERE-4435 : GL Distribution - add ValidFrom / ValidTo

* IDEMPIERE-4435 : GL Distribution - add ValidFrom / ValidTo (javadoc)
This commit is contained in:
Nicolas Micoud 2020-08-28 16:14:45 +02:00 committed by GitHub
parent 7324dde78e
commit 3384819c49
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 389 additions and 8 deletions

View File

@ -0,0 +1,158 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- IDEMPIERE-4435 : GL Distribution - add ValidFrom / ValidTo
-- 2020-08-27 02:09:55
INSERT INTO AD_Column (AD_Column_ID,Version,Name,Description,Help,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 (214224,0,'Valid from','Valid from including this date (first day)','The Valid From date indicates the first day of a date range',708,'ValidFrom',7,'N','N','N','N','N',0,'N',15,0,0,'Y',TO_DATE('2020-08-27 14:09:55','YYYY-MM-DD HH24:MI:SS'),0,TO_DATE('2020-08-27 14:09:55','YYYY-MM-DD HH24:MI:SS'),0,617,'Y','N','D','N','N','N','Y','ad11b437-4150-41b2-b90e-d519f1d99616','Y',0,'N','N','N')
;
-- 2020-08-27 02:09:56
ALTER TABLE GL_Distribution ADD ValidFrom DATE DEFAULT NULL
;
-- 2020-08-27 02:10:05
INSERT INTO AD_Column (AD_Column_ID,Version,Name,Description,Help,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 (214225,0,'Valid to','Valid to including this date (last day)','The Valid To date indicates the last day of a date range',708,'ValidTo',7,'N','N','N','N','N',0,'N',15,0,0,'Y',TO_DATE('2020-08-27 14:10:05','YYYY-MM-DD HH24:MI:SS'),0,TO_DATE('2020-08-27 14:10:05','YYYY-MM-DD HH24:MI:SS'),0,618,'Y','N','U','N','N','N','Y','dbba05f7-f7ad-4b58-94e9-c4b99992b7d5','Y',0,'N','N','N')
;
-- 2020-08-27 02:10:10
UPDATE AD_Column SET EntityType='D',Updated=TO_DATE('2020-08-27 14:10:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Column_ID=214225
;
-- 2020-08-27 02:10:11
ALTER TABLE GL_Distribution ADD ValidTo DATE DEFAULT NULL
;
-- 2020-08-27 02:10:22
INSERT INTO AD_Field (AD_Field_ID,Name,Description,Help,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 (206428,'Valid from','Valid from including this date (first day)','The Valid From date indicates the first day of a date range',646,214224,'Y',7,410,'N','N','N','N',0,0,'Y',TO_DATE('2020-08-27 14:10:22','YYYY-MM-DD HH24:MI:SS'),0,TO_DATE('2020-08-27 14:10:22','YYYY-MM-DD HH24:MI:SS'),0,'N','Y','D','e7713cf8-c25f-4647-b5ce-1084fe742a91','Y',400,2)
;
-- 2020-08-27 02:10:23
INSERT INTO AD_Field (AD_Field_ID,Name,Description,Help,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 (206429,'Valid to','Valid to including this date (last day)','The Valid To date indicates the last day of a date range',646,214225,'Y',7,420,'N','N','N','N',0,0,'Y',TO_DATE('2020-08-27 14:10:22','YYYY-MM-DD HH24:MI:SS'),0,TO_DATE('2020-08-27 14:10:22','YYYY-MM-DD HH24:MI:SS'),0,'N','Y','D','d6494919-3fe9-4b0e-97a1-dc46539b1655','Y',410,2)
;
-- 2020-08-27 02:10:35
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=120, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, XPosition=1, IsToolbarButton=NULL,Updated=TO_DATE('2020-08-27 14:10:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=206428
;
-- 2020-08-27 02:10:35
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=130, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, XPosition=4, IsToolbarButton=NULL,Updated=TO_DATE('2020-08-27 14:10:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=206429
;
-- 2020-08-27 02:10:35
UPDATE AD_Field SET SeqNo=140, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2020-08-27 14:10:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=10866
;
-- 2020-08-27 02:10:35
UPDATE AD_Field SET SeqNo=150, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2020-08-27 14:10:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=10149
;
-- 2020-08-27 02:10:35
UPDATE AD_Field SET SeqNo=160, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2020-08-27 14:10:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=10860
;
-- 2020-08-27 02:10:35
UPDATE AD_Field SET SeqNo=170, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2020-08-27 14:10:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=10145
;
-- 2020-08-27 02:10:35
UPDATE AD_Field SET SeqNo=180, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2020-08-27 14:10:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=10868
;
-- 2020-08-27 02:10:35
UPDATE AD_Field SET SeqNo=190, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2020-08-27 14:10:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=10141
;
-- 2020-08-27 02:10:35
UPDATE AD_Field SET SeqNo=200, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2020-08-27 14:10:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=10869
;
-- 2020-08-27 02:10:35
UPDATE AD_Field SET SeqNo=210, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2020-08-27 14:10:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=10142
;
-- 2020-08-27 02:10:35
UPDATE AD_Field SET SeqNo=220, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2020-08-27 14:10:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=10864
;
-- 2020-08-27 02:10:35
UPDATE AD_Field SET SeqNo=230, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2020-08-27 14:10:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=10133
;
-- 2020-08-27 02:10:35
UPDATE AD_Field SET SeqNo=240, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2020-08-27 14:10:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=10873
;
-- 2020-08-27 02:10:35
UPDATE AD_Field SET SeqNo=250, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2020-08-27 14:10:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=10150
;
-- 2020-08-27 02:10:35
UPDATE AD_Field SET SeqNo=260, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2020-08-27 14:10:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=10865
;
-- 2020-08-27 02:10:35
UPDATE AD_Field SET SeqNo=270, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2020-08-27 14:10:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=10143
;
-- 2020-08-27 02:10:35
UPDATE AD_Field SET SeqNo=280, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2020-08-27 14:10:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=10871
;
-- 2020-08-27 02:10:35
UPDATE AD_Field SET SeqNo=290, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2020-08-27 14:10:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=10154
;
-- 2020-08-27 02:10:35
UPDATE AD_Field SET SeqNo=300, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2020-08-27 14:10:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=10872
;
-- 2020-08-27 02:10:35
UPDATE AD_Field SET SeqNo=310, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2020-08-27 14:10:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=10138
;
-- 2020-08-27 02:10:35
UPDATE AD_Field SET SeqNo=320, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2020-08-27 14:10:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=10867
;
-- 2020-08-27 02:10:35
UPDATE AD_Field SET SeqNo=330, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2020-08-27 14:10:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=10156
;
-- 2020-08-27 02:10:35
UPDATE AD_Field SET SeqNo=340, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2020-08-27 14:10:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=10861
;
-- 2020-08-27 02:10:35
UPDATE AD_Field SET SeqNo=350, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2020-08-27 14:10:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=10148
;
-- 2020-08-27 02:10:35
UPDATE AD_Field SET SeqNo=360, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2020-08-27 14:10:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=10874
;
-- 2020-08-27 02:10:35
UPDATE AD_Field SET SeqNo=370, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2020-08-27 14:10:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=10137
;
-- 2020-08-27 02:10:35
UPDATE AD_Field SET SeqNo=380, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2020-08-27 14:10:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=10863
;
-- 2020-08-27 02:10:35
UPDATE AD_Field SET SeqNo=390, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2020-08-27 14:10:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=10155
;
-- 2020-08-27 02:10:35
UPDATE AD_Field SET SeqNo=400, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2020-08-27 14:10:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=10870
;
-- 2020-08-27 02:10:35
UPDATE AD_Field SET SeqNo=410, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2020-08-27 14:10:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=10134
;
-- 2020-08-27 02:10:35
UPDATE AD_Field SET SeqNo=420, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2020-08-27 14:10:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=10140
;
SELECT register_migration_script('202008271430_IDEMPIERE-4435.sql') FROM dual
;

View File

@ -0,0 +1,155 @@
-- IDEMPIERE-4435 : GL Distribution - add ValidFrom / ValidTo
-- 2020-08-27 02:09:55
INSERT INTO AD_Column (AD_Column_ID,Version,Name,Description,Help,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 (214224,0,'Valid from','Valid from including this date (first day)','The Valid From date indicates the first day of a date range',708,'ValidFrom',7,'N','N','N','N','N',0,'N',15,0,0,'Y',TO_TIMESTAMP('2020-08-27 14:09:55','YYYY-MM-DD HH24:MI:SS'),0,TO_TIMESTAMP('2020-08-27 14:09:55','YYYY-MM-DD HH24:MI:SS'),0,617,'Y','N','D','N','N','N','Y','ad11b437-4150-41b2-b90e-d519f1d99616','Y',0,'N','N','N')
;
-- 2020-08-27 02:09:56
ALTER TABLE GL_Distribution ADD COLUMN ValidFrom TIMESTAMP DEFAULT NULL
;
-- 2020-08-27 02:10:05
INSERT INTO AD_Column (AD_Column_ID,Version,Name,Description,Help,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 (214225,0,'Valid to','Valid to including this date (last day)','The Valid To date indicates the last day of a date range',708,'ValidTo',7,'N','N','N','N','N',0,'N',15,0,0,'Y',TO_TIMESTAMP('2020-08-27 14:10:05','YYYY-MM-DD HH24:MI:SS'),0,TO_TIMESTAMP('2020-08-27 14:10:05','YYYY-MM-DD HH24:MI:SS'),0,618,'Y','N','U','N','N','N','Y','dbba05f7-f7ad-4b58-94e9-c4b99992b7d5','Y',0,'N','N','N')
;
-- 2020-08-27 02:10:10
UPDATE AD_Column SET EntityType='D',Updated=TO_TIMESTAMP('2020-08-27 14:10:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Column_ID=214225
;
-- 2020-08-27 02:10:11
ALTER TABLE GL_Distribution ADD COLUMN ValidTo TIMESTAMP DEFAULT NULL
;
-- 2020-08-27 02:10:22
INSERT INTO AD_Field (AD_Field_ID,Name,Description,Help,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 (206428,'Valid from','Valid from including this date (first day)','The Valid From date indicates the first day of a date range',646,214224,'Y',7,410,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2020-08-27 14:10:22','YYYY-MM-DD HH24:MI:SS'),0,TO_TIMESTAMP('2020-08-27 14:10:22','YYYY-MM-DD HH24:MI:SS'),0,'N','Y','D','e7713cf8-c25f-4647-b5ce-1084fe742a91','Y',400,2)
;
-- 2020-08-27 02:10:23
INSERT INTO AD_Field (AD_Field_ID,Name,Description,Help,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 (206429,'Valid to','Valid to including this date (last day)','The Valid To date indicates the last day of a date range',646,214225,'Y',7,420,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2020-08-27 14:10:22','YYYY-MM-DD HH24:MI:SS'),0,TO_TIMESTAMP('2020-08-27 14:10:22','YYYY-MM-DD HH24:MI:SS'),0,'N','Y','D','d6494919-3fe9-4b0e-97a1-dc46539b1655','Y',410,2)
;
-- 2020-08-27 02:10:35
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=120, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, XPosition=1, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2020-08-27 14:10:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=206428
;
-- 2020-08-27 02:10:35
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=130, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, XPosition=4, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2020-08-27 14:10:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=206429
;
-- 2020-08-27 02:10:35
UPDATE AD_Field SET SeqNo=140, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2020-08-27 14:10:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=10866
;
-- 2020-08-27 02:10:35
UPDATE AD_Field SET SeqNo=150, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2020-08-27 14:10:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=10149
;
-- 2020-08-27 02:10:35
UPDATE AD_Field SET SeqNo=160, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2020-08-27 14:10:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=10860
;
-- 2020-08-27 02:10:35
UPDATE AD_Field SET SeqNo=170, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2020-08-27 14:10:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=10145
;
-- 2020-08-27 02:10:35
UPDATE AD_Field SET SeqNo=180, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2020-08-27 14:10:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=10868
;
-- 2020-08-27 02:10:35
UPDATE AD_Field SET SeqNo=190, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2020-08-27 14:10:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=10141
;
-- 2020-08-27 02:10:35
UPDATE AD_Field SET SeqNo=200, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2020-08-27 14:10:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=10869
;
-- 2020-08-27 02:10:35
UPDATE AD_Field SET SeqNo=210, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2020-08-27 14:10:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=10142
;
-- 2020-08-27 02:10:35
UPDATE AD_Field SET SeqNo=220, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2020-08-27 14:10:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=10864
;
-- 2020-08-27 02:10:35
UPDATE AD_Field SET SeqNo=230, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2020-08-27 14:10:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=10133
;
-- 2020-08-27 02:10:35
UPDATE AD_Field SET SeqNo=240, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2020-08-27 14:10:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=10873
;
-- 2020-08-27 02:10:35
UPDATE AD_Field SET SeqNo=250, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2020-08-27 14:10:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=10150
;
-- 2020-08-27 02:10:35
UPDATE AD_Field SET SeqNo=260, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2020-08-27 14:10:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=10865
;
-- 2020-08-27 02:10:35
UPDATE AD_Field SET SeqNo=270, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2020-08-27 14:10:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=10143
;
-- 2020-08-27 02:10:35
UPDATE AD_Field SET SeqNo=280, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2020-08-27 14:10:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=10871
;
-- 2020-08-27 02:10:35
UPDATE AD_Field SET SeqNo=290, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2020-08-27 14:10:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=10154
;
-- 2020-08-27 02:10:35
UPDATE AD_Field SET SeqNo=300, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2020-08-27 14:10:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=10872
;
-- 2020-08-27 02:10:35
UPDATE AD_Field SET SeqNo=310, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2020-08-27 14:10:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=10138
;
-- 2020-08-27 02:10:35
UPDATE AD_Field SET SeqNo=320, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2020-08-27 14:10:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=10867
;
-- 2020-08-27 02:10:35
UPDATE AD_Field SET SeqNo=330, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2020-08-27 14:10:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=10156
;
-- 2020-08-27 02:10:35
UPDATE AD_Field SET SeqNo=340, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2020-08-27 14:10:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=10861
;
-- 2020-08-27 02:10:35
UPDATE AD_Field SET SeqNo=350, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2020-08-27 14:10:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=10148
;
-- 2020-08-27 02:10:35
UPDATE AD_Field SET SeqNo=360, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2020-08-27 14:10:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=10874
;
-- 2020-08-27 02:10:35
UPDATE AD_Field SET SeqNo=370, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2020-08-27 14:10:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=10137
;
-- 2020-08-27 02:10:35
UPDATE AD_Field SET SeqNo=380, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2020-08-27 14:10:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=10863
;
-- 2020-08-27 02:10:35
UPDATE AD_Field SET SeqNo=390, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2020-08-27 14:10:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=10155
;
-- 2020-08-27 02:10:35
UPDATE AD_Field SET SeqNo=400, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2020-08-27 14:10:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=10870
;
-- 2020-08-27 02:10:35
UPDATE AD_Field SET SeqNo=410, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2020-08-27 14:10:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=10134
;
-- 2020-08-27 02:10:35
UPDATE AD_Field SET SeqNo=420, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2020-08-27 14:10:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=10140
;
SELECT register_migration_script('202008271430_IDEMPIERE-4435.sql') FROM dual
;

View File

@ -702,7 +702,7 @@ public final class Fact
{
FactLine dLine = (FactLine)m_lines.get(i);
MDistribution[] distributions = MDistribution.get (dLine.getAccount(),
m_postingType, m_doc.getC_DocType_ID());
m_postingType, m_doc.getC_DocType_ID(), dLine.getDateAcct());
// No Distribution for this line
//AZ Goodwill
//The above "get" only work in GL Journal because it's using ValidCombination Account
@ -714,7 +714,7 @@ public final class Fact
if (distributions == null || distributions.length == 0)
{
distributions = MDistribution.get (dLine.getCtx(), dLine.getC_AcctSchema_ID(),
m_postingType, m_doc.getC_DocType_ID(),
m_postingType, m_doc.getC_DocType_ID(), dLine.getDateAcct(),
dLine.getAD_Org_ID(), dLine.getAccount_ID(),
dLine.getM_Product_ID(), dLine.getC_BPartner_ID(), dLine.getC_Project_ID(),
dLine.getC_Campaign_ID(), dLine.getC_Activity_ID(), dLine.getAD_OrgTrx_ID(),

View File

@ -633,4 +633,30 @@ public interface I_GL_Distribution
public int getUser2_ID();
public org.compiere.model.I_C_ElementValue getUser2() throws RuntimeException;
/** Column name ValidFrom */
public static final String COLUMNNAME_ValidFrom = "ValidFrom";
/** Set Valid from.
* Valid from including this date (first day)
*/
public void setValidFrom (Timestamp ValidFrom);
/** Get Valid from.
* Valid from including this date (first day)
*/
public Timestamp getValidFrom();
/** Column name ValidTo */
public static final String COLUMNNAME_ValidTo = "ValidTo";
/** Set Valid to.
* Valid to including this date (last day)
*/
public void setValidTo (Timestamp ValidTo);
/** Get Valid to.
* Valid to including this date (last day)
*/
public Timestamp getValidTo();
}

View File

@ -18,6 +18,7 @@ package org.compiere.model;
import java.math.BigDecimal;
import java.sql.ResultSet;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
@ -40,20 +41,21 @@ public class MDistribution extends X_GL_Distribution
/**
*
*/
private static final long serialVersionUID = 3782058638272715005L;
private static final long serialVersionUID = -5964912910470166735L;
/**
* Get Distribution for combination
* @param acct account (ValidCombination)
* @param PostingType only posting type
* @param C_DocType_ID only document type
* @param dateAcct date (to be tested with ValidFrom/ValidTo)
* @return array of distributions
*/
public static MDistribution[] get (MAccount acct,
String PostingType, int C_DocType_ID)
String PostingType, int C_DocType_ID, Timestamp dateAcct)
{
return get (acct.getCtx(), acct.getC_AcctSchema_ID(),
PostingType, C_DocType_ID,
PostingType, C_DocType_ID, dateAcct,
acct.getAD_Org_ID(), acct.getAccount_ID(),
acct.getM_Product_ID(), acct.getC_BPartner_ID(), acct.getC_Project_ID(),
acct.getC_Campaign_ID(), acct.getC_Activity_ID(), acct.getAD_OrgTrx_ID(),
@ -67,6 +69,7 @@ public class MDistribution extends X_GL_Distribution
* @param C_AcctSchema_ID schema
* @param PostingType posting type
* @param C_DocType_ID document type
* @param dateAcct date (to be tested with ValidFrom/ValidTo)
* @param AD_Org_ID org
* @param Account_ID account
* @param M_Product_ID product
@ -83,7 +86,7 @@ public class MDistribution extends X_GL_Distribution
* @return array of distributions or null
*/
public static MDistribution[] get (Properties ctx, int C_AcctSchema_ID,
String PostingType, int C_DocType_ID,
String PostingType, int C_DocType_ID, Timestamp dateAcct,
int AD_Org_ID, int Account_ID,
int M_Product_ID, int C_BPartner_ID, int C_Project_ID,
int C_Campaign_ID, int C_Activity_ID, int AD_OrgTrx_ID,
@ -103,11 +106,15 @@ public class MDistribution extends X_GL_Distribution
// Mandatory Acct Schema
if (distribution.getC_AcctSchema_ID() != C_AcctSchema_ID)
continue;
// Only Posting Type / DocType
// Only Posting Type / DocType / ValidFrom / ValidTo
if (distribution.getPostingType() != null && !distribution.getPostingType().equals(PostingType))
continue;
if (distribution.getC_DocType_ID() != 0 && distribution.getC_DocType_ID() != C_DocType_ID)
continue;
if (distribution.getValidFrom() != null && distribution.getValidFrom().after(dateAcct))
continue;
if (distribution.getValidTo() != null && distribution.getValidTo().before(dateAcct))
continue;
// Optional Elements - "non-Any"
if (!distribution.isAnyOrg() && distribution.getOrg_ID() != AD_Org_ID)

View File

@ -19,6 +19,7 @@ package org.compiere.model;
import java.math.BigDecimal;
import java.sql.ResultSet;
import java.sql.Timestamp;
import java.util.Properties;
import org.compiere.util.Env;
import org.compiere.util.KeyNamePair;
@ -32,7 +33,7 @@ public class X_GL_Distribution extends PO implements I_GL_Distribution, I_Persis
/**
*
*/
private static final long serialVersionUID = 20200820L;
private static final long serialVersionUID = 20200827L;
/** Standard Constructor */
public X_GL_Distribution (Properties ctx, int GL_Distribution_ID, String trxName)
@ -1063,4 +1064,38 @@ public class X_GL_Distribution extends PO implements I_GL_Distribution, I_Persis
return 0;
return ii.intValue();
}
/** Set Valid from.
@param ValidFrom
Valid from including this date (first day)
*/
public void setValidFrom (Timestamp ValidFrom)
{
set_Value (COLUMNNAME_ValidFrom, ValidFrom);
}
/** Get Valid from.
@return Valid from including this date (first day)
*/
public Timestamp getValidFrom ()
{
return (Timestamp)get_Value(COLUMNNAME_ValidFrom);
}
/** Set Valid to.
@param ValidTo
Valid to including this date (last day)
*/
public void setValidTo (Timestamp ValidTo)
{
set_Value (COLUMNNAME_ValidTo, ValidTo);
}
/** Get Valid to.
@return Valid to including this date (last day)
*/
public Timestamp getValidTo ()
{
return (Timestamp)get_Value(COLUMNNAME_ValidTo);
}
}