From 477fb7ded944fe37bacd00ad2d87a50ac8e0fda1 Mon Sep 17 00:00:00 2001 From: guillermo Date: Wed, 13 Nov 2024 14:27:54 +0100 Subject: [PATCH 01/20] feat: refs #8149 Group by CuentaIvaRepercutido --- db/routines/vn/procedures/invoiceIn_booking.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/db/routines/vn/procedures/invoiceIn_booking.sql b/db/routines/vn/procedures/invoiceIn_booking.sql index 36189afcc..cfe3adb0b 100644 --- a/db/routines/vn/procedures/invoiceIn_booking.sql +++ b/db/routines/vn/procedures/invoiceIn_booking.sql @@ -219,7 +219,7 @@ BEGIN ) eWithheld ON TRUE WHERE tii.taxTypeSageFk IS NOT NULL AND (tii.taxCode IS NULL OR tii.taxCode NOT IN ('import10', 'import21')) - GROUP BY tii.PorcentajeIva, tii.expenseFk; + GROUP BY tii.CuentaIvaRepercutido; -- Línea iva inversor sujeto pasivo INSERT INTO XDiario( @@ -284,7 +284,7 @@ BEGIN AND NOT(tii.isVies AND c.nontaxableTransactionTypeFk = tii.transactionTypeSageFk AND tii.taxCode = 'nonTaxable') - GROUP BY tii.PorcentajeIva, tii.expenseFk; + GROUP BY tii.CuentaIvaRepercutido; -- Actualización del registro original UPDATE invoiceIn ii From 7ad17d75d763086e90e73447e575c7d6a378bdfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Andr=C3=A9s?= Date: Thu, 21 Nov 2024 18:41:55 +0100 Subject: [PATCH 02/20] feat: refs #8124 Enrutadores nuevos requerimientos --- .../vn/procedures/route_calcCommission.sql | 34 ++++++++++--- .../11358-maroonPhormium/00-firstScript.sql | 51 +++++++++++++++++++ 2 files changed, 77 insertions(+), 8 deletions(-) create mode 100644 db/versions/11358-maroonPhormium/00-firstScript.sql diff --git a/db/routines/vn/procedures/route_calcCommission.sql b/db/routines/vn/procedures/route_calcCommission.sql index 7c911a5e2..47a256994 100644 --- a/db/routines/vn/procedures/route_calcCommission.sql +++ b/db/routines/vn/procedures/route_calcCommission.sql @@ -11,6 +11,8 @@ BEGIN */ DECLARE vIsUpdatable, vIsFreelance BOOL DEFAULT 0; DECLARE vAgencyModePricePercentage DOUBLE; + DECLARE vIsKmTruckRate BOOL; + DECLARE vCountryFk INT; SELECT r.created >= rc.cutoffDated INTO vIsUpdatable FROM route r @@ -21,10 +23,16 @@ BEGIN DELETE FROM routeCommission WHERE routeFk = vSelf; - SELECT w.isFreelance INTO vIsFreelance + SELECT w.isFreelance, v.isKmTruckRate, c.countryFk INTO vIsFreelance, vIsKmTruckRate, vCountryFk FROM route r JOIN worker w ON w.id = r.workerFk - WHERE r.id = vSelf; + JOIN vehicle v ON v.id = r.vehicleFk + LEFT JOIN ticket t ON t.routeFk = r.id + LEFT JOIN client c ON c.id = t.clientFk + WHERE r.id = vSelf + GROUP BY c.countryFk + ORDER BY COUNT(*) DESC + LIMIT 1; SELECT ampp.percentage INTO vAgencyModePricePercentage FROM route r @@ -39,7 +47,9 @@ BEGIN workCenterFk, freelanceYearlyM3, cat4m3, - cat5m3 + cat5m3, + isKmTruckRate, + countryFk ) SELECT vSelf, r.commissionWorkCenterFk, @@ -51,11 +61,14 @@ BEGIN IFNULL(r.m3, 0), 0 ), - rc.distributionCat4M3 * IFNULL(r.m3, 0), - rc.distributionCat5M3 * IFNULL(r.m3, 0) + IFNULL(wc.distributionCat4M3, rc.distributionCat4M3) * IFNULL(r.m3, 0), + IFNULL(wc.distributionCat5M3, rc.distributionCat5M3) * IFNULL(r.m3, 0), + vIsKmTruckRate, + vCountryFk FROM route r JOIN vehicle v ON v.id = r.vehicleFk JOIN routeConfig rc + LEFT JOIN workCenterCommission wc ON wc.workCenter = r.workCenterFk WHERE r.id = vSelf AND r.workerFk AND r.commissionWorkCenterFk; @@ -68,7 +81,9 @@ BEGIN yearlyKm, yearlyM3, cat4m3, - cat5m3 + cat5m3, + isKmTruckRate, + countryFk ) SELECT vSelf, r.commissionWorkCenterFk, @@ -78,11 +93,14 @@ BEGIN IF(v.isKmTruckRate, rc.deliveryM3Cat5, rc.deliveryM3Cat4), (r.kmEnd - r.kmStart) * rc.kmYearly, IFNULL(r.m3, 0) * rc.m3Yearly, - rc.distributionCat4M3 * IFNULL(r.m3, 0), - rc.distributionCat5M3 * IFNULL(r.m3, 0) + IFNULL(wc.distributionCat4M3, rc.distributionCat4M3) * IFNULL(r.m3, 0), + IFNULL(wc.distributionCat5M3, rc.distributionCat5M3) * IFNULL(r.m3, 0), + vIsKmTruckRate, + vCountryFk FROM route r JOIN vehicle v ON v.id = r.vehicleFk JOIN routeConfig rc + LEFT JOIN workCenterCommission wc ON wc.workCenter = r.workCenterFk WHERE r.id = vSelf AND r.kmStart AND r.kmEnd diff --git a/db/versions/11358-maroonPhormium/00-firstScript.sql b/db/versions/11358-maroonPhormium/00-firstScript.sql new file mode 100644 index 000000000..5bfe78f55 --- /dev/null +++ b/db/versions/11358-maroonPhormium/00-firstScript.sql @@ -0,0 +1,51 @@ + + ALTER TABLE vn.routeCommission ADD IF NOT EXISTS countryFk mediumint(8) unsigned DEFAULT NULL NULL; + ALTER TABLE vn.routeCommission ADD IF NOT EXISTS isKmTruckRate TINYINT(1) DEFAULT NULL NULL; + + ALTER TABLE vn.routeCommission DROP FOREIGN KEY IF EXISTS routeCommission_country_FK; + ALTER TABLE vn.routeCommission ADD CONSTRAINT routeCommission_country_FK FOREIGN KEY (countryFk) + REFERENCES vn.country(id) ON DELETE RESTRICT ON UPDATE CASCADE; + + CREATE TABLE IF NOT EXISTS vn.workCenterConfig ( + `workCenterFk` INT(11) NOT NULL, + `deliveryManAdjustment` DECIMAL(4,2) DEFAULT NULL + COMMENT 'Número de trabajadores para equilibrar los repartidores de diferentes centros. + Utilizado en repartidores de grafana', + `distributionM3Category1` decimal(5,2) DEFAULT NULL, + `distributionM3Category2` decimal(5,2) DEFAULT NULL, + `distributionCat4M3` DECIMAL(5,2) DEFAULT NULL + COMMENT 'Comisión por gestión de la distribución Cat IV', + `distributionCat5M3` DECIMAL(5,2) DEFAULT NULL + COMMENT 'Comisión por gestión de la distribución Cat V', + PRIMARY KEY (`workCenterFk`), + CONSTRAINT `workCenterConfig_workCenterFk` FOREIGN KEY (`workCenterFk`) + REFERENCES `workCenter` (`id`) ON UPDATE CASCADE ON DELETE RESTRICT + ); + + UPDATE vn.routeCommission rc + JOIN (SELECT id, countryFk, isKmTruckRate + FROM (SELECT r.id, c.countryFk, v.isKmTruckRate + FROM vn.route r + JOIN vn.routeCommission rc ON rc.routeFk = r.id + LEFT JOIN vn.ticket t ON t.routeFk = r.id + LEFT JOIN vn.client c ON c.id = t.clientFk + LEFT JOIN vn.vehicle v ON v.id = r.vehicleFk + WHERE r.created >= '2023-12-01' + GROUP BY r.id, c.countryFk + ORDER BY r.id, COUNT(*) DESC + LIMIT 100000000000 + )sub + GROUP BY id + )sub ON sub.id = rc.routeFk + SET rc.isKmTruckRate = sub.isKmTruckRate, + rc.countryFk = sub.countryFk; + + ALTER TABLE vn.workerDistributionCategory ADD IF NOT EXISTS countryFk mediumint(8) unsigned DEFAULT NULL NULL; + ALTER TABLE vn.workerDistributionCategory ADD IF NOT EXISTS isKmTruckRate TINYINT(1) DEFAULT NULL NULL; + + ALTER TABLE vn.workerDistributionCategory DROP FOREIGN KEY IF EXISTS workerDistributionCategory_country_FK; + ALTER TABLE vn.workerDistributionCategory ADD CONSTRAINT workerDistributionCategory_country_FK FOREIGN KEY (countryFk) + REFERENCES vn.country(id) ON DELETE RESTRICT ON UPDATE CASCADE; + + ALTER TABLE vn.workerDistributionCategory ADD IF NOT EXISTS commissionSplitWorkers INT UNSIGNED NOT NULL DEFAULT 1 + COMMENT 'Número de enrutadores entr los que se reparte la comsión'; From 52364bbe2d27ed28a5f495a5bbaa4e59cd8eb7c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Andr=C3=A9s?= Date: Thu, 21 Nov 2024 18:44:47 +0100 Subject: [PATCH 03/20] feat: refs #8124 Enrutadores nuevos requerimientos --- db/versions/11358-maroonPhormium/00-firstScript.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/db/versions/11358-maroonPhormium/00-firstScript.sql b/db/versions/11358-maroonPhormium/00-firstScript.sql index 5bfe78f55..88762e5aa 100644 --- a/db/versions/11358-maroonPhormium/00-firstScript.sql +++ b/db/versions/11358-maroonPhormium/00-firstScript.sql @@ -6,7 +6,7 @@ ALTER TABLE vn.routeCommission ADD CONSTRAINT routeCommission_country_FK FOREIGN KEY (countryFk) REFERENCES vn.country(id) ON DELETE RESTRICT ON UPDATE CASCADE; - CREATE TABLE IF NOT EXISTS vn.workCenterConfig ( + CREATE TABLE IF NOT EXISTS vn.workCenterCommission ( `workCenterFk` INT(11) NOT NULL, `deliveryManAdjustment` DECIMAL(4,2) DEFAULT NULL COMMENT 'Número de trabajadores para equilibrar los repartidores de diferentes centros. @@ -18,7 +18,7 @@ `distributionCat5M3` DECIMAL(5,2) DEFAULT NULL COMMENT 'Comisión por gestión de la distribución Cat V', PRIMARY KEY (`workCenterFk`), - CONSTRAINT `workCenterConfig_workCenterFk` FOREIGN KEY (`workCenterFk`) + CONSTRAINT `workCenterCommission_workCenterFk` FOREIGN KEY (`workCenterFk`) REFERENCES `workCenter` (`id`) ON UPDATE CASCADE ON DELETE RESTRICT ); From 4ab2d7fd09c8e67edfe2c523b42b5ada07460b33 Mon Sep 17 00:00:00 2001 From: guillermo Date: Fri, 22 Nov 2024 12:59:24 +0100 Subject: [PATCH 04/20] feat: refs #8149 Group by CuentaIvaRepercutido --- db/routines/sage/procedures/invoiceIn_add.sql | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/db/routines/sage/procedures/invoiceIn_add.sql b/db/routines/sage/procedures/invoiceIn_add.sql index 0898d6810..1d411cfd0 100644 --- a/db/routines/sage/procedures/invoiceIn_add.sql +++ b/db/routines/sage/procedures/invoiceIn_add.sql @@ -26,7 +26,7 @@ BEGIN DECLARE vCursor CURSOR FOR SELECT it.taxableBase, - CAST((( it.taxableBase / 100) * t.PorcentajeIva) AS DECIMAL (10,2)), + CAST(SUM((( it.taxableBase / 100) * t.PorcentajeIva)) AS DECIMAL (10,2)), t.PorcentajeIva, it.transactionTypeSageFk, it.taxTypeSageFk, @@ -39,7 +39,8 @@ BEGIN JOIN TiposTransacciones tt ON tt.CodigoTransaccion = it.transactionTypeSageFk LEFT JOIN vn.dua d ON d.id = vInvoiceInFk WHERE i.id = vInvoiceInFk - AND d.id IS NULL; + AND d.id IS NULL + GROUP BY it.taxTypeSageFk; DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE; From ca1ccff10be5ef0443e3104365edb7e017873077 Mon Sep 17 00:00:00 2001 From: jorgep Date: Mon, 25 Nov 2024 13:55:07 +0100 Subject: [PATCH 05/20] fix: refs #7229 update env col for consistency --- db/dump/fixtures.before.sql | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/db/dump/fixtures.before.sql b/db/dump/fixtures.before.sql index e5d5f53dc..679d8e6cd 100644 --- a/db/dump/fixtures.before.sql +++ b/db/dump/fixtures.before.sql @@ -3011,10 +3011,10 @@ INSERT INTO `vn`.`profileType` (`id`, `name`) INSERT INTO `salix`.`url` (`appName`, `environment`, `url`) VALUES - ('lilium', 'development', 'http://localhost:9000/#/'), - ('hedera', 'development', 'http://localhost:9090/'), - ('salix', 'development', 'http://localhost:5000/#!/'), - ('docuware', 'development', 'http://docuware'); + ('lilium', 'dev', 'http://localhost:9000/#/'), + ('hedera', 'dev', 'http://localhost:9090/'), + ('salix', 'dev', 'http://localhost:5000/#!/'), + ('docuware', 'dev', 'http://docuware'); INSERT INTO `vn`.`report` (`id`, `name`, `paperSizeFk`, `method`) VALUES From 9da5b4ecda750218bf685602810819ccc9a78c8b Mon Sep 17 00:00:00 2001 From: jorgep Date: Mon, 25 Nov 2024 14:05:12 +0100 Subject: [PATCH 06/20] fix: refs #7229 update default environment --- back/methods/url/getByUser.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/back/methods/url/getByUser.js b/back/methods/url/getByUser.js index dd4805182..9997794f8 100644 --- a/back/methods/url/getByUser.js +++ b/back/methods/url/getByUser.js @@ -26,7 +26,7 @@ module.exports = function(Self) { fields: ['appName', 'url'], where: { appName: {inq: appNames}, - environment: process.env.NODE_ENV ?? 'development', + environment: process.env.NODE_ENV ?? 'dev', } }; From a68d7e8c0b1559b8e0da5569c98fecbdaabc4e88 Mon Sep 17 00:00:00 2001 From: jorgep Date: Mon, 25 Nov 2024 14:15:10 +0100 Subject: [PATCH 07/20] fix: refs #7229 rollback --- back/methods/url/getByUser.js | 2 +- db/dump/fixtures.before.sql | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/back/methods/url/getByUser.js b/back/methods/url/getByUser.js index 9997794f8..dd4805182 100644 --- a/back/methods/url/getByUser.js +++ b/back/methods/url/getByUser.js @@ -26,7 +26,7 @@ module.exports = function(Self) { fields: ['appName', 'url'], where: { appName: {inq: appNames}, - environment: process.env.NODE_ENV ?? 'dev', + environment: process.env.NODE_ENV ?? 'development', } }; diff --git a/db/dump/fixtures.before.sql b/db/dump/fixtures.before.sql index 679d8e6cd..e5d5f53dc 100644 --- a/db/dump/fixtures.before.sql +++ b/db/dump/fixtures.before.sql @@ -3011,10 +3011,10 @@ INSERT INTO `vn`.`profileType` (`id`, `name`) INSERT INTO `salix`.`url` (`appName`, `environment`, `url`) VALUES - ('lilium', 'dev', 'http://localhost:9000/#/'), - ('hedera', 'dev', 'http://localhost:9090/'), - ('salix', 'dev', 'http://localhost:5000/#!/'), - ('docuware', 'dev', 'http://docuware'); + ('lilium', 'development', 'http://localhost:9000/#/'), + ('hedera', 'development', 'http://localhost:9090/'), + ('salix', 'development', 'http://localhost:5000/#!/'), + ('docuware', 'development', 'http://docuware'); INSERT INTO `vn`.`report` (`id`, `name`, `paperSizeFk`, `method`) VALUES From 584287b2119ec7d8c5e656e9e106099d684c697c Mon Sep 17 00:00:00 2001 From: jorgep Date: Mon, 25 Nov 2024 14:20:15 +0100 Subject: [PATCH 08/20] fix: refs #7229 update default environment --- back/methods/url/getUrl.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/back/methods/url/getUrl.js b/back/methods/url/getUrl.js index 5c6e5655f..fa3f7fdad 100644 --- a/back/methods/url/getUrl.js +++ b/back/methods/url/getUrl.js @@ -22,7 +22,7 @@ module.exports = Self => { const url = await Self.app.models.Url.findOne({ where: { appName, - environment: process.env.NODE_ENV || 'dev' + environment: process.env.NODE_ENV || 'development' } }); return url?.url; From ed39ae7e4bcf203db8db348d5a77fab9255d3116 Mon Sep 17 00:00:00 2001 From: alexm Date: Mon, 25 Nov 2024 14:48:59 +0100 Subject: [PATCH 09/20] chore: refs #8231 add changelog --- CHANGELOG.md | 114 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 114 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 57848aa7f..73ebecabc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,117 @@ +# Version 24.48 - 2024-11-25 + +### Added 🆕 + +- feat: refs #4948 Added ticket_selfConsumptionPackaging by:guillermo +- feat: refs #6818 add config table by:jorgep +- feat: refs #6818 add records by:jorgep +- feat: refs #6818 saysimple integration by:jorgep +- feat: refs #6845 userInterface by:sergiodt +- feat: refs #6869 add back by:jorgep +- feat: refs #6869 define model by:jorgep +- feat: refs #6869 refs#6869 itemShelving_get (origin/6869-createGetDetails) by:sergiodt +- feat: refs #7006 itemTypeLog by:guillermo +- feat: refs #7006 itemTypeLog created by:guillermo +- feat: refs #7006 Requested changes by:guillermo +- feat: refs #7193 added scope in parking model by:Jon +- feat: refs #7244 Requested changes by:guillermo +- feat: refs #7266 Added details and improvements in item label reports by:guillermo +- feat: refs #7266 buyFkForPrint by:sergiodt +- feat: refs #7266 First commit by:guillermo +- feat: refs #7266 Item label barcode by:guillermo +- feat: refs #7266 Item label QR by:guillermo +- feat: refs #7266 Item label QR finished by:guillermo +- feat: refs #7266 Minor change by:guillermo +- feat: refs #7266 Print corrections by:guillermo +- feat: refs #7266 Requested changes and improvements by:guillermo +- feat: refs #7266 Requested changes and query optimization by:guillermo +- feat: refs #7266 Version by:guillermo +- feat: refs #7289 #7289 apply option 1 by:Javier Segarra +- feat: refs #7289 #7289 remove bad translation by:Javier Segarra +- feat: refs #7524 restrict fields by:jorgep +- feat: refs #7641 fine tunning by:jorgep +- feat: refs #7641 improve style by:jorgep +- feat: refs #7743 add simple spec for sendMail by:pablone +- feat: refs #7743 add try catch stmt to the test by:pablone +- feat: refs #7874 add default type by:jorgep +- feat: refs #7874 use name by:jorgep +- feat: refs #7920 Added ItemShelving in shelvingLog by:guillermo +- feat: refs #7921 refs#7921 sendLostExpedition by:sergiodt +- feat: refs #7922 refs #792 scanOrder by:sergiodt +- feat: refs #7943 quitar lectura en metodos comunes by:jgallego +- feat: refs #7943 return just the required content by:jorgep +- feat: refs #7943 usa back con permisos by:jgallego +- feat: refs #8020 machineWorkerDeprecated by:sergiodt +- feat: refs #8057 Added data updates by:guillermo +- feat: refs #8057 Added data updates (origin/8057-geoFk) by:guillermo +- feat: refs #8057 Added geoFk columns by:guillermo +- feat: refs #8057 Fix version by:guillermo +- feat: refs #8057 More precision in getGeo by:guillermo +- feat: refs #8057 Requested changes by:guillermo +- feat: refs #8071 quitar esquema by:robert +- feat: refs #8071 travel_weeklyClone by:robert +- feat: refs #8080 Added column comment by:guillermo +- feat: refs #8083 add prop by:jorgep +- feat: refs #8087 Traspasar redadas a travels by:Carlos Andrés +- feat: refs #8099 refs#8099 addComplmentSalary by:sergiodt +- feat: refs #8124 Enrutadores nuevos requerimientos by:Carlos Andrés +- feat: refs #8124 Enrutadores nuevos requerimientos (origin/8124-enrutadoresNuevosRequerimientos) by:Carlos Andrés +- feat: refs #8127 entry_getCommission by:robert +- feat: refs #8127 quitar esquemas by:robert +- feat: refs #8135 refs#8135 updateTicketACL (origin/8135-ticketACL) by:sergiodt +- feat: refs #8143 deprecate recoverPass and sync from account.user by:ivanm +- feat: refs #8150 movExpeditions by:sergiodt +- feat: refs #8151 Added test by:guillermo +- feat: refs #8151 moveExpeditions by:guillermo +- feat: refs #8151 Requested changes by:guillermo +- feat(Supplier): refs #6828 add companySize by:alexm +- refactor: refs #7641 entry report style by:jorgep + +### Changed 📦 + +- refactor: refs #6920 add correct role by:alexm +- refactor: refs #7242 Deleted select column by:guillermo +- refactor: refs #7457 Added from param if not exists by:guillermo +- refactor: refs #7641 entry report style by:jorgep +- refactor: refs #7715 Deleted hasNewLabelMrwMethod column by:guillermo +- refactor: refs #7920 Fix tests by:guillermo +- refactor: refs #7920 Fix version by:guillermo +- refactor: refs #7920 itemShelvingLog by:guillermo +- refactor: refs #7920 Main change by:guillermo +- refactor: refs #7920 Major changes by:guillermo +- refactor: refs #7920 No changes in itemShelvingLog table by:guillermo +- refactor: refs #7920 Requested changes by:guillermo +- refactor: refs #7950 Created cmr model (7950-cmrModelUnify) by:guillermo +- refactor: refs #7950 Requested changes by:guillermo +- refactor: refs #8153 Optimized order_getTax by:guillermo + +### Fixed 🛠️ + +- fix: clean deletes also zoneEvent range records by:jgallego +- fix: more data for fixture.before by:Pako +- fix: refs #4948 Tests by:guillermo +- fix: refs #6644 email and translations by:carlossa +- fix: refs #6818 add config by:jorgep +- fix: refs #6818 add defaultChannel by:jorgep +- fix: refs #6818 use right col type by:jorgep +- fix: refs #6869 use id as primaryKey by:jorgep +- fix: refs #7244 Added collection ACL by:guillermo +- fix: refs #7283 item filters by:carlossa +- fix: refs #7283 remove by:carlossa +- fix: refs #7283 remove tests by:carlossa +- fix: refs #7283 tback by:carlossa +- fix: refs #7323 add remaining fields (origin/7323-warfix-addRemainingFields) by:jorgep +- fix: refs #7457 add with on select to reduce by:pablone +- fix: refs #7457 empty commit for gitea by:pablone +- fix: refs #7457 error on empty from param and add translate by:pablone +- fix: refs #7457 remove group by calc time reduce bellow 1s by:pablone +- fix: refs #7457 remove translate and use param definition for restriction by:pablone +- fix: refs #7641 align columns by:jorgep +- fix: refs #7641 drop boilerplate code by:jorgep +- fix: refs #7920 refs#7920 itemShelvingLog by:sergiodt +- fix: refs #8153 Version by:guillermo +- revert cd7ed6987a88e00275b562d3248f368b6333620c by:Javier Segarra + # Version 24.38 - 2024-09-17 ### Added 🆕 From 0b5ef35d222123a86394cd46a910b213f05b6c2a Mon Sep 17 00:00:00 2001 From: sergiodt Date: Mon, 25 Nov 2024 16:16:47 +0100 Subject: [PATCH 10/20] feat: refs #8213 refs#8213 picker ItemShelvingSale --- back/methods/collection/getTickets.js | 8 ++++++-- modules/ticket/back/models/saleGroup.json | 7 ++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/back/methods/collection/getTickets.js b/back/methods/collection/getTickets.js index 3c2f6cb2d..677c9e444 100644 --- a/back/methods/collection/getTickets.js +++ b/back/methods/collection/getTickets.js @@ -63,7 +63,8 @@ module.exports = Self => { p.pickingOrder pickingOrder, iss.id itemShelvingSaleFk, iss.isPicked, - iss.itemShelvingFk + iss.itemShelvingFk, + st.code stateCode FROM ticketCollection tc LEFT JOIN collection c ON c.id = tc.collectionFk JOIN sale s ON s.ticketFk = tc.ticketFk @@ -77,6 +78,7 @@ module.exports = Self => { LEFT JOIN parking p ON p.id = sh.parkingFk LEFT JOIN itemColor ic ON ic.itemFk = s.itemFk LEFT JOIN origin o ON o.id = i.originFk + LEFT JOIN state st ON st.id = sg.stateFk WHERE tc.collectionFk = ? GROUP BY s.id, ish.id, p.code, p2.code UNION ALL @@ -104,7 +106,8 @@ module.exports = Self => { p.pickingOrder, iss.id itemShelvingSaleFk, iss.isPicked, - iss.itemShelvingFk + iss.itemShelvingFk, + st.code stateCode FROM sectorCollection sc JOIN sectorCollectionSaleGroup ss ON ss.sectorCollectionFk = sc.id JOIN saleGroup sg ON sg.id = ss.saleGroupFk @@ -118,6 +121,7 @@ module.exports = Self => { LEFT JOIN parking p ON p.id = sh.parkingFk LEFT JOIN itemColor ic ON ic.itemFk = s.itemFk LEFT JOIN origin o ON o.id = i.originFk + LEFT JOIN state st ON st.id = sg.stateFk WHERE sc.id = ? AND sgd.saleGroupFk GROUP BY s.id, ish.id, p.code, p2.code`, [id, id], myOptions); diff --git a/modules/ticket/back/models/saleGroup.json b/modules/ticket/back/models/saleGroup.json index aa78b4167..5f432b514 100644 --- a/modules/ticket/back/models/saleGroup.json +++ b/modules/ticket/back/models/saleGroup.json @@ -29,6 +29,11 @@ "type": "belongsTo", "model": "Parking", "foreignKey": "parkingFk" + }, + "state": { + "type": "belongsTo", + "model": "State", + "foreignKey": "stateFk" } } -} +} \ No newline at end of file From f6941928cd0a074fdbd87431f967df4535fba6f9 Mon Sep 17 00:00:00 2001 From: sergiodt Date: Mon, 25 Nov 2024 16:20:25 +0100 Subject: [PATCH 11/20] feat: refs #8213 refs#8213 picker ItemShelvingSale --- db/versions/11362-limeLilium/00-firstScript.sql | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 db/versions/11362-limeLilium/00-firstScript.sql diff --git a/db/versions/11362-limeLilium/00-firstScript.sql b/db/versions/11362-limeLilium/00-firstScript.sql new file mode 100644 index 000000000..4a7c5b742 --- /dev/null +++ b/db/versions/11362-limeLilium/00-firstScript.sql @@ -0,0 +1,4 @@ + + +INSERT INTO salix.ACL (model, property, accessType, permission, principalType, principalId) +VALUES('SaleGroup', 'find', 'READ', 'ALLOW', 'ROLE', 'production'); \ No newline at end of file From 26406b6fdbb4db59441dc2e27b0afab3dbeb2e06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Andr=C3=A9s?= Date: Mon, 25 Nov 2024 18:45:37 +0100 Subject: [PATCH 12/20] feat: refs #8124 Enrutadores nuevos requerimientos --- db/routines/vn/procedures/route_calcCommission.sql | 11 +++++++---- db/versions/11363-silverCarnation/00-firstScript.sql | 7 +++++++ 2 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 db/versions/11363-silverCarnation/00-firstScript.sql diff --git a/db/routines/vn/procedures/route_calcCommission.sql b/db/routines/vn/procedures/route_calcCommission.sql index 47a256994..1a5a9bdc2 100644 --- a/db/routines/vn/procedures/route_calcCommission.sql +++ b/db/routines/vn/procedures/route_calcCommission.sql @@ -23,14 +23,15 @@ BEGIN DELETE FROM routeCommission WHERE routeFk = vSelf; - SELECT w.isFreelance, v.isKmTruckRate, c.countryFk INTO vIsFreelance, vIsKmTruckRate, vCountryFk + SELECT w.isFreelance, v.isKmTruckRate, p.countryFk INTO vIsFreelance, vIsKmTruckRate, vCountryFk FROM route r JOIN worker w ON w.id = r.workerFk JOIN vehicle v ON v.id = r.vehicleFk LEFT JOIN ticket t ON t.routeFk = r.id - LEFT JOIN client c ON c.id = t.clientFk + LEFT JOIN address a ON a.id = t.addressFk + LEFT JOIN province p ON p.id = a.provinceFk WHERE r.id = vSelf - GROUP BY c.countryFk + GROUP BY p.countryFk ORDER BY COUNT(*) DESC LIMIT 1; @@ -90,7 +91,9 @@ BEGIN (r.kmEnd - r.kmStart) * IF(v.isKmTruckRate, rc.kmHeavy, rc.kmLight), IFNULL(r.m3, 0) * - IF(v.isKmTruckRate, rc.deliveryM3Cat5, rc.deliveryM3Cat4), + IF(v.isKmTruckRate, + IFNULL(wc.deliveryM3Cat5, rc.deliveryM3Cat5), + IFNULL(wc.deliveryM3Cat4, rc.deliveryM3Cat4)), (r.kmEnd - r.kmStart) * rc.kmYearly, IFNULL(r.m3, 0) * rc.m3Yearly, IFNULL(wc.distributionCat4M3, rc.distributionCat4M3) * IFNULL(r.m3, 0), diff --git a/db/versions/11363-silverCarnation/00-firstScript.sql b/db/versions/11363-silverCarnation/00-firstScript.sql new file mode 100644 index 000000000..b9595bab3 --- /dev/null +++ b/db/versions/11363-silverCarnation/00-firstScript.sql @@ -0,0 +1,7 @@ +ALTER TABLE vn.workCenterCommission ADD deliveryM3Cat4 DECIMAL(5,2) DEFAULT NULL NULL; +ALTER TABLE vn.workCenterCommission ADD deliveryM3Cat5 DECIMAL(5,2) DEFAULT NULL NULL; + +INSERT INTO vn.workCenterCommission (workCenterFk, deliveryM3Cat4, deliveryM3Cat5) + VALUES (5,8.0,8.0); + + From d007e4f218cd34ce823b9a45e68ce1904e4e7bb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Andr=C3=A9s?= Date: Mon, 25 Nov 2024 17:53:44 +0000 Subject: [PATCH 13/20] Actualizar db/versions/11363-silverCarnation/00-firstScript.sql --- db/versions/11363-silverCarnation/00-firstScript.sql | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/db/versions/11363-silverCarnation/00-firstScript.sql b/db/versions/11363-silverCarnation/00-firstScript.sql index b9595bab3..8c2e68ff4 100644 --- a/db/versions/11363-silverCarnation/00-firstScript.sql +++ b/db/versions/11363-silverCarnation/00-firstScript.sql @@ -1,7 +1,7 @@ -ALTER TABLE vn.workCenterCommission ADD deliveryM3Cat4 DECIMAL(5,2) DEFAULT NULL NULL; -ALTER TABLE vn.workCenterCommission ADD deliveryM3Cat5 DECIMAL(5,2) DEFAULT NULL NULL; +ALTER TABLE vn.workCenterCommission ADD IF NOT EXISTS deliveryM3Cat4 DECIMAL(5,2) DEFAULT NULL NULL; +ALTER TABLE vn.workCenterCommission ADD IF NOT EXISTS deliveryM3Cat5 DECIMAL(5,2) DEFAULT NULL NULL; -INSERT INTO vn.workCenterCommission (workCenterFk, deliveryM3Cat4, deliveryM3Cat5) +INSERT IGNORE INTO vn.workCenterCommission (workCenterFk, deliveryM3Cat4, deliveryM3Cat5) VALUES (5,8.0,8.0); From 35b508d3d60622d080c4671c047cee1e26e0eaf8 Mon Sep 17 00:00:00 2001 From: robert Date: Tue, 26 Nov 2024 08:33:56 +0100 Subject: [PATCH 14/20] fix: refs #8124 workCenter por workCenterFk --- db/routines/vn/procedures/route_calcCommission.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/db/routines/vn/procedures/route_calcCommission.sql b/db/routines/vn/procedures/route_calcCommission.sql index 47a256994..afca4564d 100644 --- a/db/routines/vn/procedures/route_calcCommission.sql +++ b/db/routines/vn/procedures/route_calcCommission.sql @@ -68,7 +68,7 @@ BEGIN FROM route r JOIN vehicle v ON v.id = r.vehicleFk JOIN routeConfig rc - LEFT JOIN workCenterCommission wc ON wc.workCenter = r.workCenterFk + LEFT JOIN workCenterCommission wc ON wc.workCenterFk = r.workCenterFk WHERE r.id = vSelf AND r.workerFk AND r.commissionWorkCenterFk; @@ -100,7 +100,7 @@ BEGIN FROM route r JOIN vehicle v ON v.id = r.vehicleFk JOIN routeConfig rc - LEFT JOIN workCenterCommission wc ON wc.workCenter = r.workCenterFk + LEFT JOIN workCenterCommission wc ON wc.workCenterFk = r.workCenterFk WHERE r.id = vSelf AND r.kmStart AND r.kmEnd From 2eed2f00a94a5cab000a8c4c047c31726aa85cab Mon Sep 17 00:00:00 2001 From: guillermo Date: Tue, 26 Nov 2024 09:01:04 +0100 Subject: [PATCH 15/20] fix: refs #4948 ticket_selfConsumptionPackaging --- .../procedures/expedition_selfConsumptionPackaging.sql | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/db/routines/vn/procedures/expedition_selfConsumptionPackaging.sql b/db/routines/vn/procedures/expedition_selfConsumptionPackaging.sql index 43660f215..330292f62 100644 --- a/db/routines/vn/procedures/expedition_selfConsumptionPackaging.sql +++ b/db/routines/vn/procedures/expedition_selfConsumptionPackaging.sql @@ -3,7 +3,7 @@ CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`expedition_selfConsum vSelf INT, vAction ENUM('add', 'remove') ) -BEGIN +proc:BEGIN /** * Maneja el consumo de cajas para autoconsumo, permitiendo * añadir o quitar cajas utilizadas según la acción indicada. @@ -37,8 +37,8 @@ BEGIN vWarehouseFk, vCreated FROM expedition e - JOIN packaging p ON p.id = e.packagingFk - JOIN item i ON i.id = p.itemFk + LEFT JOIN packaging p ON p.id = e.packagingFk + LEFT JOIN item i ON i.id = p.itemFk JOIN ticket t ON t.id = e.ticketFk JOIN productionConfig pc WHERE e.id = vSelf; @@ -47,6 +47,10 @@ BEGIN CALL util.throw('Some config parameters are not set'); END IF; + IF vItemFk IS NULL THEN + LEAVE proc; + END IF; + SET vCreated = DATE(vCreated); SELECT id INTO vTicketFk From 00353186e65c2371318fb2ab19b1e2f9ee2eb6cc Mon Sep 17 00:00:00 2001 From: robert Date: Tue, 26 Nov 2024 09:03:22 +0100 Subject: [PATCH 16/20] fix: refs #8124 workCenterFk por commissionWorkCenterFk --- db/routines/vn/procedures/route_calcCommission.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/db/routines/vn/procedures/route_calcCommission.sql b/db/routines/vn/procedures/route_calcCommission.sql index afca4564d..ab47e8281 100644 --- a/db/routines/vn/procedures/route_calcCommission.sql +++ b/db/routines/vn/procedures/route_calcCommission.sql @@ -68,7 +68,7 @@ BEGIN FROM route r JOIN vehicle v ON v.id = r.vehicleFk JOIN routeConfig rc - LEFT JOIN workCenterCommission wc ON wc.workCenterFk = r.workCenterFk + LEFT JOIN workCenterCommission wc ON wc.workCenterFk = r.commissionWorkCenterFk WHERE r.id = vSelf AND r.workerFk AND r.commissionWorkCenterFk; @@ -100,7 +100,7 @@ BEGIN FROM route r JOIN vehicle v ON v.id = r.vehicleFk JOIN routeConfig rc - LEFT JOIN workCenterCommission wc ON wc.workCenterFk = r.workCenterFk + LEFT JOIN workCenterCommission wc ON wc.workCenterFk = r.commissionWorkCenterFk WHERE r.id = vSelf AND r.kmStart AND r.kmEnd From 0cbaac91c2e8dc8e8de936d852531144bd26efad Mon Sep 17 00:00:00 2001 From: pablone Date: Tue, 26 Nov 2024 09:06:25 +0100 Subject: [PATCH 17/20] fix: refs #8087 correct SQL join condition in entry_beforeUpdate trigger --- db/routines/vn/triggers/entry_beforeUpdate.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/routines/vn/triggers/entry_beforeUpdate.sql b/db/routines/vn/triggers/entry_beforeUpdate.sql index 1d0c26fc1..66b36a861 100644 --- a/db/routines/vn/triggers/entry_beforeUpdate.sql +++ b/db/routines/vn/triggers/entry_beforeUpdate.sql @@ -41,7 +41,7 @@ BEGIN SELECT isRaid INTO vIsRaid FROM travel t JOIN entry e ON e.travelFk = t.id - WHERE entryFk = NEW.id; + WHERE t.entryFk = NEW.id; SELECT NOT (o.warehouseInFk <=> n.warehouseInFk) OR NOT (o.warehouseOutFk <=> n.warehouseOutFk) From 45e6d7f0465a39dace11037b2dc2570e5720c43a Mon Sep 17 00:00:00 2001 From: guillermo Date: Tue, 26 Nov 2024 09:11:36 +0100 Subject: [PATCH 18/20] fix: refs #4948 ticket_selfConsumptionPackaging --- .../vn/procedures/expedition_selfConsumptionPackaging.sql | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/db/routines/vn/procedures/expedition_selfConsumptionPackaging.sql b/db/routines/vn/procedures/expedition_selfConsumptionPackaging.sql index 330292f62..327934a43 100644 --- a/db/routines/vn/procedures/expedition_selfConsumptionPackaging.sql +++ b/db/routines/vn/procedures/expedition_selfConsumptionPackaging.sql @@ -43,11 +43,7 @@ proc:BEGIN JOIN productionConfig pc WHERE e.id = vSelf; - IF vClientFk IS NULL OR vAddressFk IS NULL THEN - CALL util.throw('Some config parameters are not set'); - END IF; - - IF vItemFk IS NULL THEN + IF vClientFk IS NULL OR vItemFk IS NULL THEN LEAVE proc; END IF; From 3057d80e768bdf4d442b211386d40066506e25d5 Mon Sep 17 00:00:00 2001 From: pablone Date: Tue, 26 Nov 2024 09:14:38 +0100 Subject: [PATCH 19/20] fix: refs #8087 correct SQL join condition in entry_beforeUpdate trigger --- db/routines/vn/triggers/entry_beforeUpdate.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/routines/vn/triggers/entry_beforeUpdate.sql b/db/routines/vn/triggers/entry_beforeUpdate.sql index 66b36a861..059548789 100644 --- a/db/routines/vn/triggers/entry_beforeUpdate.sql +++ b/db/routines/vn/triggers/entry_beforeUpdate.sql @@ -41,7 +41,7 @@ BEGIN SELECT isRaid INTO vIsRaid FROM travel t JOIN entry e ON e.travelFk = t.id - WHERE t.entryFk = NEW.id; + WHERE e.id = NEW.id; SELECT NOT (o.warehouseInFk <=> n.warehouseInFk) OR NOT (o.warehouseOutFk <=> n.warehouseOutFk) From e6df9d426f31d41028d7617deb4cdc44ab0ec105 Mon Sep 17 00:00:00 2001 From: pablone Date: Tue, 26 Nov 2024 09:17:18 +0100 Subject: [PATCH 20/20] fix: refs #8087 correct SQL query to use alias for isRaid in entry_beforeUpdate trigger --- db/routines/vn/triggers/entry_beforeUpdate.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/routines/vn/triggers/entry_beforeUpdate.sql b/db/routines/vn/triggers/entry_beforeUpdate.sql index 059548789..4f2c5ed4a 100644 --- a/db/routines/vn/triggers/entry_beforeUpdate.sql +++ b/db/routines/vn/triggers/entry_beforeUpdate.sql @@ -38,7 +38,7 @@ BEGIN CALL travel_throwAwb(NEW.travelFk); END IF; - SELECT isRaid INTO vIsRaid + SELECT t.isRaid INTO vIsRaid FROM travel t JOIN entry e ON e.travelFk = t.id WHERE e.id = NEW.id;