-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
-- Feb 21, 2018 5:31:57 AM 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_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) VALUES (300055,0,'Sales Representative','Sales Representative or Company Agent','The Sales Representative indicates the Sales Rep for this Region.  Any Sales Rep must be a valid internal user.',300000,'SalesRep_ID',22,'N','N','N','N','N',0,'N',18,190,0,0,'Y',TO_TIMESTAMP('2018-02-21 05:31:57','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2018-02-21 05:31:57','YYYY-MM-DD HH24:MI:SS'),100,1063,'N','N','U','N','N','N','Y','161d1164-2d6c-4be5-a400-f6f2473a891b','Y',0,'N','N')
;

-- Feb 21, 2018 5:32:39 AM UTC
UPDATE AD_Column SET FKConstraintName='SalesRep_MIDRequisition', FKConstraintType='N',Updated=TO_TIMESTAMP('2018-02-21 05:32:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=300055
;

-- Feb 21, 2018 5:32:39 AM UTC
ALTER TABLE MID_Requisition ADD COLUMN SalesRep_ID NUMERIC(10) DEFAULT NULL 
;

-- Feb 21, 2018 5:32:39 AM UTC
ALTER TABLE MID_Requisition ADD CONSTRAINT SalesRep_MIDRequisition FOREIGN KEY (SalesRep_ID) REFERENCES ad_user(ad_user_id) DEFERRABLE INITIALLY DEFERRED
;

-- Feb 21, 2018 8:28:39 AM UTC
INSERT INTO AD_Workflow (Name,AD_Workflow_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AccessLevel,EntityType,Author,Priority,WorkingTime,"limit",Duration,Version,Cost,DurationUnit,WaitingTime,PublishStatus,IsDefault,ValidateWorkflow,AD_Table_ID,Value,WorkflowType,IsValid,SetupTime,MovingTime,DocumentNo,QtyBatchSize,QueuingTime,IsBetaFunctionality,Yield,UnitsCycles,OverlapUnits,AD_Workflow_UU) VALUES ('Process Sales Requisition',300000,0,0,'Y',TO_TIMESTAMP('2018-02-21 08:28:39','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2018-02-21 08:28:39','YYYY-MM-DD HH24:MI:SS'),100,'3','U','Midsuit',0,0,0,0,0,0,'D',0,'U','N','N',300000,'Process_MID_Requisition','P','N',0,0,'10000000',1,0,'N',100,0,0,'84d1b007-e5cc-44a3-b7f5-5afbeb668e7e')
;

-- Feb 21, 2018 8:28:57 AM UTC
INSERT INTO AD_WF_Node (AD_WF_Node_ID,Name,AD_Workflow_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,"action",IsCentrallyMaintained,YPosition,EntityType,XPosition,"limit",Duration,Cost,WaitingTime,WorkingTime,Priority,JoinElement,SplitElement,WaitTime,DocAction,Value,DynPriorityChange,IsMilestone,IsSubcontracting,UnitsCycles,OverlapUnits,Yield,AD_WF_Node_UU,AD_InfoWindow_ID) VALUES (300000,'(Start)',300000,0,0,'Y',TO_TIMESTAMP('2018-02-21 08:28:57','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2018-02-21 08:28:57','YYYY-MM-DD HH24:MI:SS'),100,'Z','Y',0,'U',0,0,0,0,0,0,0,'X','X',0,'CO','(Start)',0,'N','N',0,0,100,'109f650e-c7ab-476b-bf92-b18711a55d08',200000)
;

-- Feb 21, 2018 8:29:12 AM UTC
INSERT INTO AD_WF_Node (AD_WF_Node_ID,Name,AD_Workflow_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,"action",IsCentrallyMaintained,YPosition,EntityType,XPosition,"limit",Duration,Cost,WaitingTime,WorkingTime,Priority,JoinElement,SplitElement,WaitTime,DocAction,Value,DynPriorityChange,IsMilestone,IsSubcontracting,UnitsCycles,OverlapUnits,Yield,AD_WF_Node_UU,AD_InfoWindow_ID) VALUES (300001,'(DocPrepare)',300000,0,0,'Y',TO_TIMESTAMP('2018-02-21 08:29:12','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2018-02-21 08:29:12','YYYY-MM-DD HH24:MI:SS'),100,'D','Y',0,'U',0,0,0,0,0,0,0,'X','X',0,'PR','(DocPrepare)',0,'N','N',0,0,100,'761af635-83b2-49f9-85de-7669ad09cd4c',200000)
;

-- Feb 21, 2018 8:29:21 AM UTC
INSERT INTO AD_WF_Node (AD_WF_Node_ID,Name,AD_Workflow_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,"action",IsCentrallyMaintained,YPosition,EntityType,XPosition,"limit",Duration,Cost,WaitingTime,WorkingTime,Priority,JoinElement,SplitElement,WaitTime,DocAction,Value,DynPriorityChange,IsMilestone,IsSubcontracting,UnitsCycles,OverlapUnits,Yield,AD_WF_Node_UU,AD_InfoWindow_ID) VALUES (300002,'(DocComplete)',300000,0,0,'Y',TO_TIMESTAMP('2018-02-21 08:29:21','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2018-02-21 08:29:21','YYYY-MM-DD HH24:MI:SS'),100,'D','Y',0,'U',0,0,0,0,0,0,0,'X','X',0,'CO','(DocComplete)',0,'N','N',0,0,100,'03dce32e-29e2-409b-9091-ca9be7711625',200000)
;

-- Feb 21, 2018 8:30:12 AM UTC
INSERT INTO AD_WF_Node (AD_WF_Node_ID,Name,AD_Workflow_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,"action",IsCentrallyMaintained,YPosition,EntityType,XPosition,"limit",Duration,Cost,WaitingTime,WorkingTime,Priority,JoinElement,SplitElement,WaitTime,DocAction,Value,DynPriorityChange,IsMilestone,IsSubcontracting,UnitsCycles,OverlapUnits,Yield,AD_WF_Node_UU,AD_InfoWindow_ID) VALUES (300003,'(DocAuto)',300000,0,0,'Y',TO_TIMESTAMP('2018-02-21 08:30:12','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2018-02-21 08:30:12','YYYY-MM-DD HH24:MI:SS'),100,'D','Y',0,'U',0,0,0,0,0,0,0,'X','X',0,'--','(DocAuto)',0,'N','N',0,0,100,'34dbbaf3-2255-40dd-9cbd-3eaa929e0a85',200000)
;

-- Feb 21, 2018 8:30:28 AM UTC
INSERT INTO AD_WF_NodeNext (AD_WF_Node_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Client_ID,AD_Org_ID,AD_WF_Next_ID,EntityType,SeqNo,AD_WF_NodeNext_ID,IsStdUserWorkflow,AD_WF_NodeNext_UU) VALUES (300000,'Y',TO_TIMESTAMP('2018-02-21 08:30:28','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2018-02-21 08:30:28','YYYY-MM-DD HH24:MI:SS'),100,0,0,300001,'U',10,300000,'Y','54e0cd73-5255-4c14-8113-e6181c077ea4')
;

-- Feb 21, 2018 8:30:33 AM UTC
INSERT INTO AD_WF_NodeNext (AD_WF_Node_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Client_ID,AD_Org_ID,AD_WF_Next_ID,EntityType,SeqNo,AD_WF_NodeNext_ID,IsStdUserWorkflow,AD_WF_NodeNext_UU) VALUES (300000,'Y',TO_TIMESTAMP('2018-02-21 08:30:33','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2018-02-21 08:30:33','YYYY-MM-DD HH24:MI:SS'),100,0,0,300003,'U',100,300001,'N','50354b6a-ff43-4748-8fe6-b4cc2bc7eeff')
;

-- Feb 21, 2018 8:30:48 AM UTC
INSERT INTO AD_WF_NodeNext (AD_WF_Node_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Client_ID,AD_Org_ID,AD_WF_Next_ID,EntityType,SeqNo,AD_WF_NodeNext_ID,IsStdUserWorkflow,AD_WF_NodeNext_UU) VALUES (300001,'Y',TO_TIMESTAMP('2018-02-21 08:30:48','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2018-02-21 08:30:48','YYYY-MM-DD HH24:MI:SS'),100,0,0,300002,'U',10,300002,'Y','9651df3f-6ed0-46c1-bd86-ceeddab7384c')
;

-- Feb 21, 2018 8:30:56 AM UTC
UPDATE AD_Workflow SET AD_WF_Node_ID=300000, IsValid='Y',Updated=TO_TIMESTAMP('2018-02-21 08:30:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Workflow_ID=300000
;

-- Feb 21, 2018 8:32:05 AM UTC
INSERT INTO AD_Process (AD_Process_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,Name,IsReport,Value,IsDirectPrint,AccessLevel,EntityType,Statistic_Count,Statistic_Seconds,AD_Workflow_ID,IsBetaFunctionality,IsServerProcess,ShowHelp,CopyFromProcess,AD_Process_UU) VALUES (300004,0,0,'Y',TO_TIMESTAMP('2018-02-21 08:32:05','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2018-02-21 08:32:05','YYYY-MM-DD HH24:MI:SS'),100,'Process Sales Requisition','N','Process_MID_Requisition','N','3','U',0,0,300000,'N','N','Y','N','05e067db-9fb9-49ac-8946-3cd679c1e73a')
;

-- Feb 21, 2018 8:32:34 AM UTC
UPDATE AD_Column SET AD_Process_ID=300004,Updated=TO_TIMESTAMP('2018-02-21 08:32:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=300009
;

