Merge pull request #7707 from aspangaro/7.0-SPEC1

SPEC #7013 : use database type "double" to store monetary values
This commit is contained in:
Laurent Destailleur 2017-11-02 09:54:34 +01:00 committed by GitHub
commit d137cef843
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
27 changed files with 261 additions and 233 deletions

View File

@ -494,3 +494,31 @@ ALTER TABLE llx_actioncomm_reminder ADD UNIQUE INDEX uk_actioncomm_reminder_uniq
-- May have error due to duplicate keys -- May have error due to duplicate keys
ALTER TABLE llx_resource ADD UNIQUE INDEX uk_resource_ref (ref, entity); ALTER TABLE llx_resource ADD UNIQUE INDEX uk_resource_ref (ref, entity);
-- SPEC : use database type "double" to store monetary values
ALTER TABLE llx_blockedlog MODIFY COLUMN amounts double(24,8);
ALTER TABLE llx_chargessociales MODIFY COLUMN amount double(24,8);
ALTER TABLE llx_commande MODIFY COLUMN amount_ht double(24,8);
ALTER TABLE llx_commande_fournisseur MODIFY COLUMN amount_ht double(24,8);
ALTER TABLE llx_don MODIFY COLUMN amount double(24,8);
ALTER TABLE llx_expensereport_rules MODIFY COLUMN amount double(24,8);
ALTER TABLE llx_loan MODIFY COLUMN capital double(24,8);
ALTER TABLE llx_loan MODIFY COLUMN capital_position double(24,8);
ALTER TABLE llx_loan_schedule MODIFY COLUMN amount_capital double(24,8);
ALTER TABLE llx_loan_schedule MODIFY COLUMN amount_insurance double(24,8);
ALTER TABLE llx_loan_schedule MODIFY COLUMN amount_interest double(24,8);
ALTER TABLE llx_paiementcharge MODIFY COLUMN amount double(24,8);
ALTER TABLE llx_paiementfourn MODIFY COLUMN amount double(24,8);
ALTER TABLE llx_payment_donation MODIFY COLUMN amount double(24,8);
ALTER TABLE llx_payment_expensereport MODIFY COLUMN amount double(24,8);
ALTER TABLE llx_payment_loan MODIFY COLUMN amount_capital double(24,8);
ALTER TABLE llx_payment_loan MODIFY COLUMN amount_insurance double(24,8);
ALTER TABLE llx_payment_loan MODIFY COLUMN amount_interest double(24,8);
ALTER TABLE llx_payment_salary MODIFY COLUMN salary double(24,8);
ALTER TABLE llx_payment_salary MODIFY COLUMN amount double(24,8);
ALTER TABLE llx_prelevement_bons MODIFY COLUMN amount double(24,8);
ALTER TABLE llx_prelevement_facture_demande MODIFY COLUMN amount double(24,8);
ALTER TABLE llx_prelevement_lignes MODIFY COLUMN amount double(24,8);
ALTER TABLE llx_societe MODIFY COLUMN capital double(24,8);
ALTER TABLE llx_tva MODIFY COLUMN amount double(24,8);
ALTER TABLE llx_subscription MODIFY COLUMN subscription double(24,8);

View File

@ -1,7 +1,7 @@
-- ============================================================================ -- ============================================================================
-- Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net> -- Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
-- Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es> -- Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
-- Copyright (C) 2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com> -- Copyright (C) 2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
-- --
-- This program is free software; you can redistribute it and/or modify -- 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 -- it under the terms of the GNU General Public License as published by
@ -21,20 +21,20 @@
create table llx_accounting_account create table llx_accounting_account
( (
rowid integer AUTO_INCREMENT PRIMARY KEY, rowid integer AUTO_INCREMENT PRIMARY KEY,
entity integer DEFAULT 1 NOT NULL, entity integer DEFAULT 1 NOT NULL,
datec datetime, datec datetime,
tms timestamp, tms timestamp,
fk_pcg_version varchar(32) NOT NULL, fk_pcg_version varchar(32) NOT NULL,
pcg_type varchar(20) NOT NULL, pcg_type varchar(20) NOT NULL,
pcg_subtype varchar(20) NOT NULL, pcg_subtype varchar(20) NOT NULL,
account_number varchar(32) NOT NULL, account_number varchar(32) NOT NULL,
account_parent varchar(32) DEFAULT '0', -- Hierarchic parent TODO Move this as integer, it is a foreign key of llx_accounting_account.rowid account_parent varchar(32) DEFAULT '0', -- Hierarchic parent TODO Move this as integer, it is a foreign key of llx_accounting_account.rowid
label varchar(255) NOT NULL, label varchar(255) NOT NULL,
fk_accounting_category integer DEFAULT 0, fk_accounting_category integer DEFAULT 0,
fk_user_author integer DEFAULT NULL, fk_user_author integer DEFAULT NULL,
fk_user_modif integer DEFAULT NULL, fk_user_modif integer DEFAULT NULL,
active tinyint DEFAULT 1 NOT NULL, active tinyint DEFAULT 1 NOT NULL,
import_key varchar(14), import_key varchar(14),
extraparams varchar(255) -- for other parameters with json format extraparams varchar(255) -- for other parameters with json format
)ENGINE=innodb; )ENGINE=innodb;

View File

@ -40,7 +40,7 @@ CREATE TABLE llx_accounting_bookkeeping
multicurrency_code varchar(255), -- FEC:Idevise multicurrency_code varchar(255), -- FEC:Idevise
lettering_code varchar(255), -- FEC:EcritureLet lettering_code varchar(255), -- FEC:EcritureLet
date_lettering datetime, -- FEC:DateLet date_lettering datetime, -- FEC:DateLet
date_lim_reglement datetime DEFAULT NULL, -- | date limite de reglement date_lim_reglement datetime DEFAULT NULL, -- | date limite de reglement
fk_user_author integer NOT NULL, -- | user creating fk_user_author integer NOT NULL, -- | user creating
fk_user_modif integer, -- | user making last change fk_user_modif integer, -- | user making last change
date_creation datetime, -- FEC:EcritureDate | creation date date_creation datetime, -- FEC:EcritureDate | creation date

View File

@ -40,7 +40,7 @@ CREATE TABLE llx_accounting_bookkeeping_tmp
multicurrency_code varchar(255), -- FEC:Idevise multicurrency_code varchar(255), -- FEC:Idevise
lettering_code varchar(255), -- FEC:EcritureLet lettering_code varchar(255), -- FEC:EcritureLet
date_lettering datetime, -- FEC:DateLet date_lettering datetime, -- FEC:DateLet
date_lim_reglement datetime, -- | date limite de reglement date_lim_reglement datetime, -- | date limite de reglement
fk_user_author integer NOT NULL, -- | user creating fk_user_author integer NOT NULL, -- | user creating
fk_user_modif integer, -- | user making last change fk_user_modif integer, -- | user making last change
date_creation datetime, -- FEC:EcritureDate | creation date date_creation datetime, -- FEC:EcritureDate | creation date

View File

@ -21,7 +21,7 @@ CREATE TABLE llx_blockedlog
rowid integer AUTO_INCREMENT PRIMARY KEY, rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp, tms timestamp,
action varchar(50), action varchar(50),
amounts real NOT NULL, amounts double(24,8) NOT NULL,
signature varchar(100) NOT NULL, signature varchar(100) NOT NULL,
signature_line varchar(100) NOT NULL, signature_line varchar(100) NOT NULL,
element varchar(50), element varchar(50),

View File

@ -25,7 +25,7 @@ create table llx_bordereau_cheque
( (
rowid integer AUTO_INCREMENT PRIMARY KEY, rowid integer AUTO_INCREMENT PRIMARY KEY,
ref varchar(30) NOT NULL, -- ref ref varchar(30) NOT NULL, -- ref
ref_ext varchar(255), -- ref_ext ref_ext varchar(255), -- ref_ext
datec datetime NOT NULL, datec datetime NOT NULL,
date_bordereau date, date_bordereau date,
amount double(24,8) NOT NULL, amount double(24,8) NOT NULL,

View File

@ -20,25 +20,25 @@
create table llx_chargesociales create table llx_chargesociales
( (
rowid integer AUTO_INCREMENT PRIMARY KEY, rowid integer AUTO_INCREMENT PRIMARY KEY,
ref varchar(16), -- 'TX....' ref varchar(16), -- 'TX....'
date_ech datetime NOT NULL, -- date echeance date_ech datetime NOT NULL, -- date echeance
libelle varchar(80) NOT NULL, libelle varchar(80) NOT NULL,
entity integer DEFAULT 1 NOT NULL, -- multi company id entity integer DEFAULT 1 NOT NULL, -- multi company id
tms timestamp, tms timestamp,
date_creation datetime, -- date de creation date_creation datetime, -- date de creation
date_valid datetime, -- date de validation date_valid datetime, -- date de validation
fk_user_author integer, -- user making creation fk_user_author integer, -- user making creation
fk_user_modif integer, -- user making last change fk_user_modif integer, -- user making last change
fk_user_valid integer, -- user validating fk_user_valid integer, -- user validating
fk_type integer NOT NULL, fk_type integer NOT NULL,
fk_account integer, -- bank account fk_account integer, -- bank account
fk_mode_reglement integer, -- mode de reglement fk_mode_reglement integer, -- mode de reglement
amount real default 0 NOT NULL, amount double(24,8) default 0 NOT NULL,
paye smallint default 0 NOT NULL, paye smallint default 0 NOT NULL,
periode date, periode date,
fk_projet integer DEFAULT NULL, fk_projet integer DEFAULT NULL,
import_key varchar(14) import_key varchar(14)
)ENGINE=innodb; )ENGINE=innodb;
-- --

View File

@ -20,63 +20,63 @@
create table llx_commande create table llx_commande
( (
rowid integer AUTO_INCREMENT PRIMARY KEY, rowid integer AUTO_INCREMENT PRIMARY KEY,
ref varchar(30) NOT NULL, -- order reference number ref varchar(30) NOT NULL, -- order reference number
entity integer DEFAULT 1 NOT NULL, -- multi company id 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 (deprecated) ref_int varchar(255), -- reference into an internal system (deprecated)
ref_client varchar(255), -- reference for customer ref_client varchar(255), -- reference for customer
fk_soc integer NOT NULL, fk_soc integer NOT NULL,
fk_projet integer DEFAULT NULL, -- projet auquel est rattache la commande fk_projet integer DEFAULT NULL, -- projet auquel est rattache la commande
tms timestamp, tms timestamp,
date_creation datetime, -- date de creation date_creation datetime, -- date de creation
date_valid datetime, -- date de validation date_valid datetime, -- date de validation
date_cloture datetime, -- date de cloture date_cloture datetime, -- date de cloture
date_commande date, -- date de la commande date_commande date, -- date de la commande
fk_user_author integer, -- user making creation fk_user_author integer, -- user making creation
fk_user_modif integer, -- user making last change fk_user_modif integer, -- user making last change
fk_user_valid integer, -- user validating fk_user_valid integer, -- user validating
fk_user_cloture integer, -- user closing fk_user_cloture integer, -- user closing
source smallint, -- not used, except by setting this to 42 for orders coming for replenishment and 0 in other case ? source smallint, -- not used, except by setting this to 42 for orders coming for replenishment and 0 in other case ?
fk_statut smallint default 0, fk_statut smallint default 0,
amount_ht real default 0, amount_ht double(24,8) default 0,
remise_percent real default 0, remise_percent real default 0,
remise_absolue real default 0, remise_absolue real default 0,
remise real default 0, remise real default 0,
tva double(24,8) default 0, tva double(24,8) default 0,
localtax1 double(24,8) default 0, -- total localtax1 localtax1 double(24,8) default 0, -- total localtax1
localtax2 double(24,8) default 0, -- total localtax2 localtax2 double(24,8) default 0, -- total localtax2
total_ht double(24,8) default 0, total_ht double(24,8) default 0,
total_ttc double(24,8) default 0, total_ttc double(24,8) default 0,
note_private text, note_private text,
note_public text, note_public text,
model_pdf varchar(255), model_pdf varchar(255),
last_main_doc varchar(255), -- relative filepath+filename of last main generated document last_main_doc varchar(255), -- relative filepath+filename of last main generated document
facture tinyint default 0, facture tinyint default 0,
fk_account integer, -- bank account fk_account integer, -- bank account
fk_currency varchar(3), -- currency code fk_currency varchar(3), -- currency code
fk_cond_reglement integer, -- condition de reglement fk_cond_reglement integer, -- condition de reglement
fk_mode_reglement integer, -- mode de reglement fk_mode_reglement integer, -- mode de reglement
date_livraison date default NULL, date_livraison date default NULL,
fk_shipping_method integer, -- shipping method id fk_shipping_method integer, -- shipping method id
fk_warehouse integer default NULL, fk_warehouse integer default NULL,
fk_availability integer NULL, fk_availability integer NULL,
fk_input_reason integer, -- id coming from c_input_reason, '0' if no defined fk_input_reason integer, -- id coming from c_input_reason, '0' if no defined
fk_delivery_address integer, -- delivery address (deprecated) fk_delivery_address integer, -- delivery address (deprecated)
fk_incoterms integer, -- for incoterms fk_incoterms integer, -- for incoterms
location_incoterms varchar(255), -- for incoterms location_incoterms varchar(255), -- for incoterms
import_key varchar(14), import_key varchar(14),
extraparams varchar(255), -- for stock other parameters with json format extraparams varchar(255), -- for stock other parameters with json format
fk_multicurrency integer, fk_multicurrency integer,
multicurrency_code varchar(255), multicurrency_code varchar(255),
multicurrency_tx double(24,8) DEFAULT 1, multicurrency_tx double(24,8) DEFAULT 1,
multicurrency_total_ht double(24,8) DEFAULT 0, multicurrency_total_ht double(24,8) DEFAULT 0,
multicurrency_total_tva double(24,8) DEFAULT 0, multicurrency_total_tva double(24,8) DEFAULT 0,
multicurrency_total_ttc double(24,8) DEFAULT 0 multicurrency_total_ttc double(24,8) DEFAULT 0
)ENGINE=innodb; )ENGINE=innodb;

View File

@ -21,58 +21,58 @@
create table llx_commande_fournisseur create table llx_commande_fournisseur
( (
rowid integer AUTO_INCREMENT PRIMARY KEY, rowid integer AUTO_INCREMENT PRIMARY KEY,
ref varchar(255) NOT NULL, -- order number ref varchar(255) NOT NULL, -- order number
entity integer DEFAULT 1 NOT NULL, -- multi company id entity integer DEFAULT 1 NOT NULL, -- multi company id
ref_ext varchar(64), -- reference into an external system (not used by dolibarr) ref_ext varchar(64), -- reference into an external system (not used by dolibarr)
ref_supplier varchar(255), ref_supplier varchar(255),
fk_soc integer NOT NULL, fk_soc integer NOT NULL,
fk_projet integer DEFAULT 0, -- project id fk_projet integer DEFAULT 0, -- project id
tms timestamp, tms timestamp,
date_creation datetime, -- date de creation date_creation datetime, -- date de creation
date_valid datetime, -- date de validation date_valid datetime, -- date de validation
date_approve datetime, -- date de approve date_approve datetime, -- date de approve
date_approve2 datetime, -- date de approve 2 (when double approving is accivated) date_approve2 datetime, -- date de approve 2 (when double approving is accivated)
date_commande date, -- date de la commande date_commande date, -- date de la commande
fk_user_author integer, -- user making creation fk_user_author integer, -- user making creation
fk_user_modif integer, -- user making last change fk_user_modif integer, -- user making last change
fk_user_valid integer, -- user validating fk_user_valid integer, -- user validating
fk_user_approve integer, -- user approving fk_user_approve integer, -- user approving
fk_user_approve2 integer, -- user approving 2 (when double approving is accivated) fk_user_approve2 integer, -- user approving 2 (when double approving is accivated)
source smallint NOT NULL, -- not used, except by setting this to 42 for orders coming for replenishment and 0 in other case ? source smallint NOT NULL, -- not used, except by setting this to 42 for orders coming for replenishment and 0 in other case ?
fk_statut smallint default 0, fk_statut smallint default 0,
billed smallint default 0, billed smallint default 0,
amount_ht real default 0, amount_ht double(24,8) default 0,
remise_percent real default 0, remise_percent real default 0,
remise real default 0, remise real default 0,
tva double(24,8) default 0, tva double(24,8) default 0,
localtax1 double(24,8) default 0, localtax1 double(24,8) default 0,
localtax2 double(24,8) default 0, localtax2 double(24,8) default 0,
total_ht double(24,8) default 0, total_ht double(24,8) default 0,
total_ttc double(24,8) default 0, total_ttc double(24,8) default 0,
note_private text, note_private text,
note_public text, note_public text,
model_pdf varchar(255), model_pdf varchar(255),
last_main_doc varchar(255), -- relative filepath+filename of last main generated document last_main_doc varchar(255), -- relative filepath+filename of last main generated document
date_livraison datetime default NULL, date_livraison datetime default NULL,
fk_account integer, -- bank account fk_account integer, -- bank account
fk_cond_reglement integer, -- condition de reglement fk_cond_reglement integer, -- condition de reglement
fk_mode_reglement integer, -- mode de reglement fk_mode_reglement integer, -- mode de reglement
fk_input_method integer default 0, -- id coming from c_input_reason, '0' if no defined fk_input_method integer default 0, -- id coming from c_input_reason, '0' if no defined
fk_incoterms integer, -- for incoterms fk_incoterms integer, -- for incoterms
location_incoterms varchar(255), -- for incoterms location_incoterms varchar(255), -- for incoterms
import_key varchar(14), import_key varchar(14),
extraparams varchar(255), -- for stock other parameters with json format extraparams varchar(255), -- for stock other parameters with json format
fk_multicurrency integer, fk_multicurrency integer,
multicurrency_code varchar(255), multicurrency_code varchar(255),
multicurrency_tx double(24,8) DEFAULT 1, multicurrency_tx double(24,8) DEFAULT 1,
multicurrency_total_ht double(24,8) DEFAULT 0, multicurrency_total_ht double(24,8) DEFAULT 0,
multicurrency_total_tva double(24,8) DEFAULT 0, multicurrency_total_tva double(24,8) DEFAULT 0,
multicurrency_total_ttc double(24,8) DEFAULT 0 multicurrency_total_ttc double(24,8) DEFAULT 0
)ENGINE=innodb; )ENGINE=innodb;

View File

@ -1,8 +1,8 @@
-- =================================================================== -- ===================================================================
-- Copyright (C) 2007 Rodolphe Quiedeville <rodolphe@quiedeville.org> -- Copyright (C) 2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2007-2009 Laurent Destailleur <eldy@users.sourceforge.net> -- Copyright (C) 2007-2009 Laurent Destailleur <eldy@users.sourceforge.net>
-- Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es> -- Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
-- Copyright (C) 2015 Marcos García <marcosgdf@gmail.com> -- Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
-- --
-- This program is free software; you can redistribute it and/or modify -- 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 -- it under the terms of the GNU General Public License as published by
@ -23,39 +23,39 @@ create table llx_commande_fournisseurdet
( (
rowid integer AUTO_INCREMENT PRIMARY KEY, rowid integer AUTO_INCREMENT PRIMARY KEY,
fk_commande integer NOT NULL, fk_commande integer NOT NULL,
fk_parent_line integer NULL, fk_parent_line integer NULL,
fk_product integer, fk_product integer,
ref varchar(50), -- supplier product ref ref varchar(50), -- supplier product ref
label varchar(255), -- product label label varchar(255), -- product label
description text, description text,
vat_src_code varchar(10) DEFAULT '', -- Vat code used as source of vat fields. Not strict foreign key here. vat_src_code varchar(10) DEFAULT '', -- Vat code used as source of vat fields. Not strict foreign key here.
tva_tx double(6,3) DEFAULT 0, -- taux tva tva_tx double(6,3) DEFAULT 0, -- taux tva
localtax1_tx double(6,3) DEFAULT 0, -- localtax1 rate localtax1_tx double(6,3) DEFAULT 0, -- localtax1 rate
localtax1_type varchar(10) NULL, -- localtax1 type localtax1_type varchar(10) NULL, -- localtax1 type
localtax2_tx double(6,3) DEFAULT 0, -- localtax2 rate localtax2_tx double(6,3) DEFAULT 0, -- localtax2 rate
localtax2_type varchar(10) NULL, -- localtax2 type localtax2_type varchar(10) NULL, -- localtax2 type
qty real, -- quantity qty real, -- quantity
remise_percent real DEFAULT 0, -- pourcentage de remise remise_percent real DEFAULT 0, -- pourcentage de remise
remise real DEFAULT 0, -- montant de la remise remise real DEFAULT 0, -- montant de la remise
subprice double(24,8) DEFAULT 0, -- prix unitaire subprice double(24,8) DEFAULT 0, -- prix unitaire
total_ht double(24,8) DEFAULT 0, -- Total HT de la ligne toute quantite et incluant remise ligne et globale total_ht double(24,8) DEFAULT 0, -- Total HT de la ligne toute quantite et incluant remise ligne et globale
total_tva double(24,8) DEFAULT 0, -- Total TVA de la ligne toute quantite et incluant remise ligne et globale total_tva double(24,8) DEFAULT 0, -- Total TVA de la ligne toute quantite et incluant remise ligne et globale
total_localtax1 double(24,8) DEFAULT 0, -- Total Local Tax 1 total_localtax1 double(24,8) DEFAULT 0, -- Total Local Tax 1
total_localtax2 double(24,8) DEFAULT 0, -- Total Local Tax 2 total_localtax2 double(24,8) DEFAULT 0, -- Total Local Tax 2
total_ttc double(24,8) DEFAULT 0, -- Total TTC de la ligne toute quantite et incluant remise ligne et globale total_ttc double(24,8) DEFAULT 0, -- Total TTC de la ligne toute quantite et incluant remise ligne et globale
product_type integer DEFAULT 0, product_type integer DEFAULT 0,
date_start datetime DEFAULT NULL, -- date debut si service date_start datetime DEFAULT NULL, -- date debut si service
date_end datetime DEFAULT NULL, -- date fin si service date_end datetime DEFAULT NULL, -- date fin si service
info_bits integer DEFAULT 0, -- TVA NPR ou non info_bits integer DEFAULT 0, -- TVA NPR ou non
special_code integer DEFAULT 0, -- code pour les lignes speciales special_code integer DEFAULT 0, -- code pour les lignes speciales
rang integer DEFAULT 0, rang integer DEFAULT 0,
import_key varchar(14), import_key varchar(14),
fk_unit integer DEFAULT NULL, fk_unit integer DEFAULT NULL,
fk_multicurrency integer, fk_multicurrency integer,
multicurrency_code varchar(255), multicurrency_code varchar(255),
multicurrency_subprice double(24,8) DEFAULT 0, multicurrency_subprice double(24,8) DEFAULT 0,
multicurrency_total_ht double(24,8) DEFAULT 0, multicurrency_total_ht double(24,8) DEFAULT 0,
multicurrency_total_tva double(24,8) DEFAULT 0, multicurrency_total_tva double(24,8) DEFAULT 0,
multicurrency_total_ttc double(24,8) DEFAULT 0 multicurrency_total_ttc double(24,8) DEFAULT 0
)ENGINE=innodb; )ENGINE=innodb;

View File

@ -30,42 +30,42 @@ create table llx_commandedet
description text, description text,
vat_src_code varchar(10) DEFAULT '', -- Vat code used as source of vat fields. Not strict foreign key here. vat_src_code varchar(10) DEFAULT '', -- Vat code used as source of vat fields. Not strict foreign key here.
tva_tx double(6,3), -- Vat rate tva_tx double(6,3), -- Vat rate
localtax1_tx double(6,3) DEFAULT 0, -- localtax1 rate localtax1_tx double(6,3) DEFAULT 0, -- localtax1 rate
localtax1_type varchar(10) NULL, -- localtax1 type localtax1_type varchar(10) NULL, -- localtax1 type
localtax2_tx double(6,3) DEFAULT 0, -- localtax2 rate localtax2_tx double(6,3) DEFAULT 0, -- localtax2 rate
localtax2_type varchar(10) NULL, -- localtax2 type localtax2_type varchar(10) NULL, -- localtax2 type
qty real, -- quantity qty real, -- quantity
remise_percent real DEFAULT 0, -- pourcentage de remise remise_percent real DEFAULT 0, -- pourcentage de remise
remise real DEFAULT 0, -- montant de la remise remise real DEFAULT 0, -- montant de la remise
fk_remise_except integer NULL, -- Lien vers table des remises fixes fk_remise_except integer NULL, -- Lien vers table des remises fixes
price real, -- prix final price real, -- prix final
subprice double(24,8) DEFAULT 0, -- P.U. HT (exemple 100) subprice double(24,8) DEFAULT 0, -- P.U. HT (exemple 100)
total_ht double(24,8) DEFAULT 0, -- Total HT de la ligne toute quantite et incluant remise ligne et globale total_ht double(24,8) DEFAULT 0, -- Total HT de la ligne toute quantite et incluant remise ligne et globale
total_tva double(24,8) DEFAULT 0, -- Total TVA de la ligne toute quantite et incluant remise ligne et globale total_tva double(24,8) DEFAULT 0, -- Total TVA de la ligne toute quantite et incluant remise ligne et globale
total_localtax1 double(24,8) DEFAULT 0, -- Total LocalTax1 total_localtax1 double(24,8) DEFAULT 0, -- Total LocalTax1
total_localtax2 double(24,8) DEFAULT 0, -- Total LocalTax2 total_localtax2 double(24,8) DEFAULT 0, -- Total LocalTax2
total_ttc double(24,8) DEFAULT 0, -- Total TTC de la ligne toute quantite et incluant remise ligne et globale total_ttc double(24,8) DEFAULT 0, -- Total TTC de la ligne toute quantite et incluant remise ligne et globale
product_type integer DEFAULT 0, product_type integer DEFAULT 0,
date_start datetime DEFAULT NULL, -- date debut si service date_start datetime DEFAULT NULL, -- date debut si service
date_end datetime DEFAULT NULL, -- date fin si service date_end datetime DEFAULT NULL, -- date fin si service
info_bits integer DEFAULT 0, -- TVA NPR ou non info_bits integer DEFAULT 0, -- TVA NPR ou non
buy_price_ht double(24,8) DEFAULT 0, -- buying price buy_price_ht double(24,8) DEFAULT 0, -- buying price
fk_product_fournisseur_price integer DEFAULT NULL, -- reference of supplier price when line was added (may be used to update buy_price_ht current price when future invoice will be created) fk_product_fournisseur_price integer DEFAULT NULL, -- reference of supplier price when line was added (may be used to update buy_price_ht current price when future invoice will be created)
special_code integer DEFAULT 0, -- code pour les lignes speciales special_code integer DEFAULT 0, -- code pour les lignes speciales
rang integer DEFAULT 0, rang integer DEFAULT 0,
fk_unit integer DEFAULT NULL, -- lien vers table des unités fk_unit integer DEFAULT NULL, -- lien vers table des unités
import_key varchar(14), import_key varchar(14),
fk_commandefourndet integer DEFAULT NULL, -- link to detail line of commande fourn (resplenish) fk_commandefourndet integer DEFAULT NULL, -- link to detail line of commande fourn (resplenish)
fk_multicurrency integer, fk_multicurrency integer,
multicurrency_code varchar(255), multicurrency_code varchar(255),
multicurrency_subprice double(24,8) DEFAULT 0, multicurrency_subprice double(24,8) DEFAULT 0,
multicurrency_total_ht double(24,8) DEFAULT 0, multicurrency_total_ht double(24,8) DEFAULT 0,
multicurrency_total_tva double(24,8) DEFAULT 0, multicurrency_total_tva double(24,8) DEFAULT 0,
multicurrency_total_ttc double(24,8) DEFAULT 0 multicurrency_total_ttc double(24,8) DEFAULT 0
)ENGINE=innodb; )ENGINE=innodb;
-- --

View File

@ -28,7 +28,7 @@ create table llx_don
tms timestamp, tms timestamp,
fk_statut smallint NOT NULL DEFAULT 0, -- Status of donation promise or validate fk_statut smallint NOT NULL DEFAULT 0, -- Status of donation promise or validate
datedon datetime, -- Date of the donation/promise datedon datetime, -- Date of the donation/promise
amount real DEFAULT 0, amount double(24,8) DEFAULT 0,
fk_payment integer, fk_payment integer,
paid smallint default 0 NOT NULL, paid smallint default 0 NOT NULL,
firstname varchar(50), firstname varchar(50),

View File

@ -18,17 +18,17 @@
-- ============================================================================ -- ============================================================================
CREATE TABLE llx_expensereport_rules ( CREATE TABLE llx_expensereport_rules (
rowid integer AUTO_INCREMENT PRIMARY KEY, rowid integer AUTO_INCREMENT PRIMARY KEY,
datec datetime DEFAULT NULL, datec datetime DEFAULT NULL,
tms timestamp, tms timestamp,
dates datetime NOT NULL, dates datetime NOT NULL,
datee datetime NOT NULL, datee datetime NOT NULL,
amount numeric(24,8) NOT NULL, amount double(24,8) NOT NULL,
restrictive tinyint NOT NULL, restrictive tinyint NOT NULL,
fk_user integer DEFAULT NULL, fk_user integer DEFAULT NULL,
fk_usergroup integer DEFAULT NULL, fk_usergroup integer DEFAULT NULL,
fk_c_type_fees integer NOT NULL, fk_c_type_fees integer NOT NULL,
code_expense_rules_type varchar(50) NOT NULL, code_expense_rules_type varchar(50) NOT NULL,
is_for_all tinyint DEFAULT '0', is_for_all tinyint DEFAULT '0',
entity integer DEFAULT 1 entity integer DEFAULT 1
) ENGINE=InnoDB ) ENGINE=InnoDB

View File

@ -23,24 +23,24 @@ create table llx_loan
entity integer DEFAULT 1 NOT NULL, entity integer DEFAULT 1 NOT NULL,
datec datetime, datec datetime,
tms timestamp, tms timestamp,
label varchar(80) NOT NULL, label varchar(80) NOT NULL,
fk_bank integer, fk_bank integer,
capital real default 0 NOT NULL, capital double(24,8) default 0 NOT NULL,
datestart date, datestart date,
dateend date, dateend date,
nbterm real, nbterm real,
rate double NOT NULL, rate double NOT NULL,
note_private text, note_private text,
note_public text, note_public text,
capital_position real default 0, -- If not a new loan, just have the position of capital capital_position double(24,8) default 0, -- If not a new loan, just have the position of capital
date_position date, date_position date,
paid smallint default 0 NOT NULL, paid smallint default 0 NOT NULL,
accountancy_account_capital varchar(32), accountancy_account_capital varchar(32),
accountancy_account_insurance varchar(32), accountancy_account_insurance varchar(32),
accountancy_account_interest varchar(32), accountancy_account_interest varchar(32),

View File

@ -24,9 +24,9 @@ create table llx_loan_schedule
datec datetime, -- creation date datec datetime, -- creation date
tms timestamp, tms timestamp,
datep datetime, -- payment date datep datetime, -- payment date
amount_capital real DEFAULT 0, amount_capital double(24,8) DEFAULT 0,
amount_insurance real DEFAULT 0, amount_insurance double(24,8) DEFAULT 0,
amount_interest real DEFAULT 0, amount_interest double(24,8) DEFAULT 0,
fk_typepayment integer NOT NULL, fk_typepayment integer NOT NULL,
num_payment varchar(50), num_payment varchar(50),
note_private text, note_private text,

View File

@ -23,7 +23,7 @@ create table llx_paiementcharge
datec datetime, -- date de creation datec datetime, -- date de creation
tms timestamp, tms timestamp,
datep datetime, -- payment date datep datetime, -- payment date
amount real DEFAULT 0, amount double(24,8) DEFAULT 0,
fk_typepaiement integer NOT NULL, fk_typepaiement integer NOT NULL,
num_paiement varchar(50), num_paiement varchar(50),
note text, note text,

View File

@ -19,19 +19,19 @@
create table llx_paiementfourn create table llx_paiementfourn
( (
rowid integer AUTO_INCREMENT PRIMARY KEY, rowid integer AUTO_INCREMENT PRIMARY KEY,
ref varchar(30), ref varchar(30),
entity integer DEFAULT 1, entity integer DEFAULT 1,
tms timestamp, tms timestamp,
datec datetime, -- date de creation de l'enregistrement datec datetime, -- date de creation de l'enregistrement
datep datetime, -- date de paiement datep datetime, -- date de paiement
amount real DEFAULT 0, -- montant amount double(24,8) DEFAULT 0, -- montant
multicurrency_amount double(24,8) DEFAULT 0, -- multicurrency amount multicurrency_amount double(24,8) DEFAULT 0, -- multicurrency amount
fk_user_author integer, -- auteur fk_user_author integer, -- auteur
fk_paiement integer NOT NULL, -- moyen de paiement fk_paiement integer NOT NULL, -- moyen de paiement
num_paiement varchar(50), -- numero de paiement (cheque) num_paiement varchar(50), -- numero de paiement (cheque)
note text, note text,
fk_bank integer NOT NULL, fk_bank integer NOT NULL,
statut smallint NOT NULL DEFAULT 0, statut smallint NOT NULL DEFAULT 0,
model_pdf varchar(255) model_pdf varchar(255)
)ENGINE=innodb; )ENGINE=innodb;

View File

@ -23,7 +23,7 @@ create table llx_payment_donation
datec datetime, -- date de creation datec datetime, -- date de creation
tms timestamp, tms timestamp,
datep datetime, -- payment date datep datetime, -- payment date
amount real DEFAULT 0, amount double(24,8) DEFAULT 0,
fk_typepayment integer NOT NULL, fk_typepayment integer NOT NULL,
num_payment varchar(50), num_payment varchar(50),
note text, note text,

View File

@ -23,7 +23,7 @@ create table llx_payment_expensereport
datec datetime, -- date de creation datec datetime, -- date de creation
tms timestamp, tms timestamp,
datep datetime, -- payment date datep datetime, -- payment date
amount real DEFAULT 0, amount double(24,8) DEFAULT 0,
fk_typepayment integer NOT NULL, fk_typepayment integer NOT NULL,
num_payment varchar(50), num_payment varchar(50),
note text, note text,

View File

@ -24,13 +24,13 @@ create table llx_payment_loan
datec datetime, -- creation date datec datetime, -- creation date
tms timestamp, tms timestamp,
datep datetime, -- payment date datep datetime, -- payment date
amount_capital real DEFAULT 0, amount_capital double(24,8) DEFAULT 0,
amount_insurance real DEFAULT 0, amount_insurance double(24,8) DEFAULT 0,
amount_interest real DEFAULT 0, amount_interest double(24,8) DEFAULT 0,
fk_typepayment integer NOT NULL, fk_typepayment integer NOT NULL,
num_payment varchar(50), num_payment varchar(50),
note_private text, note_private text,
note_public text, note_public text,
fk_bank integer NOT NULL, fk_bank integer NOT NULL,
fk_user_creat integer, -- creation user fk_user_creat integer, -- creation user
fk_user_modif integer -- last modification user fk_user_modif integer -- last modification user

View File

@ -24,8 +24,8 @@ create table llx_payment_salary
fk_user integer NOT NULL, fk_user integer NOT NULL,
datep date, -- date de paiement datep date, -- date de paiement
datev date, -- date de valeur (this field should not be here, only into bank tables) datev date, -- date de valeur (this field should not be here, only into bank tables)
salary real, -- salary of user when payment was done salary double(24,8), -- salary of user when payment was done
amount real NOT NULL DEFAULT 0, amount double(24,8) NOT NULL DEFAULT 0,
fk_typepayment integer NOT NULL, fk_typepayment integer NOT NULL,
num_payment varchar(50), -- ref num_payment varchar(50), -- ref
label varchar(255), label varchar(255),

View File

@ -29,7 +29,7 @@ create table llx_prelevement_bons
ref varchar(12), -- reference ref varchar(12), -- reference
entity integer DEFAULT 1 NOT NULL, -- multi company id entity integer DEFAULT 1 NOT NULL, -- multi company id
datec datetime, -- date de creation datec datetime, -- date de creation
amount real DEFAULT 0, -- montant total du prelevement amount double(24,8) DEFAULT 0, -- montant total du prelevement
statut smallint DEFAULT 0, -- statut statut smallint DEFAULT 0, -- statut
credite smallint DEFAULT 0, -- indique si le prelevement a ete credite credite smallint DEFAULT 0, -- indique si le prelevement a ete credite
note text, note text,

View File

@ -21,7 +21,7 @@ create table llx_prelevement_facture_demande
( (
rowid integer AUTO_INCREMENT PRIMARY KEY, rowid integer AUTO_INCREMENT PRIMARY KEY,
fk_facture integer NOT NULL, fk_facture integer NOT NULL,
amount real NOT NULL, amount double(24,8) NOT NULL,
date_demande datetime NOT NULL, date_demande datetime NOT NULL,
traite smallint DEFAULT 0, traite smallint DEFAULT 0,
date_traite datetime, date_traite datetime,

View File

@ -24,7 +24,7 @@ create table llx_prelevement_lignes
statut smallint DEFAULT 0, statut smallint DEFAULT 0,
client_nom varchar(255), client_nom varchar(255),
amount real DEFAULT 0, amount double(24,8) DEFAULT 0,
code_banque varchar(128), code_banque varchar(128),
code_guichet varchar(6), code_guichet varchar(6),
number varchar(255), number varchar(255),

View File

@ -64,7 +64,7 @@ create table llx_societe
idprof5 varchar(128), -- IDProf5: nu for france idprof5 varchar(128), -- IDProf5: nu for france
idprof6 varchar(128), -- IDProf6: nu for france idprof6 varchar(128), -- IDProf6: nu for france
tva_intra varchar(20), -- tva tva_intra varchar(20), -- tva
capital real, -- capital de la societe capital double(24,8), -- capital de la societe
fk_stcomm integer DEFAULT 0 NOT NULL, -- commercial statut fk_stcomm integer DEFAULT 0 NOT NULL, -- commercial statut
note_private text, -- note_private text, --
note_public text, -- note_public text, --

View File

@ -24,7 +24,7 @@ create table llx_subscription
fk_adherent integer, fk_adherent integer,
dateadh datetime, dateadh datetime,
datef date, datef date,
subscription real, subscription double(24,8),
fk_bank integer DEFAULT NULL, fk_bank integer DEFAULT NULL,
note text note text
)ENGINE=innodb; )ENGINE=innodb;

View File

@ -24,7 +24,7 @@ create table llx_tva
datec datetime, -- Create date datec datetime, -- Create date
datep date, -- date de paiement datep date, -- date de paiement
datev date, -- date de valeur datev date, -- date de valeur
amount real NOT NULL DEFAULT 0, amount double(24,8) NOT NULL DEFAULT 0,
fk_typepayment integer NULL, fk_typepayment integer NULL,
num_payment varchar(50), num_payment varchar(50),
label varchar(255), label varchar(255),