---SO 20013061 Start Charges Rent for Pool after x weeks (becomes standard ABS SEE REMARKS)

------------------------------PRODUCTLISTPERCUSTOMER TABLE---------------------------


ALTER TABLE PRODUCTLISTPERCUSTOMER
	ADD CONSTRAINT INVENTORYBILLINGTYP  CHECK (INVENTORYBILLINGTYPE IN (0, 1, 2, 3, 4));

COMMENT ON COLUMN PRODUCTLISTPERCUSTOMER.INVENTORYBILLINGTYPE IS 'For billingmethod 3:
0 - circulating inventory
1 - real quantity
2 - max inventory qty
3 - on-site inventory qty
4 - Non-returned pool after n weeks
';

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

COMMENT ON COLUMN PRODUCTLISTPERCUSTOMER.CHARGERENTNORETURNPOOLAFTERWKS IS 'Charge rent not returned pool items after specified no of weeks. Default value 0';

------------------------------SQITEMINCIRCULATION TABLE---------------------------
ALTER TABLE SQITEMINCIRCULATION
	ADD (QTYRENTEDPERPIECEPOOL NUMBER  NULL);

ALTER TABLE SQITEMINCIRCULATION
	ADD (VARIATIONRENTEDPERPIECEPOOL NUMBER  NULL);



COMMENT ON COLUMN SQITEMINCIRCULATION.QTYRENTEDPERPIECEPOOL IS 'Only applicable for BM 3';

COMMENT ON COLUMN SQITEMINCIRCULATION.VARIATIONRENTEDPERPIECEPOOL IS 'Only applicable for BM 3';



------------------------------INVOICELINESUBTYPE TABLE---------------------------

insert into invoicelinesubtype i
      (i.invoicelinesubtype_id,
       subtype,
       invoicelinetype_id,
       factorydescription,
       systemuser_id,
       timestamp)
      select seq_invoicelinesubtype.nextval,
             44,
             1,
             'Rent Not Returned Pool items',
             1,
             sysdate
        from dual;
commit;