---SO 20013424 Web orders order for approval

------------------------------PRODUCT TABLE---------------------------

ALTER TABLE PRODUCT
	ADD (MINAPPROVALQTY NUMBER  DEFAULT 0 NOT NULL);

------------------------------CUSTOMERINTERNETOPTIONS TABLE---------------------------

ALTER TABLE CUSTOMERINTERNETOPTIONS
	ADD (AUTOAPPROVEWEBWORKORDER NUMBER  DEFAULT 0 NOT NULL CONSTRAINT AUTOAPPWEBWO_VALID1 CHECK (AUTOAPPROVEWEBWORKORDER IN (0, 1))); 

ALTER TABLE CUSTOMERINTERNETOPTIONS 
	ADD CONSTRAINT AUTOAPPWEBWO_VALID2 CHECK ((GARMENTSWEBPORTAL = 'Y' AND AUTOAPPROVEWEBWORKORDER IN (0, 1)) OR (GARMENTSWEBPORTAL = 'N'));

COMMENT ON COLUMN CUSTOMERINTERNETOPTIONS.AUTOAPPROVEWEBWORKORDER IS '0 =  No, work order created in state Waiting for approval
1 = Yes, work order created in state New
';

------------------------------PLANTPRODUCTSETTINGS TABLE---------------------------

ALTER TABLE PLANTPRODUCTSETTINGS
	ADD (MINAPPROVALQTY NUMBER  DEFAULT 0 NOT NULL);