-- ABS-77511 / ABS-78286
-----PACKINGNOTE TABLE----
ALTER TABLE PACKINGNOTE ADD (STANDARDDELIVERYINCLUDED NUMBER NULL
                                          CONSTRAINT STDDELIVERYINCLUDED_VALID1 CHECK (STANDARDDELIVERYINCLUDED IN (1,2,3)));
										  
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 
2 = Stand deliveries overruled by fixed delivery variations
3 = Stand deliveries overruled by negative delivery amounts';										  

CREATE INDEX XIE17PACKINGNOTE ON PACKINGNOTE (NVL(STANDARDDELIVERYINCLUDED,0) ASC);