diff --git a/htdocs/install/mysql/migration/repair.sql b/htdocs/install/mysql/migration/repair.sql index 224a76cdf73af19ea4a9aab29efdb00df5c360f7..70fae404149dff7ebf27d18828d0b93b1d8b5478 100644 --- a/htdocs/install/mysql/migration/repair.sql +++ b/htdocs/install/mysql/migration/repair.sql @@ -108,14 +108,7 @@ UPDATE llx_product p SET p.stock= (SELECT SUM(ps.reel) FROM llx_product_stock ps -- VMYSQL DELETE from llx_menu where module = 'margins' and url = '/margin/index.php' and not exists (select * from llx_const where name = 'MAIN_MODULE_MARGIN' or name = 'MAIN_MODULE_MARGINS'); --- Requests to clean old tables or fields - --- DROP TABLE llx_c_methode_commande_fournisseur; --- DROP TABLE llx_c_source; --- DROP TABLE llx_cond_reglement; --- DROP TABLE llx_expedition_methode; --- DROP TABLE llx_product_fournisseur; --- ALTER TABLE llx_product_fournisseur_price DROP COLUMN fk_product_fournisseur; +ALTER TABLE llx_product_fournisseur_price DROP COLUMN fk_product_fournisseur; ALTER TABLE llx_product_fournisseur_price DROP FOREIGN KEY fk_product_fournisseur; @@ -155,3 +148,22 @@ UPDATE llx_projet_task SET fk_task_parent = 0 WHERE fk_task_parent = rowid UPDATE llx_actioncomm set fk_user_action = fk_user_done where fk_user_done > 0 and (fk_user_action is null or fk_user_action = 0); UPDATE llx_actioncomm set fk_user_action = fk_user_author where fk_user_author > 0 and (fk_user_action is null or fk_user_action = 0); + +-- Requests to clean old tables or fields + +-- DROP TABLE llx_c_methode_commande_fournisseur; +-- DROP TABLE llx_c_source; +-- DROP TABLE llx_cond_reglement; +-- DROP TABLE llx_expedition_methode; +-- DROP TABLE llx_product_fournisseur; + +-- To replace amount on all invoice and lines when forgetting to apply a 20% vat +-- update llx_facturedet set tva_tx = 20 where tva_tx = 0; +-- update llx_facturedet set total_ht = round(total_ttc / 1.2, 5) where total_ht = total_ttc; +-- update llx_facturedet set total_tva = total_ttc - total_ht where total_vat = 0; +-- update llx_facture set total = round(total_ttc / 1.2, 5) where total_ht = total_ttc; +-- update llx_facture set tva = total_ttc - total where tva = 0; + + + +