-- ABS-65360
-------------------------------------- REASONCODE  table-------------------------

ALTER TABLE REASONCODE ADD (MULTIREADREWASH VARCHAR2(1) DEFAULT 'N' NOT NULL
							CONSTRAINT YN_VALIDATIONFIELD428 CHECK (MULTIREADREWASH IN ('Y','N')));
				
--------------------------------------MULTIREADEXCEPTIONREASON  table-----------------

INSERT INTO MULTIREADEXCEPTIONREASON (MULTIREADEXCEPTIONREASON_ID, FACTORYDESCRIPTION, STORELOGYN, SYSTEMUSER_ID, TIMESTAMP) 
	   VALUES (31, 'Already scanned Rejected from Customer', 'Y', GETMINSYSTEMUSER(), SYSDATE);
COMMIT;

-------------------------------------- MULTIREADEXCEPTIONREASON_DESC  table---------------------

INSERT INTO MULTIREADEXCEPTIONREASON_DESC (MULTIREADEXCEPTIONREASON_ID, LANGUAGE_ID, DESCRIPTION, SYSTEMUSER_ID, TIMESTAMP)
SELECT M.MULTIREADEXCEPTIONREASON_ID,
		L.LANGUAGE_ID, 
		M.FACTORYDESCRIPTION,
		GETMINSYSTEMUSER(),
		SYSDATE
	FROM MULTIREADEXCEPTIONREASON M, LANGUAGES L
	WHERE L.TRANSLATEDESCRIPTION = 'Y'
	AND M.MULTIREADEXCEPTIONREASON_ID = 31;
COMMIT;

-----------------------------------------TRANSACTIONTYPE table---------------------------------------------------

INSERT INTO TRANSACTIONTYPE (TRANSACTIONTYPE_ID, FACTORYDESCRIPTION, SYSTEMUSER_ID, TIMESTAMP, LEGACYTRANSACTIONCODE)
		VALUES (14, 'Rejected from Customer Scan' ,  GETMINSYSTEMUSER() , SYSDATE , NULL);
COMMIT;

-----------------------------------------TRANSACTIONTYPE_DESC table---------------------------------------------------

INSERT INTO TRANSACTIONTYPE_DESC (TRANSACTIONTYPE_ID, LANGUAGE_ID, DESCRIPTION, SYSTEMUSER_ID, TIMESTAMP)
	   SELECT TRANSACTIONTYPE_ID, GETMINLANGUAGE(), FACTORYDESCRIPTION, GETMINSYSTEMUSER(), SYSDATE
	   FROM TRANSACTIONTYPE
	   WHERE TRANSACTIONTYPE.TRANSACTIONTYPE_ID = 14;
COMMIT;

------------------------------------------------STAY table---------------------------------------------------

INSERT INTO STAY
  (STAY_ID, STAYTYPE, STAYNR, FACTORYDESCRIPTION, SYSTEMUSER_ID, TIMESTAMP)
  SELECT SEQ_STAY.NEXTVAL,
         1,
         44,
         'Rejected from Customer / At Inscan',
         GETMINSYSTEMUSER(),
         GETCURRENTDATETIME()
    FROM DUAL;
COMMIT;

------------------------------------------------STAY_DESC table---------------------------------------------------

INSERT INTO STAY_DESC(STAY_ID, LANGUAGE_ID, DESCRIPTION, SYSTEMUSER_ID, TIMESTAMP)
  SELECT s.STAY_ID,
         l.LANGUAGE_ID,
         s.FACTORYDESCRIPTION,
         GETMINSYSTEMUSER(),
         GETCURRENTDATETIME()
    FROM STAY s, LANGUAGES l
    WHERE s.STAYTYPE = 1 and s.staynr = 44;
commit; 