--ABS-76144 PAYMENT INTERFACE ADD OPTIONAL BUSINESSUNIT(CODE)
ALTER TABLE ERP_I_INVOICEPAYMENTS ADD (BUSINESSUNIT VARCHAR2(6) NULL);

--ABS-76585 REVENUE AND INVOICES; CONTRACT AND ROUTES INTERFACE
--CHANGE INTO A VARCHAR2 INSTEAD OF A NUMBER
ALTER TABLE ERP_O_ACCT_MDSE_REVENUE MODIFY (CHT_ACCTNUMBER VARCHAR2(12));
ALTER TABLE ERP_O_ACCT_MDSE_CONTRACT MODIFY (CONTRACTCODE VARCHAR2(15));
--ADD COLUMN ACTIVE TO ERP_O_ACCT_MDSE_ROUTE
ALTER TABLE ERP_O_ACCT_MDSE_ROUTE ADD (ACTIVE VARCHAR2(1) DEFAULT 'Y' NULL); 
ALTER TABLE ERP_O_ACCT_MDSE_ROUTE
  ADD CONSTRAINT CHK_ERP_O_ACCT_MDSE_ROUTE_V3
  CHECK (ACTIVE IN ('Y','N'));

--ABS-70582 EDI INTERFACE INVOICES
--LINK TO BILLTO INSTEAD OF DELTO CUSTOMER
ALTER TABLE EDI_O_INVOICEHEADER_U
  DROP CONSTRAINT FK_EDI_O_INVOICEHEADER_U;
ALTER TABLE EDI_O_INVOICEHEADER_U
  ADD CONSTRAINT FK_EDI_O_INVOICEHEADER_U FOREIGN KEY (BILTOCUSTOMERNUMBER)
  REFERENCES EDI_M_INVOICE_CUSTOMERS_U (CUSTOMERNUMBER) ON DELETE CASCADE; 
