-- ABS-70240/ ABS-77532

ALTER TABLE ERP_O_INVOICEHEADER ADD (MASTERACCOUNTNUMBER NUMBER NULL,
                                     PURCHASE_ORDER VARCHAR2(30) NULL,
                                     PO_EXPIRATION_DATE DATE NULL,
                                     ROUTENUMBER NUMBER NULL,
                                     REMITBATCHNUMBER NUMBER NULL,
                                     CHECKNUMBER VARCHAR2(16) NULL,
                                     DEPOTCODE VARCHAR2(12) NULL,
                                     STATETAX_AUTHCODE VARCHAR2(12) NULL,
                                     STATETAX_AMOUNT NUMBER(15,6) NULL,
                                     CITYTAX_AUTHCODE VARCHAR2(12) NULL,
                                     CITYTAX_AMOUNT NUMBER(15,6) NULL,
                                     COUNTYTAX_AUTHCODE VARCHAR2(12) NULL,
                                     COUNTYTAX_AMOUNT NUMBER(15,6) NULL,
                                     LINE_COUNT NUMBER NULL,
                                     ADDITIONALMESSAGE VARCHAR2(512) NULL,
                                     DELIVERYSIGNEDBY VARCHAR2(10) NULL,
                                     LEGACYCUSTOMERNUMBER VARCHAR2(12) NULL,
                                     INVOICELAYOUTCODE VARCHAR2(6) NULL,
                                     SIGNATUREREQUIRED VARCHAR(1) DEFAULT 'Y' NOT NULL,
                                     DRIVINGDATE DATE NULL
                                     );

COMMENT ON COLUMN ERP_O_INVOICEHEADER.REMITBATCHNUMBER
  IS 'BATCHNUMBER from REMITBATCH_ID';

COMMENT ON COLUMN ERP_O_INVOICEHEADER.CHECKNUMBER
  IS 'Receipt number';

COMMENT ON COLUMN ERP_O_INVOICEHEADER.ADDITIONALMESSAGE
  IS 'Optional invoice message from the view v_invoiceheader_aus_message';
  
COMMENT ON COLUMN ERP_O_INVOICEHEADER.DELIVERYSIGNEDBY
  IS 'initials of the DelToCustomer';
  
COMMENT ON COLUMN ERP_O_INVOICEHEADER.LEGACYCUSTOMERNUMBER
  IS 'From DelToCustomer';
  
COMMENT ON COLUMN ERP_O_INVOICEHEADER.INVOICELAYOUTCODE
  IS 'ihextr.formlayout';

COMMENT ON COLUMN ERP_O_INVOICEHEADER.DRIVINGDATE
  IS 'invoiceheader.routecontrol_id.drivingdate';