From 1b8ed05f71b7e7edb0b67f19405374172215d5b2 Mon Sep 17 00:00:00 2001 From: vicent Date: Wed, 15 Mar 2023 13:28:28 +0100 Subject: [PATCH] =?UTF-8?q?refs=20#5395=20feat:=20modificado=20orderBy,=20?= =?UTF-8?q?a=C3=B1adida=20columna=20importa=20y=20corregidos=20errores?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../back/methods/claim-state/isEditable.js | 16 +++++++------- .../methods/travel/extraCommunityFilter.js | 2 ++ .../travel/front/extra-community/index.html | 21 ++++++++----------- 3 files changed, 19 insertions(+), 20 deletions(-) diff --git a/modules/claim/back/methods/claim-state/isEditable.js b/modules/claim/back/methods/claim-state/isEditable.js index 2d0a8dc44..ad51d543a 100644 --- a/modules/claim/back/methods/claim-state/isEditable.js +++ b/modules/claim/back/methods/claim-state/isEditable.js @@ -26,13 +26,13 @@ module.exports = Self => { if (typeof options == 'object') Object.assign(myOptions, options); - - const state = await models.ClaimState.findById(id, { - include: { - relation: 'writeRole' - } - }, myOptions); - const roleWithGrants = state && state.writeRole().name; - return await models.Account.hasRole(userId, roleWithGrants, myOptions); + + const state = await models.ClaimState.findById(id, { + include: { + relation: 'writeRole' + } + }, myOptions); + const roleWithGrants = state && state.writeRole().name; + return await models.Account.hasRole(userId, roleWithGrants, myOptions); }; }; diff --git a/modules/travel/back/methods/travel/extraCommunityFilter.js b/modules/travel/back/methods/travel/extraCommunityFilter.js index 027261c4b..5ee51de8e 100644 --- a/modules/travel/back/methods/travel/extraCommunityFilter.js +++ b/modules/travel/back/methods/travel/extraCommunityFilter.js @@ -130,6 +130,7 @@ module.exports = Self => { SUM(b.stickers) AS stickers, s.id AS cargoSupplierFk, s.nickname AS cargoSupplierNickname, + s.name AS supplierName, CAST(SUM(b.weight * b.stickers) as DECIMAL(10,0)) as loadedKg, CAST(SUM(vc.aerealVolumetricDensity * b.stickers * IF(pkg.volume, pkg.volume, pkg.width * pkg.depth * pkg.height) / 1000000) as DECIMAL(10,0)) as volumeKg FROM travel t @@ -167,6 +168,7 @@ module.exports = Self => { SUM(b.stickers) AS stickers, e.evaNotes, e.notes, + e.invoiceAmount, CAST(SUM(b.weight * b.stickers) AS DECIMAL(10,0)) as loadedkg, CAST(SUM(vc.aerealVolumetricDensity * b.stickers * IF(pkg.volume, pkg.volume, pkg.width * pkg.depth * pkg.height) / 1000000) AS DECIMAL(10,0)) as volumeKg FROM tmp.travel tr diff --git a/modules/travel/front/extra-community/index.html b/modules/travel/front/extra-community/index.html index ee8dcdf98..73e62b174 100644 --- a/modules/travel/front/extra-community/index.html +++ b/modules/travel/front/extra-community/index.html @@ -3,7 +3,7 @@ url="Travels/extraCommunityFilter" filter="::$ctrl.filter" data="travels" - order="shipped ASC, landed ASC, travelFk, loadPriority, agencyModeFk, evaNotes" + order="landed ASC, shipped ASC, travelFk, loadPriority, agencyModeFk, supplierName, evaNotes" limit="20" auto-load="true"> @@ -48,6 +48,9 @@ Agency + + Amount + Reference @@ -107,6 +110,7 @@ {{::travel.cargoSupplierNickname}} + {{::travel.agencyModeName}} @@ -157,22 +161,15 @@ {{::entry.supplierName}} + {{::entry.invoiceAmount | currency: 'EUR': 2}} - {{::entry.ref}} + {{::entry.invoiceNumber}} {{::entry.stickers}} {{::entry.loadedkg}} {{::entry.volumeKg}} - - - {{::entry.notes}} - - - - - {{::entry.evaNotes}} - - + +