From b6abd0e294b85fa14577ac8fc937281c8a3c4c9b Mon Sep 17 00:00:00 2001 From: opensides Date: Sat, 12 Jun 2004 17:55:11 +0000 Subject: [PATCH] adaptation pour dolibarr head --- pgsql/tables/llx_birthday_alert.sql | 29 ++++++++++++++ pgsql/tables/llx_c_ape.sql | 31 +++++++++++++++ pgsql/tables/llx_c_departements.sql | 36 +++++++++++++++++ pgsql/tables/llx_c_forme_juridique.sql | 32 +++++++++++++++ pgsql/tables/llx_c_regions.sql | 34 ++++++++++++++++ pgsql/tables/llx_cash.sql | 35 ++++++++++++++++ pgsql/tables/llx_co_fa.sql | 32 +++++++++++++++ pgsql/tables/llx_co_pr.sql | 28 +++++++++++++ pgsql/tables/llx_commande.sql | 53 +++++++++++++++++++++++++ pgsql/tables/llx_expedition.sql | 46 +++++++++++++++++++++ pgsql/tables/llx_expedition_methode.sql | 32 +++++++++++++++ pgsql/tables/llx_expeditiondet.sql | 36 +++++++++++++++++ pgsql/tables/llx_user_param.sql | 33 +++++++++++++++ 13 files changed, 457 insertions(+) create mode 100644 pgsql/tables/llx_birthday_alert.sql create mode 100644 pgsql/tables/llx_c_ape.sql create mode 100644 pgsql/tables/llx_c_departements.sql create mode 100644 pgsql/tables/llx_c_forme_juridique.sql create mode 100644 pgsql/tables/llx_c_regions.sql create mode 100644 pgsql/tables/llx_cash.sql create mode 100644 pgsql/tables/llx_co_fa.sql create mode 100644 pgsql/tables/llx_co_pr.sql create mode 100644 pgsql/tables/llx_commande.sql create mode 100644 pgsql/tables/llx_expedition.sql create mode 100644 pgsql/tables/llx_expedition_methode.sql create mode 100644 pgsql/tables/llx_expeditiondet.sql create mode 100644 pgsql/tables/llx_user_param.sql diff --git a/pgsql/tables/llx_birthday_alert.sql b/pgsql/tables/llx_birthday_alert.sql new file mode 100644 index 00000000000..118f92fc1b3 --- /dev/null +++ b/pgsql/tables/llx_birthday_alert.sql @@ -0,0 +1,29 @@ +-- ============================================================================ +-- Copyright (C) 2004 Rodolphe Quiedeville +-- Copyright (C) 2004 Benoit Mortier +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- ============================================================================ + +create table llx_birthday_alert +( + rowid serial PRIMARY KEY, + fk_contact integer, -- pointe sur llx_socpeople + fk_user integer +); diff --git a/pgsql/tables/llx_c_ape.sql b/pgsql/tables/llx_c_ape.sql new file mode 100644 index 00000000000..2082f92095a --- /dev/null +++ b/pgsql/tables/llx_c_ape.sql @@ -0,0 +1,31 @@ +-- ======================================================================== +-- Copyright (C) 2004 Rodolphe Quiedeville +-- Copyright (C) 2004 Benoit Mortier +-- +-- $Id$ +-- $Source$ +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- ======================================================================== + +create table llx_c_ape +( + rowid serial UNIQUE, + code_ape varchar(5) PRIMARY KEY, + libelle varchar(255), + active smallint default 1 +); + diff --git a/pgsql/tables/llx_c_departements.sql b/pgsql/tables/llx_c_departements.sql new file mode 100644 index 00000000000..8340cb7470a --- /dev/null +++ b/pgsql/tables/llx_c_departements.sql @@ -0,0 +1,36 @@ +-- ======================================================================== +-- Copyright (C) 2004 Rodolphe Quiedeville +-- Copyright (C) 2004 Benoit Mortier +-- +-- $Id$ +-- $Source$ +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- ======================================================================== + +create table llx_c_departements +( + rowid serial PRIMARY KEY, + code_departement char(3), + fk_region integer, + cheflieu varchar(7), + tncc integer, + ncc varchar(50), + nom varchar(50), + active smallint default 1 +); + +CREATE INDEX llx_c_departements_fk_region ON llx_c_departements(fk_region); \ No newline at end of file diff --git a/pgsql/tables/llx_c_forme_juridique.sql b/pgsql/tables/llx_c_forme_juridique.sql new file mode 100644 index 00000000000..f60b4dcffb2 --- /dev/null +++ b/pgsql/tables/llx_c_forme_juridique.sql @@ -0,0 +1,32 @@ +-- ======================================================================== +-- Copyright (C) 2004 Rodolphe Quiedeville +-- Copyright (C) 2004 Benoit Mortier +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- ======================================================================== + +create table llx_c_forme_juridique +( + rowid serial PRIMARY KEY, + fk_pays integer default 1, + code integer UNIQUE, + libelle varchar(255), + active smallint default 1 +); + diff --git a/pgsql/tables/llx_c_regions.sql b/pgsql/tables/llx_c_regions.sql new file mode 100644 index 00000000000..0dfab2c99bf --- /dev/null +++ b/pgsql/tables/llx_c_regions.sql @@ -0,0 +1,34 @@ +-- ======================================================================== +-- Copyright (C) 2001-2002,2004 Rodolphe Quiedeville +-- Copyright (C) 2004 Benoit Mortier +-- +-- $Id$ +-- $Source$ +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- ======================================================================== + +create table llx_c_regions +( + rowid serial PRIMARY KEY, + code_region integer UNIQUE, + fk_pays integer default 1, + cheflieu varchar(7), + tncc integer, + nom varchar(50), + active smallint default 1 +); + diff --git a/pgsql/tables/llx_cash.sql b/pgsql/tables/llx_cash.sql new file mode 100644 index 00000000000..009ff6aa9b0 --- /dev/null +++ b/pgsql/tables/llx_cash.sql @@ -0,0 +1,35 @@ +-- =================================================================== +-- Copyright (C) 2004 Laurent Destailleur +-- Copyright (C) 2004 Benoit Mortier +-- +-- $Id$ +-- $Source$ +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- =================================================================== + +create table llx_cash +( + rowid serial PRIMARY KEY, + datec timestamp, + dateo date NOT NULL, -- date operation + amount real NOT NULL default 0, + label varchar(255), + fk_account integer, -- Pour gerer plusieurs caisse + fk_user_author integer, + fk_type varchar(4), -- Liquide, retrait, depot + note text +); diff --git a/pgsql/tables/llx_co_fa.sql b/pgsql/tables/llx_co_fa.sql new file mode 100644 index 00000000000..1ce626d9c47 --- /dev/null +++ b/pgsql/tables/llx_co_fa.sql @@ -0,0 +1,32 @@ +-- =================================================================== +-- Copyright (C) 2003 Rodolphe Quiedeville +-- Copyright (C) 2004 Benoit Mortier +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- =================================================================== + +create table llx_co_fa +( + rowid serial PRIMARY KEY, + fk_commande integer NOT NULL, + fk_facture integer NOT NULL +); + +CREATE INDEX llx_co_fa_fk_commande ON llx_co_fa(fk_commande); + +CREATE INDEX llx_co_fa_fk_facture ON llx_co_fa(fk_facture); diff --git a/pgsql/tables/llx_co_pr.sql b/pgsql/tables/llx_co_pr.sql new file mode 100644 index 00000000000..e5f28de9977 --- /dev/null +++ b/pgsql/tables/llx_co_pr.sql @@ -0,0 +1,28 @@ +-- =================================================================== +-- Copyright (C) 2003 Rodolphe Quiedeville +-- Copyright (C) 2004 Benoit Mortier +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- =================================================================== + +create table llx_co_pr +( + rowid serial PRIMARY KEY, + fk_commande integer, + fk_propale integer +); diff --git a/pgsql/tables/llx_commande.sql b/pgsql/tables/llx_commande.sql new file mode 100644 index 00000000000..fabd3fce247 --- /dev/null +++ b/pgsql/tables/llx_commande.sql @@ -0,0 +1,53 @@ +-- =================================================================== +-- Copyright (C) 2003 Rodolphe Quiedeville +-- Copyright (C) 2004 Benoit Mortier +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- =================================================================== + +create table llx_commande +( + rowid serial PRIMARY KEY, + tms timestamp, + fk_soc integer, + fk_soc_contact integer, + fk_projet integer default 0, -- projet auquel est rattache la commande + ref varchar(30) NOT NULL, -- propal number + date_creation timestamp, -- date de creation + date_valid timestamp, -- date de validation + date_cloture timestamp, -- date de cloture + date_commande date, -- date de la commande + fk_user_author integer, -- createur de la commande + fk_user_valid integer, -- valideur de la commande + fk_user_cloture integer, -- cloture de la propale signee ou non signee + source smallint NOT NULL, + fk_statut smallint default 0, + amount_ht real default 0, + remise_percent real default 0, + remise real default 0, + tva real default 0, + total_ht real default 0, + total_ttc real default 0, + note text, + model_pdf varchar(50), + facture smallint default 0, + + UNIQUE (ref) +); + diff --git a/pgsql/tables/llx_expedition.sql b/pgsql/tables/llx_expedition.sql new file mode 100644 index 00000000000..e4722e7eb2a --- /dev/null +++ b/pgsql/tables/llx_expedition.sql @@ -0,0 +1,46 @@ +-- =================================================================== +-- Copyright (C) 2003 Rodolphe Quiedeville +-- Copyright (C) 2004 Benoit Mortier +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- =================================================================== + +create table llx_expedition +( + rowid serial PRIMARY KEY, + tms timestamp, + ref varchar(30) NOT NULL, + fk_commande integer, + date_creation timestamp, -- date de creation + date_valid timestamp, -- date de validation + date_expedition date, -- date de l'expedition + fk_user_author integer, -- createur + fk_user_valid integer, -- valideur + fk_entrepot integer, + fk_expedition_methode integer, + fk_statut smallint default 0, + note text, + model_pdf varchar(50), + + UNIQUE (ref) +); + +CREATE INDEX llx_expedition_fk_expedition_methode ON llx_expedition(fk_expedition_methode); + +CREATE INDEX llx_expedition_fk_commande ON llx_expedition(fk_commande); diff --git a/pgsql/tables/llx_expedition_methode.sql b/pgsql/tables/llx_expedition_methode.sql new file mode 100644 index 00000000000..5bcaf002d5e --- /dev/null +++ b/pgsql/tables/llx_expedition_methode.sql @@ -0,0 +1,32 @@ +-- =================================================================== +-- Copyright (C) 2003 Rodolphe Quiedeville +-- Copyright (C) 2004 Benoit Mortier +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- =================================================================== + +create table llx_expedition_methode +( + rowid integer PRIMARY KEY, + tms timestamp, + code varchar(30) NOT NULL, + libelle varchar(50) NOT NULL, + description text, + statut smallint default 0 +); diff --git a/pgsql/tables/llx_expeditiondet.sql b/pgsql/tables/llx_expeditiondet.sql new file mode 100644 index 00000000000..40da3c7645a --- /dev/null +++ b/pgsql/tables/llx_expeditiondet.sql @@ -0,0 +1,36 @@ +-- =================================================================== +-- Copyright (C) 2003 Rodolphe Quiedeville +-- Copyright (C) 2004 Benoit Mortier +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- =================================================================== + +create table llx_expeditiondet +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + fk_expedition integer not null, + fk_commande_ligne integer not null, + qty real, -- quantité + + key(fk_expedition), + key(fk_commande_ligne) +); + +CREATE INDEX llx_expeditiondet_fk_expedition ON llx_expeditiondet(fk_expedition); + +CREATE INDEX llx_expeditiondet_fk_commande_ligne ON llx_expeditiondet(fk_commande_ligne); diff --git a/pgsql/tables/llx_user_param.sql b/pgsql/tables/llx_user_param.sql new file mode 100644 index 00000000000..0311a75e5b4 --- /dev/null +++ b/pgsql/tables/llx_user_param.sql @@ -0,0 +1,33 @@ +-- ============================================================================ +-- Copyright (C) 2004 Rodolphe Quiedeville +-- Copyright (C) 2004 Laurent Destailleur +-- Copyright (C) 2004 Benoit Mortier +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- =========================================================================== + +create table llx_user_param +( + fk_user integer, + page varchar(255), + param varchar(64), + value varchar(255), + + UNIQUE (fk_user,page,param) +);