From f7ff0380914ea5817f3441be43ece2a7bfeafe08 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 Jul 2005 00:37:26 +0000 Subject: [PATCH] =?UTF-8?q?Ajout=20info=20date=20=E9ch=E9ance=20et=20mode?= =?UTF-8?q?=20r=E9glement=20sur=20factures=20fournisseurs.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mysql/migration/1.1.0-2.0.0.sql | 20 ++++++++++++++++ mysql/tables/llx_facture.key.sql | 2 ++ mysql/tables/llx_facture.sql | 10 +++++--- mysql/tables/llx_facture_fourn.key.sql | 32 ++++++++++++++++++++++++++ mysql/tables/llx_facture_fourn.sql | 5 ++++ 5 files changed, 66 insertions(+), 3 deletions(-) create mode 100644 mysql/tables/llx_facture_fourn.key.sql diff --git a/mysql/migration/1.1.0-2.0.0.sql b/mysql/migration/1.1.0-2.0.0.sql index 44806fb85e1..05aba19d11d 100644 --- a/mysql/migration/1.1.0-2.0.0.sql +++ b/mysql/migration/1.1.0-2.0.0.sql @@ -394,6 +394,25 @@ alter table llx_socpeople add tms timestamp after datec ; alter table llx_facture_fourn drop index facnumber ; alter table llx_facture_fourn add unique index (facnumber, fk_soc) ; +alter table llx_facture_fourn add fk_projet integer ; +alter table llx_facture_fourn add fk_cond_reglement integer DEFAULT 1 NOT NULL ; +alter table llx_facture_fourn add date_lim_reglement date; + +ALTER TABLE llx_facture_fourn ADD INDEX idx_facture_fourn_fk_soc (fk_soc); +ALTER TABLE llx_facture_fourn ADD INDEX idx_facture_fourn_fk_user_author (fk_user_author); +ALTER TABLE llx_facture_fourn ADD INDEX idx_facture_fourn_fk_user_valid (fk_user_valid); +ALTER TABLE llx_facture_fourn ADD INDEX idx_facture_fourn_fk_projet (fk_projet); + +ALTER TABLE llx_facture_fourn ADD FOREIGN KEY (fk_soc) REFERENCES llx_societe (idp); +ALTER TABLE llx_facture_fourn ADD FOREIGN KEY (fk_user_author) REFERENCES llx_user (rowid); +ALTER TABLE llx_facture_fourn ADD FOREIGN KEY (fk_user_valid) REFERENCES llx_user (rowid); +ALTER TABLE llx_facture_fourn ADD FOREIGN KEY (fk_projet) REFERENCES llx_projet (rowid); + +ALTER TABLE llx_facture ADD INDEX idx_facture_fk_projet (fk_projet); + +ALTER TABLE llx_facture ADD FOREIGN KEY (fk_projet) REFERENCES llx_projet (rowid); + + alter table llx_bank_account modify bank varchar(60); alter table llx_bank_account modify domiciliation varchar(255); alter table llx_bank_account add proprio varchar(60) after domiciliation ; @@ -1575,3 +1594,4 @@ insert into llx_const (name, value, type, visible, note) VALUES ('MAIN_FORCE_SET update llx_const set name='OSC_DB_NAME' where name'DB_NAME_OSC'; + diff --git a/mysql/tables/llx_facture.key.sql b/mysql/tables/llx_facture.key.sql index 3b97d39406b..c0fec2eedf7 100644 --- a/mysql/tables/llx_facture.key.sql +++ b/mysql/tables/llx_facture.key.sql @@ -25,7 +25,9 @@ ALTER TABLE llx_facture ADD INDEX idx_facture_fk_soc (fk_soc); ALTER TABLE llx_facture ADD INDEX idx_facture_fk_user_author (fk_user_author); ALTER TABLE llx_facture ADD INDEX idx_facture_fk_user_valid (fk_user_valid); +ALTER TABLE llx_facture ADD INDEX idx_facture_fk_projet (fk_projet); ALTER TABLE llx_facture ADD FOREIGN KEY (fk_soc) REFERENCES llx_societe (idp); ALTER TABLE llx_facture ADD FOREIGN KEY (fk_user_author) REFERENCES llx_user (rowid); ALTER TABLE llx_facture ADD FOREIGN KEY (fk_user_valid) REFERENCES llx_user (rowid); +ALTER TABLE llx_facture ADD FOREIGN KEY (fk_projet) REFERENCES llx_projet (rowid); diff --git a/mysql/tables/llx_facture.sql b/mysql/tables/llx_facture.sql index 2cbdfcaa144..86c951159e9 100644 --- a/mysql/tables/llx_facture.sql +++ b/mysql/tables/llx_facture.sql @@ -34,15 +34,19 @@ create table llx_facture tva real DEFAULT 0, total real DEFAULT 0, total_ttc real DEFAULT 0, + fk_statut smallint DEFAULT 0 NOT NULL, + fk_user_author integer, -- createur de la facture fk_user_valid integer, -- valideur de la facture - fk_projet integer, -- projet auquel est associé la facture + + fk_projet integer, -- projet auquel est associée la facture + fk_cond_reglement integer DEFAULT 1 NOT NULL, -- condition de reglement (30 jours, fin de mois ...) fk_mode_reglement integer, -- mode de reglement (Virement, Prélèvement) date_lim_reglement date, -- date limite de reglement + note text, - UNIQUE INDEX (facnumber), - INDEX fksoc (fk_soc) + UNIQUE INDEX (facnumber) )type=innodb; diff --git a/mysql/tables/llx_facture_fourn.key.sql b/mysql/tables/llx_facture_fourn.key.sql new file mode 100644 index 00000000000..55409bb2037 --- /dev/null +++ b/mysql/tables/llx_facture_fourn.key.sql @@ -0,0 +1,32 @@ +-- ============================================================================ +-- Copyright (C) 2005 Laurent Destailleur +-- +-- 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$ +-- +-- ============================================================================ + + +ALTER TABLE llx_facture_fourn ADD INDEX idx_facture_fourn_fk_soc (fk_soc); +ALTER TABLE llx_facture_fourn ADD INDEX idx_facture_fourn_fk_user_author (fk_user_author); +ALTER TABLE llx_facture_fourn ADD INDEX idx_facture_fourn_fk_user_valid (fk_user_valid); +ALTER TABLE llx_facture_fourn ADD INDEX idx_facture_fourn_fk_projet (fk_projet); + +ALTER TABLE llx_facture_fourn ADD FOREIGN KEY (fk_soc) REFERENCES llx_societe (idp); +ALTER TABLE llx_facture_fourn ADD FOREIGN KEY (fk_user_author) REFERENCES llx_user (rowid); +ALTER TABLE llx_facture_fourn ADD FOREIGN KEY (fk_user_valid) REFERENCES llx_user (rowid); +ALTER TABLE llx_facture_fourn ADD FOREIGN KEY (fk_projet) REFERENCES llx_projet (rowid); diff --git a/mysql/tables/llx_facture_fourn.sql b/mysql/tables/llx_facture_fourn.sql index b69af48883b..4ff8099418c 100644 --- a/mysql/tables/llx_facture_fourn.sql +++ b/mysql/tables/llx_facture_fourn.sql @@ -42,6 +42,11 @@ create table llx_facture_fourn fk_user_author integer, -- createur de la facture fk_user_valid integer, -- valideur de la facture + fk_projet integer, -- projet auquel est associée la facture + + fk_cond_reglement integer DEFAULT 1 NOT NULL, -- condition de reglement (30 jours, fin de mois ...) + date_lim_reglement date, -- date limite de reglement + note text, UNIQUE INDEX(facnumber, fk_soc)