FIX SPEC #7013 : use database type "numeric" to store monetary values

This commit is contained in:
Alexandre SPANGARO 2017-10-24 21:14:31 +02:00
parent f24204c79a
commit ecbc393c96
28 changed files with 170 additions and 90 deletions

View File

@ -458,3 +458,83 @@ UPDATE llx_accounting_system SET fk_country =140 WHERE pcg_version = 'PCN-LUXEMB
-- 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 "numeric" to store monetary values
ALTER TABLE llx_accounting_bookkeeping MODIFY COLUMN debit numeric(24,8);
ALTER TABLE llx_accounting_bookkeeping MODIFY COLUMN credit numeric(24,8);
ALTER TABLE llx_accounting_bookkeeping MODIFY COLUMN montant numeric(24,8);
ALTER TABLE llx_accounting_bookkeeping MODIFY COLUMN multicurrency_amount numeric(24,8);
ALTER TABLE llx_accounting_bookkeeping_tmp MODIFY COLUMN debit numeric(24,8);
ALTER TABLE llx_accounting_bookkeeping_tmp MODIFY COLUMN credit numeric(24,8);
ALTER TABLE llx_accounting_bookkeeping_tmp MODIFY COLUMN montant numeric(24,8);
ALTER TABLE llx_accounting_bookkeeping_tmp MODIFY COLUMN multicurrency_amount numeric(24,8);
ALTER TABLE llx_bank MODIFY COLUMN amount numeric(24,8);
ALTER TABLE llx_bordereau_cheque MODIFY COLUMN amount numeric(24,8);
ALTER TABLE llx_blockedlog MODIFY COLUMN amounts numeric(24,8);
ALTER TABLE llx_budget_lines MODIFY COLUMN amount numeric(24,8);
ALTER TABLE llx_chargessociales MODIFY COLUMN amount numeric(24,8);
ALTER TABLE llx_commande MODIFY COLUMN amount_ht numeric(24,8);
ALTER TABLE llx_commande MODIFY COLUMN tva numeric(24,8);
ALTER TABLE llx_commande MODIFY COLUMN localtax1 numeric(24,8);
ALTER TABLE llx_commande MODIFY COLUMN localtax2 numeric(24,8);
ALTER TABLE llx_commande MODIFY COLUMN total_ht numeric(24,8);
ALTER TABLE llx_commande MODIFY COLUMN total_ttc numeric(24,8);
ALTER TABLE llx_commande MODIFY COLUMN multicurrency_tx numeric(24,8);
ALTER TABLE llx_commande MODIFY COLUMN multicurrency_total_ht numeric(24,8);
ALTER TABLE llx_commande MODIFY COLUMN multicurrency_total_tva numeric(24,8);
ALTER TABLE llx_commande MODIFY COLUMN multicurrency_total_ttc numeric(24,8);
ALTER TABLE llx_commandedet MODIFY COLUMN subprice numeric(24,8);
ALTER TABLE llx_commandedet MODIFY COLUMN total_ht numeric(24,8);
ALTER TABLE llx_commandedet MODIFY COLUMN total_tva numeric(24,8);
ALTER TABLE llx_commandedet MODIFY COLUMN total_localtax1 numeric(24,8);
ALTER TABLE llx_commandedet MODIFY COLUMN total_localtax2 numeric(24,8);
ALTER TABLE llx_commandedet MODIFY COLUMN total_ttc numeric(24,8);
ALTER TABLE llx_commandedet MODIFY COLUMN buy_price_ht numeric(24,8);
ALTER TABLE llx_commandedet MODIFY COLUMN multicurrency_subprice numeric(24,8);
ALTER TABLE llx_commandedet MODIFY COLUMN multicurrency_total_ht numeric(24,8);
ALTER TABLE llx_commandedet MODIFY COLUMN multicurrency_total_tva numeric(24,8);
ALTER TABLE llx_commandedet MODIFY COLUMN multicurrency_total_ttc numeric(24,8);
ALTER TABLE llx_commande_fournisseur MODIFY COLUMN tva numeric(24,8);
ALTER TABLE llx_commande_fournisseur MODIFY COLUMN localtax1 numeric(24,8);
ALTER TABLE llx_commande_fournisseur MODIFY COLUMN localtax2 numeric(24,8);
ALTER TABLE llx_commande_fournisseur MODIFY COLUMN amount_ht numeric(24,8);
ALTER TABLE llx_commande_fournisseur MODIFY COLUMN total_ht numeric(24,8);
ALTER TABLE llx_commande_fournisseur MODIFY COLUMN total_ttc numeric(24,8);
ALTER TABLE llx_commande_fournisseur MODIFY COLUMN multicurrency_total_ht numeric(24,8);
ALTER TABLE llx_commande_fournisseur MODIFY COLUMN multicurrency_total_tva numeric(24,8);
ALTER TABLE llx_commande_fournisseur MODIFY COLUMN multicurrency_total_ttc numeric(24,8);
ALTER TABLE llx_commande_fournisseurdet MODIFY COLUMN localtax1_tx numeric(24,8);
ALTER TABLE llx_commande_fournisseurdet MODIFY COLUMN localtax2_tx numeric(24,8);
ALTER TABLE llx_commande_fournisseurdet MODIFY COLUMN subprice numeric(24,8);
ALTER TABLE llx_commande_fournisseurdet MODIFY COLUMN total_ht numeric(24,8);
ALTER TABLE llx_commande_fournisseurdet MODIFY COLUMN total_tva numeric(24,8);
ALTER TABLE llx_commande_fournisseurdet MODIFY COLUMN total_localtax1 numeric(24,8);
ALTER TABLE llx_commande_fournisseurdet MODIFY COLUMN total_localtax2 numeric(24,8);
ALTER TABLE llx_commande_fournisseurdet MODIFY COLUMN total_ttc numeric(24,8);
ALTER TABLE llx_commande_fournisseurdet MODIFY COLUMN multicurrency_subprice numeric(24,8);
ALTER TABLE llx_commande_fournisseurdet MODIFY COLUMN multicurrency_total_ht numeric(24,8);
ALTER TABLE llx_commande_fournisseurdet MODIFY COLUMN multicurrency_total_tva numeric(24,8);
ALTER TABLE llx_commande_fournisseurdet MODIFY COLUMN multicurrency_total_ttc numeric(24,8);
ALTER TABLE llx_c_ecotaxe MODIFY COLUMN price numeric(24,8);
ALTER TABLE llx_don MODIFY COLUMN amount numeric(24,8);
ALTER TABLE llx_loan MODIFY COLUMN capital numeric(24,8);
ALTER TABLE llx_loan MODIFY COLUMN capital_position numeric(24,8);
ALTER TABLE llx_loan_schedule MODIFY COLUMN amount_capital numeric(24,8);
ALTER TABLE llx_loan_schedule MODIFY COLUMN amount_insurance numeric(24,8);
ALTER TABLE llx_loan_schedule MODIFY COLUMN amount_interest numeric(24,8);
ALTER TABLE llx_paiementcharge MODIFY COLUMN amount numeric(24,8);
ALTER TABLE llx_paiementfourn MODIFY COLUMN amount numeric(24,8);
ALTER TABLE llx_paiementfourn MODIFY COLUMN multicurrency_amount numeric(24,8);
ALTER TABLE llx_payment_donation MODIFY COLUMN amount numeric(24,8);
ALTER TABLE llx_payment_expensereport MODIFY COLUMN amount numeric(24,8);
ALTER TABLE llx_payment_loan MODIFY COLUMN amount_capital numeric(24,8);
ALTER TABLE llx_payment_loan MODIFY COLUMN amount_insurance numeric(24,8);
ALTER TABLE llx_payment_loan MODIFY COLUMN amount_interest numeric(24,8);
ALTER TABLE llx_payment_salary MODIFY COLUMN salary numeric(24,8);
ALTER TABLE llx_payment_salary MODIFY COLUMN amount numeric(24,8);
ALTER TABLE llx_prelevement_bons MODIFY COLUMN amount numeric(24,8);
ALTER TABLE llx_prelevement_facture_demande MODIFY COLUMN amount numeric(24,8);
ALTER TABLE llx_prelevement_lignes MODIFY COLUMN amount numeric(24,8);
ALTER TABLE llx_societe MODIFY COLUMN capital numeric(24,8);
ALTER TABLE llx_tva MODIFY COLUMN amount numeric(24,8);
ALTER TABLE llx_subscription MODIFY COLUMN subscription numeric(24,8);

View File

@ -32,11 +32,11 @@ CREATE TABLE llx_accounting_bookkeeping
numero_compte varchar(32) NOT NULL, -- FEC:CompteNum | account number numero_compte varchar(32) NOT NULL, -- FEC:CompteNum | account number
label_compte varchar(255) NOT NULL, -- FEC:CompteLib | label of account label_compte varchar(255) NOT NULL, -- FEC:CompteLib | label of account
label_operation varchar(255), -- FEC:EcritureLib | label of the operation label_operation varchar(255), -- FEC:EcritureLib | label of the operation
debit double(24,8) NOT NULL, -- FEC:Debit debit numeric(24,8) NOT NULL, -- FEC:Debit
credit double(24,8) NOT NULL, -- FEC:Credit credit numeric(24,8) NOT NULL, -- FEC:Credit
montant double(24,8) NOT NULL, -- FEC:Montant (Not necessary) montant numeric(24,8) NOT NULL, -- FEC:Montant (Not necessary)
sens varchar(1) DEFAULT NULL, -- FEC:Sens (Not necessary) sens varchar(1) DEFAULT NULL, -- FEC:Sens (Not necessary)
multicurrency_amount double(24,8), -- FEC:Montantdevise multicurrency_amount numeric(24,8), -- FEC:Montantdevise
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

View File

@ -32,11 +32,11 @@ CREATE TABLE llx_accounting_bookkeeping_tmp
numero_compte varchar(32), -- FEC:CompteNum | account number numero_compte varchar(32), -- FEC:CompteNum | account number
label_compte varchar(255) NOT NULL, -- FEC:CompteLib | label of account label_compte varchar(255) NOT NULL, -- FEC:CompteLib | label of account
label_operation varchar(255), -- FEC:EcritureLib | label of the operation label_operation varchar(255), -- FEC:EcritureLib | label of the operation
debit double(24,8) NOT NULL, -- FEC:Debit debit numeric(24,8) NOT NULL, -- FEC:Debit
credit double(24,8) NOT NULL, -- FEC:Credit credit numeric(24,8) NOT NULL, -- FEC:Credit
montant double(24,8) NOT NULL, -- FEC:Montant (Not necessary) montant numeric(24,8) NOT NULL, -- FEC:Montant (Not necessary)
sens varchar(1) DEFAULT NULL, -- FEC:Sens (Not necessary) sens varchar(1) DEFAULT NULL, -- FEC:Sens (Not necessary)
multicurrency_amount double(24,8), -- FEC:Montantdevise multicurrency_amount numeric(24,8), -- FEC:Montantdevise
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

View File

@ -24,7 +24,7 @@ create table llx_bank
tms timestamp, tms timestamp,
datev date, -- date de valeur datev date, -- date de valeur
dateo date, -- date operation dateo date, -- date operation
amount double(24,8) NOT NULL default 0, amount numeric(24,8) NOT NULL default 0,
label varchar(255), label varchar(255),
fk_account integer, fk_account integer,
fk_user_author integer, fk_user_author integer,

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 numeric(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,10 +25,10 @@ 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 numeric(24,8) NOT NULL,
nbcheque smallint NOT NULL, nbcheque smallint NOT NULL,
fk_bank_account integer, fk_bank_account integer,
fk_user_author integer, fk_user_author integer,

View File

@ -21,7 +21,7 @@ create table llx_budget_lines
rowid integer AUTO_INCREMENT PRIMARY KEY, rowid integer AUTO_INCREMENT PRIMARY KEY,
fk_budget integer NOT NULL, fk_budget integer NOT NULL,
fk_project_ids varchar(255) NOT NULL, -- 'IDS:x,y' = List of project ids related to this budget. If budget is dedicated to projects not yet started, we recommand to create a project 'Projects to come'. 'FILTER:ref=*ABC' = Can also be a dynamic rule to select projects. fk_project_ids varchar(255) NOT NULL, -- 'IDS:x,y' = List of project ids related to this budget. If budget is dedicated to projects not yet started, we recommand to create a project 'Projects to come'. 'FILTER:ref=*ABC' = Can also be a dynamic rule to select projects.
amount double(24,8) NOT NULL, amount numeric(24,8) NOT NULL,
datec datetime, datec datetime,
tms timestamp, tms timestamp,
fk_user_creat integer, fk_user_creat integer,

View File

@ -22,7 +22,7 @@ create table llx_c_ecotaxe
rowid integer AUTO_INCREMENT PRIMARY KEY, rowid integer AUTO_INCREMENT PRIMARY KEY,
code varchar(64) NOT NULL, -- Code servant a la traduction et a la reference interne code varchar(64) NOT NULL, -- Code servant a la traduction et a la reference interne
libelle varchar(255), -- Description libelle varchar(255), -- Description
price double(24,8), -- Montant HT price numeric(24,8), -- Montant HT
organization varchar(255), -- Organisme gerant le bareme tarifaire organization varchar(255), -- Organisme gerant le bareme tarifaire
fk_pays integer NOT NULL, -- Pays correspondant fk_pays integer NOT NULL, -- Pays correspondant
active tinyint DEFAULT 1 NOT NULL active tinyint DEFAULT 1 NOT NULL

View File

@ -34,7 +34,7 @@ create table llx_chargesociales
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 numeric(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,

View File

@ -42,15 +42,15 @@ create table llx_commande
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 numeric(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 numeric(24,8) default 0,
localtax1 double(24,8) default 0, -- total localtax1 localtax1 numeric(24,8) default 0, -- total localtax1
localtax2 double(24,8) default 0, -- total localtax2 localtax2 numeric(24,8) default 0, -- total localtax2
total_ht double(24,8) default 0, total_ht numeric(24,8) default 0,
total_ttc double(24,8) default 0, total_ttc numeric(24,8) default 0,
note_private text, note_private text,
note_public text, note_public text,
model_pdf varchar(255), model_pdf varchar(255),
@ -74,9 +74,9 @@ create table llx_commande
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 numeric(24,8) DEFAULT 1,
multicurrency_total_ht double(24,8) DEFAULT 0, multicurrency_total_ht numeric(24,8) DEFAULT 0,
multicurrency_total_tva double(24,8) DEFAULT 0, multicurrency_total_tva numeric(24,8) DEFAULT 0,
multicurrency_total_ttc double(24,8) DEFAULT 0 multicurrency_total_ttc numeric(24,8) DEFAULT 0
)ENGINE=innodb; )ENGINE=innodb;

View File

@ -46,14 +46,14 @@ create table llx_commande_fournisseur
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 numeric(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 numeric(24,8) default 0,
localtax1 double(24,8) default 0, localtax1 numeric(24,8) default 0,
localtax2 double(24,8) default 0, localtax2 numeric(24,8) default 0,
total_ht double(24,8) default 0, total_ht numeric(24,8) default 0,
total_ttc double(24,8) default 0, total_ttc numeric(24,8) default 0,
note_private text, note_private text,
note_public text, note_public text,
model_pdf varchar(255), model_pdf varchar(255),
@ -70,9 +70,9 @@ create table llx_commande_fournisseur
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 numeric(24,8) DEFAULT 0,
multicurrency_total_tva double(24,8) DEFAULT 0, multicurrency_total_tva numeric(24,8) DEFAULT 0,
multicurrency_total_ttc double(24,8) DEFAULT 0 multicurrency_total_ttc numeric(24,8) DEFAULT 0
)ENGINE=innodb; )ENGINE=innodb;

View File

@ -30,19 +30,19 @@ create table llx_commande_fournisseurdet
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 numeric(24,8) 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 numeric(24,8) 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 numeric(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 numeric(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 numeric(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 numeric(24,8) DEFAULT 0, -- Total Local Tax 1
total_localtax2 double(24,8) DEFAULT 0, -- Total Local Tax 2 total_localtax2 numeric(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 numeric(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
@ -52,10 +52,10 @@ create table llx_commande_fournisseurdet
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 numeric(24,8) DEFAULT 0,
multicurrency_total_ht double(24,8) DEFAULT 0, multicurrency_total_ht numeric(24,8) DEFAULT 0,
multicurrency_total_tva double(24,8) DEFAULT 0, multicurrency_total_tva numeric(24,8) DEFAULT 0,
multicurrency_total_ttc double(24,8) DEFAULT 0 multicurrency_total_ttc numeric(24,8) DEFAULT 0
)ENGINE=innodb; )ENGINE=innodb;

View File

@ -39,18 +39,18 @@ create table llx_commandedet
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 numeric(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 numeric(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 numeric(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 numeric(24,8) DEFAULT 0, -- Total LocalTax1
total_localtax2 double(24,8) DEFAULT 0, -- Total LocalTax2 total_localtax2 numeric(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 numeric(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 numeric(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
@ -60,12 +60,12 @@ create table llx_commandedet
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 numeric(24,8) DEFAULT 0,
multicurrency_total_ht double(24,8) DEFAULT 0, multicurrency_total_ht numeric(24,8) DEFAULT 0,
multicurrency_total_tva double(24,8) DEFAULT 0, multicurrency_total_tva numeric(24,8) DEFAULT 0,
multicurrency_total_ttc double(24,8) DEFAULT 0 multicurrency_total_ttc numeric(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 numeric(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

@ -27,7 +27,7 @@ create table llx_loan
label varchar(80) NOT NULL, label varchar(80) NOT NULL,
fk_bank integer, fk_bank integer,
capital real default 0 NOT NULL, capital numeric(24,8) default 0 NOT NULL,
datestart date, datestart date,
dateend date, dateend date,
nbterm real, nbterm real,
@ -36,7 +36,7 @@ create table llx_loan
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 numeric(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,

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 numeric(24,8) DEFAULT 0,
amount_insurance real DEFAULT 0, amount_insurance numeric(24,8) DEFAULT 0,
amount_interest real DEFAULT 0, amount_interest numeric(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 numeric(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

@ -25,8 +25,8 @@ create table llx_paiementfourn
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 numeric(24,8) DEFAULT 0, -- montant
multicurrency_amount double(24,8) DEFAULT 0, -- multicurrency amount multicurrency_amount numeric(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)

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 numeric(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 numeric(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,9 +24,9 @@ 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 numeric(24,8) DEFAULT 0,
amount_insurance real DEFAULT 0, amount_insurance numeric(24,8) DEFAULT 0,
amount_interest real DEFAULT 0, amount_interest numeric(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

@ -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 numeric(24,8), -- salary of user when payment was done
amount real NOT NULL DEFAULT 0, amount numeric(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 numeric(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 numeric(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 numeric(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 numeric(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 numeric(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 numeric(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),