-- ABS-75559 / ABS-103223
ALTER TABLE PRODUCTLISTPERCUSTOMER ADD (SRCPERCENTAGEDELIVEREDQTY NUMBER(15,2) DEFAULT 0 NOT NULL);

COMMENT ON COLUMN PRODUCTLISTPERCUSTOMER.SRCMETHOD
  IS 'Systematic replacement:
0 = no src,
1 = percentage of soilcount,
2 = percentage of circulating inventory,
3 = fixed quantity
4 = percentage of billed quantity
5 = percentage of delivered quantity';

COMMENT ON COLUMN PRODUCTLISTPERCUSTOMER.SRCPERCENTAGEDELIVEREDQTY
  IS 'Percentage of delivered quantity that is charged for expected losses (2 decimals). Only applicable if SRCMethod = 5.';
  
ALTER TABLE PRODUCTLISTPERCUSTOMER
  DROP CONSTRAINT SOILCOUNT_VALIDATION15;

ALTER TABLE PRODUCTLISTPERCUSTOMER
  ADD CONSTRAINT CHK_PLPC_SRCMETHOD CHECK (SRCMETHOD IN (0, 1, 2, 3, 4, 5));


