X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=sql%2Flx-office.sql;h=6807f217fa72244257c9d8d33c46448d67a2ec41;hb=baf92f533975d1224700a85d0b8ededd8246d09b;hp=3be0a85465669e8f402a68fc556349f9af8021e4;hpb=435a5be586488ee4700b0a4fed0c91b5a5e1abfb;p=kivitendo-erp.git diff --git a/sql/lx-office.sql b/sql/lx-office.sql index 3be0a8546..6807f217f 100644 --- a/sql/lx-office.sql +++ b/sql/lx-office.sql @@ -109,12 +109,23 @@ CREATE TABLE "defaults" ( "rfqnumber" text, "customernumber" text, "vendornumber" text, + "audittrail" bool default 'f', "articlenumber" text, "servicenumber" text, "itime" timestamp DEFAULT now(), "mtime" timestamp ); -INSERT INTO defaults (version) VALUES ('2.1.2'); +INSERT INTO defaults (version,audittrail) VALUES ('2.2.0', 't'); + +CREATE TABLE audittrail ( + "trans_id" int, + "tablename" text, + "reference" text, + "formname" text, + "action" text, + "transdate" timestamp default current_timestamp, + "employee_id" int +); CREATE TABLE "acc_trans" ( "trans_id" integer, @@ -149,7 +160,11 @@ CREATE TABLE "invoice" ( "deliverydate" date, "serialnumber" text, "itime" timestamp DEFAULT now(), - "mtime" timestamp + "mtime" timestamp, + "pricegroup_id" integer, + "ordnumber" text, + "transdate" text, + "cusordnumber" text ); CREATE TABLE "vendor" ( @@ -228,9 +243,10 @@ CREATE TABLE "customer" ( "obsolete" boolean DEFAULT 'f', "ustid" varchar(12), "username" varchar(50), - "user_password" varchar(12), + "user_password" text, "salesman_id" integer, - "c_vendor_id" text + "c_vendor_id" text, + "klass" integer DEFAULT 0 ); @@ -269,6 +285,7 @@ CREATE TABLE "ar" ( "paid" numeric (15,5), "datepaid" date, "duedate" date, + "deliverydate" date, "invoice" boolean DEFAULT 'f', "shippingpoint" text, "terms" smallint DEFAULT 0, @@ -370,7 +387,7 @@ CREATE TABLE "oe" ( ); CREATE TABLE "orderitems" ( - "trans_id" integer REFERENCES oe (id), + "trans_id" integer, "parts_id" integer REFERENCES parts (id), "description" text, "qty" real, @@ -381,9 +398,13 @@ CREATE TABLE "orderitems" ( "reqdate" date, "ship" real, "serialnumber" text, - "id" integer DEFAULT nextval('orderitemsid'::text) PRIMARY KEY, + "id" integer DEFAULT nextval('orderitemsid'::text), "itime" timestamp DEFAULT now(), - "mtime" timestamp + "mtime" timestamp, + "pricegroup_id" integer, + "ordnumber" text, + "transdate" text, + "cusordnumber" text ); CREATE TABLE "exchangerate" ( @@ -433,7 +454,7 @@ CREATE TABLE "shipto" ( CREATE TABLE "project" ( "id" integer DEFAULT nextval('id'::text) PRIMARY KEY, - "projectnumber" text, + "projectnumber" text UNIQUE, "description" text, "itime" timestamp DEFAULT now(), "mtime" timestamp @@ -513,6 +534,7 @@ CREATE TABLE "business" ( "mtime" timestamp ); + CREATE TABLE "sic" ( "code" text, "sictype" character(1), @@ -540,6 +562,22 @@ CREATE TABLE "licenseinvoice" ( license_id integer ); +-- Preisgruppenverwaltung +CREATE TABLE "pricegroup" ( + "id" integer DEFAULT nextval('id'::text), + "pricegroup" text not null, + PRIMARY KEY (id) +); +--Preisverwaltung der Preisgruppen +CREATE TABLE "prices" ( + "parts_id" integer REFERENCES parts(id), + "pricegroup_id" integer REFERENCES pricegroup(id), + "price" numeric(15,5) +); + + + + -- Table of tax authoritys -- for module ustva -- Lx office