14.0.0-15.0.0.sql 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565
  1. --
  2. -- Be carefull to requests order.
  3. -- This file must be loaded by calling /install/index.php page
  4. -- when current version is 14.0.0 or higher.
  5. --
  6. -- To restrict request to Mysql version x.y minimum use -- VMYSQLx.y
  7. -- To restrict request to Pgsql version x.y minimum use -- VPGSQLx.y
  8. -- To rename a table: ALTER TABLE llx_table RENAME TO llx_table_new;
  9. -- To add a column: ALTER TABLE llx_table ADD COLUMN newcol varchar(60) NOT NULL DEFAULT '0' AFTER existingcol;
  10. -- To rename a column: ALTER TABLE llx_table CHANGE COLUMN oldname newname varchar(60);
  11. -- To drop a column: ALTER TABLE llx_table DROP COLUMN oldname;
  12. -- To change type of field: ALTER TABLE llx_table MODIFY COLUMN name varchar(60);
  13. -- To drop a foreign key: ALTER TABLE llx_table DROP FOREIGN KEY fk_name;
  14. -- To create a unique index ALTER TABLE llx_table ADD UNIQUE INDEX uk_table_field (field);
  15. -- To drop an index: -- VMYSQL4.1 DROP INDEX nomindex on llx_table;
  16. -- To drop an index: -- VPGSQL8.2 DROP INDEX nomindex;
  17. -- To make pk to be auto increment (mysql): -- VMYSQL4.3 ALTER TABLE llx_table CHANGE COLUMN rowid rowid INTEGER NOT NULL AUTO_INCREMENT;
  18. -- To make pk to be auto increment (postgres):
  19. -- -- VPGSQL8.2 CREATE SEQUENCE llx_table_rowid_seq OWNED BY llx_table.rowid;
  20. -- -- VPGSQL8.2 ALTER TABLE llx_table ADD PRIMARY KEY (rowid);
  21. -- -- VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN rowid SET DEFAULT nextval('llx_table_rowid_seq');
  22. -- -- VPGSQL8.2 SELECT setval('llx_table_rowid_seq', MAX(rowid)) FROM llx_table;
  23. -- To set a field as NULL: -- VMYSQL4.3 ALTER TABLE llx_table MODIFY COLUMN name varchar(60) NULL;
  24. -- To set a field as NULL: -- VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name DROP NOT NULL;
  25. -- To set a field as NOT NULL: -- VMYSQL4.3 ALTER TABLE llx_table MODIFY COLUMN name varchar(60) NOT NULL;
  26. -- To set a field as NOT NULL: -- VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name SET NOT NULL;
  27. -- To set a field as default NULL: -- VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name SET DEFAULT NULL;
  28. -- Note: fields with type BLOB/TEXT can't have default value.
  29. -- To rebuild sequence for postgresql after insert by forcing id autoincrement fields:
  30. -- -- VPGSQL8.2 SELECT dol_util_rebuild_sequences();
  31. -- Missing in v14 or lower
  32. -- VMYSQL4.3 ALTER TABLE llx_partnership MODIFY COLUMN date_partnership_end date NULL;
  33. -- VPGSQL8.2 ALTER TABLE llx_partnership ALTER COLUMN date_partnership_end DROP NOT NULL;
  34. ALTER TABLE llx_product_fournisseur_price ADD COLUMN packaging real DEFAULT NULL;
  35. -- VMYSQL4.3 ALTER TABLE llx_product_fournisseur_price MODIFY COLUMN packaging real DEFAULT NULL;
  36. -- VPGSQL8.2 ALTER TABLE llx_product_fournisseur_price MODIFY COLUMN packaging real DEFAULT NULL USING packaging::real;
  37. ALTER TABLE llx_accounting_bookkeeping ADD COLUMN date_export datetime DEFAULT NULL;
  38. ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD COLUMN fk_project integer NOT NULL;
  39. ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD COLUMN fk_invoice integer NULL;
  40. ALTER TABLE llx_eventorganization_conferenceorboothattendee DROP FOREIGN KEY fx_eventorganization_conferenceorboothattendee_fk_soc;
  41. ALTER TABLE llx_eventorganization_conferenceorboothattendee DROP FOREIGN KEY fx_eventorganization_conferenceorboothattendee_fk_actioncomm;
  42. ALTER TABLE llx_eventorganization_conferenceorboothattendee DROP FOREIGN KEY fx_eventorganization_conferenceorboothattendee_fk_project;
  43. ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD INDEX idx_eventorganization_conferenceorboothattendee_rowid (rowid);
  44. ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD INDEX idx_eventorganization_conferenceorboothattendee_ref (ref);
  45. ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD INDEX idx_eventorganization_conferenceorboothattendee_fk_soc (fk_soc);
  46. ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD INDEX idx_eventorganization_conferenceorboothattendee_fk_actioncomm (fk_actioncomm);
  47. ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD INDEX idx_eventorganization_conferenceorboothattendee_email (email);
  48. ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD INDEX idx_eventorganization_conferenceorboothattendee_status (status);
  49. -- VMYSQL4.1 DROP INDEX uk_eventorganization_conferenceorboothattendee on llx_eventorganization_conferenceorboothattendee;
  50. -- VPGSQL8.2 DROP INDEX uk_eventorganization_conferenceorboothattendee;
  51. ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD UNIQUE INDEX uk_eventorganization_conferenceorboothattendee(fk_project, email, fk_actioncomm);
  52. -- VMYSQL4.3 ALTER TABLE llx_eventorganization_conferenceorboothattendee MODIFY COLUMN fk_actioncomm integer NULL;
  53. -- VPGSQL8.2 ALTER TABLE llx_eventorganization_conferenceorboothattendee ALTER COLUMN fk_actioncomm DROP NOT NULL;
  54. ALTER TABLE llx_mrp_mo ADD COLUMN last_main_doc varchar(255);
  55. UPDATE llx_extrafields SET elementtype = 'salary' WHERE elementtype = 'payment_salary';
  56. ALTER TABLE llx_payment_salary_extrafields RENAME TO llx_salary_extrafields;
  57. -- VMYSQL4.1 DROP INDEX idx_payment_salary_extrafields on llx_salary_extrafields;
  58. -- VPGSQL8.2 DROP INDEX idx_payment_salary_extrafields;
  59. ALTER TABLE llx_salary_extrafields ADD INDEX idx_salary_extrafields (fk_object);
  60. INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailAskConf)', 10, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailAskConf)__', '__(Hello)__,<br /><br />__(OrganizationEventConfRequestWasReceived)__<br /><br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
  61. INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailAskBooth)', 20, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailAskBooth)__', '__(Hello)__,<br /><br />__(OrganizationEventBoothRequestWasReceived)__<br /><br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
  62. -- TODO Add message for registration only to event __ONLINE_PAYMENT_TEXT_AND_URL__
  63. INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailBoothPayment)', 30, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailBoothPayment)__', '__(Hello)__,<br /><br />__(OrganizationEventPaymentOfBoothWasReceived)__<br /><br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
  64. INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailRegistrationPayment)', 40, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailRegistrationPayment)__', '__(Hello)__,<br /><br />__(OrganizationEventPaymentOfRegistrationWasReceived)__<br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
  65. INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationMassEmailAttendees)', 50, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailAttendees)__', '__(Hello)__,<br /><br />__(OrganizationEventBulkMailToAttendees)__<br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
  66. INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationMassEmailSpeakers)', 60, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailSpeakers)__', '__(Hello)__,<br /><br />__(OrganizationEventBulkMailToSpeakers)__<br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
  67. UPDATE llx_c_email_templates SET label = '(EventOrganizationEmailBoothPayment)' WHERE label = '(EventOrganizationEmailSubsBooth)';
  68. UPDATE llx_c_email_templates SET label = '(EventOrganizationEmailRegistrationPayment)' WHERE label = '(EventOrganizationEmailSubsEvent)';
  69. --Fix bad sign on multicompany column for customer invoice lines
  70. UPDATE llx_facturedet SET multicurrency_subprice = -multicurrency_subprice WHERE ((multicurrency_subprice < 0 and subprice > 0) OR (multicurrency_subprice > 0 and subprice < 0));
  71. UPDATE llx_facturedet SET multicurrency_total_ht = -multicurrency_total_ht WHERE ((multicurrency_total_ht < 0 and total_ht > 0) OR (multicurrency_total_ht > 0 and total_ht < 0));
  72. UPDATE llx_facturedet SET multicurrency_total_tva = -multicurrency_total_tva WHERE ((multicurrency_total_tva < 0 and total_tva > 0) OR (multicurrency_total_tva > 0 and total_tva < 0));
  73. UPDATE llx_facturedet SET multicurrency_total_ttc = -multicurrency_total_ttc WHERE ((multicurrency_total_ttc < 0 and total_ttc > 0) OR (multicurrency_total_ttc > 0 and total_ttc < 0));
  74. --Fix bad sign on multicompany column for customer invoices
  75. UPDATE llx_facture SET multicurrency_total_ht = -multicurrency_total_ht WHERE ((multicurrency_total_ht < 0 and total_ht > 0) OR (multicurrency_total_ht > 0 and total_ht < 0));
  76. UPDATE llx_facture SET multicurrency_total_tva = -multicurrency_total_tva WHERE ((multicurrency_total_tva < 0 and total_tva > 0) OR (multicurrency_total_tva > 0 and total_tva < 0));
  77. UPDATE llx_facture SET multicurrency_total_ttc = -multicurrency_total_ttc WHERE ((multicurrency_total_ttc < 0 and total_ttc > 0) OR (multicurrency_total_ttc > 0 and total_ttc < 0));
  78. --Fix bad sign on multicurrency column for supplier invoice lines
  79. UPDATE llx_facture_fourn_det SET multicurrency_subprice = -multicurrency_subprice WHERE ((multicurrency_subprice < 0 and pu_ht > 0) OR (multicurrency_subprice > 0 and pu_ht < 0));
  80. UPDATE llx_facture_fourn_det SET multicurrency_total_ht = -multicurrency_total_ht WHERE ((multicurrency_total_ht < 0 and total_ht > 0) OR (multicurrency_total_ht > 0 and total_ht < 0));
  81. UPDATE llx_facture_fourn_det SET multicurrency_total_tva = -multicurrency_total_tva WHERE ((multicurrency_total_tva < 0 and tva > 0) OR (multicurrency_total_tva > 0 and tva < 0));
  82. UPDATE llx_facture_fourn_det SET multicurrency_total_ttc = -multicurrency_total_ttc WHERE ((multicurrency_total_ttc < 0 and total_ttc > 0) OR (multicurrency_total_ttc > 0 and total_ttc < 0));
  83. --Fix bad sign on multicompany column for customer invoices
  84. UPDATE llx_facture_fourn SET multicurrency_total_ht = -multicurrency_total_ht WHERE ((multicurrency_total_ht < 0 and total_ht > 0) OR (multicurrency_total_ht > 0 and total_ht < 0));
  85. UPDATE llx_facture_fourn SET multicurrency_total_tva = -multicurrency_total_tva WHERE ((multicurrency_total_tva < 0 and total_tva > 0) OR (multicurrency_total_tva > 0 and total_tva < 0));
  86. UPDATE llx_facture_fourn SET multicurrency_total_ttc = -multicurrency_total_ttc WHERE ((multicurrency_total_ttc < 0 and total_ttc > 0) OR (multicurrency_total_ttc > 0 and total_ttc < 0));
  87. ALTER TABLE llx_propaldet ADD COLUMN import_key varchar(14);
  88. -- v15
  89. ALTER TABLE llx_c_partnership_type ADD UNIQUE INDEX uk_c_partnership_type(entity, code);
  90. ALTER TABLE llx_partnership ADD COLUMN fk_type integer DEFAULT 0 NOT NULL;
  91. ALTER TABLE llx_c_holiday_types CHANGE COLUMN newByMonth newbymonth double(8,5) DEFAULT 0 NOT NULL;
  92. ALTER TABLE llx_product ADD COLUMN mandatory_period tinyint NULL DEFAULT 0;
  93. ALTER TABLE llx_holiday ADD COLUMN date_approve DATETIME DEFAULT NULL;
  94. ALTER TABLE llx_holiday ADD COLUMN fk_user_approve integer DEFAULT NULL;
  95. -- VMYSQL4.3 ALTER TABLE llx_ticket MODIFY COLUMN progress integer;
  96. -- VPGSQL8.2 ALTER TABLE llx_ticket MODIFY COLUMN progress integer USING progress::integer;
  97. ALTER TABLE llx_emailcollector_emailcollectoraction MODIFY COLUMN actionparam TEXT;
  98. ALTER TABLE llx_knowledgemanagement_knowledgerecord ADD COLUMN lang varchar(6);
  99. ALTER TABLE llx_knowledgemanagement_knowledgerecord ADD COLUMN entity integer DEFAULT 1;
  100. CREATE TABLE llx_categorie_ticket
  101. (
  102. fk_categorie integer NOT NULL,
  103. fk_ticket integer NOT NULL,
  104. import_key varchar(14)
  105. ) ENGINE=innodb;
  106. ALTER TABLE llx_categorie_ticket ADD PRIMARY KEY pk_categorie_ticket (fk_categorie, fk_ticket);
  107. ALTER TABLE llx_categorie_ticket ADD INDEX idx_categorie_ticket_fk_categorie (fk_categorie);
  108. ALTER TABLE llx_categorie_ticket ADD INDEX idx_categorie_ticket_fk_ticket (fk_ticket);
  109. ALTER TABLE llx_categorie_ticket ADD CONSTRAINT fk_categorie_ticket_categorie_rowid FOREIGN KEY (fk_categorie) REFERENCES llx_categorie (rowid);
  110. ALTER TABLE llx_categorie_ticket ADD CONSTRAINT fk_categorie_ticket_ticket_rowid FOREIGN KEY (fk_ticket) REFERENCES llx_ticket (rowid);
  111. ALTER TABLE llx_product_fournisseur_price MODIFY COLUMN ref_fourn varchar(128);
  112. ALTER TABLE llx_product_customer_price MODIFY COLUMN ref_customer varchar(128);
  113. ALTER TABLE llx_product_association ADD COLUMN rang integer DEFAULT 0;
  114. -- -- add action trigger
  115. INSERT INTO llx_c_action_trigger (code,label,description,elementtype,rang) VALUES ('ORDER_SUPPLIER_CANCEL','Supplier order request canceled','Executed when a supplier order is canceled','order_supplier',13);
  116. ALTER TABLE llx_product ADD COLUMN fk_default_bom integer DEFAULT NULL;
  117. ALTER TABLE llx_mrp_mo ADD COLUMN mrptype integer DEFAULT 0;
  118. DELETE FROM llx_menu WHERE type = 'top' AND module = 'cashdesk' AND mainmenu = 'cashdesk';
  119. INSERT INTO llx_c_action_trigger (code, label, description, elementtype, rang) values ('MEMBER_EXCLUDE', 'Member excluded', 'Executed when a member is excluded', 'member', 27);
  120. CREATE TABLE llx_categorie_knowledgemanagement
  121. (
  122. fk_categorie integer NOT NULL,
  123. fk_knowledgemanagement integer NOT NULL,
  124. import_key varchar(14)
  125. )ENGINE=innodb;
  126. ALTER TABLE llx_categorie_knowledgemanagement ADD PRIMARY KEY pk_categorie_knowledgemanagement (fk_categorie, fk_knowledgemanagement);
  127. ALTER TABLE llx_categorie_knowledgemanagement ADD INDEX idx_categorie_knowledgemanagement_fk_categorie (fk_categorie);
  128. ALTER TABLE llx_categorie_knowledgemanagement ADD INDEX idx_categorie_knowledgemanagement_fk_knowledgemanagement (fk_knowledgemanagement);
  129. ALTER TABLE llx_categorie_knowledgemanagement ADD CONSTRAINT fk_categorie_knowledgemanagement_categorie_rowid FOREIGN KEY (fk_categorie) REFERENCES llx_categorie (rowid);
  130. ALTER TABLE llx_categorie_knowledgemanagement ADD CONSTRAINT fk_categorie_knowledgemanagement_knowledgemanagement_rowid FOREIGN KEY (fk_knowledgemanagement) REFERENCES llx_knowledgemanagement_knowledgerecord (rowid);
  131. ALTER TABLE llx_product_lot ADD COLUMN barcode varchar(180) DEFAULT NULL;
  132. ALTER TABLE llx_product_lot ADD COLUMN fk_barcode_type integer DEFAULT NULL;
  133. ALTER TABLE llx_projet ADD COLUMN max_attendees integer DEFAULT 0;
  134. ALTER TABLE llx_commande_fournisseur_dispatch ADD COLUMN cost_price double(24,8) DEFAULT 0;
  135. INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (20, '2001', 'Aktiebolag');
  136. INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (20, '2002', 'Publikt aktiebolag (AB publ)');
  137. INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (20, '2003', 'Ekonomisk förening (ek. för.)');
  138. INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (20, '2004', 'Bostadsrättsförening (BRF)');
  139. INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (20, '2005', 'Hyresrättsförening (HRF)');
  140. INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (20, '2006', 'Kooperativ');
  141. INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (20, '2007', 'Enskild firma (EF)');
  142. INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (20, '2008', 'Handelsbolag (HB)');
  143. INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (20, '2009', 'Kommanditbolag (KB)');
  144. INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (20, '2010', 'Enkelt bolag');
  145. INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (20, '2011', 'Ideell förening');
  146. INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (20, '2012', 'Stiftelse');
  147. ALTER TABLE llx_c_holiday_types ADD COLUMN block_if_negative integer NOT NULL DEFAULT 0 AFTER fk_country;
  148. -- START GRH/HRM MODULE
  149. CREATE TABLE llx_hrm_evaluation
  150. (
  151. rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
  152. ref varchar(128) DEFAULT '(PROV)' NOT NULL,
  153. label varchar(255),
  154. description text,
  155. note_public text,
  156. note_private text,
  157. date_creation datetime NOT NULL,
  158. tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  159. fk_user_creat integer NOT NULL,
  160. fk_user_modif integer,
  161. import_key varchar(14),
  162. status smallint NOT NULL,
  163. date_eval date,
  164. fk_user integer NOT NULL,
  165. fk_job integer NOT NULL
  166. ) ENGINE=innodb;
  167. ALTER TABLE llx_hrm_evaluation ADD INDEX idx_hrm_evaluation_rowid (rowid);
  168. ALTER TABLE llx_hrm_evaluation ADD INDEX idx_hrm_evaluation_ref (ref);
  169. ALTER TABLE llx_hrm_evaluation ADD CONSTRAINT llx_hrm_evaluation_fk_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user(rowid);
  170. ALTER TABLE llx_hrm_evaluation ADD INDEX idx_hrm_evaluation_status (status);
  171. create table llx_hrm_evaluation_extrafields
  172. (
  173. rowid integer AUTO_INCREMENT PRIMARY KEY,
  174. tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  175. fk_object integer NOT NULL,
  176. import_key varchar(14) -- import key
  177. ) ENGINE=innodb;
  178. ALTER TABLE llx_hrm_evaluation_extrafields ADD INDEX idx_evaluation_fk_object(fk_object);
  179. CREATE TABLE llx_hrm_evaluationdet
  180. (
  181. -- BEGIN MODULEBUILDER FIELDS
  182. rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
  183. date_creation datetime NOT NULL,
  184. tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  185. fk_user_creat integer NOT NULL,
  186. fk_user_modif integer,
  187. fk_skill integer NOT NULL,
  188. fk_evaluation integer NOT NULL,
  189. rankorder integer NOT NULL,
  190. required_rank integer NOT NULL,
  191. import_key varchar(14)
  192. ) ENGINE=innodb;
  193. ALTER TABLE llx_hrm_evaluationdet ADD INDEX idx_hrm_evaluationdet_rowid (rowid);
  194. ALTER TABLE llx_hrm_evaluationdet ADD CONSTRAINT llx_hrm_evaluationdet_fk_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user(rowid);
  195. ALTER TABLE llx_hrm_evaluationdet ADD INDEX idx_hrm_evaluationdet_fk_skill (fk_skill);
  196. ALTER TABLE llx_hrm_evaluationdet ADD INDEX idx_hrm_evaluationdet_fk_evaluation (fk_evaluation);
  197. create table llx_hrm_evaluationdet_extrafields
  198. (
  199. rowid integer AUTO_INCREMENT PRIMARY KEY,
  200. tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  201. fk_object integer NOT NULL,
  202. import_key varchar(14) -- import key
  203. ) ENGINE=innodb;
  204. ALTER TABLE llx_hrm_evaluationdet_extrafields ADD INDEX idx_evaluationdet_fk_object(fk_object);
  205. CREATE TABLE llx_hrm_job
  206. (
  207. rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
  208. label varchar(255) NOT NULL,
  209. description text,
  210. date_creation datetime NOT NULL,
  211. tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  212. deplacement varchar(255),
  213. note_public text,
  214. note_private text,
  215. fk_user_creat integer,
  216. fk_user_modif integer
  217. ) ENGINE=innodb;
  218. ALTER TABLE llx_hrm_job ADD INDEX idx_hrm_job_rowid (rowid);
  219. ALTER TABLE llx_hrm_job ADD INDEX idx_hrm_job_label (label);
  220. create table llx_hrm_job_extrafields
  221. (
  222. rowid integer AUTO_INCREMENT PRIMARY KEY,
  223. tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  224. fk_object integer NOT NULL,
  225. import_key varchar(14) -- import key
  226. ) ENGINE=innodb;
  227. ALTER TABLE llx_hrm_job_extrafields ADD INDEX idx_job_fk_object(fk_object);
  228. CREATE TABLE llx_hrm_job_user(
  229. rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
  230. -- ref varchar(128) NOT NULL,
  231. description text,
  232. date_creation datetime NOT NULL,
  233. tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  234. fk_contrat integer,
  235. fk_user integer,
  236. fk_job integer NOT NULL,
  237. date_start date,
  238. date_end date,
  239. abort_comment varchar(255),
  240. note_public text,
  241. note_private text,
  242. fk_user_creat integer,
  243. fk_user_modif integer
  244. ) ENGINE=innodb;
  245. ALTER TABLE llx_hrm_job_user ADD COLUMN abort_comment varchar(255);
  246. ALTER TABLE llx_hrm_job_user ADD INDEX idx_hrm_job_user_rowid (rowid);
  247. -- ALTER TABLE llx_hrm_job_user ADD INDEX idx_hrm_job_user_ref (ref);
  248. CREATE TABLE llx_hrm_skill
  249. (
  250. rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
  251. label varchar(255),
  252. description text,
  253. date_creation datetime NOT NULL,
  254. tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  255. fk_user_creat integer NOT NULL,
  256. fk_user_modif integer,
  257. required_level integer NOT NULL,
  258. date_validite integer NOT NULL,
  259. temps_theorique double(24,8) NOT NULL,
  260. skill_type integer NOT NULL,
  261. note_public text,
  262. note_private text
  263. ) ENGINE=innodb;
  264. ALTER TABLE llx_hrm_skill ADD INDEX idx_hrm_skill_rowid (rowid);
  265. ALTER TABLE llx_hrm_skill ADD CONSTRAINT llx_hrm_skill_fk_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user(rowid);
  266. ALTER TABLE llx_hrm_skill ADD INDEX idx_hrm_skill_skill_type (skill_type);
  267. create table llx_hrm_skill_extrafields
  268. (
  269. rowid integer AUTO_INCREMENT PRIMARY KEY,
  270. tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  271. fk_object integer NOT NULL,
  272. import_key varchar(14) -- import key
  273. ) ENGINE=innodb;
  274. ALTER TABLE llx_hrm_skill_extrafields ADD INDEX idx_skill_fk_object(fk_object);
  275. CREATE TABLE llx_hrm_skilldet
  276. (
  277. rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
  278. description text,
  279. fk_user_creat integer NOT NULL,
  280. fk_user_modif integer,
  281. fk_skill integer NOT NULL,
  282. rankorder integer
  283. ) ENGINE=innodb;
  284. ALTER TABLE llx_hrm_skilldet ADD COLUMN rankorder integer NOT NULL DEFAULT '1';
  285. ALTER TABLE llx_hrm_skilldet ADD INDEX idx_hrm_skilldet_rowid (rowid);
  286. ALTER TABLE llx_hrm_skilldet ADD CONSTRAINT llx_hrm_skilldet_fk_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user(rowid);
  287. CREATE TABLE llx_hrm_skillrank
  288. (
  289. rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
  290. fk_skill integer NOT NULL,
  291. rankorder integer NOT NULL,
  292. fk_object integer NOT NULL,
  293. date_creation datetime NOT NULL,
  294. tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  295. fk_user_creat integer NOT NULL,
  296. fk_user_modif integer,
  297. objecttype varchar(128) NOT NULL
  298. ) ENGINE=innodb;
  299. ALTER TABLE llx_hrm_skillrank ADD INDEX idx_hrm_skillrank_rowid (rowid);
  300. ALTER TABLE llx_hrm_skillrank ADD INDEX idx_hrm_skillrank_fk_skill (fk_skill);
  301. ALTER TABLE llx_hrm_skillrank ADD CONSTRAINT llx_hrm_skillrank_fk_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user(rowid);
  302. --END GRH/HRM MODULE
  303. ALTER TABLE llx_c_units ADD COLUMN sortorder smallint AFTER code;
  304. -- Manage accountancy auxiliary account for thirdparties per entity
  305. ALTER TABLE llx_societe_perentity ADD COLUMN accountancy_code_customer varchar(24) AFTER entity; -- equivalent to code_compta in llx_societe
  306. ALTER TABLE llx_societe_perentity ADD COLUMN accountancy_code_supplier varchar(24) AFTER accountancy_code_customer; -- equivalent to code_compta_supplier in llx_societe
  307. ALTER TABLE llx_projet_task ADD COLUMN budget_amount double(24,8) AFTER priority;
  308. -- VMYSQL4.1 INSERT INTO llx_boxes_def (file, entity) SELECT 'box_graph_ticket_by_severity.php', 1 FROM DUAL WHERE NOT EXISTS (SELECT * FROM llx_boxes_def WHERE file = 'box_graph_ticket_by_severity.php' AND entity = 1);
  309. -- VMYSQL4.1 INSERT INTO llx_boxes_def (file, entity) SELECT 'box_graph_nb_ticket_last_x_days.php', 1 FROM DUAL WHERE NOT EXISTS (SELECT * FROM llx_boxes_def WHERE file = 'box_graph_nb_ticket_last_x_days.php' AND entity = 1);
  310. -- VMYSQL4.1 INSERT INTO llx_boxes_def (file, entity) SELECT 'box_graph_nb_tickets_type.php', 1 FROM DUAL WHERE NOT EXISTS (SELECT * FROM llx_boxes_def WHERE file = 'box_graph_nb_tickets_type.php' AND entity = 1);
  311. -- VMYSQL4.1 INSERT INTO llx_boxes_def (file, entity) SELECT 'box_graph_new_vs_close_ticket.php', 1 FROM DUAL WHERE NOT EXISTS (SELECT * FROM llx_boxes_def WHERE file = 'box_graph_new_vs_close_ticket.php' AND entity = 1);
  312. ALTER TABLE llx_user DROP COLUMN jabberid;
  313. ALTER TABLE llx_user DROP COLUMN skype;
  314. ALTER TABLE llx_user DROP COLUMN twitter;
  315. ALTER TABLE llx_user DROP COLUMN facebook;
  316. ALTER TABLE llx_user DROP COLUMN linkedin;
  317. ALTER TABLE llx_user DROP COLUMN instagram;
  318. ALTER TABLE llx_user DROP COLUMN snapchat;
  319. ALTER TABLE llx_user DROP COLUMN googleplus;
  320. ALTER TABLE llx_user DROP COLUMN youtube;
  321. ALTER TABLE llx_user DROP COLUMN whatsapp;
  322. ALTER TABLE llx_adherent DROP COLUMN jabberid;
  323. ALTER TABLE llx_adherent DROP COLUMN skype;
  324. ALTER TABLE llx_adherent DROP COLUMN twitter;
  325. ALTER TABLE llx_adherent DROP COLUMN facebook;
  326. ALTER TABLE llx_adherent DROP COLUMN linkedin;
  327. ALTER TABLE llx_adherent DROP COLUMN instagram;
  328. ALTER TABLE llx_adherent DROP COLUMN snapchat;
  329. ALTER TABLE llx_adherent DROP COLUMN googleplus;
  330. ALTER TABLE llx_adherent DROP COLUMN youtube;
  331. ALTER TABLE llx_adherent DROP COLUMN whatsapp;
  332. ALTER TABLE llx_societe DROP COLUMN jabberid;
  333. ALTER TABLE llx_societe DROP COLUMN skype;
  334. ALTER TABLE llx_societe DROP COLUMN twitter;
  335. ALTER TABLE llx_societe DROP COLUMN facebook;
  336. ALTER TABLE llx_societe DROP COLUMN linkedin;
  337. ALTER TABLE llx_societe DROP COLUMN instagram;
  338. ALTER TABLE llx_societe DROP COLUMN snapchat;
  339. ALTER TABLE llx_societe DROP COLUMN googleplus;
  340. ALTER TABLE llx_societe DROP COLUMN youtube;
  341. ALTER TABLE llx_societe DROP COLUMN whatsapp;
  342. ALTER TABLE llx_socpeople DROP COLUMN jabberid;
  343. ALTER TABLE llx_socpeople DROP COLUMN skype;
  344. ALTER TABLE llx_socpeople DROP COLUMN twitter;
  345. ALTER TABLE llx_socpeople DROP COLUMN facebook;
  346. ALTER TABLE llx_socpeople DROP COLUMN linkedin;
  347. ALTER TABLE llx_socpeople DROP COLUMN instagram;
  348. ALTER TABLE llx_socpeople DROP COLUMN snapchat;
  349. ALTER TABLE llx_socpeople DROP COLUMN googleplus;
  350. ALTER TABLE llx_socpeople DROP COLUMN youtube;
  351. ALTER TABLE llx_socpeople DROP COLUMN whatsapp;
  352. INSERT INTO llx_c_paiement (id,code,libelle,type,active) values (100, 'KLA', 'Klarna', 1, 0);
  353. INSERT INTO llx_c_paiement (id,code,libelle,type,active) values (101, 'SOF', 'Sofort', 1, 0);
  354. INSERT INTO llx_c_paiement (id,code,libelle,type,active) values (102, 'BAN', 'Bancontact', 1, 0);
  355. INSERT INTO llx_c_paiement (id,code,libelle,type,active) values (103, 'IDE', 'iDeal', 1, 0);
  356. INSERT INTO llx_c_paiement (id,code,libelle,type,active) values (104, 'GIR', 'Giropay', 1, 0);
  357. ALTER TABLE llx_paiement_facture ADD COLUMN multicurrency_code varchar(3);
  358. ALTER TABLE llx_paiement_facture ADD COLUMN multicurrency_tx double(24,8) DEFAULT 1;
  359. ALTER TABLE llx_paiement_facture ADD COLUMN multicurrency_amount double(24,8) DEFAULT 0;
  360. ALTER TABLE llx_paiementfourn_facturefourn ADD COLUMN multicurrency_code varchar(3);
  361. ALTER TABLE llx_paiementfourn_facturefourn ADD COLUMN multicurrency_tx double(24,8) DEFAULT 1;
  362. ALTER TABLE llx_paiementfourn_facturefourn ADD COLUMN multicurrency_amount double(24,8) DEFAULT 0;
  363. ALTER TABLE llx_commande_fournisseur MODIFY COLUMN multicurrency_code varchar(3);
  364. ALTER TABLE llx_commande_fournisseurdet MODIFY COLUMN multicurrency_code varchar(3);
  365. ALTER TABLE llx_commande MODIFY COLUMN multicurrency_code varchar(3);
  366. ALTER TABLE llx_commandedet MODIFY COLUMN multicurrency_code varchar(3);
  367. ALTER TABLE llx_contratdet MODIFY COLUMN multicurrency_code varchar(3);
  368. ALTER TABLE llx_expensereport_det MODIFY COLUMN multicurrency_code varchar(3);
  369. ALTER TABLE llx_expensereport MODIFY COLUMN multicurrency_code varchar(3);
  370. ALTER TABLE llx_facture_fourn_det MODIFY COLUMN multicurrency_code varchar(3);
  371. ALTER TABLE llx_facture_fourn MODIFY COLUMN multicurrency_code varchar(3);
  372. ALTER TABLE llx_facture_rec MODIFY COLUMN multicurrency_code varchar(3);
  373. ALTER TABLE llx_facture MODIFY COLUMN multicurrency_code varchar(3);
  374. ALTER TABLE llx_facturedet_rec MODIFY COLUMN multicurrency_code varchar(3);
  375. ALTER TABLE llx_facturedet MODIFY COLUMN multicurrency_code varchar(3);
  376. ALTER TABLE llx_paiement_facture MODIFY COLUMN multicurrency_code varchar(3);
  377. ALTER TABLE llx_paiementfourn_facturefourn MODIFY COLUMN multicurrency_code varchar(3);
  378. ALTER TABLE llx_product_fournisseur_price_log MODIFY COLUMN multicurrency_code varchar(3);
  379. ALTER TABLE llx_product_fournisseur_price MODIFY COLUMN multicurrency_code varchar(3);
  380. ALTER TABLE llx_product_price_by_qty MODIFY COLUMN multicurrency_code varchar(3);
  381. ALTER TABLE llx_product_price MODIFY COLUMN multicurrency_code varchar(3);
  382. ALTER TABLE llx_propal MODIFY COLUMN multicurrency_code varchar(3);
  383. ALTER TABLE llx_propaldet MODIFY COLUMN multicurrency_code varchar(3);
  384. ALTER TABLE llx_societe MODIFY COLUMN multicurrency_code varchar(3);
  385. ALTER TABLE llx_supplier_proposal MODIFY COLUMN multicurrency_code varchar(3);
  386. ALTER TABLE llx_supplier_proposaldet MODIFY COLUMN multicurrency_code varchar(3);
  387. ALTER TABLE llx_propal ADD COLUMN online_sign_ip varchar(48);
  388. ALTER TABLE llx_propal ADD COLUMN online_sign_name varchar(64);
  389. ALTER TABLE llx_entrepot ADD COLUMN warehouse_usage integer DEFAULT 1;
  390. ALTER TABLE llx_session MODIFY COLUMN user_agent VARCHAR(255) NULL;
  391. ALTER TABLE llx_inventorydet ADD COLUMN fk_movement integer NULL;
  392. ALTER TABLE llx_stock_mouvement MODIFY COLUMN origintype varchar(64);
  393. ALTER TABLE llx_intracommreport CHANGE COLUMN period periods varchar(32);
  394. UPDATE llx_rights_def SET perms = 'writeall' WHERE perms = 'writeall_advance' AND module = 'holiday';
  395. INSERT INTO llx_c_action_trigger (code,label,description,elementtype,rang) values ('USER_CREATE','User created','Executed when a user is created','user',301);
  396. INSERT INTO llx_c_action_trigger (code,label,description,elementtype,rang) values ('USER_MODIFY','User update','Executed when a user is updated','user',302);
  397. INSERT INTO llx_c_action_trigger (code,label,description,elementtype,rang) values ('USER_DELETE','User update','Executed when a user is deleted','user',303);
  398. INSERT INTO llx_c_action_trigger (code,label,description,elementtype,rang) values ('USER_NEW_PASSWORD','User update','Executed when a user is change password','user',304);
  399. INSERT INTO llx_c_action_trigger (code,label,description,elementtype,rang) values ('USER_ENABLEDISABLE','User update','Executed when a user is enable or disable','user',305);
  400. INSERT INTO llx_c_action_trigger (code,label,description,elementtype,rang) values ('HOLIDAY_CREATE','Holiday created','Executed when a holiday is created','holiday',800);
  401. INSERT INTO llx_c_action_trigger (code,label,description,elementtype,rang) values ('HOLIDAY_MODIFY','Holiday modified','Executed when a holiday is modified','holiday',801);
  402. INSERT INTO llx_c_action_trigger (code,label,description,elementtype,rang) values ('HOLIDAY_VALIDATE','Holiday validated','Executed when a holiday is validated','holiday',802);
  403. INSERT INTO llx_c_action_trigger (code,label,description,elementtype,rang) values ('HOLIDAY_APPROVE','Holiday aprouved','Executed when a holiday is aprouved','holiday',803);
  404. INSERT INTO llx_c_action_trigger (code,label,description,elementtype,rang) values ('HOLIDAY_CANCEL','Holiday canceled','Executed when a holiday is canceled','holiday',802);
  405. INSERT INTO llx_c_action_trigger (code,label,description,elementtype,rang) values ('HOLIDAY_DELETE','Holiday deleted','Executed when a holiday is deleted','holiday',804);
  406. -- We do not delete old mexican legal forms because they may have been used. User will have to insert the new one manually not inserted because of conflict if he need them.
  407. --DELETE FROM llx_c_forme_juridique WHERE code IN ('15401', '15402', '15403', '15404', '15405', '15406');
  408. INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (154, '15401', '601 - General de Ley Personas Morales', 1);
  409. INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (154, '15402', '603 - Personas Morales con Fines no Lucrativos', 1);
  410. INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (154, '15403', '605 - Sueldos y Salarios e Ingresos Asimilados a Salarios', 1);
  411. INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (154, '15404', '606 - Arrendamiento', 1);
  412. INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (154, '15405', '607 - Régimen de Enajenación o Adquisición de Bienes', 1);
  413. INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (154, '15406', '608 - Demás ingresos', 1);
  414. INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (154, '15407', '610 - Residentes en el Extranjero sin Establecimiento Permanente en México', 1);
  415. INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (154, '15408', '611 - Ingresos por Dividendos (socios y accionistas)', 1);
  416. INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (154, '15409', '612 - Personas Físicas con Actividades Empresariales y Profesionales', 1);
  417. INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (154, '15410', '614 - Ingresos por intereses', 1);
  418. INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (154, '15411', '615 - Régimen de los ingresos por obtención de premios', 1);
  419. INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (154, '15412', '616 - Sin obligaciones fiscales', 1);
  420. INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (154, '15413', '620 - Sociedades Cooperativas de Producción que optan por diferir sus ingresos', 1);
  421. INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (154, '15414', '621 - Incorporación Fiscal', 1);
  422. INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (154, '15415', '622 - Actividades Agrícolas, Ganaderas, Silvícolas y Pesqueras', 1);
  423. INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (154, '15416', '623 - Opcional para Grupos de Sociedades', 1);
  424. INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (154, '15417', '624 - Coordinados', 1);
  425. INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (154, '15418', '625 - Régimen de las Actividades Empresariales con ingresos a través de Plataformas Tecnológicas', 1);
  426. INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (154, '15419', '626 - Régimen Simplificado de Confianza', 1);
  427. -- VMYSQL4.3 ALTER TABLE llx_user MODIFY COLUMN fk_soc integer NULL;
  428. -- VPGSQL8.2 ALTER TABLE llx_user ALTER COLUMN fk_soc DROP NOT NULL;
  429. CREATE TABLE llx_element_tag
  430. (
  431. rowid integer AUTO_INCREMENT PRIMARY KEY,
  432. fk_categorie integer NOT NULL,
  433. fk_element integer NOT NULL,
  434. import_key varchar(14)
  435. )ENGINE=innodb;
  436. ALTER TABLE llx_element_tag ADD COLUMN fk_categorie integer;
  437. ALTER TABLE llx_element_tag ADD COLUMN fk_element integer;
  438. ALTER TABLE llx_element_tag ADD UNIQUE INDEX idx_element_tag_uk (fk_categorie, fk_element);
  439. ALTER TABLE llx_element_tag ADD CONSTRAINT fk_element_tag_categorie_rowid FOREIGN KEY (fk_categorie) REFERENCES llx_categorie (rowid);
  440. -- Add column to help to fix a very critical bug when transferring into accounting bank record of a bank account into another currency.
  441. -- Idea is to update this column manually in v15 with value in currency of company for bank that are not into the main currency and the transfer
  442. -- into accounting will use it in priority if value is not null. The script repair.sql contains the sequence to fix datas in llx_bank.
  443. ALTER TABLE llx_bank ADD COLUMN amount_main_currency double(24,8) NULL;
  444. ALTER TABLE llx_commande_fournisseurdet MODIFY COLUMN ref varchar(128);
  445. ALTER TABLE llx_facture_fourn_det MODIFY COLUMN ref varchar(128);
  446. UPDATE llx_c_tva SET localtax2 = '-19:-15:-9' WHERE localtax2 = '-19' AND localtax2_type = '5' AND fk_pays = 4 AND taux = 21;