2 CREATE TABLE "license" (
3 "id" integer DEFAULT nextval('id'::text),
8 "issuedate" date DEFAULT date ('now'::text),
12 CREATE INDEX "license_id_key" ON "license" (id);
14 CREATE TABLE "licenseinvoice" (
20 alter table chart add column datevautomatik boolean;
21 alter table chart alter column datevautomatik set default 'false';
22 update chart set datevautomatik='false';
24 alter table customer add column datevexport integer;
25 alter table vendor add column datevexport integer;
26 update customer set datevexport=1;
27 update vendor set datevexport=1;
30 "beraternr" character varying(7),
31 "beratername" character varying(9),
32 "mandantennr" character varying(5),
33 "dfvkz" character varying(2),
34 "datentraegernr" character varying(3),
35 "abrechnungsnr" character varying(6)
38 CREATE FUNCTION set_datevexport() RETURNS trigger AS '
40 IF OLD.datevexport IS NULL THEN
43 IF OLD.datevexport = 0 THEN
50 CREATE TRIGGER customer_datevexport BEFORE UPDATE ON customer
51 FOR EACH ROW EXECUTE PROCEDURE set_datevexport();
53 CREATE TRIGGER vendor_datevexport BEFORE UPDATE ON vendor
54 FOR EACH ROW EXECUTE PROCEDURE set_datevexport();
56 alter table customer add column language varchar(5);
57 alter table vendor add column language varchar(5);
59 alter table oe add column cusordnumber text;
60 alter table ar add column cusordnumber text;
62 alter table parts rename column unit to unit_old;
63 alter table parts add column unit varchar(10);
64 update parts set unit=unit_old;
65 alter table parts drop column unit_old;
68 --LINET-SK: add column account_number, bank code number and bank to customer and vendor
69 alter table customer add column account_number varchar(10);
70 alter table customer add column bank_code varchar(10);
71 alter table customer add column bank text;
73 alter table vendor add column account_number varchar(10);
74 alter table vendor add column bank_code varchar(10);
75 alter table vendor add column bank text;
77 --LINET-SK: add colum cp_id at oe, ar and ap
78 alter table ap add column cp_id integer;
79 alter table ar add column cp_id integer;
80 alter table oe add column cp_id integer;
82 --deafult-Werte für Kunden, Lieferanten und Artikelnummern
83 alter table defaults add column customernumber text;
84 alter table defaults add column vendornumber text;
85 alter table defaults add column articlenumber text;
86 alter table defaults add column servicenumber text;
88 update defaults set customernumber=(select max(customernumber) from customer);
89 update defaults set vendornumber=(select max(vendornumber) from vendor);
90 update defaults set articlenumber=(select max(partnumber) from parts where inventory_accno_id notnull);
91 update defaults set servicenumber=(select max(partnumber) from parts where inventory_accno_id isnull);
94 update defaults set version = '2.1.0';