--ABS-83583/ABS-103319

------- CONTRACTCOMPONENTBGPROTECTION ----------
ALTER TABLE CONTRACTCOMPONENTBGPROTECTION ADD (MATERIALLOSSPERCENTAGE NUMBER NULL CONSTRAINT CHK_CONTRCOMPBGPROT_MATLOSSPER CHECK (MATERIALLOSSPERCENTAGE IS NULL OR MATERIALLOSSPERCENTAGE BETWEEN 0.0 AND 100.0));
COMMENT ON COLUMN CONTRACTCOMPONENTBGPROTECTION.MATERIALLOSSPERCENTAGE IS '0.0 means no budget protection';

------- CONTRACTPRODUCTBGPROTECTION --------
ALTER TABLE CONTRACTPRODUCTBGPROTECTION ADD (MLPSPECIFICPERCENTAGE NUMBER NULL CONSTRAINT CHK_CPRBGPROTECT_MLPSPECPERC CHECK (MLPSPECIFICPERCENTAGE IS NULL OR MLPSPECIFICPERCENTAGE BETWEEN 0.0 AND 100.0));
COMMENT ON COLUMN CONTRACTPRODUCTBGPROTECTION.MLPSPECIFICPERCENTAGE IS 'Material Loss Protection (MMP) specific percentage';

------- CUSTOMERBUDGETPROTECTION --------
ALTER TABLE CUSTOMERBUDGETPROTECTION ADD (MATERIALLOSSPERCENTAGE NUMBER DEFAULT 0.0 NOT NULL CONSTRAINT CHK_CUSTBUDGPROT_MATLOSSPERC CHECK (MATERIALLOSSPERCENTAGE BETWEEN 0.0 AND 100.0));
COMMENT ON COLUMN CUSTOMERBUDGETPROTECTION.MATERIALLOSSPERCENTAGE IS 'Between 0.0 and 100.0, 0.0 means no budget protection';

------- DISTRIBPOINTBGPROTECTION --------
ALTER TABLE DISTRIBPOINTBGPROTECTION ADD (MATERIALLOSS VARCHAR2(1) DEFAULT 'N' NOT NULL CONSTRAINT CHK_DISTRPOINTGBPROT_MATLOSS CHECK (MATERIALLOSS IN ('Y', 'N')));

------- PLPCBUDGETPROTECTION --------
ALTER TABLE PLPCBUDGETPROTECTION ADD (MLPSPECIFICPERCENTAGE NUMBER NULL CONSTRAINT CHK_PLPCBUDGPROT_MLPSPECPERC CHECK (MLPSPECIFICPERCENTAGE IS NULL OR MLPSPECIFICPERCENTAGE BETWEEN 0.0 AND 100.0));
COMMENT ON COLUMN PLPCBUDGETPROTECTION.MLPSPECIFICPERCENTAGE IS 'Material Loss Protection (MLP) specific percentage. If empty (Null) then take the percentage defined on Customer or Product level.
If on customer level is defined 0.0 (no MLP) then must be set to Null.';
  
------ PRODUCT -------
ALTER TABLE PRODUCT ADD (MATERIALLOSSPROTECTION NUMBER DEFAULT 0 NOT NULL CONSTRAINT CHK_PRODUCT_MATLOSSPROTECTION CHECK (MATERIALLOSSPROTECTION IN (0,1)));
COMMENT ON COLUMN PRODUCT.MATERIALLOSSPROTECTION IS '0 = Not applicable / No MLP
1 = MLP allowed, default set for this product
MLP is only used for BUDGETPROTECTION and only for non-garments';