      
      /*
      CHANGE REPORT for Table PRODUCTLISTPERCUSTOMER
          - modify validation rule from CHARGEWASHESONLYFORCOG IN (0, 1, 2, 3) to CHARGEWASHESONLYFORCOG IN (0, 1, 2, 3, 4) of column CHARGEWASHESONLYFORCOG
          WARNING : Load data statement for table PRODUCTLISTPERCUSTOMER or the statement to add a validation rule may fail (existing data may violate the new validation rule for column CHARGEWASHESONLYFORCOG).
          - Changing column definition of CHARGEWASHESONLYFORCOG
          - Adding column TOTALINCIRCULATION
          - Adding column TOTALINCIRCULATIONCHARGED
      ACTION is ALTER or modify Table PRODUCTLISTPERCUSTOMER
      */

ALTER TABLE PRODUCTLISTPERCUSTOMER DROP CONSTRAINT 
    CHARGEWASHCOGONLY_VALIDATION;


COMMENT ON COLUMN PRODUCTLISTPERCUSTOMER.CHARGEWASHESONLYFORCOG IS '0 = Both LOG and COG, same washprice (default)
1 = Both LOG and COG, distinct washprice
2 = LOG only
3 = COG only
4 = Sales only';


alter table PRODUCTLISTPERCUSTOMER
  add constraint CHARGEWASHCOGONLY_VALIDATION
  check (CHARGEWASHESONLYFORCOG IN (0, 1, 2, 3) OR  (CHARGEWASHESONLYFORCOG = 4 AND BILLINGMETHOD = 4 AND AUTOMATICSALES ='Y'));


ALTER TABLE PRODUCTLISTPERCUSTOMER ADD (TOTALINCIRCULATION   NUMBER NULL);


ALTER TABLE PRODUCTLISTPERCUSTOMER ADD (TOTALINCIRCULATIONCHARGED NUMBER NULL);

