diff --git a/mssql/tables/llx_bank_url.sql b/mssql/tables/llx_bank_url.sql index 45a12e31e70..683d461a781 100644 --- a/mssql/tables/llx_bank_url.sql +++ b/mssql/tables/llx_bank_url.sql @@ -28,5 +28,5 @@ create table llx_bank_url url_id integer, url varchar(255), label varchar(255), - type varchar(16) NOT NULL check (type in ('company','payment','payment_supplier','member','subscription','donation','sc','payment_sc')) + type varchar(16) NOT NULL check (type in ('?','company','payment','payment_supplier','member','subscription','donation','sc','payment_sc')) ); diff --git a/mssql/tables/llx_boxes.sql b/mssql/tables/llx_boxes.sql index 1f242814709..139a29ed64f 100644 --- a/mssql/tables/llx_boxes.sql +++ b/mssql/tables/llx_boxes.sql @@ -30,6 +30,6 @@ create table llx_boxes rowid integer IDENTITY PRIMARY KEY, box_id integer NOT NULL, position smallint NOT NULL, - box_order smallint default 0 NOT NULL, + box_order varchar(3) NOT NULL, fk_user integer default 0 NOT NULL ); diff --git a/mssql/tables/llx_commande.sql b/mssql/tables/llx_commande.sql index fb6e2966414..6a1dc7b9ff6 100644 --- a/mssql/tables/llx_commande.sql +++ b/mssql/tables/llx_commande.sql @@ -42,9 +42,9 @@ create table llx_commande remise_percent real default 0, remise_absolue real default 0, remise real default 0, - tva real default 0, - total_ht real default 0, - total_ttc real default 0, + tva float default 0, + total_ht float default 0, + total_ttc float default 0, note text, note_public text, model_pdf varchar(50), diff --git a/mssql/tables/llx_commande_fournisseur.key.sql b/mssql/tables/llx_commande_fournisseur.key.sql index 7ed4780211a..95ca08c28f8 100644 --- a/mssql/tables/llx_commande_fournisseur.key.sql +++ b/mssql/tables/llx_commande_fournisseur.key.sql @@ -26,4 +26,6 @@ CREATE INDEX idx_commande_fournisseur_fk_soc ON llx_commande_fournisseur(fk_soc); -ALTER TABLE llx_commande_fournisseur ADD CONSTRAINT fk_commande_fournisseur_societe FOREIGN KEY (fk_soc) REFERENCES llx_societe (rowid); +ALTER TABLE llx_commande_fournisseur ADD CONSTRAINT fk_commande_fournisseur_fk_soc FOREIGN KEY (fk_soc) REFERENCES llx_societe (rowid); + +CREATE UNIQUE INDEX uk_commande_fournisseur_ref ON llx_commande_fournisseur(ref, fk_soc); diff --git a/mssql/tables/llx_commande_fournisseur.sql b/mssql/tables/llx_commande_fournisseur.sql index 3f4bccdef1e..17bd804e4c3 100644 --- a/mssql/tables/llx_commande_fournisseur.sql +++ b/mssql/tables/llx_commande_fournisseur.sql @@ -40,9 +40,9 @@ create table llx_commande_fournisseur amount_ht real default 0, remise_percent real default 0, remise real default 0, - tva real default 0, - total_ht real default 0, - total_ttc real default 0, + tva float default 0, + total_ht float default 0, + total_ttc float default 0, note text, note_public text, model_pdf varchar(50), diff --git a/mssql/tables/llx_commandedet.sql b/mssql/tables/llx_commandedet.sql index 60afe850536..ad3df019b70 100644 --- a/mssql/tables/llx_commandedet.sql +++ b/mssql/tables/llx_commandedet.sql @@ -31,13 +31,14 @@ create table llx_commandedet 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 - subprice real, -- prix avant remise price real, -- prix final - total_ht real, -- Total HT de la ligne toute quantité et incluant remise ligne et globale - total_tva real, -- Total TVA de la ligne toute quantité et incluant remise ligne et globale - total_ttc real, -- Total TTC de la ligne toute quantité et incluant remise ligne et globale + subprice float, -- prix avant remise + total_ht float, -- Total HT de la ligne toute quantité et incluant remise ligne et globale + total_tva float, -- Total TVA de la ligne toute quantité et incluant remise ligne et globale + total_ttc float, -- Total TTC de la ligne toute quantité et incluant remise ligne et globale info_bits integer DEFAULT 0, -- TVA NPR ou non - coef real, -- coefficient de marge + marge_tx real, -- taux de marge (marge sur prix d'achat) + marque_tx real, -- taux de marque (marge sur prix de vente) special_code tinyint DEFAULT 0, -- code pour les lignes speciales rang integer DEFAULT 0 ); diff --git a/mssql/tables/llx_contratdet.sql b/mssql/tables/llx_contratdet.sql index 6cbda8b953e..f9d6bb2b535 100644 --- a/mssql/tables/llx_contratdet.sql +++ b/mssql/tables/llx_contratdet.sql @@ -32,6 +32,7 @@ create table llx_contratdet label text, -- libellé du produit description text, + fk_remise_except integer NULL, -- Lien vers table des remises fixes date_commande datetime, date_ouverture_prevue datetime, @@ -39,16 +40,15 @@ create table llx_contratdet date_fin_validite datetime, date_cloture datetime, - tva_tx real DEFAULT 19.6, -- taux tva + tva_tx float DEFAULT 19.6, -- taux tva qty real, -- quantité 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 - subprice real, -- prix avant remise + subprice float, -- prix avant remise price_ht real, -- prix final - total_ht real, -- Total HT de la ligne toute quantité et incluant remise ligne et globale - total_tva real, -- Total TVA de la ligne toute quantité et incluant remise ligne et globale - total_ttc real, -- Total TTC de la ligne toute quantité et incluant remise ligne et globale + remise real DEFAULT 0, -- montant de la remise + total_ht float, -- Total HT de la ligne toute quantité et incluant remise ligne et globale + total_tva float, -- Total TVA de la ligne toute quantité et incluant remise ligne et globale + total_ttc float, -- Total TTC de la ligne toute quantité et incluant remise ligne et globale info_bits integer DEFAULT 0, -- TVA NPR ou non fk_user_author integer NOT NULL default 0, diff --git a/mssql/tables/llx_facture_fourn.sql b/mssql/tables/llx_facture_fourn.sql index fbafbc23d00..adae235f2b2 100644 --- a/mssql/tables/llx_facture_fourn.sql +++ b/mssql/tables/llx_facture_fourn.sql @@ -30,13 +30,13 @@ create table llx_facture_fourn datef SMALLDATETIME, -- SMALLDATETIME de la facture libelle varchar(255), paye smallint DEFAULT 0 NOT NULL, - amount real DEFAULT 0 NOT NULL, - remise real DEFAULT 0, - tva real DEFAULT 0, - total real DEFAULT 0, - total_ht real DEFAULT 0, - total_tva real DEFAULT 0, - total_ttc real DEFAULT 0, + amount float DEFAULT 0 NOT NULL, + remise float DEFAULT 0, + tva float DEFAULT 0, + total float DEFAULT 0, + total_ht float DEFAULT 0, + total_tva float DEFAULT 0, + total_ttc float DEFAULT 0, fk_statut smallint DEFAULT 0 NOT NULL, diff --git a/mssql/tables/llx_paiement.sql b/mssql/tables/llx_paiement.sql index b000882374d..550948f7d38 100644 --- a/mssql/tables/llx_paiement.sql +++ b/mssql/tables/llx_paiement.sql @@ -32,7 +32,6 @@ create table llx_paiement tms timestamp, datep datetime, -- payment SMALLDATETIME amount real DEFAULT 0, - author varchar(50), fk_paiement integer NOT NULL, num_paiement varchar(50), note text, diff --git a/mssql/tables/llx_product.sql b/mssql/tables/llx_product.sql index 9f070e17c6b..d7d542794e8 100644 --- a/mssql/tables/llx_product.sql +++ b/mssql/tables/llx_product.sql @@ -29,10 +29,10 @@ create table llx_product label varchar(255) NOT NULL, description text, note text, - price FLOAT(25), - price_ttc float(12) DEFAULT 0, + price FLOAT, + price_ttc float DEFAULT 0, price_base_type varchar(3) DEFAULT 'HT', - tva_tx FLOAT(25), + tva_tx FLOAT, fk_user_author integer, envente tinyint DEFAULT 1, nbvente integer DEFAULT 0, @@ -45,5 +45,7 @@ create table llx_product gencode varchar(255) DEFAULT NULL, weight float DEFAULT NULL, weight_units tinyint DEFAULT NULL, + volume float DEFAULT NULL, + volume_units tinyint DEFAULT NULL, canvas varchar(15) DEFAULT '' ); diff --git a/mssql/tables/llx_product_fournisseur_price.sql b/mssql/tables/llx_product_fournisseur_price.sql index 876aa946364..545ba4fb295 100644 --- a/mssql/tables/llx_product_fournisseur_price.sql +++ b/mssql/tables/llx_product_fournisseur_price.sql @@ -27,8 +27,10 @@ create table llx_product_fournisseur_price tms timestamp, fk_product integer, fk_soc integer, -- lien sur llx_societe - price real, - quantity real, + ref_fourn varchar(30), + price float, + quantity float, + unitprice float, fk_user integer ); diff --git a/mssql/tables/llx_product_price.sql b/mssql/tables/llx_product_price.sql index 577ed6954a5..3aa012b4489 100644 --- a/mssql/tables/llx_product_price.sql +++ b/mssql/tables/llx_product_price.sql @@ -27,10 +27,10 @@ create table llx_product_price fk_product integer NOT NULL, date_price datetime NOT NULL, price_level tinyint NULL DEFAULT 1, - price FLOAT(25), - price_ttc float(12) DEFAULT 0, + price FLOAT, + price_ttc float DEFAULT 0, price_base_type varchar(3) DEFAULT 'HT', - tva_tx FLOAT(25) NOT NULL, + tva_tx FLOAT NOT NULL, fk_user_author integer, envente tinyint DEFAULT 1 ); diff --git a/mssql/tables/llx_propal.sql b/mssql/tables/llx_propal.sql index f4d8d522606..2b45ed87049 100644 --- a/mssql/tables/llx_propal.sql +++ b/mssql/tables/llx_propal.sql @@ -41,9 +41,9 @@ create table llx_propal remise_percent real DEFAULT 0, -- remise globale relative en pourcent remise_absolue real DEFAULT 0, -- remise globale absolue remise real DEFAULT 0, -- remise calculee - tva real DEFAULT 0, -- montant tva apres remise globale - total_ht real DEFAULT 0, -- montant total ht apres remise globale - total real DEFAULT 0, -- montant total ttc apres remise globale + tva float DEFAULT 0, -- montant tva apres remise globale + total_ht float DEFAULT 0, -- montant total ht apres remise globale + total float DEFAULT 0, -- montant total ttc apres remise globale fk_cond_reglement integer, -- condition de reglement (30 jours, fin de mois ...) fk_mode_reglement integer, -- mode de reglement (Virement, Prélèvement) diff --git a/mssql/tables/llx_propaldet.sql b/mssql/tables/llx_propaldet.sql index cfaf613aa9f..1424997f19e 100644 --- a/mssql/tables/llx_propaldet.sql +++ b/mssql/tables/llx_propaldet.sql @@ -25,17 +25,18 @@ create table llx_propaldet fk_propal integer, fk_product integer, description text, + fk_remise_except integer NULL, -- Lien vers table des remises fixes tva_tx real, -- taux tva qty real, -- quantité 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 - subprice real, -- prix avant remise price real, -- prix final - total_ht real, -- Total HT de la ligne toute quantité et incluant remise ligne et globale - total_tva real, -- Total TVA de la ligne toute quantité et incluant remise ligne et globale - total_ttc real, -- Total TTC de la ligne toute quantité et incluant remise ligne et globale + subprice float, -- prix avant remise + total_ht float, -- Total HT de la ligne toute quantité et incluant remise ligne et globale + total_tva float, -- Total TVA de la ligne toute quantité et incluant remise ligne et globale + total_ttc float, -- Total TTC de la ligne toute quantité et incluant remise ligne et globale info_bits integer DEFAULT 0, -- TVA NPR ou non - coef real, -- coefficient de marge + marge_tx real, -- taux de marge (marge sur prix d'achat) + marque_tx real, -- taux de marque (marge sur prix de vente) rang integer DEFAULT 0 ); diff --git a/mssql/tables/llx_societe_remise_except.sql b/mssql/tables/llx_societe_remise_except.sql index 4e6ae353a58..645356e6e36 100644 --- a/mssql/tables/llx_societe_remise_except.sql +++ b/mssql/tables/llx_societe_remise_except.sql @@ -27,10 +27,10 @@ create table llx_societe_remise_except rowid integer IDENTITY PRIMARY KEY, fk_soc integer NOT NULL, -- client datec datetime, - amount_ht real NOT NULL, - amount_tva real DEFAULT 0 NOT NULL, - amount_ttc real DEFAULT 0 NOT NULL, - tva_tx real DEFAULT 0 NOT NULL, + amount_ht float NOT NULL, + amount_tva float DEFAULT 0 NOT NULL, + amount_ttc float DEFAULT 0 NOT NULL, + tva_tx float DEFAULT 0 NOT NULL, fk_user integer NOT NULL, fk_facture integer, fk_facture_source integer, diff --git a/mssql/tables/llx_socpeople.sql b/mssql/tables/llx_socpeople.sql index 1d7576b264a..9d7fc4c583f 100644 --- a/mssql/tables/llx_socpeople.sql +++ b/mssql/tables/llx_socpeople.sql @@ -22,7 +22,7 @@ create table llx_socpeople ( - idp integer IDENTITY PRIMARY KEY, + rowid integer IDENTITY PRIMARY KEY, datec datetime, tms timestamp, fk_soc integer, -- lien vers la societe @@ -41,7 +41,7 @@ create table llx_socpeople fax varchar(30), email varchar(255), jabberid varchar(255), - fk_user integer DEFAULT 0, -- user qui a créé l'enregistrement + fk_user_creat integer DEFAULT 0, -- user qui a créé l'enregistrement fk_user_modif integer, note text ); diff --git a/mssql/tables/llx_user.sql b/mssql/tables/llx_user.sql index 49b1c1ee58e..c45682f437b 100644 --- a/mssql/tables/llx_user.sql +++ b/mssql/tables/llx_user.sql @@ -30,6 +30,7 @@ create table llx_user login varchar(24) NOT NULL, pass varchar(32), pass_crypted varchar(128), + pass_temp varchar(32), -- temporary password when asked for forget password name varchar(50), firstname varchar(50), office_phone varchar(20),