-- ABS-72207 / ABS-110442
----ERP_I_PRODUCTLISTPERCUSTOMER---

ALTER TABLE ERP_I_PRODUCTLISTPERCUSTOMER ADD (RENTPRICE NUMBER(15,6) NULL,
                                              REPLACEPRICE  NUMBER(15,6) NULL,
                                              WASHPRICE NUMBER(15,6) NULL,
                                              SALESPRICE NUMBER(15,6) NULL,
                                              IMAGECAREPRICE NUMBER(15,6) NULL,
                                              TYPEOFRENT NUMBER(2) NULL CONSTRAINT CHK_ERP_I_PLPC_TYPEOFRENT CHECK (TYPEOFRENT BETWEEN 1 AND 10),
                                              RENTCHANGESPERWEEK NUMBER DEFAULT -1 NULL);

COMMENT ON COLUMN ERP_I_PRODUCTLISTPERCUSTOMER.TYPEOFRENT
  IS  '1 = Piece price
2 = Changes/Wk
3 = Overuse price
4 = Per Frequency
5 = Underuse Price
6 = Lease
7 = Split price
8 = Per Invoice Frequency
9 = Residential rent (not used)
10 = Loan';

COMMENT ON COLUMN ERP_I_PRODUCTLISTPERCUSTOMER.RENTCHANGESPERWEEK
  IS  '0 for piece and overuse price, >0 for changes/wk
For changes per week price (TypeOfRent = 2) also allow value -1.
This is shown as price * as a general price for all changes per week excluding the ones that have a specific price.';

UPDATE ERP_I_PRODUCTLISTPERCUSTOMER
SET RESIDUALVALUESCHEMECODE='-'
WHERE RESIDUALVALUESCHEMECODE IS NULL;

ALTER TABLE ERP_I_PRODUCTLISTPERCUSTOMER MODIFY (RESIDUALVALUESCHEMECODE DEFAULT '-' NOT NULL);