-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
-- Apr 19, 2018 10:43:06 PM UTC
INSERT INTO AD_Element (AD_Element_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,ColumnName,Name,PrintName,EntityType,AD_Element_UU) VALUES (30000,0,0,'Y',TO_TIMESTAMP('2018-04-19 22:43:06','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2018-04-19 22:43:06','YYYY-MM-DD HH24:MI:SS'),100,'RefDocumentNo','Document No Ref.','Document No Ref.','U','fdd90183-f5be-44d9-80be-15f9c981f740')
;

-- Apr 19, 2018 10:43:16 PM UTC
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) VALUES (30000,0,'Line No','Unique line for this document','Indicates the unique line for a document.  It will also control the display order of the lines within a document.',270,'Line',22,'N','N','N','N','N',0,'N',11,0,0,'Y',TO_TIMESTAMP('2018-04-19 22:43:16','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2018-04-19 22:43:16','YYYY-MM-DD HH24:MI:SS'),100,439,'N','N','U','N','N','N','Y','e42dcad3-6658-4b7f-bb5e-836ce1f235ae','Y',0,'N','N')
;

-- Apr 19, 2018 10:43:22 PM UTC
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) VALUES (30001,0,'Document No','Document sequence number of the document','The document number is usually automatically generated by the system and determined by the document type of the document. If the document is not saved, the preliminary number is displayed in "<>".

If the document type of your document has no automatic document sequence defined, the field is empty if you create a new document. This is for documents which usually have an external number (like vendor invoice).  If you leave the field empty, the system will generate a document number for you. The document sequence used for this fallback number is defined in the "Maintain Sequence" window with the name "DocumentNo_<TableName>", where TableName is the actual name of the table (e.g. C_Order).',270,'DocumentNo',30,'N','N','N','N','N',0,'N',10,0,0,'Y',TO_TIMESTAMP('2018-04-19 22:43:22','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2018-04-19 22:43:22','YYYY-MM-DD HH24:MI:SS'),100,290,'N','Y','U','N','N','N','Y','f03c57f5-28a6-4185-bc84-27946d4efa09','Y',0,'N','N')
;

-- Apr 19, 2018 10:43:30 PM UTC
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) VALUES (30002,0,'Document No Ref.',270,'RefDocumentNo',50,'N','N','N','N','N',0,'N',10,0,0,'Y',TO_TIMESTAMP('2018-04-19 22:43:30','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2018-04-19 22:43:30','YYYY-MM-DD HH24:MI:SS'),100,30000,'Y','N','U','N','N','N','Y','0158d128-1734-4eda-9534-2550def4c43b','Y',0,'N','N')
;

-- Apr 19, 2018 10:44:29 PM UTC
ALTER TABLE Fact_Acct ADD COLUMN RefDocumentNo VARCHAR(50) DEFAULT NULL 
;

-- Apr 19, 2018 10:44:45 PM UTC
ALTER TABLE Fact_Acct ADD COLUMN DocumentNo VARCHAR(30) DEFAULT NULL 
;

-- Apr 19, 2018 10:44:51 PM UTC
ALTER TABLE Fact_Acct ADD COLUMN Line NUMERIC(10) DEFAULT NULL 
;

