-- ABS-75939
--- ERP_I_CUSTOMER ---
ALTER TABLE ERP_I_CUSTOMER ADD (MERCHANDISEBUYOUTCHARGE VARCHAR2(1) NULL,
                                MBYOPPERCENTAGE NUMBER NULL);

ALTER TABLE ERP_I_CUSTOMER DROP CONSTRAINT YN_VALIDATIONFIELD462;
ALTER TABLE ERP_I_CUSTOMER DROP CONSTRAINT MBYOPPERCENTAGE_VALID5;

ALTER TABLE ERP_I_CUSTOMER ADD CONSTRAINT YN_VALIDATIONFIELD462 CHECK ((MERCHANDISEBUYOUTCHARGE IS NULL) OR (MERCHANDISEBUYOUTCHARGE IN ('Y','N')));
ALTER TABLE ERP_I_CUSTOMER ADD CONSTRAINT MBYOPPERCENTAGE_VALID5 CHECK ((MBYOPPERCENTAGE IS NULL) OR (MBYOPPERCENTAGE BETWEEN 0.0 AND 100.0));

--- ERP_I_CONSUMPTIONPOINT ---
ALTER TABLE ERP_I_CONSUMPTIONPOINT ADD (MBYOPROTECTION VARCHAR2(1) NULL);

ALTER TABLE ERP_I_CONSUMPTIONPOINT DROP CONSTRAINT YN_VALIDATIONFIELD463;
ALTER TABLE ERP_I_CONSUMPTIONPOINT ADD CONSTRAINT YN_VALIDATIONFIELD463 CHECK ((MBYOPROTECTION IS NULL) OR (MBYOPROTECTION IN ('Y','N')));

--- ERP_I_CONTRACTCOMPONENT ---
ALTER TABLE ERP_I_CONTRACTCOMPONENT ADD (MERCHANDISEBUYOUTCHARGE VARCHAR2(1) NULL,
                                         MBYOPPERCENTAGE NUMBER NULL);
                                         
ALTER TABLE ERP_I_CONTRACTCOMPONENT DROP CONSTRAINT YN_VALIDATIONFIELD464;
ALTER TABLE ERP_I_CONTRACTCOMPONENT DROP CONSTRAINT MBYOPPERCENTAGE_VALID6;                        

ALTER TABLE ERP_I_CONTRACTCOMPONENT ADD CONSTRAINT YN_VALIDATIONFIELD464 CHECK ((MERCHANDISEBUYOUTCHARGE IS NULL) OR (MERCHANDISEBUYOUTCHARGE IN ('Y','N')));
ALTER TABLE ERP_I_CONTRACTCOMPONENT ADD CONSTRAINT MBYOPPERCENTAGE_VALID6 CHECK ((MBYOPPERCENTAGE IS NULL) OR (MBYOPPERCENTAGE BETWEEN 0.0 AND 100.0));

--- ERP_I_CONTRACTPRODUCT ---
ALTER TABLE ERP_I_CONTRACTPRODUCT ADD (MBYOPPERCENTAGE NUMBER NULL);

ALTER TABLE ERP_I_CONTRACTPRODUCT DROP CONSTRAINT MBYOPPERCENTAGE_VALID7;

ALTER TABLE ERP_I_CONTRACTPRODUCT ADD CONSTRAINT MBYOPPERCENTAGE_VALID7 CHECK ((MBYOPPERCENTAGE IS NULL) OR (MBYOPPERCENTAGE BETWEEN 0.0 AND 100.0));

ALTER TABLE ERP_I_CONTRACTPRODUCT DROP CONSTRAINT ERP_I_ALLOWRETURNTOSTOCK_VALID;

ALTER TABLE ERP_I_CONTRACTPRODUCT ADD CONSTRAINT ERP_I_ALLOWRETURNTOSTOCK_VALID CHECK (ALLOWRETURNTOSTOCK IN (0,1,2,3,4));