From 1f819ab16aef2a573a1c5f87b88416fceef981eb Mon Sep 17 00:00:00 2001 From: robert Date: Wed, 27 Mar 2024 19:02:05 +0100 Subject: [PATCH 01/20] fix: riesgos --- db/routines/vn/procedures/company_getSuppliersDebt.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/routines/vn/procedures/company_getSuppliersDebt.sql b/db/routines/vn/procedures/company_getSuppliersDebt.sql index f6bfc229d..6b0494db7 100644 --- a/db/routines/vn/procedures/company_getSuppliersDebt.sql +++ b/db/routines/vn/procedures/company_getSuppliersDebt.sql @@ -187,7 +187,7 @@ BEGIN FROM tPendingDuedates vp LEFT JOIN supplier s ON s.id = vp.supplierFk LEFT JOIN client c ON c.fi = s.nif - LEFT JOIN clientRisk cr ON cr.clientFk = c.id + JOIN clientRisk cr ON cr.clientFk = c.id AND cr.companyFk = vp.companyFk; DROP TEMPORARY TABLE tOpeningBalances; From 063745167e939e0d46de8c02ab138dbb26639149 Mon Sep 17 00:00:00 2001 From: robert Date: Thu, 28 Mar 2024 10:30:41 +0100 Subject: [PATCH 02/20] fix: modificar company_getSuppliersDebt --- db/routines/vn/procedures/company_getSuppliersDebt.sql | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/db/routines/vn/procedures/company_getSuppliersDebt.sql b/db/routines/vn/procedures/company_getSuppliersDebt.sql index 6b0494db7..3f91a2328 100644 --- a/db/routines/vn/procedures/company_getSuppliersDebt.sql +++ b/db/routines/vn/procedures/company_getSuppliersDebt.sql @@ -185,10 +185,12 @@ BEGIN vp.endingBalance, cr.amount clientRiskAmount FROM tPendingDuedates vp - LEFT JOIN supplier s ON s.id = vp.supplierFk + LEFT JOIN supplier s ON s.id = vp.supplierFk LEFT JOIN client c ON c.fi = s.nif - JOIN clientRisk cr ON cr.clientFk = c.id - AND cr.companyFk = vp.companyFk; + JOIN clientRisk cr ON cr.clientFk = c.id AND cr.companyFk = vp.companyFk + LEFT JOIN supplierAccount sa ON sa.supplierFk = s.id + LEFT JOIN bankEntity be ON be.id = sa.bankEntityFk + LEFT JOIN country co ON co.id = be.countryFk; DROP TEMPORARY TABLE tOpeningBalances; DROP TEMPORARY TABLE tPendingDuedates; From 1c18b0953147070e69aadc497ac47c3561a71a1b Mon Sep 17 00:00:00 2001 From: robert Date: Thu, 28 Mar 2024 10:47:47 +0100 Subject: [PATCH 03/20] fix: company_getSuppliersDebt --- .../procedures/company_getSuppliersDebt.sql | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/db/routines/vn/procedures/company_getSuppliersDebt.sql b/db/routines/vn/procedures/company_getSuppliersDebt.sql index 3f91a2328..842698020 100644 --- a/db/routines/vn/procedures/company_getSuppliersDebt.sql +++ b/db/routines/vn/procedures/company_getSuppliersDebt.sql @@ -174,16 +174,17 @@ BEGIN SELECT vp.expirationId, vp.dated, vp.supplierFk, - vp.companyFk, - vp.currencyFk, - vp.amount, - vp.pending, - vp.balance, - s.payMethodFk, - vp.isPayment, - vp.isReconciled, - vp.endingBalance, - cr.amount clientRiskAmount + vp.companyFk, + vp.currencyFk, + vp.amount, + vp.pending, + vp.balance, + s.payMethodFk, + vp.isPayment, + vp.isReconciled, + vp.endingBalance, + cr.amount clientRiskAmount, + co.CEE FROM tPendingDuedates vp LEFT JOIN supplier s ON s.id = vp.supplierFk LEFT JOIN client c ON c.fi = s.nif From 9a7bcdf104b423a26fec5c49944c420058eabadb Mon Sep 17 00:00:00 2001 From: robert Date: Thu, 28 Mar 2024 13:26:09 +0100 Subject: [PATCH 04/20] fix: company_getSuppliersDebt --- .../procedures/company_getSuppliersDebt.sql | 78 +++++++++---------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/db/routines/vn/procedures/company_getSuppliersDebt.sql b/db/routines/vn/procedures/company_getSuppliersDebt.sql index 842698020..3f6756d48 100644 --- a/db/routines/vn/procedures/company_getSuppliersDebt.sql +++ b/db/routines/vn/procedures/company_getSuppliersDebt.sql @@ -34,19 +34,19 @@ BEGIN currencyFk FROM ( SELECT p.supplierFk, - p.companyFk, - IF (p.currencyFk = vCurrencyEuroFk, p.amount, p.divisa) AS amount, - p.dueDated < vStartingDate isBeforeStarting, - p.currencyFk + p.companyFk, + IF (p.currencyFk = vCurrencyEuroFk, p.amount, p.divisa) AS amount, + p.dueDated < vStartingDate isBeforeStarting, + p.currencyFk FROM payment p WHERE p.received > vStartDate AND p.companyFk = vSelf UNION ALL SELECT r.supplierFk, - r.companyFk, - - IF (r.currencyFk = vCurrencyEuroFk, rv.amount, rv.foreignValue) AS Total, - rv.dueDated < vStartingDate isBeforeStarting, - r.currencyFk + r.companyFk, + - IF (r.currencyFk = vCurrencyEuroFk, rv.amount, rv.foreignValue) AS Total, + rv.dueDated < vStartingDate isBeforeStarting, + r.currencyFk FROM invoiceIn r INNER JOIN invoiceInDueDay rv ON r.id = rv.invoiceInFk WHERE r.issued > vStartDate @@ -57,7 +57,7 @@ BEGIN DROP TEMPORARY TABLE IF EXISTS tPendingDuedates; CREATE TEMPORARY TABLE tPendingDuedates ( id INT auto_increment, - expirationId INT, + expirationId INT, dated DATE, supplierFk INT NOT NULL, companyFk INT NOT NULL, @@ -82,35 +82,35 @@ BEGIN isPayment, isReconciled )SELECT p.id, - p.dueDated, - p.supplierFk, - p.companyFk, - IF (p.currencyFk = vCurrencyEuroFk, p.amount, p.divisa), - p.currencyFk, - TRUE isPayment, - p.isConciliated - FROM payment p - WHERE p.dueDated >= vStartingDate - AND p.companyFk = vSelf - UNION ALL - SELECT r.id, - rv.dueDated, - r.supplierFk, - r.companyFk, - -IF (r.currencyFk = vCurrencyEuroFk, rv.amount, rv.foreignValue), - r.currencyFk, - FALSE isPayment, - TRUE - FROM invoiceIn r - LEFT JOIN tOpeningBalances si ON r.companyFk = si.companyFk - AND r.supplierFk = si.supplierFk - AND r.currencyFk = si.currencyFk - JOIN invoiceInDueDay rv ON r.id = rv.invoiceInFk - WHERE rv.dueDated >= vStartingDate - AND (si.closingBalances IS NULL OR si.closingBalances <> 0) - AND r.isBooked - AND r.companyFk = vSelf - ORDER BY supplierFk, companyFk, companyFk, dueDated, isPayment DESC, id; + p.dueDated, + p.supplierFk, + p.companyFk, + IF (p.currencyFk = vCurrencyEuroFk, p.amount, p.divisa), + p.currencyFk, + TRUE isPayment, + p.isConciliated + FROM payment p + WHERE p.dueDated >= vStartingDate + AND p.companyFk = vSelf + UNION ALL + SELECT r.id, + rv.dueDated, + r.supplierFk, + r.companyFk, + -IF (r.currencyFk = vCurrencyEuroFk, rv.amount, rv.foreignValue), + r.currencyFk, + FALSE isPayment, + TRUE + FROM invoiceIn r + LEFT JOIN tOpeningBalances si ON r.companyFk = si.companyFk + AND r.supplierFk = si.supplierFk + AND r.currencyFk = si.currencyFk + JOIN invoiceInDueDay rv ON r.id = rv.invoiceInFk + WHERE rv.dueDated >= vStartingDate + AND (si.closingBalances IS NULL OR si.closingBalances <> 0) + AND r.isBooked + AND r.companyFk = vSelf + ORDER BY supplierFk, companyFk, companyFk, dueDated, isPayment DESC, id; -- Now, we calculate the outstanding amount for each receipt in descending order SET @risk := 0.0; SET @supplier := 0.0; @@ -169,7 +169,7 @@ BEGIN AND vp.supplierFk = rd.supplierFk AND vp.companyFk = rd.companyFk AND vp.currencyFk = rd.currencyFk - WHERE vp.isPayment = FALSE; + WHERE NOT vp.isPayment; SELECT vp.expirationId, vp.dated, From 3a1f5109d9cb6908f5d2496f44f56f4c21ed696b Mon Sep 17 00:00:00 2001 From: pako Date: Mon, 1 Apr 2024 11:58:16 +0200 Subject: [PATCH 05/20] lines and volume --- db/routines/vn/procedures/collection_new.sql | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/db/routines/vn/procedures/collection_new.sql b/db/routines/vn/procedures/collection_new.sql index 82196585d..1292707af 100644 --- a/db/routines/vn/procedures/collection_new.sql +++ b/db/routines/vn/procedures/collection_new.sql @@ -219,9 +219,11 @@ proc:BEGIN UPDATE tmp.productionBuffer pb JOIN ( SELECT SUM(litros) liters, - @lines:= COUNT(*) + @lines `lines`, + @lines:= COUNT(*) + @lines, + COUNT(*) `lines`, MAX(i.`size`) height, - @volume := SUM(sv.volume) + @volume volume + @volume := SUM(sv.volume) + @volume, + SUM(sv.volume) volume FROM saleVolume sv JOIN sale s ON s.id = sv.saleFk JOIN item i ON i.id = s.itemFk From bfa59bdcea3518146e41f12d2c897e198db07c6f Mon Sep 17 00:00:00 2001 From: pako Date: Mon, 1 Apr 2024 14:20:25 +0200 Subject: [PATCH 06/20] release_lock --- db/routines/vn/procedures/collection_assign.sql | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/db/routines/vn/procedures/collection_assign.sql b/db/routines/vn/procedures/collection_assign.sql index 6d31fbc8f..70c48bc38 100644 --- a/db/routines/vn/procedures/collection_assign.sql +++ b/db/routines/vn/procedures/collection_assign.sql @@ -1,8 +1,8 @@ -DELIMITER $$ +DELIMITER $$ CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`collection_assign`( vUserFk INT, OUT vCollectionFk INT -) +) proc:BEGIN /** * Comprueba si existen colecciones libres que se ajustan @@ -15,6 +15,15 @@ proc:BEGIN DECLARE vHasTooMuchCollections BOOL; DECLARE vLockTime INT DEFAULT 15; + DECLARE EXIT HANDLER FOR SQLEXCEPTION + BEGIN + IF 'collection_assign' IS NOT NULL THEN + DO RELEASE_LOCK('collection_assign'); + END IF; + + RESIGNAL; + END; + -- Si hay colecciones sin terminar, sale del proceso CALL collection_get(vUserFk); @@ -84,5 +93,5 @@ proc:BEGIN WHERE id = vCollectionFk; DO RELEASE_LOCK('collection_assign'); -END$$ -DELIMITER ; +END$$ +DELIMITER ; From cb745b0f4d146e38866b7a91cb45b08e81a9aa55 Mon Sep 17 00:00:00 2001 From: pako Date: Mon, 1 Apr 2024 14:21:34 +0200 Subject: [PATCH 07/20] release_lock --- db/routines/vn/procedures/collection_assign.sql | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/db/routines/vn/procedures/collection_assign.sql b/db/routines/vn/procedures/collection_assign.sql index 70c48bc38..49b4eb7bb 100644 --- a/db/routines/vn/procedures/collection_assign.sql +++ b/db/routines/vn/procedures/collection_assign.sql @@ -17,10 +17,8 @@ proc:BEGIN DECLARE EXIT HANDLER FOR SQLEXCEPTION BEGIN - IF 'collection_assign' IS NOT NULL THEN - DO RELEASE_LOCK('collection_assign'); - END IF; - + DO RELEASE_LOCK('collection_assign'); + RESIGNAL; END; From 1b72572440bb22ac15934488f70b357ea03d340c Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Tue, 2 Apr 2024 11:58:30 +0000 Subject: [PATCH 08/20] FIX render HTML --- print/templates/email/zone-included/zone-included.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/print/templates/email/zone-included/zone-included.html b/print/templates/email/zone-included/zone-included.html index 78915faad..e4fe08247 100644 --- a/print/templates/email/zone-included/zone-included.html +++ b/print/templates/email/zone-included/zone-included.html @@ -18,7 +18,7 @@ - + {{ zone.zn.name }} {{ zone.zoneFk }} {{ zone.z.price }} From 1f8afc074d3c98a11c84be1d5bb4c33eaad8a725 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Wed, 3 Apr 2024 05:49:40 +0000 Subject: [PATCH 09/20] Actualizar print/templates/email/zone-included/zone-included.html --- print/templates/email/zone-included/zone-included.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/print/templates/email/zone-included/zone-included.html b/print/templates/email/zone-included/zone-included.html index e4fe08247..0484e0919 100644 --- a/print/templates/email/zone-included/zone-included.html +++ b/print/templates/email/zone-included/zone-included.html @@ -18,7 +18,7 @@ - + {{ zone.zn.name }} {{ zone.zoneFk }} {{ zone.z.price }} From 3449e271504344c3bd20d32027ea8333b66a1982 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Wed, 3 Apr 2024 05:50:04 +0000 Subject: [PATCH 10/20] Actualizar print/templates/email/zone-included/zone-included.js --- print/templates/email/zone-included/zone-included.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/print/templates/email/zone-included/zone-included.js b/print/templates/email/zone-included/zone-included.js index 4de4777f3..ed6a59b40 100755 --- a/print/templates/email/zone-included/zone-included.js +++ b/print/templates/email/zone-included/zone-included.js @@ -8,5 +8,10 @@ module.exports = { }, props: { zoneCollisions: {type: Array, required: true} + }, + computed: { + zones() { + return JSON.parse(this.zoneCollisions); + } } }; From b9520b53abd66a61043067c2655764171c229273 Mon Sep 17 00:00:00 2001 From: ivanm Date: Wed, 3 Apr 2024 10:03:59 +0200 Subject: [PATCH 11/20] hotfix_clientsDisable --- db/routines/vn/events/clientsDisable.sql | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/db/routines/vn/events/clientsDisable.sql b/db/routines/vn/events/clientsDisable.sql index 00cd4ed8b..238e060dd 100644 --- a/db/routines/vn/events/clientsDisable.sql +++ b/db/routines/vn/events/clientsDisable.sql @@ -7,9 +7,8 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` EVENT `vn`.`clientsDisable` DO BEGIN UPDATE account.user u JOIN client c ON c.id = u.id - JOIN clientType ct ON ct.id = c.typeFk SET u.active = FALSE - WHERE ct.code = 'normal' + WHERE c.typeFk = 'normal' AND u.id NOT IN ( SELECT DISTINCT c.id FROM client c From 064d6dbb64fa1ea990e551ab923a0fad01a6359c Mon Sep 17 00:00:00 2001 From: guillermo Date: Wed, 3 Apr 2024 11:57:28 +0200 Subject: [PATCH 12/20] feat: refs #6829 Added two indexes --- db/versions/10975-whiteIvy/00-action.sql | 1 + db/versions/10975-whiteIvy/01-expeditionFk.sql | 1 + 2 files changed, 2 insertions(+) create mode 100644 db/versions/10975-whiteIvy/00-action.sql create mode 100644 db/versions/10975-whiteIvy/01-expeditionFk.sql diff --git a/db/versions/10975-whiteIvy/00-action.sql b/db/versions/10975-whiteIvy/00-action.sql new file mode 100644 index 000000000..3f9cf9d8b --- /dev/null +++ b/db/versions/10975-whiteIvy/00-action.sql @@ -0,0 +1 @@ +CREATE INDEX expeditionLog_action_IDX USING BTREE ON srt.expeditionLog (`action`); diff --git a/db/versions/10975-whiteIvy/01-expeditionFk.sql b/db/versions/10975-whiteIvy/01-expeditionFk.sql new file mode 100644 index 000000000..ac1e01e6f --- /dev/null +++ b/db/versions/10975-whiteIvy/01-expeditionFk.sql @@ -0,0 +1 @@ +CREATE INDEX expeditionLog_expeditionFk_IDX USING BTREE ON srt.expeditionLog (expeditionFk); From 09f023090ecf593b99aadb49426e8aa99d53fe44 Mon Sep 17 00:00:00 2001 From: jcasado Date: Wed, 3 Apr 2024 13:33:56 +0200 Subject: [PATCH 13/20] hotfix claimStateLanguage --- modules/claim/back/methods/claim/updateClaim.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/claim/back/methods/claim/updateClaim.js b/modules/claim/back/methods/claim/updateClaim.js index 68fff7846..82351f802 100644 --- a/modules/claim/back/methods/claim/updateClaim.js +++ b/modules/claim/back/methods/claim/updateClaim.js @@ -96,9 +96,9 @@ module.exports = Self => { // When claimState has been changed if (args.claimStateFk) { const newState = await models.ClaimState.findById(args.claimStateFk, null, myOptions); - await notifyStateChange(ctx, salesPerson.id, claim, newState.code); + await notifyStateChange(ctx, salesPerson.id, claim, newState.description); if (newState.code == 'canceled') - await notifyStateChange(ctx, claim.workerFk, claim, newState.code); + await notifyStateChange(ctx, claim.workerFk, claim, newState.description); } if (tx) await tx.commit(); From 59ead0c2e56718dadebf93c010bb6364ee16c816 Mon Sep 17 00:00:00 2001 From: alexm Date: Wed, 3 Apr 2024 15:29:56 +0200 Subject: [PATCH 14/20] debug(closure): add log --- modules/ticket/back/methods/ticket/closure.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/ticket/back/methods/ticket/closure.js b/modules/ticket/back/methods/ticket/closure.js index f616894ec..1d3077b9d 100644 --- a/modules/ticket/back/methods/ticket/closure.js +++ b/modules/ticket/back/methods/ticket/closure.js @@ -147,6 +147,10 @@ module.exports = async function(ctx, Self, tickets, reqArgs = {}) { ); } } catch (error) { + await Self.rawSql(` + INSERT INTO util.debug (variable, value) + VALUES ('invoicingTicketError', ?) + `, [ticket.id + ' - ' + error]); // Domain not found if (error.responseCode == 450) return invalidEmail(ticket); From 3e044a8efeacafa2d5af9ac9218b71ba99439a35 Mon Sep 17 00:00:00 2001 From: Jon Date: Thu, 4 Apr 2024 08:16:37 +0200 Subject: [PATCH 15/20] fix: refs #7152 add supplier storage --- loopback/server/datasources.json | 15 +++++++++++++++ modules/supplier/back/model-config.json | 3 +++ 2 files changed, 18 insertions(+) diff --git a/loopback/server/datasources.json b/loopback/server/datasources.json index 608479b4b..341d5d578 100644 --- a/loopback/server/datasources.json +++ b/loopback/server/datasources.json @@ -117,6 +117,21 @@ "video/mp4" ] }, + "supplierStorage": { + "name": "supplierStorage", + "connector": "loopback-component-storage", + "provider": "filesystem", + "root": "./storage/dms", + "maxFileSize": "31457280", + "allowedContentTypes": [ + "image/png", + "image/jpeg", + "image/jpg", + "image/webp", + "video/mp4", + "application/pdf" + ] + }, "accessStorage": { "name": "accessStorage", "connector": "loopback-component-storage", diff --git a/modules/supplier/back/model-config.json b/modules/supplier/back/model-config.json index 5a0c6b43a..7f3b3aaaf 100644 --- a/modules/supplier/back/model-config.json +++ b/modules/supplier/back/model-config.json @@ -8,6 +8,9 @@ "SupplierDms": { "dataSource": "vn" }, + "SupplierContainer": { + "dataSource": "supplierStorage" + }, "SupplierAddress": { "dataSource": "vn" }, From de5e954ce20bd0f211346ac7201fb60d896e92cd Mon Sep 17 00:00:00 2001 From: pablone Date: Thu, 4 Apr 2024 08:48:58 +0200 Subject: [PATCH 16/20] fix: refs #7145 fix overFlow on driver-route --- .../reports/driver-route/assets/css/style.css | 10 +++ .../reports/driver-route/driver-route.html | 2 +- .../reports/driver-route/sql/routes.sql | 37 ++++---- .../reports/driver-route/sql/tickets.sql | 85 +++++++++---------- 4 files changed, 71 insertions(+), 63 deletions(-) diff --git a/print/templates/reports/driver-route/assets/css/style.css b/print/templates/reports/driver-route/assets/css/style.css index a3bcae789..0f08f6493 100644 --- a/print/templates/reports/driver-route/assets/css/style.css +++ b/print/templates/reports/driver-route/assets/css/style.css @@ -1,3 +1,13 @@ +td{ + overflow: hidden; + max-width: 100px; + text-overflow: ellipsis; +} + +/* .text-field{ + text-overflow: ellipsis; +} */ + h1 { text-align: center; } diff --git a/print/templates/reports/driver-route/driver-route.html b/print/templates/reports/driver-route/driver-route.html index 109afd2f5..1391f621c 100644 --- a/print/templates/reports/driver-route/driver-route.html +++ b/print/templates/reports/driver-route/driver-route.html @@ -103,7 +103,7 @@ - + diff --git a/print/templates/reports/driver-route/sql/routes.sql b/print/templates/reports/driver-route/sql/routes.sql index 79bede5b2..9d2dd5c13 100644 --- a/print/templates/reports/driver-route/sql/routes.sql +++ b/print/templates/reports/driver-route/sql/routes.sql @@ -1,19 +1,18 @@ -SELECT - r.id, - r.m3, - r.created, - r.time, - u.nickName userNickName, - v.tradeMark vehicleTradeMark, - v.model vehicleModel, - v.numberPlate plateNumber, - IFNULL(s.name, am.name) AS agencyName -FROM route r - LEFT JOIN vehicle v ON v.id = r.vehicleFk - LEFT JOIN worker w ON w.id = r.workerFk - LEFT JOIN account.user u ON u.id = w.id - LEFT JOIN agencyMode am ON am.id = r.agencyModeFk - LEFT JOIN agency a ON a.id = am.agencyFk - LEFT JOIN supplierAgencyTerm sa ON sa.agencyFk = a.id - LEFT JOIN supplier s ON s.id = sa.supplierFk -WHERE r.id IN(?) +SELECT r.id, + r.m3, + r.created, + r.time, + u.nickName userNickName, + v.tradeMark vehicleTradeMark, + v.model vehicleModel, + v.numberPlate plateNumber, + IFNULL(s.name, am.name) agencyName + FROM route r + LEFT JOIN vehicle v ON v.id = r.vehicleFk + LEFT JOIN worker w ON w.id = r.workerFk + LEFT JOIN account.user u ON u.id = w.id + LEFT JOIN agencyMode am ON am.id = r.agencyModeFk + LEFT JOIN agency a ON a.id = am.agencyFk + LEFT JOIN supplierAgencyTerm sa ON sa.agencyFk = a.id + LEFT JOIN supplier s ON s.id = sa.supplierFk + WHERE r.id IN(?) diff --git a/print/templates/reports/driver-route/sql/tickets.sql b/print/templates/reports/driver-route/sql/tickets.sql index 9d548c2b3..1ffb4d623 100644 --- a/print/templates/reports/driver-route/sql/tickets.sql +++ b/print/templates/reports/driver-route/sql/tickets.sql @@ -1,43 +1,42 @@ -SELECT - t.nickname addressName, - t.packages, - t.priority, - t.id, - t.clientFk, - t.companyFk, - t.routeFk, - if(a.phone, a.phone, c.phone) AS phone, - if(a.mobile, a.mobile, c.mobile) AS mobile, - wh.name warehouseName, - a.city, - a.street, - a.postalCode, - LPAD(a.id, 5, '0') AS addressFk, - p.name province, - 0 AS import, - am.name ticketAgency, - tob.description, - u.nickName salesPersonName, - ipkg.itemPackingTypes -FROM route r - JOIN ticket t ON t.routeFk = r.id - LEFT JOIN address a ON a.id = t.addressFk - LEFT JOIN client c ON c.id = t.clientFk - LEFT JOIN worker w ON w.id = client_getSalesPerson(t.clientFk, CURDATE()) - LEFT JOIN account.user u ON u.id = w.id - LEFT JOIN ticketObservation tob ON tob.ticketFk = t.id AND tob.observationTypeFk = 3 - LEFT JOIN province p ON a.provinceFk = p.id - LEFT JOIN warehouse wh ON wh.id = t.warehouseFk - LEFT JOIN agencyMode am ON am.id = t.agencyModeFk - LEFT JOIN ( - SELECT t.id AS ticketFk, - GROUP_CONCAT(DISTINCT(i.itemPackingTypeFk)) AS itemPackingTypes - FROM route r - JOIN ticket t ON t.routeFk = r.id - JOIN sale s ON s.ticketFk = t.id - JOIN item i ON i.id = s.itemFk - WHERE r.id IN (?) - GROUP BY t.id - ) ipkg ON ipkg.ticketFk = t.id -WHERE r.id IN (?) -ORDER BY t.priority, t.id; \ No newline at end of file +SELECT t.nickname addressName, + t.packages, + t.priority, + t.id, + t.clientFk, + t.companyFk, + t.routeFk, + if(a.phone, a.phone, c.phone) phone, + if(a.mobile, a.mobile, c.mobile) mobile, + wh.name warehouseName, + a.city, + a.street, + a.postalCode, + LPAD(a.id, 5, '0') addressFk, + p.name province, + 0 import, + am.name ticketAgency, + tob.description, + u.nickName salesPersonName, + ipkg.itemPackingTypes + FROM route r + JOIN ticket t ON t.routeFk = r.id + LEFT JOIN address a ON a.id = t.addressFk + LEFT JOIN client c ON c.id = t.clientFk + LEFT JOIN worker w ON w.id = client_getSalesPerson(t.clientFk, CURDATE()) + LEFT JOIN account.user u ON u.id = w.id + LEFT JOIN ticketObservation tob ON tob.ticketFk = t.id AND tob.observationTypeFk = 3 + LEFT JOIN province p ON a.provinceFk = p.id + LEFT JOIN warehouse wh ON wh.id = t.warehouseFk + LEFT JOIN agencyMode am ON am.id = t.agencyModeFk + LEFT JOIN ( + SELECT t.id AS ticketFk, + GROUP_CONCAT(DISTINCT(i.itemPackingTypeFk)) AS itemPackingTypes + FROM route r + JOIN ticket t ON t.routeFk = r.id + JOIN sale s ON s.ticketFk = t.id + JOIN item i ON i.id = s.itemFk + WHERE r.id IN (?) + GROUP BY t.id + ) ipkg ON ipkg.ticketFk = t.id + WHERE r.id IN (?) + ORDER BY t.priority, t.id; \ No newline at end of file From 2a7807a4ab1ba55e900e2d22ff04320537345177 Mon Sep 17 00:00:00 2001 From: pablone Date: Thu, 4 Apr 2024 08:49:47 +0200 Subject: [PATCH 17/20] remove: refs #7145 dev code --- print/templates/reports/driver-route/assets/css/style.css | 4 ---- print/templates/reports/driver-route/driver-route.html | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/print/templates/reports/driver-route/assets/css/style.css b/print/templates/reports/driver-route/assets/css/style.css index 0f08f6493..02d6778ce 100644 --- a/print/templates/reports/driver-route/assets/css/style.css +++ b/print/templates/reports/driver-route/assets/css/style.css @@ -4,10 +4,6 @@ td{ text-overflow: ellipsis; } -/* .text-field{ - text-overflow: ellipsis; -} */ - h1 { text-align: center; } diff --git a/print/templates/reports/driver-route/driver-route.html b/print/templates/reports/driver-route/driver-route.html index 1391f621c..109afd2f5 100644 --- a/print/templates/reports/driver-route/driver-route.html +++ b/print/templates/reports/driver-route/driver-route.html @@ -103,7 +103,7 @@
{{$t('street')}}{{$t('street')}} {{ticket.street}} {{$t('postcode')}} {{ticket.postalCode}}
- + From c685000b470b9a53f60719bd344bd0236bfdd44a Mon Sep 17 00:00:00 2001 From: guillermo Date: Thu, 4 Apr 2024 10:13:56 +0200 Subject: [PATCH 18/20] hotfix: refs #6930 Rollback tokenMultimedia --- back/methods/dms/downloadFile.js | 2 +- back/methods/docuware/download.js | 2 +- back/methods/image/download.js | 2 +- front/core/services/token.js | 3 ++- modules/claim/back/methods/claim/claimPickupPdf.js | 2 +- modules/claim/back/methods/claim/downloadFile.js | 2 +- modules/client/back/methods/client/campaignMetricsPdf.js | 2 +- modules/entry/back/methods/entry/entryOrderPdf.js | 2 +- modules/invoiceOut/back/methods/invoiceOut/download.js | 2 +- modules/invoiceOut/back/methods/invoiceOut/downloadZip.js | 2 +- modules/invoiceOut/back/methods/invoiceOut/exportationPdf.js | 2 +- modules/invoiceOut/back/methods/invoiceOut/invoiceCsv.js | 2 +- modules/invoiceOut/back/methods/invoiceOut/negativeBasesCsv.js | 2 +- modules/item/back/methods/item-image-queue/download.js | 2 +- modules/route/back/methods/route/downloadCmrsZip.js | 2 +- modules/route/back/methods/route/downloadZip.js | 2 +- modules/route/back/methods/route/driverRoutePdf.js | 2 +- modules/supplier/back/methods/supplier/campaignMetricsPdf.js | 2 +- modules/ticket/back/methods/ticket/deliveryNoteCsv.js | 2 +- modules/ticket/back/methods/ticket/deliveryNotePdf.js | 2 +- modules/travel/back/methods/travel/extraCommunityPdf.js | 2 +- modules/worker/back/methods/worker-dms/downloadFile.js | 2 +- 22 files changed, 23 insertions(+), 22 deletions(-) diff --git a/back/methods/dms/downloadFile.js b/back/methods/dms/downloadFile.js index d64b15b70..6f2451505 100644 --- a/back/methods/dms/downloadFile.js +++ b/back/methods/dms/downloadFile.js @@ -30,7 +30,7 @@ module.exports = Self => { path: `/:id/downloadFile`, verb: 'GET' }, - accessScopes: ['read:multimedia'] + // accessScopes: ['read:multimedia'] }); Self.downloadFile = async function(ctx, id) { diff --git a/back/methods/docuware/download.js b/back/methods/docuware/download.js index a1776cde5..4aa40197f 100644 --- a/back/methods/docuware/download.js +++ b/back/methods/docuware/download.js @@ -43,7 +43,7 @@ module.exports = Self => { path: `/:id/download`, verb: 'GET' }, - accessScopes: ['read:multimedia'] + // accessScopes: ['read:multimedia'] }); Self.download = async function(id, fileCabinet, filter) { diff --git a/back/methods/image/download.js b/back/methods/image/download.js index 201e16164..9ac06f30b 100644 --- a/back/methods/image/download.js +++ b/back/methods/image/download.js @@ -48,7 +48,7 @@ module.exports = Self => { path: `/:collection/:size/:id/download`, verb: 'GET' }, - accessScopes: ['read:multimedia'] + // accessScopes: ['read:multimedia'] }); Self.download = async function(ctx, collection, size, id) { diff --git a/front/core/services/token.js b/front/core/services/token.js index 125de6b9a..028ebd841 100644 --- a/front/core/services/token.js +++ b/front/core/services/token.js @@ -59,7 +59,8 @@ export default class Token { getStorage(storage) { this.token = storage.getItem('vnToken'); - this.tokenMultimedia = storage.getItem('vnTokenMultimedia'); + // Cambio realizado temporalmente + this.tokenMultimedia = this.token; // storage.getItem('vnTokenMultimedia'); if (!this.token) return; const created = storage.getItem('vnTokenCreated'); this.created = created && new Date(created); diff --git a/modules/claim/back/methods/claim/claimPickupPdf.js b/modules/claim/back/methods/claim/claimPickupPdf.js index 4b66bd418..390be33b9 100644 --- a/modules/claim/back/methods/claim/claimPickupPdf.js +++ b/modules/claim/back/methods/claim/claimPickupPdf.js @@ -35,7 +35,7 @@ module.exports = Self => { path: '/:id/claim-pickup-pdf', verb: 'GET' }, - accessScopes: ['read:multimedia'] + //accessScopes: ['read:multimedia'] }); Self.claimPickupPdf = (ctx, id) => Self.printReport(ctx, id, 'claim-pickup-order'); diff --git a/modules/claim/back/methods/claim/downloadFile.js b/modules/claim/back/methods/claim/downloadFile.js index 61784f39e..7e49708f5 100644 --- a/modules/claim/back/methods/claim/downloadFile.js +++ b/modules/claim/back/methods/claim/downloadFile.js @@ -33,7 +33,7 @@ module.exports = Self => { path: `/:id/downloadFile`, verb: 'GET' }, - accessScopes: ['read:multimedia'] + //accessScopes: ['read:multimedia'] }); Self.downloadFile = async function(ctx, id) { diff --git a/modules/client/back/methods/client/campaignMetricsPdf.js b/modules/client/back/methods/client/campaignMetricsPdf.js index 20c35494e..14ae8646d 100644 --- a/modules/client/back/methods/client/campaignMetricsPdf.js +++ b/modules/client/back/methods/client/campaignMetricsPdf.js @@ -46,7 +46,7 @@ module.exports = Self => { path: '/:id/campaign-metrics-pdf', verb: 'GET' }, - accessScopes: ['read:multimedia'] + //accessScopes: ['read:multimedia'] }); Self.campaignMetricsPdf = (ctx, id) => Self.printReport(ctx, id, 'campaign-metrics'); diff --git a/modules/entry/back/methods/entry/entryOrderPdf.js b/modules/entry/back/methods/entry/entryOrderPdf.js index 93c1b6bd9..2f6489d3f 100644 --- a/modules/entry/back/methods/entry/entryOrderPdf.js +++ b/modules/entry/back/methods/entry/entryOrderPdf.js @@ -34,7 +34,7 @@ module.exports = Self => { path: '/:id/entry-order-pdf', verb: 'GET' }, - accessScopes: ['read:multimedia'] + //accessScopes: ['read:multimedia'] }); Self.entryOrderPdf = (ctx, id) => Self.printReport(ctx, id, 'entry-order'); diff --git a/modules/invoiceOut/back/methods/invoiceOut/download.js b/modules/invoiceOut/back/methods/invoiceOut/download.js index cb71121d5..24fb9fde3 100644 --- a/modules/invoiceOut/back/methods/invoiceOut/download.js +++ b/modules/invoiceOut/back/methods/invoiceOut/download.js @@ -32,7 +32,7 @@ module.exports = Self => { path: '/:id/download', verb: 'GET' }, - accessScopes: ['read:multimedia'] + // accessScopes: ['read:multimedia'] }); Self.download = async function(ctx, id, options) { diff --git a/modules/invoiceOut/back/methods/invoiceOut/downloadZip.js b/modules/invoiceOut/back/methods/invoiceOut/downloadZip.js index 4f2a8aab3..13305f6ed 100644 --- a/modules/invoiceOut/back/methods/invoiceOut/downloadZip.js +++ b/modules/invoiceOut/back/methods/invoiceOut/downloadZip.js @@ -32,7 +32,7 @@ module.exports = Self => { path: '/downloadZip', verb: 'GET' }, - accessScopes: ['read:multimedia'] + // accessScopes: ['read:multimedia'] }); Self.downloadZip = async function(ctx, ids, options) { diff --git a/modules/invoiceOut/back/methods/invoiceOut/exportationPdf.js b/modules/invoiceOut/back/methods/invoiceOut/exportationPdf.js index 0b08aec6d..a2d877189 100644 --- a/modules/invoiceOut/back/methods/invoiceOut/exportationPdf.js +++ b/modules/invoiceOut/back/methods/invoiceOut/exportationPdf.js @@ -35,7 +35,7 @@ module.exports = Self => { path: '/:reference/exportation-pdf', verb: 'GET' }, - accessScopes: ['read:multimedia'] + // accessScopes: ['read:multimedia'] }); Self.exportationPdf = (ctx, reference) => Self.printReport(ctx, reference, 'exportation'); diff --git a/modules/invoiceOut/back/methods/invoiceOut/invoiceCsv.js b/modules/invoiceOut/back/methods/invoiceOut/invoiceCsv.js index 6822e5a23..6208d0625 100644 --- a/modules/invoiceOut/back/methods/invoiceOut/invoiceCsv.js +++ b/modules/invoiceOut/back/methods/invoiceOut/invoiceCsv.js @@ -38,7 +38,7 @@ module.exports = Self => { path: '/:reference/invoice-csv', verb: 'GET' }, - accessScopes: ['read:multimedia'] + // accessScopes: ['read:multimedia'] }); Self.invoiceCsv = async reference => { diff --git a/modules/invoiceOut/back/methods/invoiceOut/negativeBasesCsv.js b/modules/invoiceOut/back/methods/invoiceOut/negativeBasesCsv.js index 6ac56b68c..6970bf368 100644 --- a/modules/invoiceOut/back/methods/invoiceOut/negativeBasesCsv.js +++ b/modules/invoiceOut/back/methods/invoiceOut/negativeBasesCsv.js @@ -40,7 +40,7 @@ module.exports = Self => { path: '/negativeBasesCsv', verb: 'GET' }, - accessScopes: ['read:multimedia'] + // accessScopes: ['read:multimedia'] }); Self.negativeBasesCsv = async(ctx, options) => { diff --git a/modules/item/back/methods/item-image-queue/download.js b/modules/item/back/methods/item-image-queue/download.js index e1bc248ae..354771071 100644 --- a/modules/item/back/methods/item-image-queue/download.js +++ b/modules/item/back/methods/item-image-queue/download.js @@ -11,7 +11,7 @@ module.exports = Self => { path: `/download`, verb: 'POST', }, - accessScopes: ['read:multimedia'] + //accessScopes: ['read:multimedia'] }); Self.download = async() => { diff --git a/modules/route/back/methods/route/downloadCmrsZip.js b/modules/route/back/methods/route/downloadCmrsZip.js index 43f6e9648..1ef25d175 100644 --- a/modules/route/back/methods/route/downloadCmrsZip.js +++ b/modules/route/back/methods/route/downloadCmrsZip.js @@ -30,7 +30,7 @@ module.exports = Self => { path: '/downloadCmrsZip', verb: 'GET' }, - accessScopes: ['read:multimedia'] + //accessScopes: ['read:multimedia'] }); Self.downloadCmrsZip = async function(ctx, ids, options) { diff --git a/modules/route/back/methods/route/downloadZip.js b/modules/route/back/methods/route/downloadZip.js index d7fc30aa3..b226cf7f8 100644 --- a/modules/route/back/methods/route/downloadZip.js +++ b/modules/route/back/methods/route/downloadZip.js @@ -30,7 +30,7 @@ module.exports = Self => { path: '/downloadZip', verb: 'GET' }, - accessScopes: ['read:multimedia'] + //accessScopes: ['read:multimedia'] }); Self.downloadZip = async function(ctx, id, options) { diff --git a/modules/route/back/methods/route/driverRoutePdf.js b/modules/route/back/methods/route/driverRoutePdf.js index e7b4dee17..9469356bb 100644 --- a/modules/route/back/methods/route/driverRoutePdf.js +++ b/modules/route/back/methods/route/driverRoutePdf.js @@ -35,7 +35,7 @@ module.exports = Self => { path: '/:id/driver-route-pdf', verb: 'GET' }, - accessScopes: ['read:multimedia'] + //accessScopes: ['read:multimedia'] }); diff --git a/modules/supplier/back/methods/supplier/campaignMetricsPdf.js b/modules/supplier/back/methods/supplier/campaignMetricsPdf.js index 51c626e69..55767e9c6 100644 --- a/modules/supplier/back/methods/supplier/campaignMetricsPdf.js +++ b/modules/supplier/back/methods/supplier/campaignMetricsPdf.js @@ -45,7 +45,7 @@ module.exports = Self => { path: '/:id/campaign-metrics-pdf', verb: 'GET' }, - accessScopes: ['read:multimedia'] + // accessScopes: ['read:multimedia'] }); Self.campaignMetricsPdf = (ctx, id) => Self.printReport(ctx, id, 'supplier-campaign-metrics'); diff --git a/modules/ticket/back/methods/ticket/deliveryNoteCsv.js b/modules/ticket/back/methods/ticket/deliveryNoteCsv.js index 9fa3c183e..29a859842 100644 --- a/modules/ticket/back/methods/ticket/deliveryNoteCsv.js +++ b/modules/ticket/back/methods/ticket/deliveryNoteCsv.js @@ -38,7 +38,7 @@ module.exports = Self => { path: '/:id/delivery-note-csv', verb: 'GET' }, - accessScopes: ['read:multimedia'] + //accessScopes: ['read:multimedia'] }); Self.deliveryNoteCsv = async id => { diff --git a/modules/ticket/back/methods/ticket/deliveryNotePdf.js b/modules/ticket/back/methods/ticket/deliveryNotePdf.js index adc9e4435..6155ff81e 100644 --- a/modules/ticket/back/methods/ticket/deliveryNotePdf.js +++ b/modules/ticket/back/methods/ticket/deliveryNotePdf.js @@ -42,7 +42,7 @@ module.exports = Self => { path: '/:id/delivery-note-pdf', verb: 'GET' }, - accessScopes: ['read:multimedia'] + //accessScopes: ['read:multimedia'] }); Self.deliveryNotePdf = (ctx, id) => Self.printReport(ctx, id, 'delivery-note'); diff --git a/modules/travel/back/methods/travel/extraCommunityPdf.js b/modules/travel/back/methods/travel/extraCommunityPdf.js index 73748ac50..0c7f0a682 100644 --- a/modules/travel/back/methods/travel/extraCommunityPdf.js +++ b/modules/travel/back/methods/travel/extraCommunityPdf.js @@ -79,7 +79,7 @@ module.exports = Self => { path: '/extra-community-pdf', verb: 'GET' }, - accessScopes: ['read:multimedia'] + //accessScopes: ['read:multimedia'] }); Self.extraCommunityPdf = ctx => Self.printReport(ctx, null, 'extra-community'); diff --git a/modules/worker/back/methods/worker-dms/downloadFile.js b/modules/worker/back/methods/worker-dms/downloadFile.js index 08fbcf924..871bbffde 100644 --- a/modules/worker/back/methods/worker-dms/downloadFile.js +++ b/modules/worker/back/methods/worker-dms/downloadFile.js @@ -30,7 +30,7 @@ module.exports = Self => { path: `/:id/downloadFile`, verb: 'GET' }, - accessScopes: ['read:multimedia'] + //accessScopes: ['read:multimedia'] }); Self.downloadFile = async function(ctx, id) { From 9423a2d04351b165ddde6c5bb93f133599212bdf Mon Sep 17 00:00:00 2001 From: sergiodt Date: Thu, 4 Apr 2024 10:38:55 +0200 Subject: [PATCH 19/20] refs #3520 hotFix: hasUncheckedTickets --- .../ticket/back/methods/ticket-collection/hasUncheckedTicket.js | 2 +- .../methods/ticket-collection/spec/hasUncheckedTicket.spec.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/ticket/back/methods/ticket-collection/hasUncheckedTicket.js b/modules/ticket/back/methods/ticket-collection/hasUncheckedTicket.js index 1ea522de6..43f6faa96 100644 --- a/modules/ticket/back/methods/ticket-collection/hasUncheckedTicket.js +++ b/modules/ticket/back/methods/ticket-collection/hasUncheckedTicket.js @@ -35,6 +35,6 @@ module.exports = Self => { WHERE tc.ticketFk = ? AND s.order < s2.id LIMIT 1;`, [ticketFk], myOptions); - return result.length > 0 && result[0]['ticketFk'] > 0; + return result[0]?.ticketFk > 0 && result[0].ticketFk; }; }; diff --git a/modules/ticket/back/methods/ticket-collection/spec/hasUncheckedTicket.spec.js b/modules/ticket/back/methods/ticket-collection/spec/hasUncheckedTicket.spec.js index ae7a8e6ee..a75784a23 100644 --- a/modules/ticket/back/methods/ticket-collection/spec/hasUncheckedTicket.spec.js +++ b/modules/ticket/back/methods/ticket-collection/spec/hasUncheckedTicket.spec.js @@ -27,7 +27,7 @@ describe('ticketCollection hasUncheckedTicket()', () => { }, myOptions); const result = await models.TicketCollection.hasUncheckedTicket(ticketFk, myOptions); - expect(result).toBe(true); + expect(result).toBeTruthy(); await tx.rollback(); } catch (e) { await tx.rollback(); From 8702a6808c8bddb28be5ee3c402ec922320e06f8 Mon Sep 17 00:00:00 2001 From: guillermo Date: Thu, 4 Apr 2024 11:25:03 +0200 Subject: [PATCH 20/20] hotfix: #7024 Modified duaInvoiceInBooking --- db/routines/vn/procedures/duaInvoiceInBooking.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/db/routines/vn/procedures/duaInvoiceInBooking.sql b/db/routines/vn/procedures/duaInvoiceInBooking.sql index 26580907c..f95e836b1 100644 --- a/db/routines/vn/procedures/duaInvoiceInBooking.sql +++ b/db/routines/vn/procedures/duaInvoiceInBooking.sql @@ -33,6 +33,7 @@ BEGIN ii.operated = IFNULL(ii.operated,d.operated), ii.issued = IFNULL(ii.issued,d.issued), ii.bookEntried = IFNULL(ii.bookEntried,d.bookEntried), + e.isBooked = TRUE, e.isConfirmed = TRUE WHERE d.id = vDuaFk;
{{$t('street')}}{{$t('street')}} {{ticket.street}} {{$t('postcode')}} {{ticket.postalCode}}