From 32a0955c1d5e210176868d1f39539f555fdb6970 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Thu, 8 Jun 2023 12:48:14 +0200 Subject: [PATCH 01/11] refs #5667 Zone translations fixed --- modules/zone/back/locale/zone-event/en.yml | 8 ++++---- modules/zone/back/locale/zone-event/es.yml | 6 +++--- modules/zone/back/locale/zone-exclusion/en.yml | 4 ++-- modules/zone/back/locale/zone-exclusion/es.yml | 2 +- modules/zone/back/locale/zone-included/en.yml | 4 +++- modules/zone/back/locale/zone-included/es.yml | 4 +++- modules/zone/back/locale/zone-warehouse/en.yml | 2 +- modules/zone/back/locale/zone-warehouse/es.yml | 2 +- 8 files changed, 18 insertions(+), 14 deletions(-) diff --git a/modules/zone/back/locale/zone-event/en.yml b/modules/zone/back/locale/zone-event/en.yml index 2d6ef39ab..1988c1239 100644 --- a/modules/zone/back/locale/zone-event/en.yml +++ b/modules/zone/back/locale/zone-event/en.yml @@ -1,14 +1,14 @@ -name: zone event +name: event columns: id: id zoneFk: zone type: type dated: dated - started: started - ended: ended + started: starts + ended: ends weekDays: week days hour: hour travelingDays: traveling days price: price bonus: bonus - m3Max: max m3 + m3Max: max. m3 diff --git a/modules/zone/back/locale/zone-event/es.yml b/modules/zone/back/locale/zone-event/es.yml index 9bc8db9fe..5092cc933 100644 --- a/modules/zone/back/locale/zone-event/es.yml +++ b/modules/zone/back/locale/zone-event/es.yml @@ -1,11 +1,11 @@ -name: evento zona +name: evento columns: id: id zoneFk: zona type: tipo dated: fecha - started: comenzado - ended: terminado + started: empieza + ended: termina weekDays: días semana hour: hora travelingDays: días de viaje diff --git a/modules/zone/back/locale/zone-exclusion/en.yml b/modules/zone/back/locale/zone-exclusion/en.yml index 4389d8b93..6a2383b87 100644 --- a/modules/zone/back/locale/zone-exclusion/en.yml +++ b/modules/zone/back/locale/zone-exclusion/en.yml @@ -1,5 +1,5 @@ -name: zone exclusion +name: exclusion columns: id: id - dated: dated + dated: date zoneFk: zone diff --git a/modules/zone/back/locale/zone-exclusion/es.yml b/modules/zone/back/locale/zone-exclusion/es.yml index 4e59cba46..35102a670 100644 --- a/modules/zone/back/locale/zone-exclusion/es.yml +++ b/modules/zone/back/locale/zone-exclusion/es.yml @@ -1,4 +1,4 @@ -name: zone exclusion +name: exclusión columns: id: id dated: fecha diff --git a/modules/zone/back/locale/zone-included/en.yml b/modules/zone/back/locale/zone-included/en.yml index 0e44989e9..65e4faac6 100644 --- a/modules/zone/back/locale/zone-included/en.yml +++ b/modules/zone/back/locale/zone-included/en.yml @@ -1,5 +1,7 @@ -name: zone included +name: inclusion columns: id: id dated: dated zoneFk: zone + isIncluded: incluida + geoFk: localización diff --git a/modules/zone/back/locale/zone-included/es.yml b/modules/zone/back/locale/zone-included/es.yml index 30a89373a..bd48cdbe5 100644 --- a/modules/zone/back/locale/zone-included/es.yml +++ b/modules/zone/back/locale/zone-included/es.yml @@ -1,5 +1,7 @@ -name: zona incluida +name: inclusión columns: id: id dated: fecha zoneFk: zona + isIncluded: incluida + geoFk: localización diff --git a/modules/zone/back/locale/zone-warehouse/en.yml b/modules/zone/back/locale/zone-warehouse/en.yml index b9c4f7609..6caa3de1b 100644 --- a/modules/zone/back/locale/zone-warehouse/en.yml +++ b/modules/zone/back/locale/zone-warehouse/en.yml @@ -1,4 +1,4 @@ -name: zone warehouse +name: warehouse columns: id: id warehouseFk: warehouse diff --git a/modules/zone/back/locale/zone-warehouse/es.yml b/modules/zone/back/locale/zone-warehouse/es.yml index ec8dec2dd..caf0d8f1a 100644 --- a/modules/zone/back/locale/zone-warehouse/es.yml +++ b/modules/zone/back/locale/zone-warehouse/es.yml @@ -1,4 +1,4 @@ -name: almacén zona +name: almacén columns: id: id warehouseFk: almacén From 3386af9b17bb5c1b27ff3c5012b34c0700e380a3 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Mon, 12 Jun 2023 16:27:02 +0200 Subject: [PATCH 02/11] refs #5667 MailAliasAccount translations added --- modules/account/back/locale/mail-alias-account/en.yml | 5 +++++ modules/account/back/locale/mail-alias-account/es.yml | 5 +++++ 2 files changed, 10 insertions(+) create mode 100644 modules/account/back/locale/mail-alias-account/en.yml create mode 100644 modules/account/back/locale/mail-alias-account/es.yml diff --git a/modules/account/back/locale/mail-alias-account/en.yml b/modules/account/back/locale/mail-alias-account/en.yml new file mode 100644 index 000000000..2449ab252 --- /dev/null +++ b/modules/account/back/locale/mail-alias-account/en.yml @@ -0,0 +1,5 @@ +name: Mail alias +columns: + id: id + mailAlias: alias + account: account diff --git a/modules/account/back/locale/mail-alias-account/es.yml b/modules/account/back/locale/mail-alias-account/es.yml new file mode 100644 index 000000000..0565b7a77 --- /dev/null +++ b/modules/account/back/locale/mail-alias-account/es.yml @@ -0,0 +1,5 @@ +name: Alias de correo +columns: + id: id + mailAlias: alias + account: cuenta From cc788d7e0606412b4b149864bdac45b59aecd801 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Mon, 12 Jun 2023 16:28:47 +0200 Subject: [PATCH 03/11] refs #5667 Account translations added --- modules/account/back/locale/account/en.yml | 3 +++ modules/account/back/locale/account/es.yml | 3 +++ modules/account/back/locale/mail-alias-account/en.yml | 2 +- modules/account/back/locale/mail-alias-account/es.yml | 2 +- 4 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 modules/account/back/locale/account/en.yml create mode 100644 modules/account/back/locale/account/es.yml diff --git a/modules/account/back/locale/account/en.yml b/modules/account/back/locale/account/en.yml new file mode 100644 index 000000000..221afef5f --- /dev/null +++ b/modules/account/back/locale/account/en.yml @@ -0,0 +1,3 @@ +name: account +columns: + id: id diff --git a/modules/account/back/locale/account/es.yml b/modules/account/back/locale/account/es.yml new file mode 100644 index 000000000..a79b1f40c --- /dev/null +++ b/modules/account/back/locale/account/es.yml @@ -0,0 +1,3 @@ +name: cuenta +columns: + id: id diff --git a/modules/account/back/locale/mail-alias-account/en.yml b/modules/account/back/locale/mail-alias-account/en.yml index 2449ab252..bf805d66f 100644 --- a/modules/account/back/locale/mail-alias-account/en.yml +++ b/modules/account/back/locale/mail-alias-account/en.yml @@ -1,4 +1,4 @@ -name: Mail alias +name: mail alias columns: id: id mailAlias: alias diff --git a/modules/account/back/locale/mail-alias-account/es.yml b/modules/account/back/locale/mail-alias-account/es.yml index 0565b7a77..b53ade996 100644 --- a/modules/account/back/locale/mail-alias-account/es.yml +++ b/modules/account/back/locale/mail-alias-account/es.yml @@ -1,4 +1,4 @@ -name: Alias de correo +name: alias de correo columns: id: id mailAlias: alias From d8b041c734a9a013a400c3257f2c5746f23cf500 Mon Sep 17 00:00:00 2001 From: alexm Date: Mon, 12 Jun 2023 22:04:02 +0200 Subject: [PATCH 04/11] refs #5472 correcto version folder --- db/changes/{232401 => 232601}/00-userPassExpired.sql | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename db/changes/{232401 => 232601}/00-userPassExpired.sql (100%) diff --git a/db/changes/232401/00-userPassExpired.sql b/db/changes/232601/00-userPassExpired.sql similarity index 100% rename from db/changes/232401/00-userPassExpired.sql rename to db/changes/232601/00-userPassExpired.sql From 961941ecb3095b7857da9bb9481d8b6290bd9a14 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Tue, 13 Jun 2023 20:52:26 +0200 Subject: [PATCH 05/11] refs #5667 TicketRequest translations added/fixed --- .../ticket/back/locale/ticket-request/en.yml | 19 ++++++++++------- .../ticket/back/locale/ticket-request/es.yml | 21 +++++++++++-------- 2 files changed, 23 insertions(+), 17 deletions(-) diff --git a/modules/ticket/back/locale/ticket-request/en.yml b/modules/ticket/back/locale/ticket-request/en.yml index f381e0c9d..fc9210501 100644 --- a/modules/ticket/back/locale/ticket-request/en.yml +++ b/modules/ticket/back/locale/ticket-request/en.yml @@ -2,14 +2,17 @@ name: request columns: id: id description: description - created: created + buyerCode: buyer quantity: quantity price: price - isOk: ok - response: response - saleFk: sale - ticketFk: ticket - attenderFk: attender - requesterFk: requester itemFk: item - + clientFk: client + response: response + total: total + buyed: buyed + saleFk: sale + created: created + isOk: ok + requesterFk: requester + attenderFk: attender + ticketFk: ticket diff --git a/modules/ticket/back/locale/ticket-request/es.yml b/modules/ticket/back/locale/ticket-request/es.yml index 5504448bf..fd89ddf60 100644 --- a/modules/ticket/back/locale/ticket-request/es.yml +++ b/modules/ticket/back/locale/ticket-request/es.yml @@ -1,15 +1,18 @@ -name: peticion +name: petición columns: id: id description: descripción - created: creado + buyerCode: comprador quantity: cantidad price: precio - isOk: ok - response: respuesta - saleFk: línea - ticketFk: ticket - attenderFk: asistente - requesterFk: solicitante itemFk: artículo - + clientFk: cliente + response: respuesta + total: total + buyed: comprado + saleFk: línea + created: creado + isOk: ok + requesterFk: solicitante + attenderFk: asistente + ticketFk: ticket From 7fa4eabf86df48b01a25ee1981e7f0475d3a12c4 Mon Sep 17 00:00:00 2001 From: vicent Date: Wed, 14 Jun 2023 14:59:18 +0200 Subject: [PATCH 06/11] refs #5842 fix: recalcula invoiceDate cuando se cambia la company --- .../front/global-invoicing/index.html | 3 +- .../front/global-invoicing/index.js | 34 +++++++++++-------- 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/modules/invoiceOut/front/global-invoicing/index.html b/modules/invoiceOut/front/global-invoicing/index.html index 6d5b16329..1df01c7f0 100644 --- a/modules/invoiceOut/front/global-invoicing/index.html +++ b/modules/invoiceOut/front/global-invoicing/index.html @@ -118,7 +118,8 @@ label="Company" show-field="code" value-field="id" - ng-model="$ctrl.companyFk"> + ng-model="$ctrl.companyFk" + on-change="$ctrl.recalcInvoiceDate($ctrl.companyFk)"> { - this.companyFk = res.data.companyFk; - const params = { - companyFk: this.companyFk - }; - return this.$http.get('InvoiceOuts/getInvoiceDate', {params}); - }) - .then(res => { - this.minInvoicingDate = res.data.issued ? new Date(res.data.issued) : null; - this.invoiceDate = this.minInvoicingDate; - }); - } + .then(res => { + this.companyFk = res.data.companyFk; + this.recalcInvoiceDate(this.companyFk); + }); + } + + recalcInvoiceDate(companyFk) { + const params = { companyFk: companyFk }; + this.fetchInvoiceDate(params); + } + + fetchInvoiceDate(params) { + this.$http.get('InvoiceOuts/getInvoiceDate', { params }) + .then(res => { + this.minInvoicingDate = res.data.issued ? new Date(res.data.issued) : null; + this.invoiceDate = this.minInvoicingDate; + }); + } stopInvoicing() { this.status = 'stopping'; From 14ebcf96c05931c6318d7dbcbab2f3ded84cfee7 Mon Sep 17 00:00:00 2001 From: vicent Date: Thu, 15 Jun 2023 07:24:17 +0200 Subject: [PATCH 07/11] refs #5842 refactor: change names --- modules/invoiceOut/front/global-invoicing/index.html | 2 +- modules/invoiceOut/front/global-invoicing/index.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/invoiceOut/front/global-invoicing/index.html b/modules/invoiceOut/front/global-invoicing/index.html index 1df01c7f0..3f0a10650 100644 --- a/modules/invoiceOut/front/global-invoicing/index.html +++ b/modules/invoiceOut/front/global-invoicing/index.html @@ -119,7 +119,7 @@ show-field="code" value-field="id" ng-model="$ctrl.companyFk" - on-change="$ctrl.recalcInvoiceDate($ctrl.companyFk)"> + on-change="$ctrl.getInvoiceDate(value)"> { this.companyFk = res.data.companyFk; - this.recalcInvoiceDate(this.companyFk); + this.getInvoiceDate(this.companyFk); }); } - recalcInvoiceDate(companyFk) { + getInvoiceDate(companyFk) { const params = { companyFk: companyFk }; this.fetchInvoiceDate(params); } From a50de4e509d11fae67b6d069bd9f7183330be973 Mon Sep 17 00:00:00 2001 From: vicent Date: Thu, 15 Jun 2023 09:50:46 +0200 Subject: [PATCH 08/11] refs #5842 feat: comprueba que invoiceDate no sea null --- modules/invoiceOut/front/global-invoicing/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/invoiceOut/front/global-invoicing/index.js b/modules/invoiceOut/front/global-invoicing/index.js index f300d4496..965782e5b 100644 --- a/modules/invoiceOut/front/global-invoicing/index.js +++ b/modules/invoiceOut/front/global-invoicing/index.js @@ -42,13 +42,14 @@ class Controller extends Section { this.addresses = null; try { + console.log(this.invoiceDate, this.minInvoicingDate); if (this.clientsToInvoice == 'one' && !this.clientId) throw new UserError('Choose a valid client'); if (!this.invoiceDate || !this.maxShipped) throw new UserError('Invoice date and the max date should be filled'); if (this.invoiceDate < this.maxShipped) throw new UserError('Invoice date can\'t be less than max date'); - if (this.invoiceDate.getTime() < this.minInvoicingDate.getTime()) + if (this.minInvoicingDate && this.invoiceDate.getTime() < this.minInvoicingDate.getTime()) throw new UserError('Exists an invoice with a previous date'); if (!this.companyFk) throw new UserError('Choose a valid company'); From 5f2c5c5f9d93ee7416f84309c095e45535433cd8 Mon Sep 17 00:00:00 2001 From: vicent Date: Thu, 15 Jun 2023 09:55:32 +0200 Subject: [PATCH 09/11] refs #5842 delete console.log --- modules/invoiceOut/front/global-invoicing/index.js | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/invoiceOut/front/global-invoicing/index.js b/modules/invoiceOut/front/global-invoicing/index.js index 965782e5b..5a078dfbb 100644 --- a/modules/invoiceOut/front/global-invoicing/index.js +++ b/modules/invoiceOut/front/global-invoicing/index.js @@ -42,7 +42,6 @@ class Controller extends Section { this.addresses = null; try { - console.log(this.invoiceDate, this.minInvoicingDate); if (this.clientsToInvoice == 'one' && !this.clientId) throw new UserError('Choose a valid client'); if (!this.invoiceDate || !this.maxShipped) From 99ad9d3afa56d8d38a1dc112e11fc39c69571a19 Mon Sep 17 00:00:00 2001 From: alexm Date: Thu, 15 Jun 2023 11:49:39 +0200 Subject: [PATCH 10/11] refs #5753 fix(change-password) --- CHANGELOG.md | 2 +- README.md | 4 ++-- back/methods/vn-user/signIn.js | 7 +++---- db/changes/{232601 => 232401}/00-userPassExpired.sql | 0 db/changes/232601/.gitkeep | 0 front/salix/components/change-password/index.js | 8 ++++---- front/salix/components/login/index.js | 7 +++---- front/salix/routes.js | 2 +- modules/account/front/accounts/index.js | 3 +-- package.json | 2 +- 10 files changed, 16 insertions(+), 19 deletions(-) rename db/changes/{232601 => 232401}/00-userPassExpired.sql (100%) delete mode 100644 db/changes/232601/.gitkeep diff --git a/CHANGELOG.md b/CHANGELOG.md index 708ebbc4b..8967a1633 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - -## [2324.01] - 2023-06-08 +## [2324.01] - 2023-06-15 ### Added - (Tickets -> Abono) Al abonar permite crear el ticket abono con almacén o sin almmacén diff --git a/README.md b/README.md index f73a8551b..59f5dbcf7 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Salix is also the scientific name of a beautifull tree! :) Required applications. -* Node.js = 14.x LTS +* Node.js >= 16.x LTS * Docker * Git @@ -71,7 +71,7 @@ $ npm run test:e2e Open Visual Studio Code, press Ctrl+P and paste the following commands. -In Visual Studio Code we use the ESLint extension. +In Visual Studio Code we use the ESLint extension. ``` ext install dbaeumer.vscode-eslint ``` diff --git a/back/methods/vn-user/signIn.js b/back/methods/vn-user/signIn.js index d7db90a21..6615cb5f1 100644 --- a/back/methods/vn-user/signIn.js +++ b/back/methods/vn-user/signIn.js @@ -62,10 +62,9 @@ module.exports = Self => { scopes: ['change-password'], userId: vnUser.id }); - throw new UserError('Pass expired', 'passExpired', { - id: vnUser.id, - token: changePasswordToken.id - }); + const err = new UserError('Pass expired', 'passExpired'); + err.details = {token: changePasswordToken}; + throw err; } try { diff --git a/db/changes/232601/00-userPassExpired.sql b/db/changes/232401/00-userPassExpired.sql similarity index 100% rename from db/changes/232601/00-userPassExpired.sql rename to db/changes/232401/00-userPassExpired.sql diff --git a/db/changes/232601/.gitkeep b/db/changes/232601/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/front/salix/components/change-password/index.js b/front/salix/components/change-password/index.js index 3d660e894..baa9d96e5 100644 --- a/front/salix/components/change-password/index.js +++ b/front/salix/components/change-password/index.js @@ -15,7 +15,7 @@ export default class Controller { } $onInit() { - if (!this.$state.params || !this.$state.params.id || !this.$state.params.token) + if (!this.$state.params.id) this.$state.go('login'); this.$http.get('UserPasswords/findOne') @@ -25,7 +25,7 @@ export default class Controller { } submit() { - const id = this.$state.params.id; + const userId = this.$state.params.userId; const newPassword = this.newPassword; const oldPassword = this.oldPassword; @@ -35,12 +35,12 @@ export default class Controller { throw new UserError(`Passwords don't match`); const headers = { - Authorization: this.$state.params.token + Authorization: this.$state.params.id }; this.$http.post('VnUsers/change-password', { - id, + id: userId, oldPassword, newPassword }, diff --git a/front/salix/components/login/index.js b/front/salix/components/login/index.js index 0412f3b74..8e8f08244 100644 --- a/front/salix/components/login/index.js +++ b/front/salix/components/login/index.js @@ -27,10 +27,9 @@ export default class Controller { this.loading = false; this.password = ''; this.focusUser(); - if (req?.data?.error?.code == 'passExpired') { - const [args] = req.data.error.translateArgs; - this.$state.go('change-password', args); - } + const err = req.data?.error; + if (err?.code == 'passExpired') + this.$state.go('change-password', err.details.token); throw req; }); diff --git a/front/salix/routes.js b/front/salix/routes.js index d6dea244a..675da719a 100644 --- a/front/salix/routes.js +++ b/front/salix/routes.js @@ -38,7 +38,7 @@ function config($stateProvider, $urlRouterProvider) { }) .state('change-password', { parent: 'outLayout', - url: '/change-password?id&token', + url: '/change-password?id&userId', description: 'Change password', template: '' }) diff --git a/modules/account/front/accounts/index.js b/modules/account/front/accounts/index.js index 7a341b0b0..0e78ab8d6 100644 --- a/modules/account/front/accounts/index.js +++ b/modules/account/front/accounts/index.js @@ -5,8 +5,7 @@ import UserError from 'core/lib/user-error'; export default class Controller extends Section { onSynchronizeAll() { this.vnApp.showSuccess(this.$t('Synchronizing in the background')); - this.$http.patch(`Accounts/syncAll`) - .then(() => this.vnApp.showSuccess(this.$t('Users synchronized!'))); + this.$http.patch(`Accounts/syncAll`); } onUserSync() { diff --git a/package.json b/package.json index 4358c86a7..f1b3daca3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "salix-back", - "version": "23.26.01", + "version": "23.24.01", "author": "Verdnatura Levante SL", "description": "Salix backend", "license": "GPL-3.0", From 1c666cd48e04ce883e128d2b9a42b2bd1109f501 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Thu, 15 Jun 2023 13:10:44 +0200 Subject: [PATCH 11/11] refs #5595 Fix: ctx & userId removed from TpvTransaction/confirm --- modules/client/back/methods/tpv-transaction/confirm.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/client/back/methods/tpv-transaction/confirm.js b/modules/client/back/methods/tpv-transaction/confirm.js index 4faa21bb5..41229a1fd 100644 --- a/modules/client/back/methods/tpv-transaction/confirm.js +++ b/modules/client/back/methods/tpv-transaction/confirm.js @@ -2,7 +2,7 @@ const UserError = require('vn-loopback/util/user-error'); const base64url = require('base64url'); module.exports = Self => { - Self.remoteMethodCtx('confirm', { + Self.remoteMethod('confirm', { description: 'Confirms electronic payment transaction', accessType: 'WRITE', accepts: [ @@ -30,7 +30,7 @@ module.exports = Self => { } }); - Self.confirm = async(ctx, signatureVersion, merchantParameters, signature) => { + Self.confirm = async(signatureVersion, merchantParameters, signature) => { const $ = Self.app.models; let transaction; @@ -83,7 +83,7 @@ module.exports = Self => { params['Ds_Currency'], params['Ds_Response'], params['Ds_ErrorCode'] - ], {userId: ctx.req.accessToken.userId}); + ]); return true; } catch (err) {