--Order 20012938.90

------PRODUCTLISTPERCUSTOMER table-------

ALTER TABLE PRODUCTLISTPERCUSTOMER ADD (ALLOWMODIFICATIONSFORSALES VARCHAR2(1) DEFAULT 'Y' NOT NULL CONSTRAINT YN_VALIDATIONFIELD97
  									CHECK (ALLOWMODIFICATIONSFORSALES IN ('Y', 'N'))
					);
ALTER TABLE PRODUCTLISTPERCUSTOMER ADD (ALLOWMODIFICATIONSFORRENT VARCHAR2(1) DEFAULT 'Y' NOT NULL CONSTRAINT YN_VALIDATIONFIELD98
 									CHECK (ALLOWMODIFICATIONSFORRENT IN ('Y', 'N'))
					);

COMMENT ON COLUMN PRODUCTLISTPERCUSTOMER.ALLOWMODIFICATIONSFORSALES
  IS 'May modifications be defined for sold garments via Garment web portal. ';

COMMENT ON COLUMN PRODUCTLISTPERCUSTOMER.ALLOWMODIFICATIONSFORRENT
  IS 'May modifications be defined for garments via Garment web portal. ';


------PRODUCT table------

ALTER TABLE PRODUCT ADD (REMARKFORWEB CLOB NULL);

COMMENT ON COLUMN PRODUCT.REMARKFORWEB
  IS 'Remark to be shown only on web, optional so may be left empty. Maximum 5000 characters';


------WEARER table------

ALTER TABLE WEARERBUDGETTRANSACTION ADD (WEBUSER_ID NUMBER NULL);

COMMENT ON COLUMN WEARERBUDGETTRANSACTION.WEBUSER_ID IS 
'Web user that caused the transaction. Optional, so may be left empty.';

COMMENT ON COLUMN WEARERBUDGETTRANSACTION.ORIGIN IS 
'1 = New employment, initial budget
2 = Annual Budget increase
3 = Expired Budget
4 = Manual Adjustment
5 = Work Order (Budget reservation)
6 = Issue (with work order)
7 = Cancel work order (Budget refund)
8 = Take out of circulation (Budget refund)
9 = Wearer inactive (set budget to zero)';

ALTER TABLE WEARERBUDGETTRANSACTION
  ADD CONSTRAINT WEARERBUDGETTRANSACTION_WEBU FOREIGN KEY (WEBUSER_ID)
  REFERENCES WEBUSER (WEBUSER_ID) ON DELETE SET NULL;


