From 7c8b1feaebded73a51059ecc935267510566680b Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Wed, 22 Jul 2015 10:57:25 +0200 Subject: [PATCH 1/2] FIX: Change Spanish provinces code to ISO --- .../mysql/data/llx_20_c_departements.sql | 105 +++++++++--------- .../install/mysql/migration/3.7.0-3.8.0.sql | 57 ++++++++++ 2 files changed, 109 insertions(+), 53 deletions(-) diff --git a/htdocs/install/mysql/data/llx_20_c_departements.sql b/htdocs/install/mysql/data/llx_20_c_departements.sql index bc727447abe..76544173bbf 100644 --- a/htdocs/install/mysql/data/llx_20_c_departements.sql +++ b/htdocs/install/mysql/data/llx_20_c_departements.sql @@ -287,59 +287,58 @@ insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,no insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (1401,'NL','',1,'','Newfoundland and Labrador'); -- Provinces Spain (id country=4) -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('01', 419, '', 19, 'ALAVA', 'Álava', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('02', 404, '', 4, 'ALBACETE', 'Albacete', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('03', 411, '', 11, 'ALICANTE', 'Alicante', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('04', 401, '', 1, 'ALMERIA', 'Almería', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('05', 403, '', 3, 'AVILA', 'Avila', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('06', 412, '', 12, 'BADAJOZ', 'Badajoz', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('07', 414, '', 14, 'ISLAS BALEARES', 'Islas Baleares', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('08', 406, '', 6, 'BARCELONA', 'Barcelona', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('09', 403, '', 8, 'BURGOS', 'Burgos', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('10', 412, '', 12, 'CACERES', 'Cáceres', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('11', 401, '', 1, 'CADIZ', 'Cádiz', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('12', 411, '', 11, 'CASTELLON', 'Castellón', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('13', 404, '', 4, 'CIUDAD REAL', 'Ciudad Real', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('14', 401, '', 1, 'CORDOBA', 'Córdoba', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('15', 413, '', 13, 'LA CORUÑA', 'La Coruña', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('16', 404, '', 4, 'CUENCA', 'Cuenca', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('17', 406, '', 6, 'GERONA', 'Gerona', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('18', 401, '', 1, 'GRANADA', 'Granada', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('19', 404, '', 4, 'GUADALAJARA', 'Guadalajara', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('20', 419, '', 19, 'GUIPUZCOA', 'Guipúzcoa', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('21', 401, '', 1, 'HUELVA', 'Huelva', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('22', 402, '', 2, 'HUESCA', 'Huesca', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('23', 401, '', 1, 'JAEN', 'Jaén', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('24', 403, '', 3, 'LEON', 'León', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('25', 406, '', 6, 'LERIDA', 'Lérida', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('26', 415, '', 15, 'LA RIOJA', 'La Rioja', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('27', 413, '', 13, 'LUGO', 'Lugo', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('28', 416, '', 16, 'MADRID', 'Madrid', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('29', 401, '', 1, 'MALAGA', 'Málaga', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('30', 417, '', 17, 'MURCIA', 'Murcia', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('31', 408, '', 8, 'NAVARRA', 'Navarra', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('32', 413, '', 13, 'ORENSE', 'Orense', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('33', 418, '', 18, 'ASTURIAS', 'Asturias', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('34', 403, '', 3, 'PALENCIA', 'Palencia', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('35', 405, '', 5, 'LAS PALMAS', 'Las Palmas', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('36', 413, '', 13, 'PONTEVEDRA', 'Pontevedra', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('37', 403, '', 3, 'SALAMANCA', 'Salamanca', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('38', 405, '', 5, 'STA. CRUZ DE TENERIFE', 'Sta. Cruz de Tenerife', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('39', 410, '', 10, 'CANTABRIA', 'Cantabria', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('40', 403, '', 3, 'SEGOVIA', 'Segovia', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('41', 401, '', 1, 'SEVILLA', 'Sevilla', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('42', 403, '', 3, 'SORIA', 'Soria', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('43', 406, '', 6, 'TARRAGONA', 'Tarragona', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('44', 402, '', 2, 'TERUEL', 'Teruel', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('45', 404, '', 5, 'TOLEDO', 'Toledo', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('46', 411, '', 11, 'VALENCIA', 'Valencia', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('47', 403, '', 3, 'VALLADOLID', 'Valladolid', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('48', 419, '', 19, 'VIZCAYA', 'Vizcaya', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('49', 403, '', 3, 'ZAMORA', 'Zamora', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('50', 402, '', 1, 'ZARAGOZA', 'Zaragoza', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('51', 407, '', 7, 'CEUTA', 'Ceuta', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('52', 409, '', 9, 'MELILLA', 'Melilla', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('53', 420, '', 20, 'OTROS', 'Otros', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('VI', 419, '', 19, 'ALAVA', 'Álava', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('AB', 404, '', 4, 'ALBACETE', 'Albacete', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('A', 411, '', 11, 'ALICANTE', 'Alicante', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('AL', 401, '', 1, 'ALMERIA', 'Almería', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('AV', 403, '', 3, 'AVILA', 'Avila', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('BA', 412, '', 12, 'BADAJOZ', 'Badajoz', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('PM', 414, '', 14, 'ISLAS BALEARES', 'Islas Baleares', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('B', 406, '', 6, 'BARCELONA', 'Barcelona', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('BU', 403, '', 8, 'BURGOS', 'Burgos', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('CC', 412, '', 12, 'CACERES', 'Cáceres', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('CA', 401, '', 1, 'CADIZ', 'Cádiz', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('CS', 411, '', 11, 'CASTELLON', 'Castellón', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('CR', 404, '', 4, 'CIUDAD REAL', 'Ciudad Real', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('CO', 401, '', 1, 'CORDOBA', 'Córdoba', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('C', 413, '', 13, 'LA CORUÑA', 'La Coruña', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('CU', 404, '', 4, 'CUENCA', 'Cuenca', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('GI', 406, '', 6, 'GERONA', 'Gerona', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('GR', 401, '', 1, 'GRANADA', 'Granada', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('GU', 404, '', 4, 'GUADALAJARA', 'Guadalajara', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('SS', 419, '', 19, 'GUIPUZCOA', 'Guipúzcoa', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('H', 401, '', 1, 'HUELVA', 'Huelva', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('HU', 402, '', 2, 'HUESCA', 'Huesca', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('J', 401, '', 1, 'JAEN', 'Jaén', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('LE', 403, '', 3, 'LEON', 'León', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('L', 406, '', 6, 'LERIDA', 'Lérida', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('LO', 415, '', 15, 'LA RIOJA', 'La Rioja', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('LU', 413, '', 13, 'LUGO', 'Lugo', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('M', 416, '', 16, 'MADRID', 'Madrid', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('MA', 401, '', 1, 'MALAGA', 'Málaga', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('MU', 417, '', 17, 'MURCIA', 'Murcia', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('NA', 408, '', 8, 'NAVARRA', 'Navarra', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('OR', 413, '', 13, 'ORENSE', 'Orense', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('O', 418, '', 18, 'ASTURIAS', 'Asturias', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('P', 403, '', 3, 'PALENCIA', 'Palencia', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('GC', 405, '', 5, 'LAS PALMAS', 'Las Palmas', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('PO', 413, '', 13, 'PONTEVEDRA', 'Pontevedra', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('SA', 403, '', 3, 'SALAMANCA', 'Salamanca', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('TF', 405, '', 5, 'STA. CRUZ DE TENERIFE', 'Sta. Cruz de Tenerife', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('S', 410, '', 10, 'CANTABRIA', 'Cantabria', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('SG', 403, '', 3, 'SEGOVIA', 'Segovia', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('SE', 401, '', 1, 'SEVILLA', 'Sevilla', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('SO', 403, '', 3, 'SORIA', 'Soria', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('T', 406, '', 6, 'TARRAGONA', 'Tarragona', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('TE', 402, '', 2, 'TERUEL', 'Teruel', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('TO', 404, '', 5, 'TOLEDO', 'Toledo', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('V', 411, '', 11, 'VALENCIA', 'Valencia', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('VA', 403, '', 3, 'VALLADOLID', 'Valladolid', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('BI', 419, '', 19, 'VIZCAYA', 'Vizcaya', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('ZA', 403, '', 3, 'ZAMORA', 'Zamora', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('Z', 402, '', 1, 'ZARAGOZA', 'Zaragoza', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('CE', 407, '', 7, 'CEUTA', 'Ceuta', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('ML', 409, '', 9, 'MELILLA', 'Melilla', 1); -- Provinces Germany (id country=5) INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (501,'BW','BADEN-WÜRTTEMBERG','Baden-Württemberg',1); diff --git a/htdocs/install/mysql/migration/3.7.0-3.8.0.sql b/htdocs/install/mysql/migration/3.7.0-3.8.0.sql index 3bd8c282c38..b87a4fdb680 100755 --- a/htdocs/install/mysql/migration/3.7.0-3.8.0.sql +++ b/htdocs/install/mysql/migration/3.7.0-3.8.0.sql @@ -729,3 +729,60 @@ INSERT INTO llx_c_lead_status(rowid,code,label,position,percent,active) VALUES ( DELETE FROM llx_c_action_trigger where code = 'PROPAL_CLASSIFYBILLED'; DELETE FROM llx_c_action_trigger where code = 'FICHINTER_CLASSIFYBILLED'; +-- Spain provinces to ISO codes +UPDATE llx_c_departements SET code_departement='VI' WHERE ncc='ALAVA' AND fk_region=419; +UPDATE llx_c_departements SET code_departement='AB' WHERE ncc='ALBACETE' AND fk_region=404; +UPDATE llx_c_departements SET code_departement='A' WHERE ncc='ALICANTE' AND fk_region=411; +UPDATE llx_c_departements SET code_departement='AL' WHERE ncc='ALMERIA' AND fk_region=401; +UPDATE llx_c_departements SET code_departement='AV' WHERE ncc='AVILA' AND fk_region=403; +UPDATE llx_c_departements SET code_departement='BA' WHERE ncc='BADAJOZ' AND fk_region=412; +UPDATE llx_c_departements SET code_departement='PM' WHERE ncc='ISLAS BALEARES' AND fk_region=414; +UPDATE llx_c_departements SET code_departement='B' WHERE ncc='BARCELONA' AND fk_region=406; +UPDATE llx_c_departements SET code_departement='BU' WHERE ncc='BURGOS' AND fk_region=403; +UPDATE llx_c_departements SET code_departement='CC' WHERE ncc='CACERES' AND fk_region=412; +UPDATE llx_c_departements SET code_departement='CA' WHERE ncc='CADIZ' AND fk_region=401; +UPDATE llx_c_departements SET code_departement='CS' WHERE ncc='CASTELLON' AND fk_region=411; +UPDATE llx_c_departements SET code_departement='CR' WHERE ncc='CIUDAD REAL' AND fk_region=404; +UPDATE llx_c_departements SET code_departement='CO' WHERE ncc='CORDOBA' AND fk_region=401; +UPDATE llx_c_departements SET code_departement='C' WHERE ncc='LA CORUÑA' AND fk_region=413; +UPDATE llx_c_departements SET code_departement='CU' WHERE ncc='CUENCA' AND fk_region=404; +UPDATE llx_c_departements SET code_departement='GI' WHERE ncc='GERONA' AND fk_region=406; +UPDATE llx_c_departements SET code_departement='GR' WHERE ncc='GRANADA' AND fk_region=401; +UPDATE llx_c_departements SET code_departement='GU' WHERE ncc='GUADALAJARA' AND fk_region=404; +UPDATE llx_c_departements SET code_departement='SS' WHERE ncc='GUIPUZCOA' AND fk_region=419; +UPDATE llx_c_departements SET code_departement='H' WHERE ncc='HUELVA' AND fk_region=401; +UPDATE llx_c_departements SET code_departement='HU' WHERE ncc='HUESCA' AND fk_region=402; +UPDATE llx_c_departements SET code_departement='J' WHERE ncc='JAEN' AND fk_region=401; +UPDATE llx_c_departements SET code_departement='LE' WHERE ncc='LEON' AND fk_region=403; +UPDATE llx_c_departements SET code_departement='L' WHERE ncc='LERIDA' AND fk_region=406; +UPDATE llx_c_departements SET code_departement='LO' WHERE ncc='LA RIOJA' AND fk_region=415; +UPDATE llx_c_departements SET code_departement='LU' WHERE ncc='LUGO' AND fk_region=413; +UPDATE llx_c_departements SET code_departement='M' WHERE ncc='MADRID' AND fk_region=416; +UPDATE llx_c_departements SET code_departement='MA' WHERE ncc='MALAGA' AND fk_region=401; +UPDATE llx_c_departements SET code_departement='MU' WHERE ncc='MURCIA' AND fk_region=417; +UPDATE llx_c_departements SET code_departement='NA' WHERE ncc='NAVARRA' AND fk_region=408; +UPDATE llx_c_departements SET code_departement='OR' WHERE ncc='ORENSE' AND fk_region=413; +UPDATE llx_c_departements SET code_departement='VI' WHERE ncc='ALAVA' AND fk_region=419; +UPDATE llx_c_departements SET code_departement='O' WHERE ncc='ASTURIAS' AND fk_region=418; +UPDATE llx_c_departements SET code_departement='P' WHERE ncc='PALENCIA' AND fk_region=403; +UPDATE llx_c_departements SET code_departement='GC' WHERE ncc='LAS PALMAS' AND fk_region=405; +UPDATE llx_c_departements SET code_departement='PO' WHERE ncc='PONTEVEDRA' AND fk_region=413; +UPDATE llx_c_departements SET code_departement='SA' WHERE ncc='SALAMANCA' AND fk_region=403; +UPDATE llx_c_departements SET code_departement='TF' WHERE ncc='STA. CRUZ DE TENERIFE' AND fk_region=405; +UPDATE llx_c_departements SET code_departement='S' WHERE ncc='CANTABRIA' AND fk_region=410; +UPDATE llx_c_departements SET code_departement='SG' WHERE ncc='SEGOVIA' AND fk_region=403; +UPDATE llx_c_departements SET code_departement='SE' WHERE ncc='SEVILLA' AND fk_region=401; +UPDATE llx_c_departements SET code_departement='SO' WHERE ncc='SORIA' AND fk_region=403; +UPDATE llx_c_departements SET code_departement='T' WHERE ncc='TARRAGONA' AND fk_region=406; +UPDATE llx_c_departements SET code_departement='TE' WHERE ncc='TERUEL' AND fk_region=402; +UPDATE llx_c_departements SET code_departement='TO' WHERE ncc='TOLEDO' AND fk_region=404; +UPDATE llx_c_departements SET code_departement='V' WHERE ncc='VALENCIA' AND fk_region=411; +UPDATE llx_c_departements SET code_departement='VA' WHERE ncc='VALLADOLID' AND fk_region=403; +UPDATE llx_c_departements SET code_departement='BI' WHERE ncc='VIZCAYA' AND fk_region=419; +UPDATE llx_c_departements SET code_departement='ZA' WHERE ncc='ZAMORA' AND fk_region=403; +UPDATE llx_c_departements SET code_departement='Z' WHERE ncc='ZARAGOZA' AND fk_region=402; +UPDATE llx_c_departements SET code_departement='VI' WHERE ncc='ALAVA' AND fk_region=419; +UPDATE llx_c_departements SET code_departement='CE' WHERE ncc='CEUTA' AND fk_region=407; +UPDATE llx_c_departements SET code_departement='ML' WHERE ncc='MELILLA' AND fk_region=409; +DELETE FROM llx_c_departements WHERE nnc='OTROS' AND fk_region=420; +DELETE FROM llx_c_regions WHERE code_region=420 and fk_pays=4; \ No newline at end of file From 16ae9633e53815d1f77ea01591d472bc47bc1819 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Wed, 22 Jul 2015 11:26:20 +0200 Subject: [PATCH 2/2] FIX: Change Spanish provinces code to ISO --- htdocs/install/mysql/migration/3.7.0-3.8.0.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/3.7.0-3.8.0.sql b/htdocs/install/mysql/migration/3.7.0-3.8.0.sql index b87a4fdb680..6d45efa9052 100755 --- a/htdocs/install/mysql/migration/3.7.0-3.8.0.sql +++ b/htdocs/install/mysql/migration/3.7.0-3.8.0.sql @@ -784,5 +784,5 @@ UPDATE llx_c_departements SET code_departement='Z' WHERE ncc='ZARAGOZA' AND fk_r UPDATE llx_c_departements SET code_departement='VI' WHERE ncc='ALAVA' AND fk_region=419; UPDATE llx_c_departements SET code_departement='CE' WHERE ncc='CEUTA' AND fk_region=407; UPDATE llx_c_departements SET code_departement='ML' WHERE ncc='MELILLA' AND fk_region=409; -DELETE FROM llx_c_departements WHERE nnc='OTROS' AND fk_region=420; +DELETE FROM llx_c_departements WHERE ncc='OTROS' AND fk_region=420; DELETE FROM llx_c_regions WHERE code_region=420 and fk_pays=4; \ No newline at end of file