 
      
      /*
      CHANGE REPORT for Table GENERALRENTPRICE
          - Changing column definition of TYPEOFRENT
      ACTION is ALTER or modify Table GENERALRENTPRICE
      */

COMMENT ON COLUMN GENERALRENTPRICE.TYPEOFRENT IS '1=Piece price 
2=Changes/Wk 
3=Overuse price 
4=Per Frequency
5=Underuse Price
6=Lease
7=Split price';

     
     ALTER TABLE PRODUCTLISTPERCUSTOMER ADD (PRICEUSAGE  NUMBER DEFAULT 0 NOT NULL );

COMMENT ON COLUMN PRODUCTLISTPERCUSTOMER.PRICEUSAGE IS '0 = Not applicable
1 = Split price
2 = Rent price only
3 = Wash price only';

COMMENT ON COLUMN GENERALWASHPRICE.PRICETYPE IS '1 = All items
2 = COG items only
4 = Split price';

COMMENT ON COLUMN CUSTOMERPRODUCTTAXDEF.TYPE IS '1 = Rent
2 = Wash
3 = Replacement
4 = Sales
5 = Wash COG';


COMMENT ON COLUMN CUSTOMERPRODUCTTOGDEF.TYPE IS '1 = Rent
2 = Wash
3 = Replacement
4 = Sales
5 = Wash COG';

insert into CUSTOMERPRODUCTTOGDEF(CUSTOMER_ID,PRODUCT_ID,TURNOVERGROUP_ID,TYPE,PERCENTAGE,SYSTEMUSER_ID,TIMESTAMP)
select a.customer_id, a.product_id, a.turnovergroup_id, 5, a.percentage, getminsystemuser(), getcurrentdatetime()
from CUSTOMERPRODUCTTOGDEF a
where a.type=2;

insert into CUSTOMERPRODUCTTAXDEF(CUSTOMER_ID,PRODUCT_ID,TYPE,TAXGROUP_ID,SYSTEMUSER_ID,TIMESTAMP)
select a.customer_id, a.product_id, 5, a.Taxgroup_Id, getminsystemuser(), getcurrentdatetime()
from CUSTOMERPRODUCTTAXDEF a
where a.type=2;
