--Order 20011598.80

----PRINTQUEUERESIDENTIALITEM----

ALTER TABLE PRINTQUEUERESIDENTIALITEM
	ADD (PATCHING NUMBER(1)  DEFAULT 0 NOT NULL CONSTRAINT Patching_valid1_1 CHECK (PATCHING IN (0, 1)));

COMMENT ON COLUMN PRINTQUEUERESIDENTIALITEM.PATCHING IS '0 = Label is patched by the customer or there is no patch price defined and therefore only the label price is charged.
1 = If a separate patch price is defined for the customer then this is added to the label price.
';

----CUSTOMERLABELLAYOUTPRICE----

ALTER TABLE CUSTOMERLABELLAYOUTPRICE
	DROP CONSTRAINT LABELTYPE_VALID;


ALTER TABLE CUSTOMERLABELLAYOUTPRICE
	ADD CONSTRAINT LABELTYPE_VALID  CHECK (LABELTYPE IN (1, 2, 3, 5));


COMMENT ON COLUMN CUSTOMERLABELLAYOUTPRICE.LABELTYPE IS '1 = Code label
2 = Name label
3 = Residential/domestic
5 = Patch price (residential)';


----INVOICELINESUBTYPE----

insert into invoicelinesubtype i
      (i.invoicelinesubtype_id,
       subtype,
       invoicelinetype_id,
       factorydescription,
       systemuser_id,
       timestamp)
      select seq_invoicelinesubtype.nextval,
             33,
             27,
             'Labels Charged including Patching',
             1,
             sysdate
        from dual;
commit;

update invoicelinesubtype i set i.factorydescription = 'Labels Charged excluding Patching'
where i.subtype = 31 and i.invoicelinetype_id = 27;

commit;
