--Order 20013355.70

ALTER TABLE STOCKROOMLOCATION
	ADD (EXPORTTOSTORAGESYSTEM NUMBER  DEFAULT 0 NOT NULL CONSTRAINT EXPORTTOSTORAGESYSTEM_VALID1_1 CHECK (EXPORTTOSTORAGESYSTEM IN (0, 1)));

COMMENT ON COLUMN STOCKROOMLOCATION.EXPORTTOSTORAGESYSTEM IS 'This attribute indicates whether any items put on / taken from this stockroom location should be included when exporting the transactions to an external (automated) storage system. Possible values :
0 = Not applicable / Do not include 
1 = Do include any transactions for this location
';

ALTER TABLE RECEIVEINSTOCKHISTORY
	ADD (AREACODE VARCHAR2(12) NULL);

ALTER TABLE RECEIVEINSTOCKHISTORY
	ADD (EXPORTEDTOSTORAGESYSTEM DATE NULL);

COMMENT ON COLUMN RECEIVEINSTOCKHISTORY.AREACODE IS 'The received item has been stored within this area upon reception. ';

COMMENT ON COLUMN RECEIVEINSTOCKHISTORY.EXPORTEDTOSTORAGESYSTEM IS 'This flag indicates whether the transaction has been exported to an automated storage system. When filled it shows the date/time when it was exported.';

CREATE INDEX XIE8RECEIVEINSTOCKHISTORY ON RECEIVEINSTOCKHISTORY
(PURCHASEORDERNUMBER   ASC,EXPORTEDTOSTORAGESYSTEM   ASC);