-- ABS-32035
-------------   CUSTOMERBILLINGCOMMENT  ---------------


ALTER TABLE CUSTOMERBILLINGCOMMENT MODIFY(
  ENDDATE DATE DEFAULT TO_DATE('31-12-2099','DD-MM-YYYY'),
  STARTDATE DATE DEFAULT TO_DATE('31-12-2099','DD-MM-YYYY'),
  DESCRIPTION VARCHAR2(300) NULL
);

-------------   CONTRACTATTRIBUTE  ---------------


ALTER TABLE CONTRACTATTRIBUTE ADD(
  NOVALUERULE NUMBER DEFAULT 0 NOT NULL CONSTRAINT  NOVALUERULE_VALID1_1 CHECK ( NOVALUERULE IN (0, 1, 2)));

COMMENT ON COLUMN CONTRACTATTRIBUTE.NOVALUERULE IS '0 = When value on contract is empty, compliancy rule contract enforced is not allowed, attribute must be overrulable on customer level. Enforcement buttons are disabled.
1 = When value on contract is empty, compliancy rule contract enforced is available. 
2 = When value on contract is empty, compliancy rule contract enforced is available. On customer level, the Null value corresponds with the default or neutral value.
Option 1 should only be used if the corresponding attribute on customer level is null allowed.
';


UPDATE CONTRACTATTRIBUTE C
SET C.NOVALUERULE = 1
WHERE C.CONTRACTATTRIBUTE_ID IN (74, 77, 79);
COMMIT;

UPDATE CONTRACTATTRIBUTE C
SET C.NOVALUERULE = 2
WHERE C.CONTRACTATTRIBUTE_ID IN (39, 53, 73, 75, 76, 88, 89, 96, 97);
COMMIT;


