--Order 20010744.90

---CLIENT---

ALTER TABLE CLIENT
	ADD (PUBLICSERVICENUMBER VARCHAR2(20) NULL);

COMMENT ON COLUMN CLIENT.PUBLICSERVICENUMBER IS 'In some countries each person has a unique number that is provided by the authorities.
In Dutch BSN (Burger Service Nummer).
';

---CSVEXPORT---

ALTER TABLE CSVEXPORT
	ADD (	
		ADMINNUMBER VARCHAR2(20) NULL,
		CLIENTNUMBER NUMBER NULL,
		CLIENTNAME VARCHAR2(40) NULL,
		CLIENTCATEGORYCODE VARCHAR2(6) NULL,
		CLIENTINVOICECATEGORYCODE VARCHAR2(6) NULL,
		CLIENTREMARK VARCHAR2(80) NULL,
		CLIENTSIGNAL VARCHAR2(6) NULL,
		CLIENTDELIVERYNOTENUMBER NUMBER NULL,
		PRICEINBETWEENTABLE NUMBER NULL,
		PUBLICSERVICENUMBER VARCHAR2(20) NULL,
		CSVEXPORTTYPE NUMBER  DEFAULT 0 NOT NULL CONSTRAINT CSVExport_valid1_1 CHECK (CSVEXPORTTYPE IN (0, 1))
            );


DROP INDEX XIE3CSVEXPORT;

DROP INDEX XIE2CSVEXPORT;

DROP INDEX XIE1CSVEXPORT;

CREATE  INDEX XIE3CSVEXPORT ON CSVEXPORT
(CSVEXPORTSESSIONNO   ASC,EXPORTED   ASC,CSVEXPORTTYPE   ASC);

CREATE  INDEX XIE2CSVEXPORT ON CSVEXPORT
(BILLTOCUSTOMERNO   ASC,CSVEXPORTTYPE   ASC);

CREATE  INDEX XIE1CSVEXPORT ON CSVEXPORT
(BUSINESSUNIT_ID   ASC,EXPORTED   ASC,EXPORTTIMESTAMP   ASC,CSVEXPORTTYPE   ASC);


---INVOICEAPPENDIXDEFINITION---

INSERT INTO  INVOICEAPPENDIXDEFINITION 
      (INVOICEAPPENDIXDEFINITION_ID,
       INVOICEAPPENDIXTYPE,
       DESCRIPTION,
       REPORTNAME,
       CUSTOMERCODE,
       MODULE,
       MANUAL,
       DIRECTINVOICE,
       OTHERSERVICES,
       RESIDENTIALSERVICES,
       REPORTTYPE,
       SYSTEMUSER_ID,
       TIMESTAMP)
    VALUES
      (36,
       36,
       'Client.csv',
       'Clientcsv',     
       '',
       'EXPORTTOCSV',
       'N',
       'N',
       'N',
       'Y',
	2,
       GETMINSYSTEMUSER(),
       SYSDATE);

commit;