--Order 20015250

----PACKINGNOTELINE table----
BEGIN
EXECUTE IMMEDIATE ('ALTER TABLE PACKINGNOTELINE DROP CONSTRAINT ORIGIN_valid');
EXCEPTION WHEN OTHERS THEN NULL;
END;
/

ALTER TABLE PACKINGNOTE
	ADD  CONSTRAINT PNLORIGIN_valid  CHECK (ORIGIN IN (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13));

COMMENT ON COLUMN PACKINGNOTELINE.ORIGIN IS '0 = Generated based on Order
1 = Manually added
2 = Generated based on Outscan
3 = Quantity Correction Ticket
4 = Stock Delivery Note
10 = Mounting Order
11 = Sales Order
12 = Credit Note
13 = Residential Delivery Note
';

----PRESORTBATCH table----
ALTER TABLE PRESORTBATCH
	ADD (SYSTEMUSER_ID        NUMBER NOT NULL ,
	         TIMESTAMP            DATE NOT NULL);




