---ABS-26958/ABS-43037

------------CUSTOMERINTERNETOPTIONS----------------------------------
ALTER TABLE CUSTOMERINTERNETOPTIONS ADD (WORKORDERSUPAPPROVALREQ VARCHAR2(1) DEFAULT 'N' NOT NULL CONSTRAINT YN_VALIDATIONFIELD353 CHECK (WORKORDERSUPAPPROVALREQ IN ('Y','N')));
									 
---------------------WEBUSERCUSTOMER--------------------------------------------
ALTER TABLE WEBUSERCUSTOMER ADD (WORKORDERAPPROVER NUMBER DEFAULT 0 NOT NULL CONSTRAINT WORKORDERAPPROVER_VALID CHECK (WORKORDERAPPROVER IN (0, 1, 2)),
                        WORKORDERAPPROVALREQ VARCHAR2(1) DEFAULT 'N' NOT NULL CONSTRAINT YN_VALIDATIONFIELD354 CHECK (WORKORDERAPPROVALREQ  IN ('Y','N')));

COMMENT ON COLUMN WEBUSERCUSTOMER.WORKORDERAPPROVER 
IS '0 = no effect
1 = own works orders only
2 = any works orders';


-----------------------------WORKORDER-----------------------------------
ALTER TABLE WORKORDER ADD (WEBORDERAPPROVALUSER VARCHAR2(20) NULL,
                           WEBORDERAPPROVALDATE DATE NULL);

COMMENT ON COLUMN WORKORDER.STATUS_ID
IS 'StatusType = WO, linked to status code
10=New
15=Awaiting Approval
20=In Progress
25=In Progress Priority
30=Completed
40=Cancelled';

COMMENT ON COLUMN WORKORDER.WEBORDERAPPROVALUSER IS 'If the Work Order needed web user approval, store web user login name here';

-------------------STATUS-----------------------------------------
INSERT INTO STATUS
  (STATUS_ID,
   STATUSTYPE,
   CODE,
   FACTORYDESCRIPTION,
   SYSTEMUSER_ID,
   TIMESTAMP)
VALUES
  (SEQ_STATUS.NEXTVAL, 'WO', 3, 'Waiting Supervisor Approval', GETMINSYSTEMUSER(), SYSDATE);
COMMIT;