--ABS-7326
------------------------- CUSTOMER ---------------------------------------
ALTER TABLE CUSTOMER ADD (ALLOWRECALCPLANNEDDATA NUMBER DEFAULT 0 NOT NULL CONSTRAINT ALLOWRECPLANNEDDATA_VALID1_1 CHECK (ALLOWRECALCPLANNEDDATA IN (0,1)));
 
COMMENT ON COLUMN CUSTOMER.ALLOWRECALCPLANNEDDATA
IS '0 = Not allowed / Not applicable
    1 = Allowed';
	
------------------------- STANDARDDELIVERY ---------------------------------------
ALTER TABLE STANDARDDELIVERY ADD (ALLOWRECALCPLANNEDDATA NUMBER DEFAULT 0 NOT NULL CONSTRAINT ALLOWRECPLANDATA_VALID1_1 CHECK (ALLOWRECALCPLANNEDDATA IN (0,1)));

COMMENT ON COLUMN STANDARDDELIVERY.ALLOWRECALCPLANNEDDATA
IS '0 = Not allowed / Not applicable
    1 = Allowed';

------------------------- PRODUCTLISTPERDISTRIBPOINT ---------------------------------------
ALTER TABLE PRODUCTLISTPERDISTRIBPOINT ADD (DELQTYPREVYEAR NUMBER DEFAULT 0 NOT NULL,
											PREVYEAR NUMBER(4) DEFAULT 0 NOT NULL,
											PLANNEDDELQTYCURRENTYEAR NUMBER DEFAULT 0 NOT NULL);

COMMENT ON COLUMN PRODUCTLISTPERDISTRIBPOINT.DELQTYPREVYEAR
  IS 'Only used for module WEBPLANNEDDATA.';
COMMENT ON COLUMN PRODUCTLISTPERDISTRIBPOINT.PREVYEAR
  IS 'Only used for module WEBPLANNEDDATA.';
COMMENT ON COLUMN PRODUCTLISTPERDISTRIBPOINT.PLANNEDDELQTYCURRENTYEAR
  IS 'Only used for module WEBPLANNEDDATA.';

  ------------------------- PLANTPROCESS ---------------------------------------
COMMENT ON COLUMN PLANTPROCESS.FREQUENCY
  IS '10	Every minute
11	Every 5 minutes
12	Every 10 minutes	
13	Every 15 minutes
14	Every 30 minutes
15	Every hour
20	Daily
21	Daily except Monday
22	Daily except Sunday
23	Daily except Saturday
24	Daily except Sunday & Monday
25	Daily except Saturday & Sunday
31	Weekly on Monday
32	Weekly on Tuesday
33	Weekly on Wednesday
34	Weekly on Thursday
35	Weekly on Friday
36	Weekly on Saturday
37	Weekly on Sunday
41	Monthly on first day of Month
42	Monthly on second day of Month
43	Monthly on last day of Month
51	Monthly on first Monday of Month
52	Monthly on first Tuesday of Month
...	...
57	Monthly on first Sunday of Month
58  Monthly on the 15th
60  Yearly on the first day of the year (1st January)
61  Yearly on the last day of the year (31st December)';  
  
------------------------- WEBEVENTTYPE ---------------------------------------
INSERT INTO WEBEVENTTYPE 
  SELECT 85, 'Planned Data entry', GETMINSYSTEMUSER(), SYSDATE FROM DUAL;
COMMIT;

------------------------- PROCESS ---------------------------------------
INSERT INTO PROCESS(PROCESS_ID,DESCRIPTION,ACTIVE) VALUES ('126','Delivered Quantities Planned Data','Y');
COMMIT;