3.1.0-3.2.0.sql 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467
  1. --
  2. -- Be carefull to requests order.
  3. -- This file must be loaded by calling /install/index.php page
  4. -- when current version is 3.1.0 or higher.
  5. --
  6. -- To rename a table: ALTER TABLE llx_table RENAME TO llx_table_new;
  7. -- To add a column: ALTER TABLE llx_table ADD COLUMN newcol varchar(60) NOT NULL DEFAULT '0' AFTER existingcol;
  8. -- To rename a column: ALTER TABLE llx_table CHANGE COLUMN oldname newname varchar(60);
  9. -- To drop a column: ALTER TABLE llx_table DROP COLUMN oldname;
  10. -- To change type of field: ALTER TABLE llx_table MODIFY name varchar(60);
  11. -- To restrict request to Mysql version x.y use -- VMYSQLx.y
  12. -- To restrict request to Pgsql version x.y use -- VPGSQLx.y
  13. -- -- VPGSQL8.2 DELETE FROM llx_usergroup_user WHERE fk_user NOT IN (SELECT rowid from llx_user);
  14. -- -- VMYSQL4.1 DELETE FROM llx_usergroup_user WHERE fk_usergroup NOT IN (SELECT rowid from llx_usergroup);
  15. -- Delete old themes setup
  16. DELETE FROM llx_user_param WHERE param = 'MAIN_THEME' and value = 'freelug';
  17. update llx_propal set fk_projet = null where fk_projet not in (select rowid from llx_projet);
  18. update llx_commande set fk_projet = null where fk_projet not in (select rowid from llx_projet);
  19. update llx_facture set fk_projet = null where fk_projet not in (select rowid from llx_projet);
  20. update llx_commande_fournisseur set fk_projet = null where fk_projet not in (select rowid from llx_projet);
  21. update llx_contrat set fk_projet = null where fk_projet not in (select rowid from llx_projet);
  22. update llx_deplacement set fk_projet = null where fk_projet not in (select rowid from llx_projet);
  23. update llx_facture_fourn set fk_projet = null where fk_projet not in (select rowid from llx_projet);
  24. update llx_facture_rec set fk_projet = null where fk_projet not in (select rowid from llx_projet);
  25. update llx_fichinter set fk_projet = null where fk_projet not in (select rowid from llx_projet);
  26. update llx_projet_task set fk_projet = null where fk_projet not in (select rowid from llx_projet);
  27. update llx_propal set fk_user_author = null where fk_user_author not in (select rowid from llx_user);
  28. update llx_propal set fk_user_valid = null where fk_user_valid not in (select rowid from llx_user);
  29. update llx_propal set fk_user_cloture = null where fk_user_cloture not in (select rowid from llx_user);
  30. update llx_commande set fk_user_author = null where fk_user_author not in (select rowid from llx_user);
  31. update llx_commande set fk_user_valid = null where fk_user_valid not in (select rowid from llx_user);
  32. ALTER TABLE llx_extrafields ADD COLUMN type VARCHAR(8);
  33. UPDATE llx_c_paper_format SET active=1 WHERE active=0;
  34. ALTER TABLE llx_actioncomm ADD COLUMN ref_ext varchar(128) after id;
  35. ALTER TABLE llx_product_fournisseur_price ADD COLUMN fk_availability integer AFTER fk_product_fournisseur;
  36. ALTER TABLE llx_element_element MODIFY COLUMN sourcetype varchar(32) NOT NULL;
  37. ALTER TABLE llx_element_element MODIFY COLUMN targettype varchar(32) NOT NULL;
  38. ALTER TABLE llx_user MODIFY ref_ext varchar(50);
  39. ALTER TABLE llx_user ADD COLUMN ref_int varchar(50) AFTER ref_ext;
  40. ALTER TABLE llx_societe MODIFY code_client varchar(24);
  41. ALTER TABLE llx_societe MODIFY code_fournisseur varchar(24);
  42. ALTER TABLE llx_societe MODIFY siren varchar(128);
  43. ALTER TABLE llx_societe MODIFY siret varchar(128);
  44. ALTER TABLE llx_societe MODIFY ape varchar(128);
  45. ALTER TABLE llx_societe MODIFY idprof4 varchar(128);
  46. ALTER TABLE llx_societe ADD COLUMN idprof5 varchar(128);
  47. ALTER TABLE llx_societe MODIFY code_compta varchar(24);
  48. ALTER TABLE llx_societe MODIFY code_compta_fournisseur varchar(24);
  49. ALTER TABLE llx_chargesociales ADD COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
  50. ALTER TABLE llx_chargesociales ADD COLUMN date_creation datetime;
  51. ALTER TABLE llx_chargesociales ADD COLUMN date_valid datetime;
  52. -- Europe
  53. INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (1, 'EU4A0', 'Format 4A0', '1682', '2378', 'mm', 1);
  54. INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (2, 'EU2A0', 'Format 2A0', '1189', '1682', 'mm', 1);
  55. INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (3, 'EUA0', 'Format A0', '840', '1189', 'mm', 1);
  56. INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (4, 'EUA1', 'Format A1', '594', '840', 'mm', 1);
  57. INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (5, 'EUA2', 'Format A2', '420', '594', 'mm', 1);
  58. INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (6, 'EUA3', 'Format A3', '297', '420', 'mm', 1);
  59. INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (7, 'EUA4', 'Format A4', '210', '297', 'mm', 1);
  60. INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (8, 'EUA5', 'Format A5', '148', '210', 'mm', 1);
  61. INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (9, 'EUA6', 'Format A6', '105', '148', 'mm', 1);
  62. -- US
  63. INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (100, 'USLetter', 'Format Letter (A)', '216', '279', 'mm', 1);
  64. INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (105, 'USLegal', 'Format Legal', '216', '356', 'mm', 1);
  65. INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (110, 'USExecutive', 'Format Executive', '190', '254', 'mm', 1);
  66. INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (115, 'USLedger', 'Format Ledger/Tabloid (B)', '279', '432', 'mm', 1);
  67. -- Canadian
  68. INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (200, 'CAP1', 'Format Canadian P1', '560', '860', 'mm', 1);
  69. INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (205, 'CAP2', 'Format Canadian P2', '430', '560', 'mm', 1);
  70. INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (210, 'CAP3', 'Format Canadian P3', '280', '430', 'mm', 1);
  71. INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (215, 'CAP4', 'Format Canadian P4', '215', '280', 'mm', 1);
  72. INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (220, 'CAP5', 'Format Canadian P5', '140', '215', 'mm', 1);
  73. INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (225, 'CAP6', 'Format Canadian P6', '107', '140', 'mm', 1);
  74. ALTER TABLE llx_product_fournisseur_price ADD COLUMN fk_product integer after tms;
  75. ALTER TABLE llx_product_fournisseur_price ADD COLUMN fk_soc integer after fk_product;
  76. ALTER TABLE llx_product_fournisseur_price ADD COLUMN ref_fourn varchar(30) after fk_soc;
  77. ALTER TABLE llx_product_fournisseur_price ADD COLUMN entity integer DEFAULT 1 NOT NULL;
  78. -- VMYSQL4.1 UPDATE llx_product_fournisseur_price as a, llx_product_fournisseur as b SET a.fk_product = b.fk_product, a.fk_soc = b.fk_soc, a.ref_fourn = b.ref_fourn, a.entity = b.entity WHERE a.fk_product_fournisseur = b.rowid AND (a.fk_product IS NULL OR a.fk_soc IS NULL OR a.fk_product = 0 OR a.fk_soc = 0);
  79. -- VPGSQL8.1 UPDATE llx_product_fournisseur_price as a SET fk_product = b.fk_product, fk_soc = b.fk_soc, ref_fourn = b.ref_fourn, entity = b.entity FROM llx_product_fournisseur as b WHERE a.fk_product_fournisseur = b.rowid AND (a.fk_product IS NULL OR a.fk_soc IS NULL OR a.fk_product = 0 OR a.fk_soc = 0);
  80. ALTER TABLE llx_product_fournisseur_price DROP INDEX uk_product_fournisseur_price_ref;
  81. ALTER TABLE llx_product_fournisseur_price ADD UNIQUE INDEX uk_product_fournisseur_price_ref (ref_fourn, fk_soc, quantity, entity);
  82. ALTER TABLE llx_product_fournisseur_price ADD INDEX idx_product_fourn_price_fk_product (fk_product, entity);
  83. ALTER TABLE llx_product_fournisseur_price ADD INDEX idx_product_fourn_price_fk_soc (fk_soc, entity);
  84. ALTER TABLE llx_product_fournisseur_price ADD CONSTRAINT fk_product_fournisseur_price_fk_product FOREIGN KEY (fk_product) REFERENCES llx_product (rowid);
  85. ALTER TABLE llx_product_fournisseur_price DROP FOREIGN KEY fk_product_fournisseur_price_fk_product_fournisseur;
  86. DROP TABLE IF EXISTS llx_pos_tmp;
  87. ALTER TABLE llx_deplacement ADD COLUMN fk_user_modif integer AFTER fk_user_author;
  88. CREATE TABLE llx_localtax
  89. (
  90. rowid integer AUTO_INCREMENT PRIMARY KEY,
  91. entity integer NOT NULL DEFAULT '1',
  92. tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  93. datep date DEFAULT NULL,
  94. datev date DEFAULT NULL,
  95. amount double NOT NULL DEFAULT '0',
  96. label varchar(255) DEFAULT NULL,
  97. note text,
  98. fk_bank integer DEFAULT NULL,
  99. fk_user_creat integer DEFAULT NULL,
  100. fk_user_modif integer DEFAULT NULL
  101. ) ENGINE=InnoDB;
  102. ALTER TABLE llx_propal MODIFY ref_int varchar(255);
  103. ALTER TABLE llx_propal MODIFY ref_ext varchar(255);
  104. ALTER TABLE llx_propal MODIFY ref_client varchar(255);
  105. ALTER TABLE llx_commande MODIFY ref_int varchar(255);
  106. ALTER TABLE llx_commande MODIFY ref_ext varchar(255);
  107. ALTER TABLE llx_commande MODIFY ref_client varchar(255);
  108. ALTER TABLE llx_facture MODIFY ref_int varchar(255);
  109. ALTER TABLE llx_facture MODIFY ref_ext varchar(255);
  110. ALTER TABLE llx_facture MODIFY ref_client varchar(255);
  111. UPDATE llx_societe SET fk_stcomm = 0 WHERE fk_stcomm IS NULL;
  112. ALTER TABLE llx_societe MODIFY COLUMN fk_stcomm integer NOT NULL;
  113. ALTER TABLE llx_societe CHANGE COLUMN gencod barcode varchar(255);
  114. ALTER TABLE llx_societe ADD COLUMN fk_barcode_type integer DEFAULT 0;
  115. UPDATE llx_menu SET leftmenu = NULL where leftmenu in ('', '0', '1');
  116. ALTER TABLE llx_categorie_societe DROP INDEX fk_categorie;
  117. ALTER TABLE llx_categorie_societe DROP INDEX fk_societe;
  118. ALTER TABLE llx_categorie_fournisseur DROP INDEX fk_categorie;
  119. -- VMYSQL ALTER TABLE llx_categorie_fournisseur DROP PRIMARY KEY;
  120. -- VPGSQL ALTER TABLE llx_categorie_fournisseur DROP CONSTRAINT pk_categorie_fournisseur;
  121. ALTER TABLE llx_categorie_fournisseur ADD PRIMARY KEY pk_categorie_fournisseur (fk_categorie, fk_societe);
  122. ALTER TABLE llx_categorie_fournisseur ADD INDEX idx_categorie_fournisseur_fk_categorie (fk_categorie);
  123. ALTER TABLE llx_categorie_fournisseur ADD INDEX idx_categorie_fournisseur_fk_societe (fk_societe);
  124. DELETE FROM llx_categorie_fournisseur WHERE fk_categorie NOT IN (SELECT rowid FROM llx_categorie);
  125. DELETE FROM llx_categorie_fournisseur WHERE fk_societe NOT IN (SELECT rowid FROM llx_societe);
  126. ALTER TABLE llx_categorie_fournisseur ADD CONSTRAINT fk_categorie_fournisseur_categorie_rowid FOREIGN KEY (fk_categorie) REFERENCES llx_categorie (rowid);
  127. ALTER TABLE llx_categorie_fournisseur ADD CONSTRAINT fk_categorie_fournisseur_fk_soc FOREIGN KEY (fk_societe) REFERENCES llx_societe (rowid);
  128. -- Regions Venezuela (id country=232)
  129. INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (23201, 232, 23201, '', 0, 'Los Andes', 1);
  130. INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (23202, 232, 23202, '', 0, 'Capital', 1);
  131. INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (23203, 232, 23203, '', 0, 'Central', 1);
  132. INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (23204, 232, 23204, '', 0, 'Cento Occidental', 1);
  133. INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (23205, 232, 23205, '', 0, 'Guayana', 1);
  134. INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (23206, 232, 23206, '', 0, 'Insular', 1);
  135. INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (23207, 232, 23207, '', 0, 'Los Llanos', 1);
  136. INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (23208, 232, 23208, '', 0, 'Nor-Oriental', 1);
  137. INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (23209, 232, 23209, '', 0, 'Zuliana', 1);
  138. -- Provinces Venezuela (id country=232)
  139. INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('VE-L', 23201, '', 0, 'VE-L', 'Mérida', 1);
  140. INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('VE-T', 23201, '', 0, 'VE-T', 'Trujillo', 1);
  141. INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('VE-E', 23201, '', 0, 'VE-E', 'Barinas', 1);
  142. INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('VE-M', 23202, '', 0, 'VE-M', 'Miranda', 1);
  143. INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('VE-W', 23202, '', 0, 'VE-W', 'Vargas', 1);
  144. INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('VE-A', 23202, '', 0, 'VE-A', 'Distrito Capital', 1);
  145. INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('VE-D', 23203, '', 0, 'VE-D', 'Aragua', 1);
  146. INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('VE-G', 23203, '', 0, 'VE-G', 'Carabobo', 1);
  147. INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('VE-I', 23204, '', 0, 'VE-I', 'Falcón', 1);
  148. INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('VE-K', 23204, '', 0, 'VE-K', 'Lara', 1);
  149. INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('VE-U', 23204, '', 0, 'VE-U', 'Yaracuy', 1);
  150. INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('VE-F', 23205, '', 0, 'VE-F', 'Bolívar', 1);
  151. INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('VE-X', 23205, '', 0, 'VE-X', 'Amazonas', 1);
  152. INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('VE-Y', 23205, '', 0, 'VE-Y', 'Delta Amacuro', 1);
  153. INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('VE-O', 23206, '', 0, 'VE-O', 'Nueva Esparta', 1);
  154. INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('VE-Z', 23206, '', 0, 'VE-Z', 'Dependencias Federales', 1);
  155. INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('VE-C', 23207, '', 0, 'VE-C', 'Apure', 1);
  156. INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('VE-J', 23207, '', 0, 'VE-J', 'Guárico', 1);
  157. INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('VE-H', 23207, '', 0, 'VE-H', 'Cojedes', 1);
  158. INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('VE-P', 23207, '', 0, 'VE-P', 'Portuguesa', 1);
  159. INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('VE-B', 23208, '', 0, 'VE-B', 'Anzoátegui', 1);
  160. INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('VE-N', 23208, '', 0, 'VE-N', 'Monagas', 1);
  161. INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('VE-R', 23208, '', 0, 'VE-R', 'Sucre', 1);
  162. INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('VE-V', 23209, '', 0, 'VE-V', 'Zulia', 1);
  163. INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('VE-S', 23209, '', 0, 'VE-S', 'Táchira', 1);
  164. -- Currency Venezuela
  165. insert into llx_c_currencies ( code, code_iso, active, label ) VALUES ( 'VE', 'VEF', 1, 'Venezuelan Bolívar');
  166. -- VENEZUELA (id country=232)
  167. insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2321,232, '0','0','No VAT',1);
  168. insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2322,232, '12','0','VAT 12%',1);
  169. insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2323,232, '8','0','VAT 8%',1);
  170. update llx_cotisation set fk_bank = null where fk_bank not in (select rowid from llx_bank);
  171. insert into llx_c_chargesociales (id, libelle, deductible, active, code, fk_pays) values (12, 'Cotisation foncière des entreprises', 0, 1, 'TAXCFE', '1');
  172. insert into llx_c_chargesociales (id, libelle, deductible, active, code, fk_pays) values (13, 'Cotisation sur la valeur ajoutée des entreprises', 0, 1, 'TAXCVAE', '1');
  173. ALTER TABLE llx_paiement ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER rowid;
  174. ALTER TABLE llx_product_price ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER rowid;
  175. -- Restore foreign key (on llx_expedition_methode before) on correct table (llx_c_shipment_mode)
  176. UPDATE llx_expedition SET fk_expedition_methode = null WHERE fk_expedition_methode NOT IN (SELECT rowid FROM llx_c_shipment_mode);
  177. ALTER TABLE llx_expedition DROP FOREIGN KEY fk_expedition_fk_expedition_methode;
  178. ALTER TABLE llx_expedition ADD CONSTRAINT fk_expedition_fk_expedition_methode FOREIGN KEY (fk_expedition_methode) REFERENCES llx_c_shipment_mode (rowid);
  179. -- VMYSQL4.1 UPDATE llx_chargesociales set tms = date_creation WHERE tms = '0000-00-00 00:00:00';
  180. ALTER TABLE llx_propal MODIFY fk_projet integer DEFAULT NULL;
  181. ALTER TABLE llx_propal ADD COLUMN fk_account integer AFTER total;
  182. ALTER TABLE llx_propal ADD COLUMN fk_currency varchar(2) AFTER fk_account;
  183. ALTER TABLE llx_propal ADD INDEX idx_propal_fk_user_author (fk_user_author);
  184. ALTER TABLE llx_propal ADD INDEX idx_propal_fk_user_valid (fk_user_valid);
  185. ALTER TABLE llx_propal ADD INDEX idx_propal_fk_user_cloture (fk_user_cloture);
  186. ALTER TABLE llx_propal ADD INDEX idx_propal_fk_projet (fk_projet);
  187. ALTER TABLE llx_propal ADD INDEX idx_propal_fk_account(fk_account);
  188. ALTER TABLE llx_propal ADD INDEX idx_propal_fk_currency(fk_currency);
  189. ALTER TABLE llx_propal ADD CONSTRAINT fk_propal_fk_user_author FOREIGN KEY (fk_user_author) REFERENCES llx_user (rowid);
  190. ALTER TABLE llx_propal ADD CONSTRAINT fk_propal_fk_user_valid FOREIGN KEY (fk_user_valid) REFERENCES llx_user (rowid);
  191. ALTER TABLE llx_propal ADD CONSTRAINT fk_propal_fk_user_cloture FOREIGN KEY (fk_user_cloture) REFERENCES llx_user (rowid);
  192. ALTER TABLE llx_propal ADD CONSTRAINT fk_propal_fk_projet FOREIGN KEY (fk_projet) REFERENCES llx_projet (rowid);
  193. ALTER TABLE llx_propal DROP FOREIGN KEY fk_propal_fk_account;
  194. ALTER TABLE llx_propal DROP FOREIGN KEY fk_propal_fk_currency;
  195. ALTER TABLE llx_commande MODIFY fk_projet integer DEFAULT NULL;
  196. ALTER TABLE llx_commande ADD COLUMN fk_account integer AFTER facture;
  197. ALTER TABLE llx_commande ADD COLUMN fk_currency varchar(2) AFTER fk_account;
  198. ALTER TABLE llx_commande ADD INDEX idx_commande_fk_user_author (fk_user_author);
  199. ALTER TABLE llx_commande ADD INDEX idx_commande_fk_user_valid (fk_user_valid);
  200. ALTER TABLE llx_commande ADD INDEX idx_commande_fk_user_cloture (fk_user_cloture);
  201. ALTER TABLE llx_commande ADD INDEX idx_commande_fk_projet (fk_projet);
  202. ALTER TABLE llx_commande ADD INDEX idx_commande_fk_account(fk_account);
  203. ALTER TABLE llx_commande ADD INDEX idx_commande_fk_currency(fk_currency);
  204. ALTER TABLE llx_commande ADD CONSTRAINT fk_commande_fk_user_author FOREIGN KEY (fk_user_author) REFERENCES llx_user (rowid);
  205. ALTER TABLE llx_commande ADD CONSTRAINT fk_commande_fk_user_valid FOREIGN KEY (fk_user_valid) REFERENCES llx_user (rowid);
  206. ALTER TABLE llx_commande ADD CONSTRAINT fk_commande_fk_user_cloture FOREIGN KEY (fk_user_cloture) REFERENCES llx_user (rowid);
  207. ALTER TABLE llx_commande ADD CONSTRAINT fk_commande_fk_projet FOREIGN KEY (fk_projet) REFERENCES llx_projet (rowid);
  208. ALTER TABLE llx_commande DROP FOREIGN KEY fk_commande_fk_account;
  209. ALTER TABLE llx_commande DROP FOREIGN KEY fk_commande_fk_currency;
  210. ALTER TABLE llx_facture MODIFY fk_projet integer DEFAULT NULL;
  211. ALTER TABLE llx_facture ADD COLUMN fk_account integer AFTER fk_projet;
  212. ALTER TABLE llx_facture ADD COLUMN fk_currency varchar(2) AFTER fk_account;
  213. ALTER TABLE llx_facture ADD INDEX idx_facture_fk_account (fk_account);
  214. ALTER TABLE llx_facture ADD INDEX idx_facture_fk_currency (fk_currency);
  215. ALTER TABLE llx_facture DROP FOREIGN KEY fk_facture_fk_account;
  216. ALTER TABLE llx_facture DROP FOREIGN KEY fk_facture_fk_currency;
  217. ALTER TABLE llx_actioncomm DROP COLUMN propalrowid;
  218. ALTER TABLE llx_actioncomm DROP COLUMN fk_facture;
  219. ALTER TABLE llx_actioncomm DROP COLUMN fk_supplier_order;
  220. ALTER TABLE llx_actioncomm DROP COLUMN fk_supplier_invoice;
  221. ALTER TABLE llx_actioncomm DROP COLUMN fk_commande;
  222. ALTER TABLE llx_product_stock DROP COLUMN location;
  223. ALTER TABLE llx_adherent_extrafields ADD COLUMN import_key varchar(14);
  224. ALTER TABLE llx_product_extrafields ADD COLUMN import_key varchar(14);
  225. ALTER TABLE llx_societe_extrafields ADD COLUMN import_key varchar(14);
  226. DROP TABLE llx_c_currencies;
  227. create table llx_c_currencies
  228. (
  229. code_iso varchar(3) PRIMARY KEY,
  230. label varchar(64) NOT NULL,
  231. unicode varchar(32) DEFAULT NULL,
  232. active tinyint DEFAULT 1 NOT NULL
  233. )ENGINE=innodb;
  234. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'ALL', '[76,101,107]', 1, 'Albania Lek');
  235. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'DZD', NULL, 1, 'Algeria Dinar');
  236. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'AFN', '[1547]', 1, 'Afghanistan Afghani');
  237. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'ARS', '[36]', 1, 'Argentino Peso');
  238. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'AWG', '[402]', 1, 'Aruba Guilder');
  239. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'AUD', '[36]', 1, 'Australia Dollar');
  240. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'AZN', '[1084,1072,1085]', 1, 'Azerbaijan New Manat');
  241. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'BSD', '[36]', 1, 'Bahamas Dollar');
  242. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'BBD', '[36]', 1, 'Barbados Dollar');
  243. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'BYR', '[112,46]', 1, 'Belarus Ruble');
  244. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'BZD', '[66,90,36]', 1, 'Belize Dollar');
  245. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'BMD', '[36]', 1, 'Bermuda Dollar');
  246. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'BOB', '[36,98]', 1, 'Bolivia Boliviano');
  247. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'BAM', '[75,77]', 1, 'Bosnia and Herzegovina Convertible Marka');
  248. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'BWP', '[80]', 1, 'Botswana Pula');
  249. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'BGN', '[1083,1074]', 1, 'Bulgaria Lev');
  250. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'BRL', '[82,36]', 1, 'Brazil Real');
  251. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'BND', '[36]', 1, 'Brunei Darussalam Dollar');
  252. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'KHR', '[6107]', 1, 'Cambodia Riel');
  253. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'CAD', '[36]', 1, 'Canada Dollar');
  254. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'KYD', '[36]', 1, 'Cayman Islands Dollar');
  255. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'CLP', '[36]', 1, 'Chile Peso');
  256. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'CNY', '[165]', 1, 'China Yuan Renminbi');
  257. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'COP', '[36]', 1, 'Colombia Peso');
  258. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'CRC', '[8353]', 1, 'Costa Rica Colon');
  259. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'HRK', '[107,110]', 1, 'Croatia Kuna');
  260. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'CUP', '[8369]', 1, 'Cuba Peso');
  261. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'CZK', '[75,269]', 1, 'Czech Republic Koruna');
  262. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'DKK', '[107,114]', 1, 'Denmark Krone');
  263. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'DOP', '[82,68,36]', 1, 'Dominican Republic Peso');
  264. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'XCD', '[36]', 1, 'East Caribbean Dollar');
  265. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'EGP', '[163]', 1, 'Egypt Pound');
  266. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'SVC', '[36]', 1, 'El Salvador Colon');
  267. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'EEK', '[107,114]', 1, 'Estonia Kroon');
  268. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'EUR', '[8364]', 1, 'Euro Member Countries');
  269. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'FKP', '[163]', 1, 'Falkland Islands (Malvinas) Pound');
  270. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'FJD', '[36]', 1, 'Fiji Dollar');
  271. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'GHC', '[162]', 1, 'Ghana Cedis');
  272. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'GIP', '[163]', 1, 'Gibraltar Pound');
  273. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'GTQ', '[81]', 1, 'Guatemala Quetzal');
  274. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'GGP', '[163]', 1, 'Guernsey Pound');
  275. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'GYD', '[36]', 1, 'Guyana Dollar');
  276. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'HNL', '[76]', 1, 'Honduras Lempira');
  277. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'HKD', '[36]', 1, 'Hong Kong Dollar');
  278. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'HUF', '[70,116]', 1, 'Hungary Forint');
  279. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'ISK', '[107,114]', 1, 'Iceland Krona');
  280. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'INR', NULL, 1, 'India Rupee');
  281. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'IDR', '[82,112]', 1, 'Indonesia Rupiah');
  282. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'IRR', '[65020]', 1, 'Iran Rial');
  283. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'IMP', '[163]', 1, 'Isle of Man Pound');
  284. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'ILS', '[8362]', 1, 'Israel Shekel');
  285. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'JMD', '[74,36]', 1, 'Jamaica Dollar');
  286. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'JPY', '[165]', 1, 'Japan Yen');
  287. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'JEP', '[163]', 1, 'Jersey Pound');
  288. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'KZT', '[1083,1074]', 1, 'Kazakhstan Tenge');
  289. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'KPW', '[8361]', 1, 'Korea (North) Won');
  290. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'KRW', '[8361]', 1, 'Korea (South) Won');
  291. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'KGS', '[1083,1074]', 1, 'Kyrgyzstan Som');
  292. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'LAK', '[8365]', 1, 'Laos Kip');
  293. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'LVL', '[76,115]', 1, 'Latvia Lat');
  294. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'LBP', '[163]', 1, 'Lebanon Pound');
  295. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'LRD', '[36]', 1, 'Liberia Dollar');
  296. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'LTL', '[76,116]', 1, 'Lithuania Litas');
  297. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'MKD', '[1076,1077,1085]', 1, 'Macedonia Denar');
  298. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'MYR', '[82,77]', 1, 'Malaysia Ringgit');
  299. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'MRO', NULL, 1, 'Mauritania Ouguiya');
  300. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'MUR', '[8360]', 1, 'Mauritius Rupee');
  301. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'MXN', '[36]', 1, 'Mexico Peso');
  302. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'MNT', '[8366]', 1, 'Mongolia Tughrik');
  303. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'MAD', NULL, 1, 'Morocco Dirham');
  304. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'MZN', '[77,84]', 1, 'Mozambique Metical');
  305. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'NAD', '[36]', 1, 'Namibia Dollar');
  306. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'NPR', '[8360]', 1, 'Nepal Rupee');
  307. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'ANG', '[402]', 1, 'Netherlands Antilles Guilder');
  308. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'NZD', '[36]', 1, 'New Zealand Dollar');
  309. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'NIO', '[67,36]', 1, 'Nicaragua Cordoba');
  310. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'NGN', '[8358]', 1, 'Nigeria Naira');
  311. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'NOK', '[107,114]', 1, 'Norway Krone');
  312. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'OMR', '[65020]', 1, 'Oman Rial');
  313. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'PKR', '[8360]', 1, 'Pakistan Rupee');
  314. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'PAB', '[66,47,46]', 1, 'Panama Balboa');
  315. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'PYG', '[71,115]', 1, 'Paraguay Guarani');
  316. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'PEN', '[83,47,46]', 1, 'Peru Nuevo Sol');
  317. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'PHP', '[8369]', 1, 'Philippines Peso');
  318. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'PLN', '[122,322]', 1, 'Poland Zloty');
  319. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'QAR', '[65020]', 1, 'Qatar Riyal');
  320. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'RON', '[108,101,105]', 1, 'Romania New Leu');
  321. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'RUB', '[1088,1091,1073]', 1, 'Russia Ruble');
  322. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'SHP', '[163]', 1, 'Saint Helena Pound');
  323. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'SAR', '[65020]', 1, 'Saudi Arabia Riyal');
  324. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'RSD', '[1044,1080,1085,46]', 1, 'Serbia Dinar');
  325. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'SCR', '[8360]', 1, 'Seychelles Rupee');
  326. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'SGD', '[36]', 1, 'Singapore Dollar');
  327. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'SBD', '[36]', 1, 'Solomon Islands Dollar');
  328. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'SOS', '[83]', 1, 'Somalia Shilling');
  329. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'ZAR', '[82]', 1, 'South Africa Rand');
  330. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'LKR', '[8360]', 1, 'Sri Lanka Rupee');
  331. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'SEK', '[107,114]', 1, 'Sweden Krona');
  332. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'CHF', '[67,72,70]', 1, 'Switzerland Franc');
  333. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'SRD', '[36]', 1, 'Suriname Dollar');
  334. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'SYP', '[163]', 1, 'Syria Pound');
  335. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'TWD', '[78,84,36]', 1, 'Taiwan New Dollar');
  336. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'THB', '[3647]', 1, 'Thailand Baht');
  337. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'TTD', '[84,84,36]', 1, 'Trinidad and Tobago Dollar');
  338. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'TND', NULL, 1, 'Tunisia Dinar');
  339. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'TRL', '[84,76]', 1, 'Turkey Lira');
  340. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'TRY', '[8356]', 1, 'Turkey Lira');
  341. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'TVD', '[36]', 1, 'Tuvalu Dollar');
  342. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'UAH', '[8372]', 1, 'Ukraine Hryvna');
  343. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'AED', NULL, 1, 'United Arab Emirates Dirham');
  344. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'GBP', '[163]', 1, 'United Kingdom Pound');
  345. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'USD', '[36]', 1, 'United States Dollar');
  346. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'UYU', '[36,85]', 1, 'Uruguay Peso');
  347. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'UZS', '[1083,1074]', 1, 'Uzbekistan Som');
  348. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'VEF', '[66,115]', 1, 'Venezuela Bolivar Fuerte');
  349. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'VND', '[8363]', 1, 'Viet Nam Dong');
  350. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'XAF', NULL, 1, 'Communaute Financiere Africaine (BEAC) CFA Franc');
  351. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'XOF', NULL, 1, 'Communaute Financiere Africaine (BCEAO) Franc');
  352. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'YER', '[65020]', 1, 'Yemen Rial');
  353. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'ZWD', '[90,36]', 1, 'Zimbabwe Dollar');
  354. -- obsolete
  355. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'ATS', NULL, 0, 'Shiliing autrichiens');
  356. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'BEF', NULL, 0, 'Francs belges');
  357. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'DEM', NULL, 0, 'Deutsch mark');
  358. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'ESP', NULL, 0, 'Pesete');
  359. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'FIM', NULL, 0, 'Mark finlandais');
  360. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'FRF', NULL, 0, 'Francs francais');
  361. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'GRD', NULL, 0, 'Drachme (grece)');
  362. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'IEP', NULL, 0, 'Livres irlandaises');
  363. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'ITL', NULL, 0, 'Lires');
  364. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'LUF', NULL, 0, 'Francs luxembourgeois');
  365. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'NLG', NULL, 0, 'Florins');
  366. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'PTE', NULL, 0, 'Escudos');
  367. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'SKK', NULL, 0, 'Couronnes slovaques');
  368. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'SUR', NULL, 0, 'Rouble');
  369. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'XEU', NULL, 0, 'Ecus');
  370. -- invalid (for compatibility)
  371. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'ARP', NULL, 0, 'Pesos argentins');
  372. INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'MXP', NULL, 0, 'Pesos Mexicans');
  373. ALTER TABLE llx_expedition DROP COLUMN billed;
  374. ALTER TABLE llx_product_fournisseur_price DROP FOREIGN KEY fk_product_fournisseur_price_fk_product_fournisseur;
  375. ALTER TABLE llx_product_fournisseur_price DROP INDEX idx_product_fournisseur_price_fk_product_fournisseur;
  376. --We keep column for the moment because we must not loose data if migrate process fails (upgrade2) to allow a second chance fix. We will delete it at next version.
  377. --ALTER TABLE llx_product_fournisseur_price DROP COLUMN fk_product_fournisseur;
  378. ALTER TABLE llx_product_fournisseur_price ADD COLUMN tva_tx double(6,3) NOT NULL DEFAULT 0 AFTER unitprice;
  379. UPDATE llx_c_departements SET ncc='JUJUY', nom = 'Jujuy' WHERE code_departement='2302' and fk_region='2301';
  380. ALTER TABLE llx_propal ADD COLUMN import_key varchar(14) AFTER fk_demand_reason;
  381. ALTER TABLE llx_propal ADD COLUMN extraparams varchar(255) AFTER import_key;
  382. ALTER TABLE llx_commande ADD COLUMN extraparams varchar(255) AFTER import_key;
  383. ALTER TABLE llx_facture ADD COLUMN extraparams varchar(255) AFTER import_key;
  384. ALTER TABLE llx_fichinter ADD COLUMN extraparams varchar(255) AFTER model_pdf;
  385. ALTER TABLE llx_deplacement ADD COLUMN extraparams varchar(255) AFTER note_public;
  386. ALTER TABLE llx_contrat ADD COLUMN import_key varchar(14) AFTER note_public;
  387. ALTER TABLE llx_contrat ADD COLUMN extraparams varchar(255) AFTER import_key;
  388. ALTER TABLE llx_commande_fournisseur ADD COLUMN extraparams varchar(255) AFTER import_key;
  389. ALTER TABLE llx_facture_fourn ADD COLUMN extraparams varchar(255) AFTER import_key;
  390. ALTER TABLE llx_boxes ADD COLUMN maxline integer NULL;
  391. ALTER TABLE llx_product_fournisseur_price MODIFY fk_product_fournisseur integer DEFAULT 0;
  392. UPDATE llx_product SET canvas = NULL where canvas = 'default@product';
  393. UPDATE llx_product SET canvas = NULL where canvas = 'product@product';
  394. UPDATE llx_product SET canvas = NULL where canvas = 'service@product';
  395. DELETE FROM llx_const WHERE __DECRYPT('name')__ = 'SOCIETE_CODECOMPTA_ADDON' AND __DECRYPT('value')__ = 'mod_codecompta_digitaria';
  396. ALTER TABLE llx_c_barcode_type ADD UNIQUE INDEX uk_c_barcode_type(code, entity);
  397. -- To make migration script with version >= 3.3 working correctly
  398. ALTER TABLE llx_c_tva ADD COLUMN localtax1_type varchar(1) default '0' after localtax1;
  399. ALTER TABLE llx_c_tva ADD COLUMN localtax2_type varchar(1) default '0' after localtax2;