From 56925be41fd2023a3dbe5e47b1a3ede9d2102494 Mon Sep 17 00:00:00 2001 From: joan Date: Thu, 7 Jan 2021 14:21:17 +0100 Subject: [PATCH 1/9] 2708 - Extra community changes --- .../methods/travel/extraCommunityFilter.js | 4 +- modules/travel/back/models/travel.json | 3 ++ .../extra-community-search-panel/index.html | 12 +++-- .../extra-community-search-panel/index.js | 54 ++++++++++++++++++- .../travel/front/extra-community/index.html | 37 ++++++++----- modules/travel/front/extra-community/index.js | 6 +++ .../front/extra-community/locale/es.yml | 4 +- .../travel/front/extra-community/style.scss | 4 +- 8 files changed, 100 insertions(+), 24 deletions(-) diff --git a/modules/travel/back/methods/travel/extraCommunityFilter.js b/modules/travel/back/methods/travel/extraCommunityFilter.js index 4a49b4401..a2a355209 100644 --- a/modules/travel/back/methods/travel/extraCommunityFilter.js +++ b/modules/travel/back/methods/travel/extraCommunityFilter.js @@ -172,8 +172,8 @@ module.exports = Self => { e.notes, CAST(SUM(i.density * b.stickers * IF(pkg.volume, pkg.volume, pkg.width * pkg.depth * pkg.height) / 1000000 ) as DECIMAL(10,0)) as loadedkg, CAST(SUM(167.5 * b.stickers * IF(pkg.volume, pkg.volume, pkg.width * pkg.depth * pkg.height) / 1000000 ) as DECIMAL(10,0)) as volumeKg - FROM entry e - JOIN tmp.travel tr ON tr.id = e.travelFk + FROM tmp.travel tr + JOIN entry e ON e.travelFk = tr.id JOIN buy b ON b.entryFk = e.id JOIN packaging pkg ON pkg.id = b.packageFk JOIN item i ON i.id = b.itemFk diff --git a/modules/travel/back/models/travel.json b/modules/travel/back/models/travel.json index df5b183b1..cd2f1d653 100644 --- a/modules/travel/back/models/travel.json +++ b/modules/travel/back/models/travel.json @@ -37,6 +37,9 @@ "m3": { "type": "Number" }, + "kg": { + "type": "Number" + }, "cargoSupplierFk": { "type": "Number" }, diff --git a/modules/travel/front/extra-community-search-panel/index.html b/modules/travel/front/extra-community-search-panel/index.html index 85a30907a..00b1f14a0 100644 --- a/modules/travel/front/extra-community-search-panel/index.html +++ b/modules/travel/front/extra-community-search-panel/index.html @@ -39,24 +39,28 @@ + ng-model="filter.shippedFrom" + on-change="$ctrl.shippedFrom = value"> + ng-model="filter.shippedTo" + on-change="$ctrl.shippedTo = value"> + ng-model="filter.landedFrom" + on-change="$ctrl.landedFrom = value"> + ng-model="filter.landedTo" + on-change="$ctrl.landedTo = value"> diff --git a/modules/travel/front/extra-community-search-panel/index.js b/modules/travel/front/extra-community-search-panel/index.js index 63d404b4b..f2e4b66d9 100644 --- a/modules/travel/front/extra-community-search-panel/index.js +++ b/modules/travel/front/extra-community-search-panel/index.js @@ -1,7 +1,59 @@ import ngModule from '../module'; import SearchPanel from 'core/components/searchbar/search-panel'; +class Controller extends SearchPanel { + constructor($, $element) { + super($, $element); + + this.filter = this.$.filter; + } + + get shippedFrom() { + return this._shippedFrom; + } + + set shippedFrom(value) { + this._shippedFrom = value; + + if (!this.filter.shippedTo) + this.filter.shippedTo = value; + } + + get shippedTo() { + return this._shippedTo; + } + + set shippedTo(value) { + this._shippedTo = value; + + if (!this.filter.shippedFrom) + this.filter.shippedFrom = value; + } + + get landedFrom() { + return this._landedFrom; + } + + set landedFrom(value) { + this._landedFrom = value; + + if (!this.filter.landedTo) + this.filter.landedTo = value; + } + + get landedTo() { + return this._landedTo; + } + + set landedTo(value) { + this._landedTo = value; + + if (!this.filter.landedFrom) + this.filter.landedFrom = value; + } +} + ngModule.vnComponent('vnExtraCommunitySearchPanel', { template: require('./index.html'), - controller: SearchPanel + controller: Controller }); diff --git a/modules/travel/front/extra-community/index.html b/modules/travel/front/extra-community/index.html index 84e6fcb85..265eddcdc 100644 --- a/modules/travel/front/extra-community/index.html +++ b/modules/travel/front/extra-community/index.html @@ -17,11 +17,11 @@ - +
- + - + Id Supplier Freighter @@ -30,17 +30,17 @@ Bl. KG Phy. KG Vol. KG - - Wh. Out - - Shipped Wh. In - Landed + W. Shipped + + Wh. Out + + W. Landed - + + on-change="$ctrl.save(travel.id, {ref: value})"> {{::travel.stickers}} - {{::travel.kg}} + + {{travel.kg}} + + + + + {{::travel.loadedKg}} {{::travel.volumeKg}} - {{::travel.warehouseOutName}} - {{::travel.shipped | date: 'dd/MM/yyyy'}} {{::travel.warehouseInName}} + {{::travel.shipped | date: 'dd/MM/yyyy'}} + {{::travel.warehouseOutName}} {{::travel.landed | date: 'dd/MM/yyyy'}} {{::entry.supplierName}} {{::entry.ref}} - {{::entry.stickers}} + {{::entry.stickers}} 1123 {{::entry.loadedkg}} {{::entry.volumeKg}} diff --git a/modules/travel/front/extra-community/index.js b/modules/travel/front/extra-community/index.js index 221d6cb0d..1c8db7b68 100644 --- a/modules/travel/front/extra-community/index.js +++ b/modules/travel/front/extra-community/index.js @@ -83,6 +83,12 @@ class Controller extends Section { this.$http.patch(endpoint, params) .then(() => this.vnApp.showSuccess(this.$t('Data saved!'))); } + + save(id, data) { + const endpoint = `Travels/${id}`; + this.$http.patch(endpoint, data) + .then(() => this.vnApp.showSuccess(this.$t('Data saved!'))); + } } ngModule.vnComponent('vnTravelExtraCommunity', { diff --git a/modules/travel/front/extra-community/locale/es.yml b/modules/travel/front/extra-community/locale/es.yml index e377a1011..0c47d1f05 100644 --- a/modules/travel/front/extra-community/locale/es.yml +++ b/modules/travel/front/extra-community/locale/es.yml @@ -5,4 +5,6 @@ Bl. KG: KG Bloq. Phy. KG: KG físico Vol. KG: KG Vol. Search by travel id or reference: Buscar por id travel o referencia -Continent Out: Continente salida \ No newline at end of file +Continent Out: Continente salida +W. Shipped: F. envío +W. Landed: F. llegada \ No newline at end of file diff --git a/modules/travel/front/extra-community/style.scss b/modules/travel/front/extra-community/style.scss index e7265781d..41544242d 100644 --- a/modules/travel/front/extra-community/style.scss +++ b/modules/travel/front/extra-community/style.scss @@ -26,11 +26,11 @@ vn-travel-extra-community { color: $color-active } - vn-td-editable text:after { + vn-td-editable:hover text:after { font-family: 'Material Icons'; content: 'edit'; position: absolute; - margin-left: 5px; + right: -15px; color: $color-spacer } -- 2.40.1 From 1cc271023132d7a7bcfa59de78f8c1ea8ddb54d4 Mon Sep 17 00:00:00 2001 From: joan Date: Fri, 8 Jan 2021 10:16:38 +0100 Subject: [PATCH 2/9] Fixes --- modules/travel/front/extra-community/index.html | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/modules/travel/front/extra-community/index.html b/modules/travel/front/extra-community/index.html index 265eddcdc..77cebec76 100644 --- a/modules/travel/front/extra-community/index.html +++ b/modules/travel/front/extra-community/index.html @@ -19,6 +19,13 @@
+ + + + @@ -89,17 +96,17 @@ {{::entry.supplierName}} {{::entry.ref}} - {{::entry.stickers}} 1123 + {{::entry.stickers}} {{::entry.loadedkg}} {{::entry.volumeKg}} - + {{::entry.notes}} - + {{::entry.evaNotes}} -- 2.40.1 From ddf59932776cbaddff5e09f8f98f9636692f7e57 Mon Sep 17 00:00:00 2001 From: joan Date: Mon, 18 Jan 2021 08:33:20 +0100 Subject: [PATCH 3/9] 2708 - Added report --- .../methods/travel/extraCommunityFilter.js | 44 +++++-- .../extra-community-search-panel/index.html | 7 ++ .../travel/front/extra-community/index.html | 14 +-- modules/travel/front/extra-community/index.js | 24 ++-- print/common/css/spacing.css | 88 +++++++++++--- print/core/database.js | 63 +++++++++- print/core/filters/number.js | 1 + print/core/mixins/db-helper.js | 21 +++- .../buyer-week-waste/buyer-week-waste.html | 4 +- .../campaign-metrics/campaign-metrics.html | 2 +- .../claim-pickup-order.html | 2 +- .../email/client-welcome/client-welcome.html | 2 +- .../delivery-note-link.html | 6 +- .../email/delivery-note/delivery-note.html | 2 +- .../email/driver-route/driver-route.html | 2 +- .../letter-debtor-nd/letter-debtor-nd.html | 4 +- .../letter-debtor-st/letter-debtor-st.html | 4 +- .../email/payment-update/payment-update.html | 2 +- .../email/printer-setup/printer-setup.html | 8 +- .../templates/email/sepa-core/sepa-core.html | 4 +- .../supplier-campaign-metrics.html | 2 +- .../claim-pickup-order.html | 2 +- .../reports/delivery-note/delivery-note.html | 2 +- .../reports/entry-order/entry-order.html | 2 +- .../extra-community/assets/css/import.js | 9 ++ .../extra-community/assets/css/style.css | 7 ++ .../extra-community/extra-community.html | 84 +++++++++++++ .../extra-community/extra-community.js | 115 ++++++++++++++++++ .../reports/extra-community/locale/es.yml | 15 +++ .../reports/extra-community/sql/entries.sql | 15 +++ .../reports/extra-community/sql/travels.sql | 24 ++++ 31 files changed, 504 insertions(+), 77 deletions(-) create mode 100644 print/templates/reports/extra-community/assets/css/import.js create mode 100644 print/templates/reports/extra-community/assets/css/style.css create mode 100644 print/templates/reports/extra-community/extra-community.html create mode 100755 print/templates/reports/extra-community/extra-community.js create mode 100644 print/templates/reports/extra-community/locale/es.yml create mode 100644 print/templates/reports/extra-community/sql/entries.sql create mode 100644 print/templates/reports/extra-community/sql/travels.sql diff --git a/modules/travel/back/methods/travel/extraCommunityFilter.js b/modules/travel/back/methods/travel/extraCommunityFilter.js index a2a355209..831759279 100644 --- a/modules/travel/back/methods/travel/extraCommunityFilter.js +++ b/modules/travel/back/methods/travel/extraCommunityFilter.js @@ -13,65 +13,82 @@ module.exports = Self => { type: 'Object', description: 'Filter defining where, order, offset, and limit - must be a JSON-encoded string', http: {source: 'query'} - }, { + }, + { arg: 'search', type: 'String', description: 'Searchs the travel by id', http: {source: 'query'} - }, { + }, + { arg: 'id', type: 'Integer', description: 'The travel id', http: {source: 'query'} - }, { + }, + { arg: 'shippedFrom', type: 'Date', description: 'The shipped from date filter', http: {source: 'query'} - }, { + }, + { arg: 'shippedTo', type: 'Date', description: 'The shipped to date filter', http: {source: 'query'} - }, { + }, + { arg: 'landedFrom', type: 'Date', description: 'The landed from date filter', http: {source: 'query'} - }, { + }, + { arg: 'landedTo', type: 'Date', description: 'The landed to date filter', http: {source: 'query'} - }, { + }, + { arg: 'agencyFk', type: 'Number', description: 'The agencyModeFk id', http: {source: 'query'} - }, { + }, + { arg: 'warehouseOutFk', type: 'Number', description: 'The warehouseOutFk filter', http: {source: 'query'} - }, { + }, + { arg: 'warehouseInFk', type: 'Number', description: 'The warehouseInFk filter', http: {source: 'query'} - }, { + }, + { arg: 'totalEntries', type: 'Number', description: 'The totalEntries filter', http: {source: 'query'} - }, { + }, + { arg: 'ref', type: 'string', description: 'The reference' - }, { + }, + { arg: 'continent', type: 'string', description: 'The continent code' - } + }, + { + arg: 'cargoSupplierFk', + type: 'Number', + description: 'The freighter supplier id' + }, ], returns: { type: ['Object'], @@ -108,6 +125,7 @@ module.exports = Self => { case 'warehouseOutFk': case 'warehouseInFk': case 'totalEntries': + case 'cargoSupplierFk': param = `t.${param}`; return {[param]: value}; } diff --git a/modules/travel/front/extra-community-search-panel/index.html b/modules/travel/front/extra-community-search-panel/index.html index 00b1f14a0..73c158a03 100644 --- a/modules/travel/front/extra-community-search-panel/index.html +++ b/modules/travel/front/extra-community-search-panel/index.html @@ -80,6 +80,13 @@ + +
- @@ -37,13 +37,13 @@ Bl. KG Phy. KG Vol. KG - - Wh. In - - W. Shipped Wh. Out + W. Shipped + + Wh. In + W. Landed @@ -79,9 +79,9 @@ {{::travel.loadedKg}} {{::travel.volumeKg}} - {{::travel.warehouseInName}} - {{::travel.shipped | date: 'dd/MM/yyyy'}} {{::travel.warehouseOutName}} + {{::travel.shipped | date: 'dd/MM/yyyy'}} + {{::travel.warehouseInName}} {{::travel.landed | date: 'dd/MM/yyyy'}} this.dragStart(event)); @@ -77,20 +79,26 @@ class Controller extends Section { } } - changeReference(travel) { - const params = {ref: travel.ref}; - const endpoint = `Travels/${travel.id}`; - this.$http.patch(endpoint, params) - .then(() => this.vnApp.showSuccess(this.$t('Data saved!'))); - } - save(id, data) { const endpoint = `Travels/${id}`; this.$http.patch(endpoint, data) .then(() => this.vnApp.showSuccess(this.$t('Data saved!'))); } + + get reportParams() { + const userParams = this.$.model.userParams; + return Object.assign({ + authorization: this.vnToken.token + }, userParams); + } + + showReport() { + this.vnReport.show('extra-community', this.reportParams); + } } +Controller.$inject = ['$element', '$scope', 'vnReport']; + ngModule.vnComponent('vnTravelExtraCommunity', { template: require('./index.html'), controller: Controller diff --git a/print/common/css/spacing.css b/print/common/css/spacing.css index 670102d7c..96cb8c828 100644 --- a/print/common/css/spacing.css +++ b/print/common/css/spacing.css @@ -125,30 +125,56 @@ padding-right: 16px; } +/* Medium-Large */ + +.vn-pa-ml { + padding: 32px; +} +.vn-pl-ml { + padding-left: 32px; +} +.vn-pr-ml { + padding-right: 32px; +} +.vn-pt-ml { + padding-top: 32px; +} +.vn-pb-ml { + padding-bottom: 32px; +} +.vn-py-ml { + padding-top: 32px; + padding-bottom: 32px; +} +.vn-px-ml { + padding-left: 32px; + padding-right: 32px; +} + /* Large */ .vn-pa-lg { - padding: 32px; + padding: 64px; } .vn-pl-lg { - padding-left: 32px; + padding-left: 64px; } .vn-pr-lg { - padding-right: 32px; + padding-right: 64px; } .vn-pt-lg { - padding-top: 32px; + padding-top: 64px; } .vn-pb-lg { - padding-bottom: 32px; + padding-bottom: 64px; } .vn-py-lg { - padding-top: 32px; - padding-bottom: 32px; + padding-top: 64px; + padding-bottom: 64px; } .vn-px-lg { - padding-left: 32px; - padding-right: 32px; + padding-left: 64px; + padding-right: 64px; } /* Extra large */ @@ -296,30 +322,56 @@ margin-right: 16px; } +/* Medium-Large */ + +.vn-ma-ml { + margin: 32px; +} +.vn-mt-ml { + margin-top: 32px; +} +.vn-ml-ml { + margin-left: 32px; +} +.vn-mr-ml { + margin-right: 32px; +} +.vn-mb-ml { + margin-bottom: 32px; +} +.vn-my-ml { + margin-top: 32px; + margin-bottom: 32px; +} +.vn-mx-ml { + margin-left: 32px; + margin-right: 32px; +} + /* Large */ .vn-ma-lg { - margin: 32px; + margin: 64px; } .vn-mt-lg { - margin-top: 32px; + margin-top: 64px; } .vn-ml-lg { - margin-left: 32px; + margin-left: 64px; } .vn-mr-lg { - margin-right: 32px; + margin-right: 64px; } .vn-mb-lg { - margin-bottom: 32px; + margin-bottom: 64px; } .vn-my-lg { - margin-top: 32px; - margin-bottom: 32px; + margin-top: 64px; + margin-bottom: 64px; } .vn-mx-lg { - margin-left: 32px; - margin-right: 32px; + margin-left: 64px; + margin-right: 64px; } /* Extra large */ diff --git a/print/core/database.js b/print/core/database.js index 3cc508cef..e879d0e3a 100644 --- a/print/core/database.js +++ b/print/core/database.js @@ -1,6 +1,7 @@ const mysql = require('mysql2/promise'); const config = require('./config.js'); const fs = require('fs-extra'); +const PromisePoolConnection = mysql.PromisePoolConnection; module.exports = { init() { @@ -16,11 +17,17 @@ module.exports = { * Makes a query from a raw sql * @param {String} query - The raw SQL query * @param {Object} params - Parameterized values + * @param {Object} connection - Optional pool connection * * @return {Object} - Result promise */ - rawSql(query, params) { - return this.pool.query(query, params).then(([rows]) => { + rawSql(query, params, connection) { + let pool = this.pool; + if (params instanceof PromisePoolConnection) + connection = params; + if (connection) pool = connection; + + return pool.query(query, params).then(([rows]) => { return rows; }); }, @@ -85,5 +92,57 @@ module.exports = { return this.findOneFromDef(queryName, params).then(row => { return Object.values(row)[0]; }); + }, + + /** + * Returns the content of a SQL file + * @param {String} queryName - The SQL file name + * + * @return {Object} - SQL + */ + getSqlFromDef(queryName) { + return fs.readFileSync(`${queryName}.sql`, 'utf8'); + }, + + /** + * Merges two SQL strings + * + * @param {String} query - Input SQL + * @param {String} sql - String to merge + * + * @return {String} - Merged SQL string + */ + merge(query, sql) { + return query += `\r\n ${sql}`; + }, + + /** + * Builds where string + * + * @param {Object} args - Query params + * @param {Function} callback - Callback + * + * @return {String} - Where Sql string + */ + buildWhere(args, callback) { + let sql = ''; + + for (let prop in args) { + const value = args[prop]; + if (!value) continue; + + const sanitizedValue = mysql.escape(value); + const conditional = callback(prop, sanitizedValue); + + if (!conditional) continue; + + if (sql) sql += ' AND '; + sql += conditional; + } + let where = ''; + if (sql) + where = `WHERE ${sql}`; + + return where; } }; diff --git a/print/core/filters/number.js b/print/core/filters/number.js index a0c5e61f7..430639de4 100644 --- a/print/core/filters/number.js +++ b/print/core/filters/number.js @@ -4,6 +4,7 @@ const defaultLocale = config.i18n.locale; const number = function(value, locale = defaultLocale) { if (!locale) locale = defaultLocale; + if (value === null || value == '') return; return new Intl.NumberFormat(locale, { style: 'decimal' }).format(parseFloat(value)); diff --git a/print/core/mixins/db-helper.js b/print/core/mixins/db-helper.js index 06f4e196d..4a6f9e460 100644 --- a/print/core/mixins/db-helper.js +++ b/print/core/mixins/db-helper.js @@ -8,10 +8,12 @@ const dbHelper = { * Makes a query from a raw sql * @param {String} query - The raw SQL query * @param {Object} params - Parameterized values + * @param {Object} connection - Optional pool connection * * @return {Object} - Result promise */ - rawSql: db.rawSql, + rawSql: (query, params, connection) => + db.rawSql(query, params, connection), /** * Makes a query from a SQL file @@ -32,7 +34,7 @@ const dbHelper = { * * @return {Object} - Result promise */ - findOne: db.findOne, + findOne: (query, params) => db.findOne(query, params), /** * Returns the first row from a given SQL file @@ -53,7 +55,7 @@ const dbHelper = { * * @return {Object} - Result promise */ - findValue: db.findValue, + findValue: (query, params) => db.findValue(query, params), /** * Returns the first property from a given SQL file @@ -66,7 +68,18 @@ const dbHelper = { return this.findOneFromDef(queryName, params).then(row => { return Object.values(row)[0]; }); - } + }, + + /** + * Returns the content of an SQL file + * @param {String} queryName - The SQL file name + * + * @return {Object} - SQL + */ + getSqlFromDef(queryName) { + const absolutePath = path.join(__dirname, '../', this.tplPath, 'sql', queryName); + return db.getSqlFromDef(absolutePath); + }, }, props: ['tplPath'] }; diff --git a/print/templates/email/buyer-week-waste/buyer-week-waste.html b/print/templates/email/buyer-week-waste/buyer-week-waste.html index 9f6b22968..3b0c71160 100644 --- a/print/templates/email/buyer-week-waste/buyer-week-waste.html +++ b/print/templates/email/buyer-week-waste/buyer-week-waste.html @@ -22,7 +22,7 @@
-
+

{{ $t('title') }}

{{$t('dear')}},

@@ -30,7 +30,7 @@
-
+
diff --git a/print/templates/email/campaign-metrics/campaign-metrics.html b/print/templates/email/campaign-metrics/campaign-metrics.html index 9d7014f34..ff8c661ee 100644 --- a/print/templates/email/campaign-metrics/campaign-metrics.html +++ b/print/templates/email/campaign-metrics/campaign-metrics.html @@ -22,7 +22,7 @@
-
+

{{ $t('title') }}

{{$t('dear')}},

diff --git a/print/templates/email/claim-pickup-order/claim-pickup-order.html b/print/templates/email/claim-pickup-order/claim-pickup-order.html index cdde0dd92..f674dcee8 100644 --- a/print/templates/email/claim-pickup-order/claim-pickup-order.html +++ b/print/templates/email/claim-pickup-order/claim-pickup-order.html @@ -22,7 +22,7 @@
-
+

{{ $t('title') }}

{{$t('description.dear')}},

{{$t('description.instructions')}}

diff --git a/print/templates/email/client-welcome/client-welcome.html b/print/templates/email/client-welcome/client-welcome.html index 1d21846d7..07b61b3e6 100644 --- a/print/templates/email/client-welcome/client-welcome.html +++ b/print/templates/email/client-welcome/client-welcome.html @@ -22,7 +22,7 @@
-
+

{{ $t('title') }}

{{$t('dearClient')}},

diff --git a/print/templates/email/delivery-note-link/delivery-note-link.html b/print/templates/email/delivery-note-link/delivery-note-link.html index 78fa2c922..ab58cbb24 100644 --- a/print/templates/email/delivery-note-link/delivery-note-link.html +++ b/print/templates/email/delivery-note-link/delivery-note-link.html @@ -27,7 +27,7 @@
-
+

{{ $t('title') }}

{{$t('dear')}}

@@ -35,7 +35,7 @@
-
+

{{$t('copyLink')}}

-
+

diff --git a/print/templates/email/delivery-note/delivery-note.html b/print/templates/email/delivery-note/delivery-note.html index 71de29a3e..96c53b1d7 100644 --- a/print/templates/email/delivery-note/delivery-note.html +++ b/print/templates/email/delivery-note/delivery-note.html @@ -22,7 +22,7 @@
-
+

{{ $t('title') }}

{{$t('dear')}},

diff --git a/print/templates/email/driver-route/driver-route.html b/print/templates/email/driver-route/driver-route.html index 815b28b8c..069edbfc4 100644 --- a/print/templates/email/driver-route/driver-route.html +++ b/print/templates/email/driver-route/driver-route.html @@ -22,7 +22,7 @@
-
+

{{ $t('title') }}

{{$t('description.instructions')}}

diff --git a/print/templates/email/letter-debtor-nd/letter-debtor-nd.html b/print/templates/email/letter-debtor-nd/letter-debtor-nd.html index 630cce8a2..64bc7ca69 100644 --- a/print/templates/email/letter-debtor-nd/letter-debtor-nd.html +++ b/print/templates/email/letter-debtor-nd/letter-debtor-nd.html @@ -22,7 +22,7 @@
-
+

{{ $t('title') }}

{{ $t('sections.introduction.title') }},

{{ $t('sections.introduction.description') }}

@@ -62,7 +62,7 @@
-
+
-
+

{{ $t('title') }} {{$i18n.locale}}

{{ $t('sections.introduction.title') }},

{{ $t('sections.introduction.description') }}

@@ -45,7 +45,7 @@
-
+
-
+

{{ $t('title') }}

{{ $t('sections.introduction.title') }},

diff --git a/print/templates/email/printer-setup/printer-setup.html b/print/templates/email/printer-setup/printer-setup.html index df0b43f0c..fff21eb90 100644 --- a/print/templates/email/printer-setup/printer-setup.html +++ b/print/templates/email/printer-setup/printer-setup.html @@ -22,7 +22,7 @@
-
+

{{ $t('title') }}

{{$t('description.dear')}},

{{$t('description.instructions')}}

@@ -41,7 +41,7 @@
-
+

{{$t('sections.help.title')}}

{{$t('sections.help.description')}}

@@ -49,7 +49,7 @@
-
+
{{$t('salesPersonName')}}: {{client.salesPersonName}}
@@ -64,7 +64,7 @@
-
+
-
+

{{ $t('title') }}

{{$t('description.dear')}},

@@ -31,7 +31,7 @@
-
+
-
+

{{ $t('title') }}

{{$t('dear')}},

diff --git a/print/templates/reports/claim-pickup-order/claim-pickup-order.html b/print/templates/reports/claim-pickup-order/claim-pickup-order.html index 3cc335887..20c29f0ee 100644 --- a/print/templates/reports/claim-pickup-order/claim-pickup-order.html +++ b/print/templates/reports/claim-pickup-order/claim-pickup-order.html @@ -49,7 +49,7 @@
-
+
diff --git a/print/templates/reports/delivery-note/delivery-note.html b/print/templates/reports/delivery-note/delivery-note.html index b6529dbe3..0004d171b 100644 --- a/print/templates/reports/delivery-note/delivery-note.html +++ b/print/templates/reports/delivery-note/delivery-note.html @@ -14,7 +14,7 @@
-
+

{{$t('title')}}

{{$t('reference')}}
diff --git a/print/templates/reports/entry-order/entry-order.html b/print/templates/reports/entry-order/entry-order.html index dcd2f3ed9..956d4e2f6 100644 --- a/print/templates/reports/entry-order/entry-order.html +++ b/print/templates/reports/entry-order/entry-order.html @@ -54,7 +54,7 @@ -
+
diff --git a/print/templates/reports/extra-community/assets/css/import.js b/print/templates/reports/extra-community/assets/css/import.js new file mode 100644 index 000000000..fd8796c2b --- /dev/null +++ b/print/templates/reports/extra-community/assets/css/import.js @@ -0,0 +1,9 @@ +const Stylesheet = require(`${appPath}/core/stylesheet`); + +module.exports = new Stylesheet([ + `${appPath}/common/css/spacing.css`, + `${appPath}/common/css/misc.css`, + `${appPath}/common/css/layout.css`, + `${appPath}/common/css/report.css`, + `${__dirname}/style.css`]) + .mergeStyles(); diff --git a/print/templates/reports/extra-community/assets/css/style.css b/print/templates/reports/extra-community/assets/css/style.css new file mode 100644 index 000000000..305a174d2 --- /dev/null +++ b/print/templates/reports/extra-community/assets/css/style.css @@ -0,0 +1,7 @@ +h1 { + text-align: center; +} + +th.align-right { + padding-right: 1em; +} \ No newline at end of file diff --git a/print/templates/reports/extra-community/extra-community.html b/print/templates/reports/extra-community/extra-community.html new file mode 100644 index 000000000..86baf858b --- /dev/null +++ b/print/templates/reports/extra-community/extra-community.html @@ -0,0 +1,84 @@ + + + +
{{$t('boxes')}}
+ + + + + +
+ + +
+
+

{{$t('title')}}

+
+
+ + +
+
+
+
{{$t('information')}}
+
+
+ + + + + + + + + + + + + + + + + + + + + +
{{$t('reference')}}{{travel.ref}}{{$t('blockedKg')}}{{travel.kg | number($i18n.locale)}}
{{$t('packages')}}{{travel.stickers}}{{$t('volumeKg')}}{{travel.volumeKg | number($i18n.locale)}}
{{$t('shipped')}}{{travel.shipped | date('%d-%m-%Y')}}{{$t('physicalKg')}}{{travel.loadedKg | number($i18n.locale)}}
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + +
{{$t('supplier')}}{{$t('reference')}}{{$t('volKg')}}{{$t('phyKg')}}{{$t('packages')}}
{{entry.supplierName}}{{entry.ref}}{{entry.volumeKg | number($i18n.locale)}}{{entry.loadedKg | number($i18n.locale)}}{{entry.stickers}}
{{$t('noRows')}}
+
+
+ + + +
+ + \ No newline at end of file diff --git a/print/templates/reports/extra-community/extra-community.js b/print/templates/reports/extra-community/extra-community.js new file mode 100755 index 000000000..ddeabb49b --- /dev/null +++ b/print/templates/reports/extra-community/extra-community.js @@ -0,0 +1,115 @@ +const Component = require(`${appPath}/core/component`); +const reportHeader = new Component('report-header'); +const reportFooter = new Component('report-footer'); +const db = require(`${appPath}/core/database`); + +module.exports = { + name: 'extra-community', + async serverPrefetch() { + this.filters = this.$options.filters; + const args = { + landedFrom: this.landedStart, + landedTo: this.landedEnd, + shippedFrom: this.shippedStart, + shippedTo: this.shippedEnd, + continent: this.continent + }; + + const connection = await db.pool.getConnection(); + + await this.fetchTravels(args, connection); + + const travels = await this.rawSql(` + SELECT * FROM tmp.travel`, connection); + const entries = await this.fetchEntries(connection); + + await this.rawSql(` + DROP TEMPORARY TABLE + tmp.travel`, connection); + + await connection.release(); + + const map = new Map(); + + for (let travel of travels) + map.set(travel.id, travel); + + for (let entry of entries) { + const travel = map.get(entry.travelFk); + if (!travel.entries) travel.entries = []; + travel.entries.push(entry); + } + + this.travels = travels; + + if (!this.travels) + throw new Error('Something went wrong'); + }, + computed: { + dated: function() { + return this.filters.date(new Date(), '%d-%m-%Y'); + }, + landedStart: function() { + if (!this.landedFrom) return; + + return this.filters.date(this.landedFrom, '%Y-%m-%d'); + }, + landedEnd: function() { + if (!this.landedTo) return; + + return this.filters.date(this.landedTo, '%Y-%m-%d'); + }, + shippedStart: function() { + if (!this.shippedFrom) return; + + return this.filters.date(this.shippedFrom, '%Y-%m-%d'); + }, + shippedEnd: function() { + if (!this.shippedTo) return; + + return this.filters.date(this.shippedTo, '%Y-%m-%d'); + } + }, + methods: { + fetchTravels(args, connection) { + const where = db.buildWhere(args, (key, value) => { + switch (key) { + case 'shippedFrom': + return `t.shipped >= ${value}`; + case 'shippedTo': + return `t.shipped <= ${value}`; + case 'landedFrom': + return `t.landed >= ${value}`; + case 'landedTo': + return `t.landed <= ${value}`; + case 'continent': + return `cnt.code = ${value}`; + } + }); + + let query = this.getSqlFromDef('travels'); + query = db.merge(query, where); + query = db.merge(query, 'GROUP BY t.id'); + + return this.rawSql(query, connection); + }, + + fetchEntries(connection) { + let query = this.getSqlFromDef('entries'); + query = db.merge(query, 'GROUP BY e.id'); + + return this.rawSql(query, connection); + } + }, + components: { + 'report-header': reportHeader.build(), + 'report-footer': reportFooter.build() + }, + props: [ + 'landedFrom', + 'landedTo', + 'shippedFrom', + 'shippedTo', + 'continent' + ] +}; diff --git a/print/templates/reports/extra-community/locale/es.yml b/print/templates/reports/extra-community/locale/es.yml new file mode 100644 index 000000000..1112b0fe8 --- /dev/null +++ b/print/templates/reports/extra-community/locale/es.yml @@ -0,0 +1,15 @@ +title: Orden de carga +reference: Referencia +information: Información +packages: Bultos +blockedKg: KG Bloqueado +volumeKg: KG Volumen +physicalKg: KG Físico +volKg: KG Vol. +phyKg: KG Fís. +warehouseIn: Alm. entrada +shipped: F. envío +warehouseOut: Alm. salida +landed: F. llegada +noRows: Sin líneas que mostrar +supplier: Proveedor \ No newline at end of file diff --git a/print/templates/reports/extra-community/sql/entries.sql b/print/templates/reports/extra-community/sql/entries.sql new file mode 100644 index 000000000..5cf22fe44 --- /dev/null +++ b/print/templates/reports/extra-community/sql/entries.sql @@ -0,0 +1,15 @@ +SELECT + e.id, + e.travelFk, + e.ref, + s.name AS supplierName, + SUM(b.stickers) AS stickers, + CAST(SUM(i.density * b.stickers * IF(pkg.volume, pkg.volume, pkg.width * pkg.depth * pkg.height) / 1000000 ) as DECIMAL(10,0)) as loadedKg, + CAST(SUM(167.5 * b.stickers * IF(pkg.volume, pkg.volume, pkg.width * pkg.depth * pkg.height) / 1000000 ) as DECIMAL(10,0)) as volumeKg + FROM tmp.travel t + JOIN entry e ON e.travelFk = t.id + JOIN buy b ON b.entryFk = e.id + JOIN packaging pkg ON pkg.id = b.packageFk + JOIN item i ON i.id = b.itemFk + JOIN itemType it ON it.id = i.typeFk + JOIN supplier s ON s.id = e.supplierFk \ No newline at end of file diff --git a/print/templates/reports/extra-community/sql/travels.sql b/print/templates/reports/extra-community/sql/travels.sql new file mode 100644 index 000000000..f9b421df7 --- /dev/null +++ b/print/templates/reports/extra-community/sql/travels.sql @@ -0,0 +1,24 @@ +CREATE TEMPORARY TABLE tmp.travel + (INDEX (id)) + ENGINE = MEMORY + SELECT + t.id, + t.ref, + t.shipped, + t.landed, + t.kg, + SUM(b.stickers) AS stickers, + CAST(SUM(i.density * b.stickers * IF(pkg.volume, pkg.volume, pkg.width * pkg.depth * pkg.height) / 1000000 ) as DECIMAL(10,0)) as loadedKg, + CAST(SUM(167.5 * b.stickers * IF(pkg.volume, pkg.volume, pkg.width * pkg.depth * pkg.height) / 1000000 ) as DECIMAL(10,0)) as volumeKg + FROM travel t + LEFT JOIN supplier s ON s.id = t.cargoSupplierFk + LEFT JOIN entry e ON e.travelFk = t.id + LEFT JOIN buy b ON b.entryFk = e.id + LEFT JOIN packaging pkg ON pkg.id = b.packageFk + LEFT JOIN item i ON i.id = b.itemFk + LEFT JOIN itemType it ON it.id = i.typeFk + JOIN warehouse w ON w.id = t.warehouseInFk + JOIN warehouse wo ON wo.id = t.warehouseOutFk + JOIN country c ON c.id = wo.countryFk + LEFT JOIN continent cnt ON cnt.id = c.continentFk + JOIN agencyMode am ON am.id = t.agencyFk \ No newline at end of file -- 2.40.1 From 895fd4c9e8ed067d7c1b4b66ce1e6397058e2747 Mon Sep 17 00:00:00 2001 From: joan Date: Mon, 18 Jan 2021 14:22:27 +0100 Subject: [PATCH 4/9] Updated unit test --- .../front/extra-community/index.spec.js | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/modules/travel/front/extra-community/index.spec.js b/modules/travel/front/extra-community/index.spec.js index 2f510f22f..5e284c0d7 100644 --- a/modules/travel/front/extra-community/index.spec.js +++ b/modules/travel/front/extra-community/index.spec.js @@ -14,20 +14,6 @@ describe('Travel Component vnTravelExtraCommunity', () => { controller.$.model.refresh = jest.fn(); })); - describe('changeReference()', () => { - it('should make an HTTP query', () => { - jest.spyOn(controller.vnApp, 'showSuccess'); - - const travel = {id: 1, ref: 'New reference'}; - const expectedData = {ref: 'New reference'}; - $httpBackend.expect('PATCH', `Travels/${travel.id}`, expectedData).respond(200); - controller.changeReference(travel); - $httpBackend.flush(); - - expect(controller.vnApp.showSuccess).toHaveBeenCalledWith('Data saved!'); - }); - }); - describe('findDraggable()', () => { it('should find the draggable element', () => { const draggable = document.createElement('a'); @@ -124,4 +110,19 @@ describe('Travel Component vnTravelExtraCommunity', () => { $httpBackend.flush(); }); }); + + describe('save()', () => { + it('should make an HTTP query', () => { + jest.spyOn(controller.vnApp, 'showSuccess'); + + const travelId = 1; + const data = {ref: 'New reference'}; + const expectedData = {ref: 'New reference'}; + $httpBackend.expect('PATCH', `Travels/${travelId}`, expectedData).respond(200); + controller.save(travelId, data); + $httpBackend.flush(); + + expect(controller.vnApp.showSuccess).toHaveBeenCalledWith('Data saved!'); + }); + }); }); -- 2.40.1 From d6ac9dba4c6e685f97450e74095f32caa9316664 Mon Sep 17 00:00:00 2001 From: joan Date: Mon, 18 Jan 2021 14:53:15 +0100 Subject: [PATCH 5/9] Updated e2e --- e2e/helpers/selectors.js | 3 ++- e2e/paths/10-travel/04_extra_community.spec.js | 9 ++++++++- modules/travel/front/extra-community/index.html | 4 ++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index 8d40542b8..80970975e 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -832,7 +832,8 @@ export default { }, travelExtraCommunity: { anySearchResult: 'vn-travel-extra-community > vn-data-viewer div > vn-tbody > vn-tr', - firstTravelReference: 'vn-travel-extra-community vn-card:nth-child(1) vn-td-editable', + firstTravelReference: 'vn-travel-extra-community vn-card:nth-child(1) vn-td-editable[name="reference"]', + firstTravelLockedKg: 'vn-travel-extra-community vn-card:nth-child(1) vn-td-editable[name="lockedKg"]', removeContinentFilter: 'vn-searchbar > form > vn-textfield > div.container > div.prepend > prepend > div > span:nth-child(3) > vn-icon > i' }, travelBasicData: { diff --git a/e2e/paths/10-travel/04_extra_community.spec.js b/e2e/paths/10-travel/04_extra_community.spec.js index 7a37b89e4..3a3543706 100644 --- a/e2e/paths/10-travel/04_extra_community.spec.js +++ b/e2e/paths/10-travel/04_extra_community.spec.js @@ -22,13 +22,20 @@ describe('Travel extra community path', () => { await page.writeOnEditableTD(selectors.travelExtraCommunity.firstTravelReference, 'edited reference'); }); - it('should reload the index and confirm the reference was edited', async() => { + it('should edit the travel locked kg', async() => { + await page.waitForSpinnerLoad(); + await page.writeOnEditableTD(selectors.travelExtraCommunity.firstTravelLockedKg, '1500'); + }); + + it('should reload the index and confirm the reference and locked kg were edited', async() => { await page.accessToSection('travel.index'); await page.accessToSection('travel.extraCommunity'); await page.waitToClick(selectors.travelExtraCommunity.removeContinentFilter); await page.waitForTextInElement(selectors.travelExtraCommunity.firstTravelReference, 'edited reference'); const reference = await page.getProperty(selectors.travelExtraCommunity.firstTravelReference, 'innerText'); + const lockedKg = await page.getProperty(selectors.travelExtraCommunity.firstTravelLockedKg, 'innerText'); expect(reference).toContain('edited reference'); + expect(lockedKg).toContain(1500); }); }); diff --git a/modules/travel/front/extra-community/index.html b/modules/travel/front/extra-community/index.html index 3d28e16df..c9de8a14d 100644 --- a/modules/travel/front/extra-community/index.html +++ b/modules/travel/front/extra-community/index.html @@ -57,7 +57,7 @@ {{::travel.agencyModeName}} {{::travel.cargoSupplierNickname}} - + {{travel.ref}} {{::travel.stickers}} - + {{travel.kg}} Date: Tue, 19 Jan 2021 11:25:05 +0100 Subject: [PATCH 6/9] Updated e2e --- e2e/paths/10-travel/04_extra_community.spec.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/e2e/paths/10-travel/04_extra_community.spec.js b/e2e/paths/10-travel/04_extra_community.spec.js index 3a3543706..d902bb45e 100644 --- a/e2e/paths/10-travel/04_extra_community.spec.js +++ b/e2e/paths/10-travel/04_extra_community.spec.js @@ -16,14 +16,10 @@ describe('Travel extra community path', () => { await browser.close(); }); - it('should edit the travel reference', async() => { + it('should edit the travel reference and the locked kilograms', async() => { await page.waitToClick(selectors.travelExtraCommunity.removeContinentFilter); await page.waitForSpinnerLoad(); await page.writeOnEditableTD(selectors.travelExtraCommunity.firstTravelReference, 'edited reference'); - }); - - it('should edit the travel locked kg', async() => { - await page.waitForSpinnerLoad(); await page.writeOnEditableTD(selectors.travelExtraCommunity.firstTravelLockedKg, '1500'); }); -- 2.40.1 From 8c8891f8e399b27d90349f91ce4a52e209fa7bfc Mon Sep 17 00:00:00 2001 From: joan Date: Tue, 19 Jan 2021 13:06:10 +0100 Subject: [PATCH 7/9] Requested changes --- modules/ticket/back/methods/ticket/filter.js | 42 +++++++------- .../methods/travel/extraCommunityFilter.js | 58 ++++++++----------- .../travel/front/extra-community/index.html | 3 +- modules/travel/front/extra-community/index.js | 2 +- .../front/extra-community/locale/es.yml | 3 +- 5 files changed, 50 insertions(+), 58 deletions(-) diff --git a/modules/ticket/back/methods/ticket/filter.js b/modules/ticket/back/methods/ticket/filter.js index 6dbe52524..5341de8d1 100644 --- a/modules/ticket/back/methods/ticket/filter.js +++ b/modules/ticket/back/methods/ticket/filter.js @@ -10,75 +10,75 @@ module.exports = Self => { accepts: [ { arg: 'ctx', - type: 'Object', + type: 'object', http: {source: 'context'} }, { arg: 'filter', - type: 'Object', + type: 'object', description: `Filter defining where, order, offset, and limit - must be a JSON-encoded string` }, { arg: 'search', - type: 'String', - description: `If it's and integer searchs by id, otherwise it searchs by nickname` + type: 'string', + description: `If it's and number searchs by id, otherwise it searchs by nickname` }, { arg: 'from', - type: 'Date', + type: 'date', description: `The from date filter` }, { arg: 'to', - type: 'Date', + type: 'date', description: `The to date filter` }, { arg: 'nickname', - type: 'String', + type: 'string', description: `The nickname filter` }, { arg: 'id', - type: 'Integer', + type: 'number', description: `The ticket id filter` }, { arg: 'clientFk', - type: 'Integer', + type: 'number', description: `The client id filter` }, { arg: 'agencyModeFk', - type: 'Integer', + type: 'number', description: `The agency mode id filter` }, { arg: 'warehouseFk', - type: 'Integer', + type: 'number', description: `The warehouse id filter` }, { arg: 'salesPersonFk', - type: 'Integer', + type: 'number', description: `The salesperson id filter` }, { arg: 'provinceFk', - type: 'Integer', + type: 'number', description: `The province id filter` }, { arg: 'stateFk', - type: 'Number', + type: 'number', description: `The state id filter` }, { arg: 'myTeam', - type: 'Boolean', + type: 'boolean', description: `Whether to show only tickets for the current logged user team (For now it shows only the current user tickets)` }, { arg: 'problems', - type: 'Boolean', + type: 'boolean', description: `Whether to show only tickets with problems` }, { arg: 'pending', - type: 'Boolean', + type: 'boolean', description: `Whether to show only tickets with state 'Pending'` }, { arg: 'mine', - type: 'Boolean', + type: 'boolean', description: `Whether to show only tickets for the current logged user` }, { arg: 'orderFk', - type: 'Number', + type: 'number', description: `The order id filter` }, { arg: 'refFk', @@ -86,12 +86,12 @@ module.exports = Self => { description: `The invoice reference filter` }, { arg: 'alertLevel', - type: 'Number', + type: 'number', description: `The alert level of the tickets` } ], returns: { - type: ['Object'], + type: ['object'], root: true }, http: { diff --git a/modules/travel/back/methods/travel/extraCommunityFilter.js b/modules/travel/back/methods/travel/extraCommunityFilter.js index 831759279..73765e38a 100644 --- a/modules/travel/back/methods/travel/extraCommunityFilter.js +++ b/modules/travel/back/methods/travel/extraCommunityFilter.js @@ -10,69 +10,58 @@ module.exports = Self => { accepts: [ { arg: 'filter', - type: 'Object', - description: 'Filter defining where, order, offset, and limit - must be a JSON-encoded string', - http: {source: 'query'} + type: 'object', + description: 'Filter defining where, order, offset, and limit - must be a JSON-encoded string' }, { arg: 'search', - type: 'String', - description: 'Searchs the travel by id', - http: {source: 'query'} + type: 'string', + description: 'Searchs the travel by id' }, { arg: 'id', - type: 'Integer', - description: 'The travel id', - http: {source: 'query'} + type: 'number', + description: 'The travel id' }, { arg: 'shippedFrom', - type: 'Date', - description: 'The shipped from date filter', - http: {source: 'query'} + type: 'date', + description: 'The shipped from date filter' }, { arg: 'shippedTo', - type: 'Date', - description: 'The shipped to date filter', - http: {source: 'query'} + type: 'date', + description: 'The shipped to date filter' }, { arg: 'landedFrom', - type: 'Date', - description: 'The landed from date filter', - http: {source: 'query'} + type: 'date', + description: 'The landed from date filter' }, { arg: 'landedTo', - type: 'Date', - description: 'The landed to date filter', - http: {source: 'query'} + type: 'date', + description: 'The landed to date filter' }, { arg: 'agencyFk', - type: 'Number', - description: 'The agencyModeFk id', - http: {source: 'query'} + type: 'number', + description: 'The agencyModeFk id' }, { arg: 'warehouseOutFk', - type: 'Number', - description: 'The warehouseOutFk filter', - http: {source: 'query'} + type: 'number', + description: 'The warehouseOutFk filter' }, { arg: 'warehouseInFk', - type: 'Number', - description: 'The warehouseInFk filter', - http: {source: 'query'} + type: 'number', + description: 'The warehouseInFk filter' }, { arg: 'totalEntries', - type: 'Number', - description: 'The totalEntries filter', - http: {source: 'query'} + type: 'number', + description: 'The totalEntries filter' }, { arg: 'ref', @@ -86,7 +75,7 @@ module.exports = Self => { }, { arg: 'cargoSupplierFk', - type: 'Number', + type: 'number', description: 'The freighter supplier id' }, ], @@ -132,6 +121,7 @@ module.exports = Self => { }); filter = mergeFilters(filter, {where}); + console.log(JSON.stringify(filter.where)); let stmts = []; let stmt; diff --git a/modules/travel/front/extra-community/index.html b/modules/travel/front/extra-community/index.html index c9de8a14d..88728cf8e 100644 --- a/modules/travel/front/extra-community/index.html +++ b/modules/travel/front/extra-community/index.html @@ -9,9 +9,10 @@ diff --git a/modules/travel/front/extra-community/index.js b/modules/travel/front/extra-community/index.js index ea66fba74..08d4a168f 100644 --- a/modules/travel/front/extra-community/index.js +++ b/modules/travel/front/extra-community/index.js @@ -15,7 +15,7 @@ class Controller extends Section { event => this.dragEnd(event)); this.draggableElement = 'a[draggable]'; - this.droppableElement = 'vn-table[vn-droppable]'; + this.droppableElement = 'vn-tbody[vn-droppable]'; const scopeDays = 14; const landedFrom = new Date(); diff --git a/modules/travel/front/extra-community/locale/es.yml b/modules/travel/front/extra-community/locale/es.yml index 0c47d1f05..dc231226f 100644 --- a/modules/travel/front/extra-community/locale/es.yml +++ b/modules/travel/front/extra-community/locale/es.yml @@ -4,7 +4,8 @@ Freighter: Transitario Bl. KG: KG Bloq. Phy. KG: KG físico Vol. KG: KG Vol. -Search by travel id or reference: Buscar por id travel o referencia +Search by travel id or reference: Buscar por id de travel o referencia +Search by extra community travel: Buscar por envío extra comunitario Continent Out: Continente salida W. Shipped: F. envío W. Landed: F. llegada \ No newline at end of file -- 2.40.1 From 9935f7f4ee988f1a765715accf251bd62637ba44 Mon Sep 17 00:00:00 2001 From: joan Date: Tue, 19 Jan 2021 14:27:58 +0100 Subject: [PATCH 8/9] Updated unit test --- modules/travel/front/extra-community/index.spec.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/travel/front/extra-community/index.spec.js b/modules/travel/front/extra-community/index.spec.js index 5e284c0d7..7815bdd4f 100644 --- a/modules/travel/front/extra-community/index.spec.js +++ b/modules/travel/front/extra-community/index.spec.js @@ -32,7 +32,7 @@ describe('Travel Component vnTravelExtraCommunity', () => { describe('findDroppable()', () => { it('should find the droppable element', () => { - const droppable = document.createElement('vn-table'); + const droppable = document.createElement('vn-tbody'); droppable.setAttribute('vn-droppable', true); const $event = new Event('drop'); @@ -89,13 +89,13 @@ describe('Travel Component vnTravelExtraCommunity', () => { describe('onDrop()', () => { it('should make an HTTP patch query', () => { - const droppable = document.createElement('vn-table'); + const droppable = document.createElement('vn-tbody'); droppable.setAttribute('vn-droppable', true); droppable.setAttribute('id', 1); jest.spyOn(controller, 'findDroppable').mockReturnValue(droppable); - const oldDroppable = document.createElement('vn-table'); + const oldDroppable = document.createElement('vn-tbody'); oldDroppable.setAttribute('vn-droppable', true); const entry = document.createElement('div'); oldDroppable.appendChild(entry); -- 2.40.1 From bbfb2304279f4db2fa57b81a4592fff4250f6894 Mon Sep 17 00:00:00 2001 From: joan Date: Tue, 19 Jan 2021 14:30:06 +0100 Subject: [PATCH 9/9] Removed clog --- modules/travel/back/methods/travel/extraCommunityFilter.js | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/travel/back/methods/travel/extraCommunityFilter.js b/modules/travel/back/methods/travel/extraCommunityFilter.js index 73765e38a..f4132c631 100644 --- a/modules/travel/back/methods/travel/extraCommunityFilter.js +++ b/modules/travel/back/methods/travel/extraCommunityFilter.js @@ -121,7 +121,6 @@ module.exports = Self => { }); filter = mergeFilters(filter, {where}); - console.log(JSON.stringify(filter.where)); let stmts = []; let stmt; -- 2.40.1