diff --git a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql index aa287e5f610..a42a3411811 100644 --- a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql +++ b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql @@ -459,82 +459,30 @@ UPDATE llx_accounting_system SET fk_country =140 WHERE pcg_version = 'PCN-LUXEMB -- May have error due to duplicate keys 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); +-- 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); diff --git a/htdocs/install/mysql/tables/llx_accounting_bookkeeping.sql b/htdocs/install/mysql/tables/llx_accounting_bookkeeping.sql index 628f14fb5b0..c7f8faa6f63 100644 --- a/htdocs/install/mysql/tables/llx_accounting_bookkeeping.sql +++ b/htdocs/install/mysql/tables/llx_accounting_bookkeeping.sql @@ -32,15 +32,15 @@ CREATE TABLE llx_accounting_bookkeeping numero_compte varchar(32) NOT NULL, -- FEC:CompteNum | account number label_compte varchar(255) NOT NULL, -- FEC:CompteLib | label of account label_operation varchar(255), -- FEC:EcritureLib | label of the operation - debit numeric(24,8) NOT NULL, -- FEC:Debit - credit numeric(24,8) NOT NULL, -- FEC:Credit - montant numeric(24,8) NOT NULL, -- FEC:Montant (Not necessary) + debit double(24,8) NOT NULL, -- FEC:Debit + credit double(24,8) NOT NULL, -- FEC:Credit + montant double(24,8) NOT NULL, -- FEC:Montant (Not necessary) sens varchar(1) DEFAULT NULL, -- FEC:Sens (Not necessary) - multicurrency_amount numeric(24,8), -- FEC:Montantdevise + multicurrency_amount double(24,8), -- FEC:Montantdevise multicurrency_code varchar(255), -- FEC:Idevise lettering_code varchar(255), -- FEC:EcritureLet 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_modif integer, -- | user making last change date_creation datetime, -- FEC:EcritureDate | creation date diff --git a/htdocs/install/mysql/tables/llx_accounting_bookkeeping_tmp.sql b/htdocs/install/mysql/tables/llx_accounting_bookkeeping_tmp.sql index 8688b97fe9d..3b4a4e54143 100644 --- a/htdocs/install/mysql/tables/llx_accounting_bookkeeping_tmp.sql +++ b/htdocs/install/mysql/tables/llx_accounting_bookkeeping_tmp.sql @@ -32,15 +32,15 @@ CREATE TABLE llx_accounting_bookkeeping_tmp numero_compte varchar(32), -- FEC:CompteNum | account number label_compte varchar(255) NOT NULL, -- FEC:CompteLib | label of account label_operation varchar(255), -- FEC:EcritureLib | label of the operation - debit numeric(24,8) NOT NULL, -- FEC:Debit - credit numeric(24,8) NOT NULL, -- FEC:Credit - montant numeric(24,8) NOT NULL, -- FEC:Montant (Not necessary) + debit double(24,8) NOT NULL, -- FEC:Debit + credit double(24,8) NOT NULL, -- FEC:Credit + montant double(24,8) NOT NULL, -- FEC:Montant (Not necessary) sens varchar(1) DEFAULT NULL, -- FEC:Sens (Not necessary) - multicurrency_amount numeric(24,8), -- FEC:Montantdevise + multicurrency_amount double(24,8), -- FEC:Montantdevise multicurrency_code varchar(255), -- FEC:Idevise lettering_code varchar(255), -- FEC:EcritureLet 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_modif integer, -- | user making last change date_creation datetime, -- FEC:EcritureDate | creation date diff --git a/htdocs/install/mysql/tables/llx_bank.sql b/htdocs/install/mysql/tables/llx_bank.sql index 9eee185f1da..6c2c8d34537 100644 --- a/htdocs/install/mysql/tables/llx_bank.sql +++ b/htdocs/install/mysql/tables/llx_bank.sql @@ -24,7 +24,7 @@ create table llx_bank tms timestamp, datev date, -- date de valeur dateo date, -- date operation - amount numeric(24,8) NOT NULL default 0, + amount double(24,8) NOT NULL default 0, label varchar(255), fk_account integer, fk_user_author integer, diff --git a/htdocs/install/mysql/tables/llx_blockedlog.sql b/htdocs/install/mysql/tables/llx_blockedlog.sql index 596dba9e69d..d94f2ade702 100644 --- a/htdocs/install/mysql/tables/llx_blockedlog.sql +++ b/htdocs/install/mysql/tables/llx_blockedlog.sql @@ -21,7 +21,7 @@ CREATE TABLE llx_blockedlog rowid integer AUTO_INCREMENT PRIMARY KEY, tms timestamp, action varchar(50), - amounts numeric(24,8) NOT NULL, + amounts double(24,8) NOT NULL, signature varchar(100) NOT NULL, signature_line varchar(100) NOT NULL, element varchar(50), diff --git a/htdocs/install/mysql/tables/llx_bordereau_cheque.sql b/htdocs/install/mysql/tables/llx_bordereau_cheque.sql index 4afaee64aaf..ec400f6cbbd 100644 --- a/htdocs/install/mysql/tables/llx_bordereau_cheque.sql +++ b/htdocs/install/mysql/tables/llx_bordereau_cheque.sql @@ -28,7 +28,7 @@ create table llx_bordereau_cheque ref_ext varchar(255), -- ref_ext datec datetime NOT NULL, date_bordereau date, - amount numeric(24,8) NOT NULL, + amount double(24,8) NOT NULL, nbcheque smallint NOT NULL, fk_bank_account integer, fk_user_author integer, diff --git a/htdocs/install/mysql/tables/llx_budget_lines.sql b/htdocs/install/mysql/tables/llx_budget_lines.sql index 74c228ed98c..c93a6e736e7 100644 --- a/htdocs/install/mysql/tables/llx_budget_lines.sql +++ b/htdocs/install/mysql/tables/llx_budget_lines.sql @@ -21,7 +21,7 @@ create table llx_budget_lines rowid integer AUTO_INCREMENT PRIMARY KEY, 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. - amount numeric(24,8) NOT NULL, + amount double(24,8) NOT NULL, datec datetime, tms timestamp, fk_user_creat integer, diff --git a/htdocs/install/mysql/tables/llx_c_ecotaxe.sql b/htdocs/install/mysql/tables/llx_c_ecotaxe.sql index bee5ab61026..09613787f76 100644 --- a/htdocs/install/mysql/tables/llx_c_ecotaxe.sql +++ b/htdocs/install/mysql/tables/llx_c_ecotaxe.sql @@ -22,7 +22,7 @@ create table llx_c_ecotaxe rowid integer AUTO_INCREMENT PRIMARY KEY, code varchar(64) NOT NULL, -- Code servant a la traduction et a la reference interne libelle varchar(255), -- Description - price numeric(24,8), -- Montant HT + price double(24,8), -- Montant HT organization varchar(255), -- Organisme gerant le bareme tarifaire fk_pays integer NOT NULL, -- Pays correspondant active tinyint DEFAULT 1 NOT NULL diff --git a/htdocs/install/mysql/tables/llx_chargesociales.sql b/htdocs/install/mysql/tables/llx_chargesociales.sql index a5b074b83cf..c32198dd6e6 100644 --- a/htdocs/install/mysql/tables/llx_chargesociales.sql +++ b/htdocs/install/mysql/tables/llx_chargesociales.sql @@ -34,7 +34,7 @@ create table llx_chargesociales fk_type integer NOT NULL, fk_account integer, -- bank account fk_mode_reglement integer, -- mode de reglement - amount numeric(24,8) default 0 NOT NULL, + amount double(24,8) default 0 NOT NULL, paye smallint default 0 NOT NULL, periode date, fk_projet integer DEFAULT NULL, diff --git a/htdocs/install/mysql/tables/llx_commande.sql b/htdocs/install/mysql/tables/llx_commande.sql index add3f2d53e2..0e430c0c483 100644 --- a/htdocs/install/mysql/tables/llx_commande.sql +++ b/htdocs/install/mysql/tables/llx_commande.sql @@ -20,63 +20,63 @@ 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_int varchar(255), -- reference into an internal system (deprecated) - 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 (deprecated) + ref_client varchar(255), -- reference for customer - fk_soc integer NOT NULL, - fk_projet integer DEFAULT NULL, -- projet auquel est rattache la commande + fk_soc integer NOT NULL, + fk_projet integer DEFAULT NULL, -- 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, -- user making creation - fk_user_modif integer, -- user making last change - fk_user_valid integer, -- user validating - 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 ? - fk_statut smallint default 0, - amount_ht numeric(24,8) default 0, - remise_percent real default 0, - remise_absolue real default 0, - remise real default 0, - tva numeric(24,8) default 0, - localtax1 numeric(24,8) default 0, -- total localtax1 - localtax2 numeric(24,8) default 0, -- total localtax2 - total_ht numeric(24,8) default 0, - total_ttc numeric(24,8) default 0, - note_private text, - note_public text, - model_pdf varchar(255), - last_main_doc varchar(255), -- relative filepath+filename of last main generated document + 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, -- user making creation + fk_user_modif integer, -- user making last change + fk_user_valid integer, -- user validating + 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 ? + fk_statut smallint default 0, + amount_ht double(24,8) 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_private text, + note_public text, + model_pdf varchar(255), + last_main_doc varchar(255), -- relative filepath+filename of last main generated document - facture tinyint default 0, - fk_account integer, -- bank account - fk_currency varchar(3), -- currency code - fk_cond_reglement integer, -- condition de reglement - fk_mode_reglement integer, -- mode de reglement + facture tinyint default 0, + fk_account integer, -- bank account + fk_currency varchar(3), -- currency code + fk_cond_reglement integer, -- condition de reglement + fk_mode_reglement integer, -- mode de reglement - date_livraison date default NULL, - fk_shipping_method integer, -- shipping method id - fk_warehouse integer default NULL, - fk_availability integer NULL, - fk_input_reason integer, -- id coming from c_input_reason, '0' if no defined - fk_delivery_address integer, -- delivery address (deprecated) - fk_incoterms integer, -- for incoterms - location_incoterms varchar(255), -- for incoterms - import_key varchar(14), - extraparams varchar(255), -- for stock other parameters with json format + date_livraison date default NULL, + fk_shipping_method integer, -- shipping method id + fk_warehouse integer default NULL, + fk_availability integer NULL, + fk_input_reason integer, -- id coming from c_input_reason, '0' if no defined + fk_delivery_address integer, -- delivery address (deprecated) + fk_incoterms integer, -- for incoterms + location_incoterms varchar(255), -- for incoterms + import_key varchar(14), + extraparams varchar(255), -- for stock other parameters with json format - fk_multicurrency integer, + fk_multicurrency integer, multicurrency_code varchar(255), - multicurrency_tx numeric(24,8) DEFAULT 1, - multicurrency_total_ht numeric(24,8) DEFAULT 0, - multicurrency_total_tva numeric(24,8) DEFAULT 0, - multicurrency_total_ttc numeric(24,8) DEFAULT 0 + multicurrency_tx double(24,8) DEFAULT 1, + multicurrency_total_ht double(24,8) DEFAULT 0, + multicurrency_total_tva double(24,8) DEFAULT 0, + multicurrency_total_ttc double(24,8) DEFAULT 0 )ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_commande_fournisseur.sql b/htdocs/install/mysql/tables/llx_commande_fournisseur.sql index ec08b95b6fb..bb060afca67 100644 --- a/htdocs/install/mysql/tables/llx_commande_fournisseur.sql +++ b/htdocs/install/mysql/tables/llx_commande_fournisseur.sql @@ -21,58 +21,58 @@ create table llx_commande_fournisseur ( - rowid integer AUTO_INCREMENT PRIMARY KEY, + rowid integer AUTO_INCREMENT PRIMARY KEY, - ref varchar(255) NOT NULL, -- order number - entity integer DEFAULT 1 NOT NULL, -- multi company id + ref varchar(255) NOT NULL, -- order number + entity integer DEFAULT 1 NOT NULL, -- multi company id - ref_ext varchar(64), -- reference into an external system (not used by dolibarr) - ref_supplier varchar(255), + ref_ext varchar(64), -- reference into an external system (not used by dolibarr) + ref_supplier varchar(255), - fk_soc integer NOT NULL, - fk_projet integer DEFAULT 0, -- project id + fk_soc integer NOT NULL, + fk_projet integer DEFAULT 0, -- project id - tms timestamp, - date_creation datetime, -- date de creation - date_valid datetime, -- date de validation - date_approve datetime, -- date de approve - date_approve2 datetime, -- date de approve 2 (when double approving is accivated) - date_commande date, -- date de la commande - fk_user_author integer, -- user making creation - fk_user_modif integer, -- user making last change - fk_user_valid integer, -- user validating - fk_user_approve integer, -- user approving - 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 ? - fk_statut smallint default 0, - billed smallint default 0, - amount_ht numeric(24,8) default 0, - remise_percent real default 0, - remise real default 0, - tva numeric(24,8) default 0, - localtax1 numeric(24,8) default 0, - localtax2 numeric(24,8) default 0, - total_ht numeric(24,8) default 0, - total_ttc numeric(24,8) default 0, - note_private text, - note_public text, - model_pdf varchar(255), - last_main_doc varchar(255), -- relative filepath+filename of last main generated document + tms timestamp, + date_creation datetime, -- date de creation + date_valid datetime, -- date de validation + date_approve datetime, -- date de approve + date_approve2 datetime, -- date de approve 2 (when double approving is accivated) + date_commande date, -- date de la commande + fk_user_author integer, -- user making creation + fk_user_modif integer, -- user making last change + fk_user_valid integer, -- user validating + fk_user_approve integer, -- user approving + 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 ? + fk_statut smallint default 0, + billed smallint default 0, + amount_ht double(24,8) default 0, + remise_percent real default 0, + remise real default 0, + tva double(24,8) default 0, + localtax1 double(24,8) default 0, + localtax2 double(24,8) default 0, + total_ht double(24,8) default 0, + total_ttc double(24,8) default 0, + note_private text, + note_public text, + model_pdf varchar(255), + last_main_doc varchar(255), -- relative filepath+filename of last main generated document - date_livraison datetime default NULL, - fk_account integer, -- bank account - fk_cond_reglement integer, -- condition 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_incoterms integer, -- for incoterms - location_incoterms varchar(255), -- for incoterms - import_key varchar(14), - extraparams varchar(255), -- for stock other parameters with json format + date_livraison datetime default NULL, + fk_account integer, -- bank account + fk_cond_reglement integer, -- condition 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_incoterms integer, -- for incoterms + location_incoterms varchar(255), -- for incoterms + import_key varchar(14), + extraparams varchar(255), -- for stock other parameters with json format fk_multicurrency integer, multicurrency_code varchar(255), multicurrency_tx double(24,8) DEFAULT 1, - multicurrency_total_ht numeric(24,8) DEFAULT 0, - multicurrency_total_tva numeric(24,8) DEFAULT 0, - multicurrency_total_ttc numeric(24,8) DEFAULT 0 + multicurrency_total_ht double(24,8) DEFAULT 0, + multicurrency_total_tva double(24,8) DEFAULT 0, + multicurrency_total_ttc double(24,8) DEFAULT 0 )ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_commande_fournisseurdet.sql b/htdocs/install/mysql/tables/llx_commande_fournisseurdet.sql index 17d86d2b016..dd9dc40c412 100644 --- a/htdocs/install/mysql/tables/llx_commande_fournisseurdet.sql +++ b/htdocs/install/mysql/tables/llx_commande_fournisseurdet.sql @@ -30,19 +30,19 @@ create table llx_commande_fournisseurdet description text, 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 - localtax1_tx numeric(24,8) DEFAULT 0, -- localtax1 rate + localtax1_tx double(24,8) DEFAULT 0, -- localtax1 rate localtax1_type varchar(10) NULL, -- localtax1 type - localtax2_tx numeric(24,8) DEFAULT 0, -- localtax2 rate + localtax2_tx double(24,8) DEFAULT 0, -- localtax2 rate localtax2_type varchar(10) NULL, -- localtax2 type qty real, -- quantity remise_percent real DEFAULT 0, -- pourcentage de remise remise real DEFAULT 0, -- montant de la remise - subprice numeric(24,8) DEFAULT 0, -- prix unitaire - total_ht numeric(24,8) DEFAULT 0, -- Total HT 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 numeric(24,8) DEFAULT 0, -- Total Local Tax 1 - total_localtax2 numeric(24,8) DEFAULT 0, -- Total Local Tax 2 - total_ttc numeric(24,8) DEFAULT 0, -- Total TTC de la ligne toute quantite et incluant remise ligne et globale + 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_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_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 product_type integer DEFAULT 0, date_start datetime DEFAULT NULL, -- date debut si service date_end datetime DEFAULT NULL, -- date fin si service @@ -54,8 +54,8 @@ create table llx_commande_fournisseurdet fk_multicurrency integer, multicurrency_code varchar(255), - multicurrency_subprice numeric(24,8) DEFAULT 0, - multicurrency_total_ht numeric(24,8) DEFAULT 0, - multicurrency_total_tva numeric(24,8) DEFAULT 0, - multicurrency_total_ttc numeric(24,8) DEFAULT 0 + multicurrency_subprice double(24,8) DEFAULT 0, + multicurrency_total_ht double(24,8) DEFAULT 0, + multicurrency_total_tva double(24,8) DEFAULT 0, + multicurrency_total_ttc double(24,8) DEFAULT 0 )ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_commandedet.sql b/htdocs/install/mysql/tables/llx_commandedet.sql index ae252870fd3..81ba14cca2c 100644 --- a/htdocs/install/mysql/tables/llx_commandedet.sql +++ b/htdocs/install/mysql/tables/llx_commandedet.sql @@ -30,42 +30,42 @@ create table llx_commandedet description text, 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 - localtax1_tx double(6,3) DEFAULT 0, -- localtax1 rate - localtax1_type varchar(10) NULL, -- localtax1 type - localtax2_tx double(6,3) DEFAULT 0, -- localtax2 rate + localtax1_tx double(6,3) DEFAULT 0, -- localtax1 rate + localtax1_type varchar(10) NULL, -- localtax1 type + localtax2_tx double(6,3) DEFAULT 0, -- localtax2 rate localtax2_type varchar(10) NULL, -- localtax2 type qty real, -- quantity remise_percent real DEFAULT 0, -- pourcentage de remise remise real DEFAULT 0, -- montant de la remise fk_remise_except integer NULL, -- Lien vers table des remises fixes price real, -- prix final - subprice numeric(24,8) DEFAULT 0, -- P.U. HT (exemple 100) - total_ht numeric(24,8) DEFAULT 0, -- Total HT 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 numeric(24,8) DEFAULT 0, -- Total LocalTax1 - total_localtax2 numeric(24,8) DEFAULT 0, -- Total LocalTax2 - total_ttc numeric(24,8) DEFAULT 0, -- Total TTC de la ligne toute quantite et incluant remise ligne et globale + 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_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_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 product_type integer DEFAULT 0, date_start datetime DEFAULT NULL, -- date debut si service date_end datetime DEFAULT NULL, -- date fin si service info_bits integer DEFAULT 0, -- TVA NPR ou non - buy_price_ht numeric(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) special_code integer DEFAULT 0, -- code pour les lignes speciales 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), fk_commandefourndet integer DEFAULT NULL, -- link to detail line of commande fourn (resplenish) fk_multicurrency integer, multicurrency_code varchar(255), - multicurrency_subprice numeric(24,8) DEFAULT 0, - multicurrency_total_ht numeric(24,8) DEFAULT 0, - multicurrency_total_tva numeric(24,8) DEFAULT 0, - multicurrency_total_ttc numeric(24,8) DEFAULT 0 + multicurrency_subprice double(24,8) DEFAULT 0, + multicurrency_total_ht double(24,8) DEFAULT 0, + multicurrency_total_tva double(24,8) DEFAULT 0, + multicurrency_total_ttc double(24,8) DEFAULT 0 )ENGINE=innodb; -- diff --git a/htdocs/install/mysql/tables/llx_don.sql b/htdocs/install/mysql/tables/llx_don.sql index efa6614796c..2120f6a5b2b 100644 --- a/htdocs/install/mysql/tables/llx_don.sql +++ b/htdocs/install/mysql/tables/llx_don.sql @@ -28,7 +28,7 @@ create table llx_don tms timestamp, fk_statut smallint NOT NULL DEFAULT 0, -- Status of donation promise or validate datedon datetime, -- Date of the donation/promise - amount numeric(24,8) DEFAULT 0, + amount double(24,8) DEFAULT 0, fk_payment integer, paid smallint default 0 NOT NULL, firstname varchar(50), diff --git a/htdocs/install/mysql/tables/llx_expensereport_rules.sql b/htdocs/install/mysql/tables/llx_expensereport_rules.sql index 0a3b6dc0c49..e6103ee8fb9 100644 --- a/htdocs/install/mysql/tables/llx_expensereport_rules.sql +++ b/htdocs/install/mysql/tables/llx_expensereport_rules.sql @@ -18,17 +18,17 @@ -- ============================================================================ CREATE TABLE llx_expensereport_rules ( - rowid integer AUTO_INCREMENT PRIMARY KEY, - datec datetime DEFAULT NULL, - tms timestamp, - dates datetime NOT NULL, - datee datetime NOT NULL, - amount numeric(24,8) NOT NULL, - restrictive tinyint NOT NULL, - fk_user integer DEFAULT NULL, - fk_usergroup integer DEFAULT NULL, - fk_c_type_fees integer NOT NULL, - code_expense_rules_type varchar(50) NOT NULL, - is_for_all tinyint DEFAULT '0', - entity integer DEFAULT 1 + rowid integer AUTO_INCREMENT PRIMARY KEY, + datec datetime DEFAULT NULL, + tms timestamp, + dates datetime NOT NULL, + datee datetime NOT NULL, + amount double(24,8) NOT NULL, + restrictive tinyint NOT NULL, + fk_user integer DEFAULT NULL, + fk_usergroup integer DEFAULT NULL, + fk_c_type_fees integer NOT NULL, + code_expense_rules_type varchar(50) NOT NULL, + is_for_all tinyint DEFAULT '0', + entity integer DEFAULT 1 ) ENGINE=InnoDB \ No newline at end of file diff --git a/htdocs/install/mysql/tables/llx_loan.sql b/htdocs/install/mysql/tables/llx_loan.sql index ae2d3bac96d..7277fa85d47 100644 --- a/htdocs/install/mysql/tables/llx_loan.sql +++ b/htdocs/install/mysql/tables/llx_loan.sql @@ -27,16 +27,16 @@ create table llx_loan label varchar(80) NOT NULL, fk_bank integer, - capital numeric(24,8) default 0 NOT NULL, + capital double(24,8) default 0 NOT NULL, datestart date, dateend date, nbterm real, rate double NOT NULL, - note_private text, - note_public text, + note_private text, + note_public text, - capital_position numeric(24,8) 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, paid smallint default 0 NOT NULL, diff --git a/htdocs/install/mysql/tables/llx_loan_schedule.sql b/htdocs/install/mysql/tables/llx_loan_schedule.sql index eb43238255a..005ae07528e 100644 --- a/htdocs/install/mysql/tables/llx_loan_schedule.sql +++ b/htdocs/install/mysql/tables/llx_loan_schedule.sql @@ -24,9 +24,9 @@ create table llx_loan_schedule datec datetime, -- creation date tms timestamp, datep datetime, -- payment date - amount_capital numeric(24,8) DEFAULT 0, - amount_insurance numeric(24,8) DEFAULT 0, - amount_interest numeric(24,8) DEFAULT 0, + amount_capital double(24,8) DEFAULT 0, + amount_insurance double(24,8) DEFAULT 0, + amount_interest double(24,8) DEFAULT 0, fk_typepayment integer NOT NULL, num_payment varchar(50), note_private text, diff --git a/htdocs/install/mysql/tables/llx_paiementcharge.sql b/htdocs/install/mysql/tables/llx_paiementcharge.sql index 086bafae0fa..579628c44af 100644 --- a/htdocs/install/mysql/tables/llx_paiementcharge.sql +++ b/htdocs/install/mysql/tables/llx_paiementcharge.sql @@ -23,7 +23,7 @@ create table llx_paiementcharge datec datetime, -- date de creation tms timestamp, datep datetime, -- payment date - amount numeric(24,8) DEFAULT 0, + amount double(24,8) DEFAULT 0, fk_typepaiement integer NOT NULL, num_paiement varchar(50), note text, diff --git a/htdocs/install/mysql/tables/llx_paiementfourn.sql b/htdocs/install/mysql/tables/llx_paiementfourn.sql index 126d4df8c2a..3ce0d027ea9 100644 --- a/htdocs/install/mysql/tables/llx_paiementfourn.sql +++ b/htdocs/install/mysql/tables/llx_paiementfourn.sql @@ -19,19 +19,19 @@ create table llx_paiementfourn ( - rowid integer AUTO_INCREMENT PRIMARY KEY, - ref varchar(30), - entity integer DEFAULT 1, - tms timestamp, - datec datetime, -- date de creation de l'enregistrement - datep datetime, -- date de paiement - amount numeric(24,8) DEFAULT 0, -- montant - multicurrency_amount numeric(24,8) DEFAULT 0, -- multicurrency amount - fk_user_author integer, -- auteur - fk_paiement integer NOT NULL, -- moyen de paiement - num_paiement varchar(50), -- numero de paiement (cheque) - note text, - fk_bank integer NOT NULL, - statut smallint NOT NULL DEFAULT 0, - model_pdf varchar(255) + rowid integer AUTO_INCREMENT PRIMARY KEY, + ref varchar(30), + entity integer DEFAULT 1, + tms timestamp, + datec datetime, -- date de creation de l'enregistrement + datep datetime, -- date de paiement + amount double(24,8) DEFAULT 0, -- montant + multicurrency_amount double(24,8) DEFAULT 0, -- multicurrency amount + fk_user_author integer, -- auteur + fk_paiement integer NOT NULL, -- moyen de paiement + num_paiement varchar(50), -- numero de paiement (cheque) + note text, + fk_bank integer NOT NULL, + statut smallint NOT NULL DEFAULT 0, + model_pdf varchar(255) )ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_payment_donation.sql b/htdocs/install/mysql/tables/llx_payment_donation.sql index 1859c7aa796..d452d4da054 100644 --- a/htdocs/install/mysql/tables/llx_payment_donation.sql +++ b/htdocs/install/mysql/tables/llx_payment_donation.sql @@ -23,7 +23,7 @@ create table llx_payment_donation datec datetime, -- date de creation tms timestamp, datep datetime, -- payment date - amount numeric(24,8) DEFAULT 0, + amount double(24,8) DEFAULT 0, fk_typepayment integer NOT NULL, num_payment varchar(50), note text, diff --git a/htdocs/install/mysql/tables/llx_payment_expensereport.sql b/htdocs/install/mysql/tables/llx_payment_expensereport.sql index 1857246e22e..deeb82f615c 100644 --- a/htdocs/install/mysql/tables/llx_payment_expensereport.sql +++ b/htdocs/install/mysql/tables/llx_payment_expensereport.sql @@ -23,7 +23,7 @@ create table llx_payment_expensereport datec datetime, -- date de creation tms timestamp, datep datetime, -- payment date - amount numeric(24,8) DEFAULT 0, + amount double(24,8) DEFAULT 0, fk_typepayment integer NOT NULL, num_payment varchar(50), note text, diff --git a/htdocs/install/mysql/tables/llx_payment_loan.sql b/htdocs/install/mysql/tables/llx_payment_loan.sql index 3b6111a7b2f..10801fc7454 100644 --- a/htdocs/install/mysql/tables/llx_payment_loan.sql +++ b/htdocs/install/mysql/tables/llx_payment_loan.sql @@ -24,13 +24,13 @@ create table llx_payment_loan datec datetime, -- creation date tms timestamp, datep datetime, -- payment date - amount_capital numeric(24,8) DEFAULT 0, - amount_insurance numeric(24,8) DEFAULT 0, - amount_interest numeric(24,8) DEFAULT 0, + amount_capital double(24,8) DEFAULT 0, + amount_insurance double(24,8) DEFAULT 0, + amount_interest double(24,8) DEFAULT 0, fk_typepayment integer NOT NULL, num_payment varchar(50), - note_private text, - note_public text, + note_private text, + note_public text, fk_bank integer NOT NULL, fk_user_creat integer, -- creation user fk_user_modif integer -- last modification user diff --git a/htdocs/install/mysql/tables/llx_payment_salary.sql b/htdocs/install/mysql/tables/llx_payment_salary.sql index d9b0f3f4477..171c356415f 100644 --- a/htdocs/install/mysql/tables/llx_payment_salary.sql +++ b/htdocs/install/mysql/tables/llx_payment_salary.sql @@ -24,8 +24,8 @@ create table llx_payment_salary fk_user integer NOT NULL, datep date, -- date de paiement datev date, -- date de valeur (this field should not be here, only into bank tables) - salary numeric(24,8), -- salary of user when payment was done - amount numeric(24,8) NOT NULL DEFAULT 0, + salary double(24,8), -- salary of user when payment was done + amount double(24,8) NOT NULL DEFAULT 0, fk_typepayment integer NOT NULL, num_payment varchar(50), -- ref label varchar(255), diff --git a/htdocs/install/mysql/tables/llx_prelevement_bons.sql b/htdocs/install/mysql/tables/llx_prelevement_bons.sql index c9cdf7992a2..25e9381afe0 100644 --- a/htdocs/install/mysql/tables/llx_prelevement_bons.sql +++ b/htdocs/install/mysql/tables/llx_prelevement_bons.sql @@ -29,7 +29,7 @@ create table llx_prelevement_bons ref varchar(12), -- reference entity integer DEFAULT 1 NOT NULL, -- multi company id datec datetime, -- date de creation - amount numeric(24,8) DEFAULT 0, -- montant total du prelevement + amount double(24,8) DEFAULT 0, -- montant total du prelevement statut smallint DEFAULT 0, -- statut credite smallint DEFAULT 0, -- indique si le prelevement a ete credite note text, diff --git a/htdocs/install/mysql/tables/llx_prelevement_facture_demande.sql b/htdocs/install/mysql/tables/llx_prelevement_facture_demande.sql index 1d1b59bf3f5..9da18cbd416 100644 --- a/htdocs/install/mysql/tables/llx_prelevement_facture_demande.sql +++ b/htdocs/install/mysql/tables/llx_prelevement_facture_demande.sql @@ -21,7 +21,7 @@ create table llx_prelevement_facture_demande ( rowid integer AUTO_INCREMENT PRIMARY KEY, fk_facture integer NOT NULL, - amount numeric(24,8) NOT NULL, + amount double(24,8) NOT NULL, date_demande datetime NOT NULL, traite smallint DEFAULT 0, date_traite datetime, diff --git a/htdocs/install/mysql/tables/llx_prelevement_lignes.sql b/htdocs/install/mysql/tables/llx_prelevement_lignes.sql index 448b3846d71..421f8ee4969 100644 --- a/htdocs/install/mysql/tables/llx_prelevement_lignes.sql +++ b/htdocs/install/mysql/tables/llx_prelevement_lignes.sql @@ -24,7 +24,7 @@ create table llx_prelevement_lignes statut smallint DEFAULT 0, client_nom varchar(255), - amount numeric(24,8) DEFAULT 0, + amount double(24,8) DEFAULT 0, code_banque varchar(128), code_guichet varchar(6), number varchar(255), diff --git a/htdocs/install/mysql/tables/llx_societe.sql b/htdocs/install/mysql/tables/llx_societe.sql index 38097090a4c..a6a1e51a22b 100644 --- a/htdocs/install/mysql/tables/llx_societe.sql +++ b/htdocs/install/mysql/tables/llx_societe.sql @@ -64,7 +64,7 @@ create table llx_societe idprof5 varchar(128), -- IDProf5: nu for france idprof6 varchar(128), -- IDProf6: nu for france tva_intra varchar(20), -- tva - capital numeric(24,8), -- capital de la societe + capital double(24,8), -- capital de la societe fk_stcomm integer DEFAULT 0 NOT NULL, -- commercial statut note_private text, -- note_public text, -- diff --git a/htdocs/install/mysql/tables/llx_subscription.sql b/htdocs/install/mysql/tables/llx_subscription.sql index f1a22d6ec83..8d220ed9059 100644 --- a/htdocs/install/mysql/tables/llx_subscription.sql +++ b/htdocs/install/mysql/tables/llx_subscription.sql @@ -24,7 +24,7 @@ create table llx_subscription fk_adherent integer, dateadh datetime, datef date, - subscription numeric(24,8), + subscription double(24,8), fk_bank integer DEFAULT NULL, note text )ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_tva.sql b/htdocs/install/mysql/tables/llx_tva.sql index c0f680c4824..34ab53a5b22 100644 --- a/htdocs/install/mysql/tables/llx_tva.sql +++ b/htdocs/install/mysql/tables/llx_tva.sql @@ -24,7 +24,7 @@ create table llx_tva datec datetime, -- Create date datep date, -- date de paiement datev date, -- date de valeur - amount numeric(24,8) NOT NULL DEFAULT 0, + amount double(24,8) NOT NULL DEFAULT 0, fk_typepayment integer NULL, num_payment varchar(50), label varchar(255),