-- ABS-77511 / ABS-79395

-----PACKINGNOTE ----

ALTER TABLE PACKINGNOTE DROP CONSTRAINT STDDELIVERYINCLUDED_VALID1;

UPDATE PACKINGNOTE PN
SET PN.STANDARDDELIVERYINCLUDED=NULL
WHERE PN.STANDARDDELIVERYINCLUDED NOT IN(NULL,1);
COMMIT;

ALTER TABLE PACKINGNOTE ADD CONSTRAINT STDDELIVERYINCLUDED_VALID1 CHECK (STANDARDDELIVERYINCLUDED IN (NULL,1));

COMMENT ON COLUMN PACKINGNOTE.STANDARDDELIVERYINCLUDED IS
'Indicates if packing note was generated based upon any standard deliveries to avoid that they are used more than once to generate a packing note for a given date 
1 = Stand deliveries included';