 /*order 502362*/   
      /*
      CHANGE REPORT for Table RENTALQTYADJUSTMENT
          - Adding column EXPIRATIONDATE
          - Adding column AUTOBILLONEXPIRATIONDATE
      ACTION is ALTER or modify Table RENTALQTYADJUSTMENT
      */

ALTER TABLE RENTALQTYADJUSTMENT ADD (EXPIRATIONDATE       DATE DEFAULT 
    TO_DATE('31-12-2099','DD-MM-YYYY') NOT NULL);


ALTER TABLE RENTALQTYADJUSTMENT ADD (AUTOBILLONEXPIRATIONDATE VARCHAR2(1) 
    DEFAULT 'N' NOT NULL
                                   CONSTRAINT YN_ValidationNew151
                                          CHECK (AUTOBILLONEXPIRATIONDATE IN 
    ('Y', 'N')));

ALTER TABLE RENTALQTYADJUSTMENT ADD (AUTOPROCESSED VARCHAR2(1) 
    DEFAULT 'N' NOT NULL
                                   CONSTRAINT YN_ValidationNew152
                                          CHECK (AUTOPROCESSED IN 
    ('Y', 'N')));
   
      /*
      CHANGE REPORT for Table SQMATINCIRCULATION
          - Adding column QTYSAMPLE
          - Adding column VARIATIONQTYSAMPLE
      ACTION is ALTER or modify Table SQMATINCIRCULATION
      */

ALTER TABLE SQMATINCIRCULATION ADD (QTYSAMPLE            NUMBER DEFAULT 0 NOT 
    NULL);


ALTER TABLE SQMATINCIRCULATION ADD (VARIATIONQTYSAMPLE   NUMBER DEFAULT 0 NOT 
    NULL);

--insert new invoicelinesubtypes
insert into invoicelinesubtype i
      (i.invoicelinesubtype_id,
       subtype,
       invoicelinetype_id,
       factorydescription,
       systemuser_id,
       timestamp)
      select seq_invoicelinesubtype.nextval,
             39,
             2,
             'Wash based on soiled registered items',
             1,
             sysdate
        from dual;
insert into invoicelinesubtype i
      (i.invoicelinesubtype_id,
       subtype,
       invoicelinetype_id,
       factorydescription,
       systemuser_id,
       timestamp)
      select seq_invoicelinesubtype.nextval,
             40,
             1,
             'Sample products',
             1,
             sysdate
        from dual;

insert into invoicelinesubtype_desc
      (invoicelinesubtype_id,
       language_id,
       description,
       systemuser_id,
       timestamp)
      select i.invoicelinesubtype_id,
             l.language_id,
             i.factorydescription,
             1,
             sysdate
        from invoicelinesubtype i, languages l
       where l.translatedescription = 'Y' and  subtype in (39,40);
--insert process

insert into process(process_id,description,active) values ('80','Automatic Billing','Y');

