--ABS-76585
ALTER TABLE ERP_O_ACCT_MDSE_REVENUE ADD INVOICELINE_CODE VARCHAR2(16) NULL;
ALTER TABLE ERP_O_ACCT_MDSE_REVENUE ADD INVOICELINE_DESCRIPTION VARCHAR2(40) NULL;

--ABS-84931
CREATE SEQUENCE SEQ_SQ_WEEKLY_REVENUE START WITH 1 INCREMENT BY 1;
ALTER TABLE SQ_STOPVALUE ADD MAX_INVOICEHEADER_ID NUMBER;
ALTER INDEX UK1_SQ_STOPVALUE RENAME TO UK1_WEEKLY_REVENUE;
ALTER INDEX UK2_SQ_STOPVALUE RENAME TO UK2_WEEKLY_REVENUE;
ALTER INDEX XPKSQ_STOPVALUE RENAME TO XPKSQ_WEEKLY_REVENUE;
ALTER TABLE SQ_STOPVALUE RENAME CONSTRAINT UK1_SQ_STOPVALUE TO UK1_WEEKLY_REVENUE;
ALTER TABLE SQ_STOPVALUE RENAME CONSTRAINT UK2_SQ_STOPVALUE TO UK2_WEEKLY_REVENUE;
ALTER TABLE SQ_STOPVALUE RENAME CONSTRAINT FK_SQ_STOPVALUE_BUSS TO FK_WEEKLY_REVENUE_BUSS;
ALTER TABLE SQ_STOPVALUE RENAME CONSTRAINT FK_SQ_STOPVALUE_CURR TO FK_WEEKLY_REVENUE_CURR;
ALTER TABLE SQ_STOPVALUE RENAME CONSTRAINT FK_SQ_STOPVALUE_DELT TO FK_WEEKLY_REVENUE_DELT;
ALTER TABLE SQ_STOPVALUE RENAME CONSTRAINT FK_SQ_STOPVALUE_TURN TO FK_WEEKLY_REVENUE_TURN;
ALTER TABLE SQ_STOPVALUE RENAME COLUMN SQ_STOPVALUE_ID TO SQ_WEEKLY_REVENUE_ID;
ALTER TABLE SQ_STOPVALUE RENAME COLUMN EXPECTED_REVENUE TO WEEKLY_REVENUE;
ALTER TABLE SQ_STOPVALUE RENAME COLUMN AVGERAGE_INVOICE_AMOUNT TO WEEKLY_AVGERAGE_REVENUE;
ALTER TABLE SQ_STOPVALUE RENAME COLUMN PROCES_STATUS TO PROCESS_STATUS;
ALTER TABLE SQ_STOPVALUE RENAME COLUMN SQ_STOPVALUE_TYPE TO SQ_WEEKLY_REVENUE_TYPE;
ALTER TABLE SQ_STOPVALUE DROP CONSTRAINT XPKSQ_STOPVALUE CASCADE;
ALTER TABLE SQ_STOPVALUE ADD CONSTRAINT XPKSQ_WEEKLY_REVENUE PRIMARY KEY (SQ_WEEKLY_REVENUE_ID); 
ALTER TABLE SQ_STOPVALUE DROP CONSTRAINT CHK_SQ_STOPVALUE_TYPE;
ALTER TABLE SQ_STOPVALUE ADD CONSTRAINT CHK_SQ_WEEKLY_REVENUE_TYPE
  CHECK (SQ_WEEKLY_REVENUE_TYPE IN (1,2,3));
ALTER TABLE SQ_STOPVALUE DROP CONSTRAINT CHK_SQ_STOPVALUE_V1;
ALTER TABLE SQ_STOPVALUE ADD CONSTRAINT CHK_SQ_WEEKLY_REVENUE_V1
  CHECK (PROCESS_STATUS IN (-1,0,1));
ALTER TABLE SQ_STOPVALUE RENAME TO SQ_WEEKLY_REVENUE;
ALTER INDEX INDX_SQ_STOPVALUE_BUSS RENAME TO INDX_SQ_WEEKLY_REVENUE_BUSS;
ALTER INDEX INDX_SQ_STOPVALUE_CURR RENAME TO INDX_SQ_WEEKLY_REVENUE_CURR;
ALTER INDEX INDX_SQ_STOPVALUE_DELT RENAME TO INDX_SQ_WEEKLY_REVENUE_DELT;
ALTER INDEX INDX_SQ_STOPVALUE_TURN RENAME TO INDX_SQ_WEEKLY_REVENUE_TURN;
DROP SEQUENCE SEQ_SQ_STOPVALUE;