Works on multi-currency and bank account select
This commit is contained in:
parent
47688668d9
commit
a56011e1da
@ -197,6 +197,43 @@ ALTER TABLE llx_expedition ADD CONSTRAINT fk_expedition_fk_expedition_methode F
|
||||
|
||||
-- VMYSQL4.1 UPDATE llx_chargesociales set tms = date_creation WHERE tms = '0000-00-00 00:00:00';
|
||||
|
||||
ALTER TABLE llx_propal ADD COLUMN fk_account integer AFTER total;
|
||||
ALTER TABLE llx_propal ADD COLUMN fk_currency varchar(2) AFTER fk_account;
|
||||
ALTER TABLE llx_propal ADD INDEX idx_propal_fk_user_author (fk_user_author);
|
||||
ALTER TABLE llx_propal ADD INDEX idx_propal_fk_user_valid (fk_user_valid);
|
||||
ALTER TABLE llx_propal ADD INDEX idx_propal_fk_user_cloture (fk_user_cloture);
|
||||
ALTER TABLE llx_propal ADD INDEX idx_propal_fk_projet (fk_projet);
|
||||
ALTER TABLE llx_propal ADD INDEX idx_propal_fk_account(fk_account);
|
||||
ALTER TABLE llx_propal ADD INDEX idx_propal_fk_currency(fk_currency);
|
||||
ALTER TABLE llx_propal ADD CONSTRAINT fk_propal_fk_user_author FOREIGN KEY (fk_user_author) REFERENCES llx_user (rowid);
|
||||
ALTER TABLE llx_propal ADD CONSTRAINT fk_propal_fk_user_valid FOREIGN KEY (fk_user_valid) REFERENCES llx_user (rowid);
|
||||
ALTER TABLE llx_propal ADD CONSTRAINT fk_propal_fk_user_cloture FOREIGN KEY (fk_user_cloture) REFERENCES llx_user (rowid);
|
||||
ALTER TABLE llx_propal ADD CONSTRAINT fk_propal_fk_projet FOREIGN KEY (fk_projet) REFERENCES llx_projet (rowid);
|
||||
ALTER TABLE llx_propal ADD CONSTRAINT fk_propal_fk_account FOREIGN KEY (fk_account) REFERENCES llx_bank_account (rowid);
|
||||
ALTER TABLE llx_propal ADD CONSTRAINT fk_propal_fk_currency FOREIGN KEY (fk_currency) REFERENCES llx_c_currencies (code);
|
||||
|
||||
ALTER TABLE llx_commande ADD COLUMN fk_account integer AFTER facture;
|
||||
ALTER TABLE llx_commande ADD COLUMN fk_currency varchar(2) AFTER fk_account;
|
||||
ALTER TABLE llx_commande ADD INDEX idx_commande_fk_user_author (fk_user_author);
|
||||
ALTER TABLE llx_commande ADD INDEX idx_commande_fk_user_valid (fk_user_valid);
|
||||
ALTER TABLE llx_commande ADD INDEX idx_commande_fk_user_cloture (fk_user_cloture);
|
||||
ALTER TABLE llx_commande ADD INDEX idx_commande_fk_projet (fk_projet);
|
||||
ALTER TABLE llx_commande ADD INDEX idx_commande_fk_account(fk_account);
|
||||
ALTER TABLE llx_commande ADD INDEX idx_commande_fk_currency(fk_currency);
|
||||
ALTER TABLE llx_commande ADD CONSTRAINT fk_commande_fk_user_author FOREIGN KEY (fk_user_author) REFERENCES llx_user (rowid);
|
||||
ALTER TABLE llx_commande ADD CONSTRAINT fk_commande_fk_user_valid FOREIGN KEY (fk_user_valid) REFERENCES llx_user (rowid);
|
||||
ALTER TABLE llx_commande ADD CONSTRAINT fk_commande_fk_user_cloture FOREIGN KEY (fk_user_cloture) REFERENCES llx_user (rowid);
|
||||
ALTER TABLE llx_commande ADD CONSTRAINT fk_commande_fk_projet FOREIGN KEY (fk_projet) REFERENCES llx_projet (rowid);
|
||||
ALTER TABLE llx_commande ADD CONSTRAINT fk_commande_fk_account FOREIGN KEY (fk_account) REFERENCES llx_bank_account (rowid);
|
||||
ALTER TABLE llx_commande ADD CONSTRAINT fk_commande_fk_currency FOREIGN KEY (fk_currency) REFERENCES llx_c_currencies (code);
|
||||
|
||||
ALTER TABLE llx_facture ADD COLUMN fk_account integer AFTER fk_projet;
|
||||
ALTER TABLE llx_facture ADD COLUMN fk_currency varchar(2) AFTER fk_account;
|
||||
ALTER TABLE llx_facture ADD INDEX idx_facture_fk_account (fk_account);
|
||||
ALTER TABLE llx_facture ADD INDEX idx_facture_fk_currency (fk_currency);
|
||||
ALTER TABLE llx_facture ADD CONSTRAINT fk_facture_fk_account FOREIGN KEY (fk_account) REFERENCES llx_bank_account (rowid);
|
||||
ALTER TABLE llx_facture ADD CONSTRAINT fk_facture_fk_currency FOREIGN KEY (fk_currency) REFERENCES llx_c_currencies (code);
|
||||
|
||||
ALTER TABLE llx_actioncomm DROP COLUMN propalrowid;
|
||||
ALTER TABLE llx_actioncomm DROP COLUMN fk_facture;
|
||||
ALTER TABLE llx_actioncomm DROP COLUMN fk_supplier_order;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
-- ============================================================================
|
||||
-- Copyright (C) 2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
-- Copyright (C) 2009 Regis Houssin <regis@dolibarr.fr>
|
||||
-- Copyright (C) 2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
-- Copyright (C) 2009-2012 Regis Houssin <regis@dolibarr.fr>
|
||||
--
|
||||
-- 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
|
||||
@ -24,4 +24,17 @@
|
||||
ALTER TABLE llx_commande ADD UNIQUE INDEX uk_commande_ref (ref, entity);
|
||||
|
||||
ALTER TABLE llx_commande ADD INDEX idx_commande_fk_soc (fk_soc);
|
||||
ALTER TABLE llx_commande ADD CONSTRAINT fk_commande_fk_soc FOREIGN KEY (fk_soc) REFERENCES llx_societe (rowid);
|
||||
ALTER TABLE llx_commande ADD INDEX idx_commande_fk_user_author (fk_user_author);
|
||||
ALTER TABLE llx_commande ADD INDEX idx_commande_fk_user_valid (fk_user_valid);
|
||||
ALTER TABLE llx_commande ADD INDEX idx_commande_fk_user_cloture (fk_user_cloture);
|
||||
ALTER TABLE llx_commande ADD INDEX idx_commande_fk_projet (fk_projet);
|
||||
ALTER TABLE llx_commande ADD INDEX idx_commande_fk_account(fk_account);
|
||||
ALTER TABLE llx_commande ADD INDEX idx_commande_fk_currency(fk_currency);
|
||||
|
||||
ALTER TABLE llx_commande ADD CONSTRAINT fk_commande_fk_soc FOREIGN KEY (fk_soc) REFERENCES llx_societe (rowid);
|
||||
ALTER TABLE llx_commande ADD CONSTRAINT fk_commande_fk_user_author FOREIGN KEY (fk_user_author) REFERENCES llx_user (rowid);
|
||||
ALTER TABLE llx_commande ADD CONSTRAINT fk_commande_fk_user_valid FOREIGN KEY (fk_user_valid) REFERENCES llx_user (rowid);
|
||||
ALTER TABLE llx_commande ADD CONSTRAINT fk_commande_fk_user_cloture FOREIGN KEY (fk_user_cloture) REFERENCES llx_user (rowid);
|
||||
ALTER TABLE llx_commande ADD CONSTRAINT fk_commande_fk_projet FOREIGN KEY (fk_projet) REFERENCES llx_projet (rowid);
|
||||
ALTER TABLE llx_commande ADD CONSTRAINT fk_commande_fk_account FOREIGN KEY (fk_account) REFERENCES llx_bank_account (rowid);
|
||||
ALTER TABLE llx_commande ADD CONSTRAINT fk_commande_fk_currency FOREIGN KEY (fk_currency) REFERENCES llx_c_currencies (code);
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
-- ===================================================================
|
||||
-- Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
-- Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
|
||||
-- Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
|
||||
-- Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
|
||||
--
|
||||
-- This program is free software; you can redistribute it and/or modify
|
||||
@ -20,46 +20,50 @@
|
||||
|
||||
create table llx_commande
|
||||
(
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||
ref varchar(30) NOT NULL, -- order reference number
|
||||
entity integer DEFAULT 1 NOT NULL, -- multi company id
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||
ref varchar(30) NOT NULL, -- order reference number
|
||||
entity integer DEFAULT 1 NOT NULL, -- multi company id
|
||||
|
||||
ref_ext varchar(255), -- reference into an external system (not used by dolibarr)
|
||||
ref_ext varchar(255), -- reference into an external system (not used by dolibarr)
|
||||
ref_int varchar(255), -- reference into an internal system (used by dolibarr)
|
||||
ref_client varchar(255), -- reference for customer
|
||||
ref_client varchar(255), -- reference for customer
|
||||
|
||||
fk_soc integer NOT NULL,
|
||||
fk_projet integer DEFAULT 0, -- projet auquel est rattache la commande
|
||||
fk_soc integer NOT NULL,
|
||||
fk_projet integer DEFAULT 0, -- projet auquel est rattache la commande
|
||||
|
||||
tms timestamp,
|
||||
date_creation datetime, -- date de creation
|
||||
date_valid datetime, -- date de validation
|
||||
date_cloture datetime, -- 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, -- auteur cloture
|
||||
source smallint,
|
||||
fk_statut smallint default 0,
|
||||
amount_ht real default 0,
|
||||
remise_percent real default 0,
|
||||
remise_absolue real default 0,
|
||||
remise real default 0,
|
||||
tva double(24,8) default 0,
|
||||
localtax1 double(24,8) default 0, -- total localtax1
|
||||
localtax2 double(24,8) default 0, -- total localtax2
|
||||
total_ht double(24,8) default 0,
|
||||
total_ttc double(24,8) default 0,
|
||||
note text,
|
||||
note_public text,
|
||||
model_pdf varchar(255),
|
||||
tms timestamp,
|
||||
date_creation datetime, -- date de creation
|
||||
date_valid datetime, -- date de validation
|
||||
date_cloture datetime, -- 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, -- auteur cloture
|
||||
source smallint,
|
||||
fk_statut smallint default 0,
|
||||
amount_ht real default 0,
|
||||
remise_percent real default 0,
|
||||
remise_absolue real default 0,
|
||||
remise real default 0,
|
||||
tva double(24,8) default 0,
|
||||
localtax1 double(24,8) default 0, -- total localtax1
|
||||
localtax2 double(24,8) default 0, -- total localtax2
|
||||
total_ht double(24,8) default 0,
|
||||
total_ttc double(24,8) default 0,
|
||||
note text,
|
||||
note_public text,
|
||||
model_pdf varchar(255),
|
||||
|
||||
facture tinyint default 0,
|
||||
fk_cond_reglement integer, -- condition de reglement
|
||||
fk_mode_reglement integer, -- mode de reglement
|
||||
date_livraison date default NULL,
|
||||
fk_availability integer NULL,
|
||||
facture tinyint default 0,
|
||||
fk_account integer, -- bank account
|
||||
fk_currency varchar(2), -- currency code
|
||||
fk_cond_reglement integer, -- condition de reglement
|
||||
fk_mode_reglement integer, -- mode de reglement
|
||||
|
||||
date_livraison date default NULL,
|
||||
fk_availability integer NULL,
|
||||
fk_demand_reason integer, -- should be named fk_input_reason
|
||||
fk_adresse_livraison integer, -- delivery address (deprecated)
|
||||
import_key varchar(14)
|
||||
fk_adresse_livraison integer, -- delivery address (deprecated)
|
||||
import_key varchar(14)
|
||||
|
||||
)ENGINE=innodb;
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
-- ============================================================================
|
||||
-- Copyright (C) 2002-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
-- Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
-- Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
|
||||
-- Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
-- Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
|
||||
--
|
||||
-- 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
|
||||
@ -26,9 +26,13 @@ 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_facture_source (fk_facture_source);
|
||||
ALTER TABLE llx_facture ADD INDEX idx_facture_fk_projet (fk_projet);
|
||||
ALTER TABLE llx_facture ADD INDEX idx_facture_fk_account (fk_account);
|
||||
ALTER TABLE llx_facture ADD INDEX idx_facture_fk_currency (fk_currency);
|
||||
|
||||
ALTER TABLE llx_facture ADD CONSTRAINT fk_facture_fk_soc FOREIGN KEY (fk_soc) REFERENCES llx_societe (rowid);
|
||||
ALTER TABLE llx_facture ADD CONSTRAINT fk_facture_fk_user_author FOREIGN KEY (fk_user_author) REFERENCES llx_user (rowid);
|
||||
ALTER TABLE llx_facture ADD CONSTRAINT fk_facture_fk_user_valid FOREIGN KEY (fk_user_valid) REFERENCES llx_user (rowid);
|
||||
ALTER TABLE llx_facture ADD CONSTRAINT fk_facture_fk_facture_source FOREIGN KEY (fk_facture_source) REFERENCES llx_facture (rowid);
|
||||
ALTER TABLE llx_facture ADD CONSTRAINT fk_facture_fk_projet FOREIGN KEY (fk_projet) REFERENCES llx_projet (rowid);
|
||||
ALTER TABLE llx_facture ADD CONSTRAINT fk_facture_fk_account FOREIGN KEY (fk_account) REFERENCES llx_bank_account (rowid);
|
||||
ALTER TABLE llx_facture ADD CONSTRAINT fk_facture_fk_currency FOREIGN KEY (fk_currency) REFERENCES llx_c_currencies (code);
|
||||
@ -1,7 +1,7 @@
|
||||
-- ===========================================================================
|
||||
-- Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
-- Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
-- Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
|
||||
-- Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
-- Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
|
||||
-- Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
|
||||
--
|
||||
-- This program is free software; you can redistribute it and/or modify
|
||||
@ -22,52 +22,54 @@
|
||||
|
||||
create table llx_facture
|
||||
(
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||
|
||||
facnumber varchar(30) NOT NULL, -- invoice reference number
|
||||
entity integer DEFAULT 1 NOT NULL, -- multi company id
|
||||
facnumber varchar(30) NOT NULL, -- invoice reference number
|
||||
entity integer DEFAULT 1 NOT NULL, -- multi company id
|
||||
|
||||
ref_ext varchar(255), -- reference into an external system (not used by dolibarr)
|
||||
ref_int varchar(255), -- reference into an internal system (used by dolibarr)
|
||||
ref_client varchar(255), -- reference for customer
|
||||
ref_ext varchar(255), -- reference into an external system (not used by dolibarr)
|
||||
ref_int varchar(255), -- reference into an internal system (used by dolibarr)
|
||||
ref_client varchar(255), -- reference for customer
|
||||
|
||||
type smallint DEFAULT 0 NOT NULL, -- type of invoice
|
||||
increment varchar(10),
|
||||
fk_soc integer NOT NULL,
|
||||
datec datetime, -- date de creation de la facture
|
||||
datef date, -- date de la facture
|
||||
date_valid date, -- date de validation
|
||||
tms timestamp, -- date creation/modification
|
||||
paye smallint DEFAULT 0 NOT NULL,
|
||||
amount double(24,8) DEFAULT 0 NOT NULL,
|
||||
remise_percent real DEFAULT 0, -- remise relative
|
||||
remise_absolue real DEFAULT 0, -- remise absolue
|
||||
remise real DEFAULT 0, -- remise totale calculee
|
||||
type smallint DEFAULT 0 NOT NULL, -- type of invoice
|
||||
increment varchar(10),
|
||||
fk_soc integer NOT NULL,
|
||||
datec datetime, -- date de creation de la facture
|
||||
datef date, -- date de la facture
|
||||
date_valid date, -- date de validation
|
||||
tms timestamp, -- date creation/modification
|
||||
paye smallint DEFAULT 0 NOT NULL,
|
||||
amount double(24,8) DEFAULT 0 NOT NULL,
|
||||
remise_percent real DEFAULT 0, -- remise relative
|
||||
remise_absolue real DEFAULT 0, -- remise absolue
|
||||
remise real DEFAULT 0, -- remise totale calculee
|
||||
|
||||
close_code varchar(16), -- Code motif cloture sans paiement complet
|
||||
close_note varchar(128), -- Commentaire cloture sans paiement complet
|
||||
close_code varchar(16), -- Code motif cloture sans paiement complet
|
||||
close_note varchar(128), -- Commentaire cloture sans paiement complet
|
||||
|
||||
tva double(24,8) DEFAULT 0, -- montant tva apres remise totale
|
||||
localtax1 double(24,8) DEFAULT 0, -- amount localtax1
|
||||
localtax2 double(24,8) DEFAULT 0, -- amount localtax2
|
||||
total double(24,8) DEFAULT 0, -- montant total ht apres remise totale
|
||||
total_ttc double(24,8) DEFAULT 0, -- montant total ttc apres remise totale
|
||||
tva double(24,8) DEFAULT 0, -- montant tva apres remise totale
|
||||
localtax1 double(24,8) DEFAULT 0, -- amount localtax1
|
||||
localtax2 double(24,8) DEFAULT 0, -- amount localtax2
|
||||
total double(24,8) DEFAULT 0, -- montant total ht apres remise totale
|
||||
total_ttc double(24,8) DEFAULT 0, -- montant total ttc apres remise totale
|
||||
|
||||
fk_statut smallint DEFAULT 0 NOT NULL,
|
||||
fk_statut smallint DEFAULT 0 NOT NULL,
|
||||
|
||||
fk_user_author integer, -- createur de la facture
|
||||
fk_user_valid integer, -- valideur de la facture
|
||||
fk_user_author integer, -- createur de la facture
|
||||
fk_user_valid integer, -- valideur de la facture
|
||||
|
||||
fk_facture_source integer, -- facture origine si facture avoir
|
||||
fk_projet integer, -- projet auquel est associee la facture
|
||||
fk_facture_source integer, -- facture origine si facture avoir
|
||||
fk_projet integer, -- projet auquel est associee 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, Prelevement)
|
||||
date_lim_reglement date, -- date limite de reglement
|
||||
fk_account integer, -- bank account
|
||||
fk_currency varchar(2), -- currency code
|
||||
fk_cond_reglement integer DEFAULT 1 NOT NULL, -- condition de reglement (30 jours, fin de mois ...)
|
||||
fk_mode_reglement integer, -- mode de reglement (Virement, Prelevement)
|
||||
date_lim_reglement date, -- date limite de reglement
|
||||
|
||||
note text,
|
||||
note_public text,
|
||||
model_pdf varchar(255),
|
||||
import_key varchar(14)
|
||||
note text,
|
||||
note_public text,
|
||||
model_pdf varchar(255),
|
||||
import_key varchar(14)
|
||||
|
||||
)ENGINE=innodb;
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
-- ============================================================================
|
||||
-- Copyright (C) 2002-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
-- Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
-- Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
|
||||
-- Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
|
||||
--
|
||||
-- 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
|
||||
@ -22,4 +22,17 @@
|
||||
ALTER TABLE llx_propal ADD UNIQUE INDEX uk_propal_ref (ref, entity);
|
||||
|
||||
ALTER TABLE llx_propal ADD INDEX idx_propal_fk_soc (fk_soc);
|
||||
ALTER TABLE llx_propal ADD CONSTRAINT fk_propal_fk_soc FOREIGN KEY (fk_soc) REFERENCES llx_societe (rowid);
|
||||
ALTER TABLE llx_propal ADD INDEX idx_propal_fk_user_author (fk_user_author);
|
||||
ALTER TABLE llx_propal ADD INDEX idx_propal_fk_user_valid (fk_user_valid);
|
||||
ALTER TABLE llx_propal ADD INDEX idx_propal_fk_user_cloture (fk_user_cloture);
|
||||
ALTER TABLE llx_propal ADD INDEX idx_propal_fk_projet (fk_projet);
|
||||
ALTER TABLE llx_propal ADD INDEX idx_propal_fk_account(fk_account);
|
||||
ALTER TABLE llx_propal ADD INDEX idx_propal_fk_currency(fk_currency);
|
||||
|
||||
ALTER TABLE llx_propal ADD CONSTRAINT fk_propal_fk_soc FOREIGN KEY (fk_soc) REFERENCES llx_societe (rowid);
|
||||
ALTER TABLE llx_propal ADD CONSTRAINT fk_propal_fk_user_author FOREIGN KEY (fk_user_author) REFERENCES llx_user (rowid);
|
||||
ALTER TABLE llx_propal ADD CONSTRAINT fk_propal_fk_user_valid FOREIGN KEY (fk_user_valid) REFERENCES llx_user (rowid);
|
||||
ALTER TABLE llx_propal ADD CONSTRAINT fk_propal_fk_user_cloture FOREIGN KEY (fk_user_cloture) REFERENCES llx_user (rowid);
|
||||
ALTER TABLE llx_propal ADD CONSTRAINT fk_propal_fk_projet FOREIGN KEY (fk_projet) REFERENCES llx_projet (rowid);
|
||||
ALTER TABLE llx_propal ADD CONSTRAINT fk_propal_fk_account FOREIGN KEY (fk_account) REFERENCES llx_bank_account (rowid);
|
||||
ALTER TABLE llx_propal ADD CONSTRAINT fk_propal_fk_currency FOREIGN KEY (fk_currency) REFERENCES llx_c_currencies (code);
|
||||
@ -1,6 +1,6 @@
|
||||
-- ===================================================================
|
||||
-- Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
-- Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
|
||||
-- Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
|
||||
-- Copyright (C) 2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
-- Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
|
||||
--
|
||||
@ -21,45 +21,47 @@
|
||||
|
||||
create table llx_propal
|
||||
(
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||
ref varchar(30) NOT NULL, -- proposal reference number
|
||||
entity integer DEFAULT 1 NOT NULL, -- multi company id
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||
ref varchar(30) NOT NULL, -- proposal reference number
|
||||
entity integer DEFAULT 1 NOT NULL, -- multi company id
|
||||
|
||||
ref_ext varchar(255), -- reference into an external system (not used by dolibarr)
|
||||
ref_int varchar(255), -- reference into an internal system (used by dolibarr)
|
||||
ref_client varchar(255), -- customer proposal number
|
||||
ref_ext varchar(255), -- reference into an external system (not used by dolibarr)
|
||||
ref_int varchar(255), -- reference into an internal system (used by dolibarr)
|
||||
ref_client varchar(255), -- customer proposal number
|
||||
|
||||
fk_soc integer,
|
||||
fk_projet integer DEFAULT 0, -- projet auquel est rattache la propale
|
||||
fk_soc integer,
|
||||
fk_projet integer DEFAULT 0, -- projet auquel est rattache la propale
|
||||
|
||||
tms timestamp,
|
||||
datec datetime, -- date de creation
|
||||
datep date, -- date de la propal
|
||||
fin_validite datetime, -- date de fin de validite
|
||||
date_valid datetime, -- date de validation
|
||||
date_cloture datetime, -- date de cloture
|
||||
fk_user_author integer, -- createur de la propale
|
||||
fk_user_valid integer, -- valideur de la propale
|
||||
fk_user_cloture integer, -- cloture de la propale signee ou non signee
|
||||
fk_statut smallint DEFAULT 0 NOT NULL,
|
||||
price real DEFAULT 0, -- (obsolete)
|
||||
remise_percent real DEFAULT 0, -- remise globale relative en pourcent (obsolete)
|
||||
remise_absolue real DEFAULT 0, -- remise globale absolue (obsolete)
|
||||
remise real DEFAULT 0, -- remise calculee (obsolete)
|
||||
total_ht double(24,8) DEFAULT 0, -- montant total ht apres remise globale
|
||||
tva double(24,8) DEFAULT 0, -- montant total tva apres remise globale
|
||||
localtax1 double(24,8) DEFAULT 0, -- amount total localtax1
|
||||
localtax2 double(24,8) DEFAULT 0, -- amount total localtax2
|
||||
total double(24,8) DEFAULT 0, -- montant total ttc apres remise globale
|
||||
tms timestamp,
|
||||
datec datetime, -- date de creation
|
||||
date date, -- date de la propal
|
||||
fin_validite datetime, -- date de fin de validite
|
||||
date_valid datetime, -- date de validation
|
||||
date_cloture datetime, -- date de cloture
|
||||
fk_user_author integer, -- createur de la propale
|
||||
fk_user_valid integer, -- valideur de la propale
|
||||
fk_user_cloture integer, -- cloture de la propale signee ou non signee
|
||||
fk_statut smallint DEFAULT 0 NOT NULL,
|
||||
price real DEFAULT 0, -- (obsolete)
|
||||
remise_percent real DEFAULT 0, -- remise globale relative en pourcent (obsolete)
|
||||
remise_absolue real DEFAULT 0, -- remise globale absolue (obsolete)
|
||||
remise real DEFAULT 0, -- remise calculee (obsolete)
|
||||
total_ht double(24,8) DEFAULT 0, -- montant total ht apres remise globale
|
||||
tva double(24,8) DEFAULT 0, -- montant total tva apres remise globale
|
||||
localtax1 double(24,8) DEFAULT 0, -- amount total localtax1
|
||||
localtax2 double(24,8) DEFAULT 0, -- amount total localtax2
|
||||
total double(24,8) DEFAULT 0, -- montant total ttc apres remise globale
|
||||
|
||||
fk_cond_reglement integer, -- condition de reglement (30 jours, fin de mois ...)
|
||||
fk_mode_reglement integer, -- mode de reglement (Virement, Prelevement)
|
||||
fk_account integer, -- bank account
|
||||
fk_currency varchar(2), -- currency code
|
||||
fk_cond_reglement integer, -- condition de reglement (30 jours, fin de mois ...)
|
||||
fk_mode_reglement integer, -- mode de reglement (Virement, Prelevement)
|
||||
|
||||
note text,
|
||||
note_public text,
|
||||
model_pdf varchar(255),
|
||||
date_livraison date DEFAULT NULL, -- delivery date
|
||||
fk_availability integer NULL,
|
||||
date_livraison date DEFAULT NULL, -- delivery date
|
||||
fk_availability integer NULL,
|
||||
fk_demand_reason integer,
|
||||
fk_adresse_livraison integer -- delivery address (deprecated)
|
||||
fk_adresse_livraison integer -- delivery address (deprecated)
|
||||
)ENGINE=innodb;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user