From 7899cf230eb91247ce9f932a3a37dc2f1198c8c3 Mon Sep 17 00:00:00 2001 From: robert Date: Wed, 24 Apr 2024 09:05:29 +0200 Subject: [PATCH 1/6] feat: refs #7039 country --- db/routines/vn/procedures/agencyVolume.sql | 2 +- db/routines/vn/procedures/client_getRisk.sql | 2 +- db/routines/vn/procedures/creditInsurance_getRisk.sql | 2 +- db/routines/vn/procedures/stockBuyed_add.sql | 2 +- db/routines/vn/views/saleVolume_Today_VNH.sql | 2 +- db/routines/vn2008/views/Paises.sql | 2 +- db/versions/11013-orangeGerbera/00-firstScript.sql | 1 + 7 files changed, 7 insertions(+), 6 deletions(-) create mode 100644 db/versions/11013-orangeGerbera/00-firstScript.sql diff --git a/db/routines/vn/procedures/agencyVolume.sql b/db/routines/vn/procedures/agencyVolume.sql index 176b77726..ef47834ba 100644 --- a/db/routines/vn/procedures/agencyVolume.sql +++ b/db/routines/vn/procedures/agencyVolume.sql @@ -9,7 +9,7 @@ BEGIN DECLARE vEnded DATETIME DEFAULT util.dayEnd(util.VN_CURDATE()); SELECT ag.id agency_id, - CONCAT(RPAD(c.country, 16,' _') ,' ',ag.name) Agencia, + CONCAT(RPAD(c.name, 16,' _') ,' ',ag.name) Agencia, COUNT(*) expediciones, SUM(t.packages) Bultos, SUM(tpe.boxes) Faltan diff --git a/db/routines/vn/procedures/client_getRisk.sql b/db/routines/vn/procedures/client_getRisk.sql index 7fbade303..106284c2f 100644 --- a/db/routines/vn/procedures/client_getRisk.sql +++ b/db/routines/vn/procedures/client_getRisk.sql @@ -22,7 +22,7 @@ BEGIN c.credit, CAST(r.risk AS DECIMAL (10,2)) risk, CAST(c.credit - r.risk AS DECIMAL (10,2)) difference, - co.country + co.name country FROM client c JOIN tmp.risk r ON r.clientFk = c.id JOIN country co ON co.id = c.countryFk diff --git a/db/routines/vn/procedures/creditInsurance_getRisk.sql b/db/routines/vn/procedures/creditInsurance_getRisk.sql index 8ddb9d721..eccc37ca1 100644 --- a/db/routines/vn/procedures/creditInsurance_getRisk.sql +++ b/db/routines/vn/procedures/creditInsurance_getRisk.sql @@ -27,7 +27,7 @@ BEGIN cac.invoiced billedAnnually, c.dueDay, cgd.grade, - c2.country + c2.name country FROM tmp.clientGetDebt cgd LEFT JOIN tmp.risk r ON r.clientFk = cgd.clientFk JOIN client c ON c.id = cgd.clientFk diff --git a/db/routines/vn/procedures/stockBuyed_add.sql b/db/routines/vn/procedures/stockBuyed_add.sql index bddb720a5..1fff1484c 100644 --- a/db/routines/vn/procedures/stockBuyed_add.sql +++ b/db/routines/vn/procedures/stockBuyed_add.sql @@ -43,7 +43,7 @@ BEGIN INSERT INTO stockBuyed(buyed, dated, description) SELECT SUM(ic.cm3 * ito.quantity / vc.palletM3 / 1000000), vDated, - IF(c.code = 'ES', p.name, c.country) destiny + IF(c.code = 'ES', p.name, c.name) destiny FROM itemTicketOut ito JOIN ticket t ON t.id = ito.ticketFk JOIN `address` a ON a.id = t.addressFk diff --git a/db/routines/vn/views/saleVolume_Today_VNH.sql b/db/routines/vn/views/saleVolume_Today_VNH.sql index 29b921bcb..c36779146 100644 --- a/db/routines/vn/views/saleVolume_Today_VNH.sql +++ b/db/routines/vn/views/saleVolume_Today_VNH.sql @@ -3,7 +3,7 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` VIEW `vn`.`saleVolume_Today_VNH` AS SELECT `t`.`nickname` AS `Cliente`, `p`.`name` AS `Provincia`, - `c`.`country` AS `Pais`, + `c`.`name` AS `Pais`, cast(sum(`sv`.`volume`) AS decimal(5, 1)) AS `volume` FROM ( ( diff --git a/db/routines/vn2008/views/Paises.sql b/db/routines/vn2008/views/Paises.sql index ea7172dff..99d2835f0 100644 --- a/db/routines/vn2008/views/Paises.sql +++ b/db/routines/vn2008/views/Paises.sql @@ -2,7 +2,7 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `vn2008`.`Paises` AS SELECT `c`.`id` AS `Id`, - `c`.`country` AS `Pais`, + `c`.`name` AS `Pais`, `c`.`CEE` AS `CEE`, `c`.`isUeeMember` AS `isUeeMember`, `c`.`code` AS `Codigo`, diff --git a/db/versions/11013-orangeGerbera/00-firstScript.sql b/db/versions/11013-orangeGerbera/00-firstScript.sql new file mode 100644 index 000000000..371c2c358 --- /dev/null +++ b/db/versions/11013-orangeGerbera/00-firstScript.sql @@ -0,0 +1 @@ +-- Place your SQL code here -- 2.40.1 From a27e06e8ff67606145f02ea4cf9c9fae8aa795ed Mon Sep 17 00:00:00 2001 From: robert Date: Wed, 24 Apr 2024 09:08:19 +0200 Subject: [PATCH 2/6] feat: refs #7039 country --- db/versions/11013-orangeGerbera/00-firstScript.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/db/versions/11013-orangeGerbera/00-firstScript.sql b/db/versions/11013-orangeGerbera/00-firstScript.sql index 371c2c358..a3dac2170 100644 --- a/db/versions/11013-orangeGerbera/00-firstScript.sql +++ b/db/versions/11013-orangeGerbera/00-firstScript.sql @@ -1 +1,2 @@ -- Place your SQL code here +ALTER TABLE vn.country CHANGE country name varchar(25) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL; -- 2.40.1 From ffe56edc9c52ffda2e194d8e98b05f42d8b4169d Mon Sep 17 00:00:00 2001 From: robert Date: Wed, 24 Apr 2024 09:24:42 +0200 Subject: [PATCH 3/6] feat: refs #7039 country --- db/dump/fixtures.before.sql | 2 +- db/routines/vn/triggers/country_afterInsert.sql | 7 +++++-- db/routines/vn/triggers/country_afterUpdate.sql | 4 ++-- db/routines/vn/triggers/country_beforeInsert.sql | 2 +- db/versions/11013-orangeGerbera/00-firstScript.sql | 14 ++++++++++++++ 5 files changed, 23 insertions(+), 6 deletions(-) diff --git a/db/dump/fixtures.before.sql b/db/dump/fixtures.before.sql index ff58af2e2..4782c5194 100644 --- a/db/dump/fixtures.before.sql +++ b/db/dump/fixtures.before.sql @@ -162,7 +162,7 @@ INSERT INTO `vn`.`currency`(`id`, `code`, `name`, `ratio`) (3, 'GBP', 'Libra', 1), (4, 'JPY', 'Yen Japones', 1); -INSERT INTO `vn`.`country`(`id`, `country`, `isUeeMember`, `code`, `currencyFk`, `ibanLength`, `continentFk`, `hasDailyInvoice`, `CEE`) +INSERT INTO `vn`.`country`(`id`, `name`, `isUeeMember`, `code`, `currencyFk`, `ibanLength`, `continentFk`, `hasDailyInvoice`, `CEE`) VALUES (1, 'España', 1, 'ES', 1, 24, 4, 0, 1), (2, 'Italia', 1, 'IT', 1, 27, 4, 0, 1), diff --git a/db/routines/vn/triggers/country_afterInsert.sql b/db/routines/vn/triggers/country_afterInsert.sql index 0a7e5dc00..69294a9d5 100644 --- a/db/routines/vn/triggers/country_afterInsert.sql +++ b/db/routines/vn/triggers/country_afterInsert.sql @@ -5,14 +5,17 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`country_afterInsert` BEGIN UPDATE sage.Naciones SET countryFk = NEW.id - WHERE Nacion = NEW.country; + WHERE Nacion = NEW.name; IF ROW_COUNT() = 0 THEN CALL mail_insert( 'cau@verdnatura.es', NULL, 'Actualizar tabla sage.Naciones', - CONCAT('Se ha insertado un nuevo país en la tabla vn.conuntry. Para el correcto funcionamiento del sistema \n\t\t\t\tde contabilidad es necesario actualizar la columna sage.Naciones.countryFk con el valor del nuevo país. \n\t\t\t Hay que buscar el nuevo país: ', NEW.country, ' en la tabla sage.Naciones y actualizar el campo sage.Naciones.countryFk con el valor ', NEW.id) + CONCAT('Se ha insertado un nuevo país en la tabla vn.conuntry. + Para el correcto funcionamiento del sistema \n\t\t\t\tde contabilidad es necesario actualizar la columna + sage.Naciones.countryFk con el valor del nuevo país. \n\t\t\t Hay que buscar el nuevo país: ', NEW.name, + ' en la tabla sage.Naciones y actualizar el campo sage.Naciones.countryFk con el valor ', NEW.id) ); END IF; END$$ diff --git a/db/routines/vn/triggers/country_afterUpdate.sql b/db/routines/vn/triggers/country_afterUpdate.sql index 6afa2fd48..a38994735 100644 --- a/db/routines/vn/triggers/country_afterUpdate.sql +++ b/db/routines/vn/triggers/country_afterUpdate.sql @@ -3,8 +3,8 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`country_afterUpdate` AFTER UPDATE ON `country` FOR EACH ROW BEGIN - IF !(OLD.country <=> NEW.country) THEN - UPDATE zoneGeo SET `name` = NEW.country + IF !(OLD.name <=> NEW.name) THEN + UPDATE zoneGeo SET `name` = NEW.name WHERE id = NEW.geoFk; END IF; END$$ diff --git a/db/routines/vn/triggers/country_beforeInsert.sql b/db/routines/vn/triggers/country_beforeInsert.sql index 26e0235ce..5ba5b832d 100644 --- a/db/routines/vn/triggers/country_beforeInsert.sql +++ b/db/routines/vn/triggers/country_beforeInsert.sql @@ -3,6 +3,6 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`country_beforeInsert` BEFORE INSERT ON `country` FOR EACH ROW BEGIN - SET NEW.geoFk = zoneGeo_new('country', NEW.country, NULL); + SET NEW.geoFk = zoneGeo_new('country', NEW.name, NULL); END$$ DELIMITER ; diff --git a/db/versions/11013-orangeGerbera/00-firstScript.sql b/db/versions/11013-orangeGerbera/00-firstScript.sql index a3dac2170..37628c1a2 100644 --- a/db/versions/11013-orangeGerbera/00-firstScript.sql +++ b/db/versions/11013-orangeGerbera/00-firstScript.sql @@ -1,2 +1,16 @@ -- Place your SQL code here ALTER TABLE vn.country CHANGE country name varchar(25) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL; + +CREATE OR REPLACE DEFINER=`root`@`localhost` + SQL SECURITY DEFINER + VIEW `vn2008`.`Paises` +AS SELECT `c`.`id` AS `Id`, + `c`.`name` AS `Pais`, + `c`.`CEE` AS `CEE`, + `c`.`isUeeMember` AS `isUeeMember`, + `c`.`code` AS `Codigo`, + `c`.`currencyFk` AS `Id_Moneda`, + `c`.`geoFk` AS `geoFk`, + `c`.`ibanLength` AS `ibanLength`, + `c`.`hasDailyInvoice` AS `hasDailyInvoice` +FROM `vn`.`country` `c` -- 2.40.1 From 8153a526cecb80110e51e04ff4bda61f1446237c Mon Sep 17 00:00:00 2001 From: robert Date: Thu, 25 Apr 2024 12:35:21 +0200 Subject: [PATCH 4/6] feat: refs #7039 country-name --- back/methods/postcode/filter.js | 4 ++-- back/models/country.json | 2 +- e2e/tests.js | 4 ++-- front/salix/components/bank-entity/index.html | 2 +- .../client/back/methods/client/extendedListFilter.js | 2 +- modules/client/back/methods/defaulter/filter.js | 2 +- modules/client/front/address/create/index.html | 6 +++--- modules/client/front/address/edit/index.html | 6 +++--- modules/client/front/address/index/index.html | 2 +- modules/client/front/create/index.html | 8 ++++---- modules/client/front/fiscal-data/index.html | 10 +++++----- modules/client/front/summary/index.html | 2 +- .../back/methods/invoiceOut/negativeBases.js | 2 +- modules/item/front/summary/index.html | 2 +- modules/item/front/tax/index.html | 2 +- modules/route/back/methods/route/getExternalCmrs.js | 2 +- modules/supplier/front/address/create/index.html | 6 +++--- modules/supplier/front/address/edit/index.html | 6 +++--- modules/supplier/front/fiscal-data/index.html | 10 +++++----- modules/supplier/front/summary/index.html | 2 +- modules/worker/front/create/index.html | 6 +++--- modules/zone/front/delivery-days/index.html | 2 +- .../templates/reports/campaign-metrics/sql/client.sql | 2 +- .../reports/claim-pickup-order/sql/client.sql | 2 +- .../reports/client-debt-statement/sql/client.sql | 2 +- print/templates/reports/cmr/sql/data.sql | 8 ++++---- .../reports/incoterms-authorization/sql/client.sql | 2 +- print/templates/reports/letter-debtor/sql/client.sql | 2 +- print/templates/reports/sepa-core/sql/client.sql | 2 +- print/templates/reports/sepa-core/sql/supplier.sql | 2 +- .../reports/supplier-campaign-metrics/sql/supplier.sql | 2 +- 31 files changed, 57 insertions(+), 57 deletions(-) diff --git a/back/methods/postcode/filter.js b/back/methods/postcode/filter.js index 4c3fc0cd3..cc0747961 100644 --- a/back/methods/postcode/filter.js +++ b/back/methods/postcode/filter.js @@ -45,7 +45,7 @@ module.exports = Self => { {'pc.code': {like: `%${value}%`}}, {'t.name': {like: `%${value}%`}}, {'p.name': {like: `%${value}%`}}, - {'c.country': {like: `%${value}%`}} + {'c.name': {like: `%${value}%`}} ] }; } @@ -62,7 +62,7 @@ module.exports = Self => { pc.code, t.name as town, p.name as province, - c.country + c.name as country FROM postCode pc JOIN town t on t.id = pc.townFk diff --git a/back/models/country.json b/back/models/country.json index fd540d819..a4c74d330 100644 --- a/back/models/country.json +++ b/back/models/country.json @@ -13,7 +13,7 @@ "id": true, "description": "Identifier" }, - "country": { + "name": { "type": "string", "required": true }, diff --git a/e2e/tests.js b/e2e/tests.js index 829056f4c..d57028518 100644 --- a/e2e/tests.js +++ b/e2e/tests.js @@ -23,8 +23,8 @@ async function test() { const opts = getopts(process.argv.slice(2), { boolean: ['show'] }); - if (opts.show) - process.env.E2E_SHOW = true; + // if (opts.show) + process.env.E2E_SHOW = true; console.log('Building and running DB container.'); const myt = new Myt(); diff --git a/front/salix/components/bank-entity/index.html b/front/salix/components/bank-entity/index.html index 211b77317..6ce073f1a 100644 --- a/front/salix/components/bank-entity/index.html +++ b/front/salix/components/bank-entity/index.html @@ -28,7 +28,7 @@ ng-model="$ctrl.data.countryFk" url="Countries" fields="['id', 'country', 'code']" - show-field="country" + show-field="name" value-field="id" label="Country"> diff --git a/modules/client/back/methods/client/extendedListFilter.js b/modules/client/back/methods/client/extendedListFilter.js index 27bbe2a35..b37960efb 100644 --- a/modules/client/back/methods/client/extendedListFilter.js +++ b/modules/client/back/methods/client/extendedListFilter.js @@ -123,7 +123,7 @@ module.exports = Self => { c.hasLcr, c.hasCoreVnl, ct.id AS countryFk, - ct.country, + ct.name AS country, p.id AS provinceFk, p.name AS province, u.id AS salesPersonFk, diff --git a/modules/client/back/methods/defaulter/filter.js b/modules/client/back/methods/defaulter/filter.js index 220cb957b..8c8f8e059 100644 --- a/modules/client/back/methods/defaulter/filter.js +++ b/modules/client/back/methods/defaulter/filter.js @@ -69,7 +69,7 @@ module.exports = Self => { uw.name workerName, c.creditInsurance, d.defaulterSinced, - cn.country, + cn.name AS country, c.countryFk, pm.name payMethod FROM vn.defaulter d diff --git a/modules/client/front/address/create/index.html b/modules/client/front/address/create/index.html index 20e7b38e1..cd2be39c9 100644 --- a/modules/client/front/address/create/index.html +++ b/modules/client/front/address/create/index.html @@ -61,7 +61,7 @@ rule> {{code}} - {{town.name}} ({{town.province.name}}, - {{town.province.country.country}}) + {{town.province.country.name}}) {{name}}, {{province.name}} - ({{province.country.country}}) + ({{province.country.name}}) - {{name}} ({{country.country}}) + {{name}} ({{country.name}}) diff --git a/modules/client/front/address/edit/index.html b/modules/client/front/address/edit/index.html index e6b1dc71e..4bab3aeae 100644 --- a/modules/client/front/address/edit/index.html +++ b/modules/client/front/address/edit/index.html @@ -74,7 +74,7 @@ rule> {{code}} - {{town.name}} ({{town.province.name}}, - {{town.province.country.country}}) + {{town.province.country.name}}) {{name}}, {{province.name}} - ({{province.country.country}}) + ({{province.country.name}}) - {{name}} ({{country.country}}) + {{name}} ({{country.name}}) diff --git a/modules/client/front/address/index/index.html b/modules/client/front/address/index/index.html index ef3da4051..8ef423213 100644 --- a/modules/client/front/address/index/index.html +++ b/modules/client/front/address/index/index.html @@ -50,7 +50,7 @@ {{::address.postalCode}} - {{::address.city}}, {{::address.province.name}}, - {{::address.province.country.country}} + {{::address.province.country.name}}
{{::address.phone}}, diff --git a/modules/client/front/create/index.html b/modules/client/front/create/index.html index b5c23ecff..abd974cbf 100644 --- a/modules/client/front/create/index.html +++ b/modules/client/front/create/index.html @@ -66,7 +66,7 @@ rule> {{code}} - {{town.name}} ({{town.province.name}}, - {{town.province.country.country}}) + {{town.province.country.name}}) {{name}}, {{province.name}} - ({{province.country.country}}) + ({{province.country.name}}) @@ -101,14 +101,14 @@ url="Provinces/location" fields="['id', 'name', 'countryFk']" rule> - {{name}} ({{country.country}}) + {{name}} ({{country.name}}) + show-field="name"> diff --git a/modules/client/front/fiscal-data/index.html b/modules/client/front/fiscal-data/index.html index c2bf86f70..c366c8ca3 100644 --- a/modules/client/front/fiscal-data/index.html +++ b/modules/client/front/fiscal-data/index.html @@ -16,7 +16,7 @@ auto-load="true" url="Countries" data="countries" - order="country"> + order="name"> {{code}} - {{town.name}} ({{town.province.name}}, - {{town.province.country.country}}) + {{town.province.country.name}}) {{name}}, {{province.name}} - ({{province.country.country}}) + ({{province.country.name}}) @@ -126,14 +126,14 @@ show-field="name" value-field="id" rule> - {{name}} ({{country.country}}) + {{name}} ({{country.name}}) diff --git a/modules/client/front/summary/index.html b/modules/client/front/summary/index.html index a42e192d0..3a46a4959 100644 --- a/modules/client/front/summary/index.html +++ b/modules/client/front/summary/index.html @@ -104,7 +104,7 @@ value="{{$ctrl.summary.province.name}}"> + value="{{$ctrl.summary.country.name}}"> diff --git a/modules/invoiceOut/back/methods/invoiceOut/negativeBases.js b/modules/invoiceOut/back/methods/invoiceOut/negativeBases.js index fc8830885..2dfdf1556 100644 --- a/modules/invoiceOut/back/methods/invoiceOut/negativeBases.js +++ b/modules/invoiceOut/back/methods/invoiceOut/negativeBases.js @@ -59,7 +59,7 @@ module.exports = Self => { `CREATE OR REPLACE TEMPORARY TABLE tmp.filter ENGINE = MEMORY SELECT co.code company, - cou.country, + cou.name AS country, c.id clientId, c.socialName clientSocialName, u.nickname workerSocialName, diff --git a/modules/item/front/summary/index.html b/modules/item/front/summary/index.html index 5fe84591f..13c671d29 100644 --- a/modules/item/front/summary/index.html +++ b/modules/item/front/summary/index.html @@ -181,7 +181,7 @@ ng-show="!$ctrl.isBuyer && !$ctrl.isAdministrative"> Tax - diff --git a/modules/item/front/tax/index.html b/modules/item/front/tax/index.html index e993f974f..78858704f 100644 --- a/modules/item/front/tax/index.html +++ b/modules/item/front/tax/index.html @@ -15,7 +15,7 @@ { SELECT t.cmrFk, t.id ticketFk, t.routeFk, - co.country, + co.name AS country, t.clientFk, IF(sub.id, TRUE, FALSE) hasCmrDms, DATE(t.shipped) shipped diff --git a/modules/supplier/front/address/create/index.html b/modules/supplier/front/address/create/index.html index e45539445..e3f883641 100644 --- a/modules/supplier/front/address/create/index.html +++ b/modules/supplier/front/address/create/index.html @@ -43,7 +43,7 @@ rule> {{code}} - {{town.name}} ({{town.province.name}}, - {{town.province.country.country}}) + {{town.province.country.name}}) {{name}}, {{province.name}} - ({{province.country.country}}) + ({{province.country.name}}) - {{name}} ({{country.country}}) + {{name}} ({{country.name}}) diff --git a/modules/supplier/front/address/edit/index.html b/modules/supplier/front/address/edit/index.html index b6f90134b..b966023da 100644 --- a/modules/supplier/front/address/edit/index.html +++ b/modules/supplier/front/address/edit/index.html @@ -41,7 +41,7 @@ rule> {{code}} - {{town.name}} ({{town.province.name}}, - {{town.province.country.country}}) + {{town.province.country.name}}) {{name}}, {{province.name}} - ({{province.country.country}}) + ({{province.country.name}}) - {{name}} ({{country.country}}) + {{name}} ({{country.name}}) diff --git a/modules/supplier/front/fiscal-data/index.html b/modules/supplier/front/fiscal-data/index.html index 3fe67762f..6455bf3fd 100644 --- a/modules/supplier/front/fiscal-data/index.html +++ b/modules/supplier/front/fiscal-data/index.html @@ -16,7 +16,7 @@ auto-load="true" url="Countries" data="countries" - order="country"> + order="name"> {{code}} - {{town.name}} ({{town.province.name}}, - {{town.province.country.country}}) + {{town.province.country.name}}) {{name}}, {{province.name}} - ({{province.country.country}}) + ({{province.country.name}}) - {{name}} ({{country.country}}) + {{name}} ({{country.name}}) @@ -198,7 +198,7 @@ vn-name="country" ng-model="$ctrl.supplier.countryFk" data="countries" - show-field="country" + show-field="name" value-field="id" rule> diff --git a/modules/supplier/front/summary/index.html b/modules/supplier/front/summary/index.html index d1b3ee20a..5ba713fcf 100644 --- a/modules/supplier/front/summary/index.html +++ b/modules/supplier/front/summary/index.html @@ -162,7 +162,7 @@ + value="{{::$ctrl.summary.country.name}}"> diff --git a/modules/worker/front/create/index.html b/modules/worker/front/create/index.html index 39b2dbf47..3030ffecd 100644 --- a/modules/worker/front/create/index.html +++ b/modules/worker/front/create/index.html @@ -65,7 +65,7 @@ rule> {{code}} - {{town.name}} ({{town.province.name}}, - {{town.province.country.country}}) + {{town.province.country.name}}) - {{name}} ({{country.country}}) + {{name}} ({{country.name}}) @@ -99,7 +99,7 @@ value-field="name"> {{name}}, {{province.name}} - ({{province.country.country}}) + ({{province.country.name}})
- {{town.province.name}}, {{town.province.country.country}} + {{town.province.name}}, {{town.province.country.name}}
diff --git a/print/templates/reports/campaign-metrics/sql/client.sql b/print/templates/reports/campaign-metrics/sql/client.sql index 9f392c97e..b962ce6b2 100644 --- a/print/templates/reports/campaign-metrics/sql/client.sql +++ b/print/templates/reports/campaign-metrics/sql/client.sql @@ -6,7 +6,7 @@ SELECT c.id, c.name AS clientName, p.name AS province, - co.country + co.name AS country FROM client c JOIN province p ON c.provinceFk = p.id JOIN country co ON c.countryFk = co.id diff --git a/print/templates/reports/claim-pickup-order/sql/client.sql b/print/templates/reports/claim-pickup-order/sql/client.sql index 640b0c8a7..b8b58c9ec 100644 --- a/print/templates/reports/claim-pickup-order/sql/client.sql +++ b/print/templates/reports/claim-pickup-order/sql/client.sql @@ -8,7 +8,7 @@ SELECT a.street, a.nickname, p.name AS province, - ct.country, + ct.name AS country, IFNULL(c.phone, cc.phone) AS phone FROM claim cl JOIN client c ON c.id = cl.clientFk diff --git a/print/templates/reports/client-debt-statement/sql/client.sql b/print/templates/reports/client-debt-statement/sql/client.sql index d675cf168..174d96772 100644 --- a/print/templates/reports/client-debt-statement/sql/client.sql +++ b/print/templates/reports/client-debt-statement/sql/client.sql @@ -6,7 +6,7 @@ SELECT c.city, c.fi, p.name AS province, - ct.country + ct.name AS country FROM client c JOIN country ct ON ct.id = c.countryFk LEFT JOIN province p ON p.id = c.provinceFk diff --git a/print/templates/reports/cmr/sql/data.sql b/print/templates/reports/cmr/sql/data.sql index e9500cc4b..42231709a 100644 --- a/print/templates/reports/cmr/sql/data.sql +++ b/print/templates/reports/cmr/sql/data.sql @@ -14,12 +14,12 @@ SELECT c.id cmrFk, s.street carrierStreet, s.postCode carrierPostCode, s.city carrierCity, - cou.country carrierCountry, + cou.name carrierCountry, s2.name senderName, s2.street senderStreet, s2.postCode senderPostCode, s2.city senderCity, - cou2.country senderCountry, + cou2.name senderCountry, a.street deliveryStreet, a.id deliveryAddressFk, a.postalCode deliveryPostalCode, @@ -27,12 +27,12 @@ SELECT c.id cmrFk, a.nickname deliveryName, a.phone deliveryPhone, a.mobile deliveryMobile, - cou3.country deliveryCountry, + cou3.name deliveryCountry, cl.phone clientPhone, a2.street loadStreet, a2.postalCode loadPostalCode, a2.city loadCity, - cou4.country loadCountry, + cou4.name loadCountry, co.stamp senderStamp, s.stamp deliveryStamp FROM cmr c diff --git a/print/templates/reports/incoterms-authorization/sql/client.sql b/print/templates/reports/incoterms-authorization/sql/client.sql index bb17afd1d..f6c267e38 100644 --- a/print/templates/reports/incoterms-authorization/sql/client.sql +++ b/print/templates/reports/incoterms-authorization/sql/client.sql @@ -4,7 +4,7 @@ SELECT c.name, c.fi, c.street, - cty.country + cty.name AS country FROM client c JOIN country cty ON cty.id = c.countryFk WHERE c.id = ? \ No newline at end of file diff --git a/print/templates/reports/letter-debtor/sql/client.sql b/print/templates/reports/letter-debtor/sql/client.sql index d675cf168..e3e63f45a 100644 --- a/print/templates/reports/letter-debtor/sql/client.sql +++ b/print/templates/reports/letter-debtor/sql/client.sql @@ -6,7 +6,7 @@ SELECT c.city, c.fi, p.name AS province, - ct.country + ct.name AS country FROM client c JOIN country ct ON ct.id = c.countryFk LEFT JOIN province p ON p.id = c.provinceFk diff --git a/print/templates/reports/sepa-core/sql/client.sql b/print/templates/reports/sepa-core/sql/client.sql index c22e7f114..000c7e0bb 100644 --- a/print/templates/reports/sepa-core/sql/client.sql +++ b/print/templates/reports/sepa-core/sql/client.sql @@ -7,7 +7,7 @@ SELECT c.city, c.fi, p.name AS province, - ct.country, + ct.name AS country, ct.code AS countryCode, ct.ibanLength AS ibanLength FROM client c diff --git a/print/templates/reports/sepa-core/sql/supplier.sql b/print/templates/reports/sepa-core/sql/supplier.sql index 80635ecf5..66a9222cf 100644 --- a/print/templates/reports/sepa-core/sql/supplier.sql +++ b/print/templates/reports/sepa-core/sql/supplier.sql @@ -2,7 +2,7 @@ SELECT m.code mandateCode, s.name, s.street, - sc.country, + sc.name AS country, s.postCode, s.city, sp.name province, diff --git a/print/templates/reports/supplier-campaign-metrics/sql/supplier.sql b/print/templates/reports/supplier-campaign-metrics/sql/supplier.sql index 0c2fa12ed..c284e0d12 100644 --- a/print/templates/reports/supplier-campaign-metrics/sql/supplier.sql +++ b/print/templates/reports/supplier-campaign-metrics/sql/supplier.sql @@ -5,7 +5,7 @@ SELECT s.id, s.name AS supplierName, p.name AS province, - co.country + co.name AS country FROM supplier s JOIN province p ON s.provinceFk = p.id JOIN country co ON s.countryFk = co.id -- 2.40.1 From fd7dcf278191e6c29647e1fb878e60913cfc636a Mon Sep 17 00:00:00 2001 From: robert Date: Fri, 26 Apr 2024 10:26:20 +0200 Subject: [PATCH 5/6] fix: refs #7039 fixpr --- back/methods/postcode/filter.js | 2 +- e2e/tests.js | 4 ++-- modules/client/back/methods/client/extendedListFilter.js | 2 +- modules/client/back/methods/defaulter/filter.js | 2 +- modules/invoiceOut/back/methods/invoiceOut/negativeBases.js | 2 +- modules/route/back/methods/route/getExternalCmrs.js | 2 +- print/templates/reports/campaign-metrics/sql/client.sql | 2 +- print/templates/reports/claim-pickup-order/sql/client.sql | 2 +- print/templates/reports/client-debt-statement/sql/client.sql | 2 +- .../templates/reports/incoterms-authorization/sql/client.sql | 2 +- print/templates/reports/letter-debtor/sql/client.sql | 2 +- print/templates/reports/sepa-core/sql/client.sql | 2 +- print/templates/reports/sepa-core/sql/supplier.sql | 2 +- .../reports/supplier-campaign-metrics/sql/supplier.sql | 2 +- 14 files changed, 15 insertions(+), 15 deletions(-) diff --git a/back/methods/postcode/filter.js b/back/methods/postcode/filter.js index cc0747961..8b0f64d97 100644 --- a/back/methods/postcode/filter.js +++ b/back/methods/postcode/filter.js @@ -62,7 +62,7 @@ module.exports = Self => { pc.code, t.name as town, p.name as province, - c.name as country + c.name country FROM postCode pc JOIN town t on t.id = pc.townFk diff --git a/e2e/tests.js b/e2e/tests.js index d57028518..829056f4c 100644 --- a/e2e/tests.js +++ b/e2e/tests.js @@ -23,8 +23,8 @@ async function test() { const opts = getopts(process.argv.slice(2), { boolean: ['show'] }); - // if (opts.show) - process.env.E2E_SHOW = true; + if (opts.show) + process.env.E2E_SHOW = true; console.log('Building and running DB container.'); const myt = new Myt(); diff --git a/modules/client/back/methods/client/extendedListFilter.js b/modules/client/back/methods/client/extendedListFilter.js index b37960efb..174970a2f 100644 --- a/modules/client/back/methods/client/extendedListFilter.js +++ b/modules/client/back/methods/client/extendedListFilter.js @@ -123,7 +123,7 @@ module.exports = Self => { c.hasLcr, c.hasCoreVnl, ct.id AS countryFk, - ct.name AS country, + ct.name country, p.id AS provinceFk, p.name AS province, u.id AS salesPersonFk, diff --git a/modules/client/back/methods/defaulter/filter.js b/modules/client/back/methods/defaulter/filter.js index 8c8f8e059..ac9504ec2 100644 --- a/modules/client/back/methods/defaulter/filter.js +++ b/modules/client/back/methods/defaulter/filter.js @@ -69,7 +69,7 @@ module.exports = Self => { uw.name workerName, c.creditInsurance, d.defaulterSinced, - cn.name AS country, + cn.name country, c.countryFk, pm.name payMethod FROM vn.defaulter d diff --git a/modules/invoiceOut/back/methods/invoiceOut/negativeBases.js b/modules/invoiceOut/back/methods/invoiceOut/negativeBases.js index 2dfdf1556..76ef29604 100644 --- a/modules/invoiceOut/back/methods/invoiceOut/negativeBases.js +++ b/modules/invoiceOut/back/methods/invoiceOut/negativeBases.js @@ -59,7 +59,7 @@ module.exports = Self => { `CREATE OR REPLACE TEMPORARY TABLE tmp.filter ENGINE = MEMORY SELECT co.code company, - cou.name AS country, + cou.name country, c.id clientId, c.socialName clientSocialName, u.nickname workerSocialName, diff --git a/modules/route/back/methods/route/getExternalCmrs.js b/modules/route/back/methods/route/getExternalCmrs.js index f74ef3065..89536f50a 100644 --- a/modules/route/back/methods/route/getExternalCmrs.js +++ b/modules/route/back/methods/route/getExternalCmrs.js @@ -103,7 +103,7 @@ module.exports = Self => { SELECT t.cmrFk, t.id ticketFk, t.routeFk, - co.name AS country, + co.name country, t.clientFk, IF(sub.id, TRUE, FALSE) hasCmrDms, DATE(t.shipped) shipped diff --git a/print/templates/reports/campaign-metrics/sql/client.sql b/print/templates/reports/campaign-metrics/sql/client.sql index b962ce6b2..38f9fffc6 100644 --- a/print/templates/reports/campaign-metrics/sql/client.sql +++ b/print/templates/reports/campaign-metrics/sql/client.sql @@ -6,7 +6,7 @@ SELECT c.id, c.name AS clientName, p.name AS province, - co.name AS country + co.name country FROM client c JOIN province p ON c.provinceFk = p.id JOIN country co ON c.countryFk = co.id diff --git a/print/templates/reports/claim-pickup-order/sql/client.sql b/print/templates/reports/claim-pickup-order/sql/client.sql index b8b58c9ec..47e89cf1b 100644 --- a/print/templates/reports/claim-pickup-order/sql/client.sql +++ b/print/templates/reports/claim-pickup-order/sql/client.sql @@ -8,7 +8,7 @@ SELECT a.street, a.nickname, p.name AS province, - ct.name AS country, + ct.name country, IFNULL(c.phone, cc.phone) AS phone FROM claim cl JOIN client c ON c.id = cl.clientFk diff --git a/print/templates/reports/client-debt-statement/sql/client.sql b/print/templates/reports/client-debt-statement/sql/client.sql index 174d96772..acc616131 100644 --- a/print/templates/reports/client-debt-statement/sql/client.sql +++ b/print/templates/reports/client-debt-statement/sql/client.sql @@ -6,7 +6,7 @@ SELECT c.city, c.fi, p.name AS province, - ct.name AS country + ct.name country FROM client c JOIN country ct ON ct.id = c.countryFk LEFT JOIN province p ON p.id = c.provinceFk diff --git a/print/templates/reports/incoterms-authorization/sql/client.sql b/print/templates/reports/incoterms-authorization/sql/client.sql index f6c267e38..9eff1379c 100644 --- a/print/templates/reports/incoterms-authorization/sql/client.sql +++ b/print/templates/reports/incoterms-authorization/sql/client.sql @@ -4,7 +4,7 @@ SELECT c.name, c.fi, c.street, - cty.name AS country + cty.name country FROM client c JOIN country cty ON cty.id = c.countryFk WHERE c.id = ? \ No newline at end of file diff --git a/print/templates/reports/letter-debtor/sql/client.sql b/print/templates/reports/letter-debtor/sql/client.sql index e3e63f45a..87fffb8b7 100644 --- a/print/templates/reports/letter-debtor/sql/client.sql +++ b/print/templates/reports/letter-debtor/sql/client.sql @@ -6,7 +6,7 @@ SELECT c.city, c.fi, p.name AS province, - ct.name AS country + ct.name country FROM client c JOIN country ct ON ct.id = c.countryFk LEFT JOIN province p ON p.id = c.provinceFk diff --git a/print/templates/reports/sepa-core/sql/client.sql b/print/templates/reports/sepa-core/sql/client.sql index 000c7e0bb..b3ba180b3 100644 --- a/print/templates/reports/sepa-core/sql/client.sql +++ b/print/templates/reports/sepa-core/sql/client.sql @@ -7,7 +7,7 @@ SELECT c.city, c.fi, p.name AS province, - ct.name AS country, + ct.name country, ct.code AS countryCode, ct.ibanLength AS ibanLength FROM client c diff --git a/print/templates/reports/sepa-core/sql/supplier.sql b/print/templates/reports/sepa-core/sql/supplier.sql index 66a9222cf..156fc71c0 100644 --- a/print/templates/reports/sepa-core/sql/supplier.sql +++ b/print/templates/reports/sepa-core/sql/supplier.sql @@ -2,7 +2,7 @@ SELECT m.code mandateCode, s.name, s.street, - sc.name AS country, + sc.name country, s.postCode, s.city, sp.name province, diff --git a/print/templates/reports/supplier-campaign-metrics/sql/supplier.sql b/print/templates/reports/supplier-campaign-metrics/sql/supplier.sql index c284e0d12..d446ba6e6 100644 --- a/print/templates/reports/supplier-campaign-metrics/sql/supplier.sql +++ b/print/templates/reports/supplier-campaign-metrics/sql/supplier.sql @@ -5,7 +5,7 @@ SELECT s.id, s.name AS supplierName, p.name AS province, - co.name AS country + co.name country FROM supplier s JOIN province p ON s.provinceFk = p.id JOIN country co ON s.countryFk = co.id -- 2.40.1 From b0da193b4aa4e11075235502818e2f6a924587cb Mon Sep 17 00:00:00 2001 From: robert Date: Tue, 14 May 2024 07:48:03 +0200 Subject: [PATCH 6/6] =?UTF-8?q?feat:=20refs=20#7039=20a=C3=B1adir=20colum?= =?UTF-8?q?=20virtual=20country?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/versions/11013-orangeGerbera/00-firstScript.sql | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/db/versions/11013-orangeGerbera/00-firstScript.sql b/db/versions/11013-orangeGerbera/00-firstScript.sql index 37628c1a2..2e8be531f 100644 --- a/db/versions/11013-orangeGerbera/00-firstScript.sql +++ b/db/versions/11013-orangeGerbera/00-firstScript.sql @@ -1,16 +1,4 @@ -- Place your SQL code here ALTER TABLE vn.country CHANGE country name varchar(25) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL; -CREATE OR REPLACE DEFINER=`root`@`localhost` - SQL SECURITY DEFINER - VIEW `vn2008`.`Paises` -AS SELECT `c`.`id` AS `Id`, - `c`.`name` AS `Pais`, - `c`.`CEE` AS `CEE`, - `c`.`isUeeMember` AS `isUeeMember`, - `c`.`code` AS `Codigo`, - `c`.`currencyFk` AS `Id_Moneda`, - `c`.`geoFk` AS `geoFk`, - `c`.`ibanLength` AS `ibanLength`, - `c`.`hasDailyInvoice` AS `hasDailyInvoice` -FROM `vn`.`country` `c` +ALTER TABLE vn.country ADD COLUMN country VARCHAR(25) AS (name) VIRTUAL; -- 2.40.1