From 05f0f72c739a6c668c7c73c0370644e3906c143e Mon Sep 17 00:00:00 2001 From: jorgep Date: Wed, 30 Aug 2023 14:14:48 +0200 Subject: [PATCH 01/43] refs #6119 microsip link added --- modules/client/front/summary/index.html | 23 ++++++++-- modules/client/front/summary/style.scss | 4 ++ modules/order/front/summary/index.html | 11 ++++- modules/order/front/summary/style.scss | 4 ++ .../route/front/roadmap/summary/index.html | 11 ++++- .../route/front/roadmap/summary/style.scss | 6 ++- modules/ticket/front/summary/index.html | 42 ++++++++++++++++--- modules/ticket/front/summary/style.scss | 5 +++ modules/worker/front/descriptor/index.html | 30 +++++++++++-- modules/worker/front/descriptor/index.js | 2 +- modules/worker/front/descriptor/style.scss | 6 +++ modules/worker/front/summary/index.html | 41 +++++++++++++++--- modules/worker/front/summary/index.js | 2 +- modules/worker/front/summary/style.scss | 6 +++ 14 files changed, 169 insertions(+), 24 deletions(-) create mode 100644 modules/worker/front/descriptor/style.scss create mode 100644 modules/worker/front/summary/style.scss diff --git a/modules/client/front/summary/index.html b/modules/client/front/summary/index.html index 15a55ec8c..6f7c915c1 100644 --- a/modules/client/front/summary/index.html +++ b/modules/client/front/summary/index.html @@ -45,11 +45,26 @@ - + + {{$ctrl.summary.phone}} + + + + - + + {{$ctrl.summary.mobile}} + + + diff --git a/modules/client/front/summary/style.scss b/modules/client/front/summary/style.scss index 7dc1cc928..dd30edaa0 100644 --- a/modules/client/front/summary/style.scss +++ b/modules/client/front/summary/style.scss @@ -11,4 +11,8 @@ vn-client-summary .summary { font-family: 'salixfont' !important; content: "\e965"; } + vn-icon.tel { + font-size: 1.1em; + vertical-align: bottom; + } } diff --git a/modules/order/front/summary/index.html b/modules/order/front/summary/index.html index 3622ae932..52a1afd6d 100644 --- a/modules/order/front/summary/index.html +++ b/modules/order/front/summary/index.html @@ -49,7 +49,16 @@ value="{{$ctrl.summary.landed | date: 'dd/MM/yyyy HH:mm'}}"> + > + {{$ctrl.summary.address.phone}} + + + + diff --git a/modules/order/front/summary/style.scss b/modules/order/front/summary/style.scss index a2537c58f..7abcd889b 100644 --- a/modules/order/front/summary/style.scss +++ b/modules/order/front/summary/style.scss @@ -17,4 +17,8 @@ vn-order-summary .summary{ } } } + vn-icon.tel { + font-size: 1.1em; + vertical-align: bottom; + } } \ No newline at end of file diff --git a/modules/route/front/roadmap/summary/index.html b/modules/route/front/roadmap/summary/index.html index e6b50601e..c8ba85456 100644 --- a/modules/route/front/roadmap/summary/index.html +++ b/modules/route/front/roadmap/summary/index.html @@ -25,7 +25,16 @@ + > + {{summary.phone}} + + + + + > + {{$ctrl.summary.address.phone}} + + + + + > + {{$ctrl.summary.address.mobile}} + + + + + ng-if="$ctrl.summary.client.phone != null"> + {{$ctrl.summary.client.phone}} + + + + ng-if="$ctrl.summary.client.mobile != null"> + {{$ctrl.summary.client.mobile}} + + + diff --git a/modules/ticket/front/summary/style.scss b/modules/ticket/front/summary/style.scss index e92ff0d42..2f52de65e 100644 --- a/modules/ticket/front/summary/style.scss +++ b/modules/ticket/front/summary/style.scss @@ -47,4 +47,9 @@ vn-ticket-summary .summary { } } } + + vn-icon.tel { + font-size: 1.1em; + vertical-align: bottom; + } } \ No newline at end of file diff --git a/modules/worker/front/descriptor/index.html b/modules/worker/front/descriptor/index.html index ea005e1a2..ce318540f 100644 --- a/modules/worker/front/descriptor/index.html +++ b/modules/worker/front/descriptor/index.html @@ -36,12 +36,34 @@ value="{{$ctrl.worker.department.department.name}}"> + label="Phone"> + - + + {{$ctrl.worker.phone}} + + + + + label="Extension"> + - + + {{$ctrl.worker.sip.extension}} + + + +
diff --git a/modules/worker/front/descriptor/index.js b/modules/worker/front/descriptor/index.js index a53528ef2..446f8167c 100644 --- a/modules/worker/front/descriptor/index.js +++ b/modules/worker/front/descriptor/index.js @@ -1,6 +1,6 @@ import ngModule from '../module'; import Descriptor from 'salix/components/descriptor'; - +import './style.scss'; class Controller extends Descriptor { constructor($element, $, $rootScope) { super($element, $); diff --git a/modules/worker/front/descriptor/style.scss b/modules/worker/front/descriptor/style.scss new file mode 100644 index 000000000..6db663ae3 --- /dev/null +++ b/modules/worker/front/descriptor/style.scss @@ -0,0 +1,6 @@ +vn-worker-descriptor { + vn-icon.tel { + font-size: 1.1em; + vertical-align: bottom; + } +} \ No newline at end of file diff --git a/modules/worker/front/summary/index.html b/modules/worker/front/summary/index.html index 2607d9b2f..13924fe8d 100644 --- a/modules/worker/front/summary/index.html +++ b/modules/worker/front/summary/index.html @@ -42,14 +42,45 @@ {{::worker.boss.name}} - + + - + + {{worker.mobileExtension}} + + + + - + + - + + {{worker.phone}} + + + + + > + - + + {{worker.client.phone}} + + + + diff --git a/modules/worker/front/summary/index.js b/modules/worker/front/summary/index.js index 2bb1f0853..1e64527cf 100644 --- a/modules/worker/front/summary/index.js +++ b/modules/worker/front/summary/index.js @@ -1,6 +1,6 @@ import ngModule from '../module'; import Summary from 'salix/components/summary'; - +import './style.scss'; class Controller extends Summary { get worker() { return this._worker; diff --git a/modules/worker/front/summary/style.scss b/modules/worker/front/summary/style.scss new file mode 100644 index 000000000..2bde27129 --- /dev/null +++ b/modules/worker/front/summary/style.scss @@ -0,0 +1,6 @@ +vn-worker-summary { + vn-icon.tel { + font-size: 1.1em; + vertical-align: bottom; + } +} \ No newline at end of file From c2a54b8c6590458094ec6cdc512bc00d556dccf4 Mon Sep 17 00:00:00 2001 From: jorgep Date: Thu, 31 Aug 2023 13:02:56 +0200 Subject: [PATCH 02/43] ref #6119 vnLinkPhone created --- front/core/components/index.js | 1 + front/core/components/link-phone/index.html | 21 +++++++++ front/core/components/link-phone/index.js | 21 +++++++++ front/core/components/link-phone/style.scss | 7 +++ modules/client/front/summary/index.html | 24 +++------- modules/client/front/summary/style.scss | 4 -- modules/order/front/summary/index.html | 15 ++----- modules/order/front/summary/style.scss | 4 -- .../route/front/roadmap/summary/index.html | 12 ++--- .../route/front/roadmap/summary/style.scss | 7 +-- modules/ticket/front/summary/index.html | 44 +++++-------------- modules/worker/front/descriptor/index.html | 36 +++++---------- modules/worker/front/descriptor/index.js | 1 - modules/worker/front/descriptor/style.scss | 6 --- modules/worker/front/summary/index.html | 42 ++++-------------- modules/worker/front/summary/index.js | 1 - modules/worker/front/summary/style.scss | 6 --- 17 files changed, 96 insertions(+), 156 deletions(-) create mode 100644 front/core/components/link-phone/index.html create mode 100644 front/core/components/link-phone/index.js create mode 100644 front/core/components/link-phone/style.scss delete mode 100644 modules/worker/front/descriptor/style.scss delete mode 100644 modules/worker/front/summary/style.scss diff --git a/front/core/components/index.js b/front/core/components/index.js index eb40d5e1f..cfa46f0cb 100644 --- a/front/core/components/index.js +++ b/front/core/components/index.js @@ -39,6 +39,7 @@ import './range'; import './input-time'; import './input-file'; import './label'; +import './link-phone'; import './list'; import './popover'; import './popup'; diff --git a/front/core/components/link-phone/index.html b/front/core/components/link-phone/index.html new file mode 100644 index 000000000..2e2e2338a --- /dev/null +++ b/front/core/components/link-phone/index.html @@ -0,0 +1,21 @@ + + + + {{ $ctrl.phoneNumber }} + + + + + + + + {{ $ctrl.phoneNumber }} + + +- \ No newline at end of file diff --git a/front/core/components/link-phone/index.js b/front/core/components/link-phone/index.js new file mode 100644 index 000000000..7731487eb --- /dev/null +++ b/front/core/components/link-phone/index.js @@ -0,0 +1,21 @@ +import ngModule from '../../module'; +import './style.scss'; +class Controller { + constructor() { + this.phoneNumber = null; + this.icon = true; + this.showNumber = true; + this.schemeUrl = 'tel'; + } +} + +ngModule.vnComponent('vnLinkPhone', { + template: require('./index.html'), + controller: Controller, + bindings: { + phoneNumber: '<', + icon: ' - {{$ctrl.summary.phone}} - - - - + + - {{$ctrl.summary.mobile}} - - - + diff --git a/modules/client/front/summary/style.scss b/modules/client/front/summary/style.scss index dd30edaa0..7dc1cc928 100644 --- a/modules/client/front/summary/style.scss +++ b/modules/client/front/summary/style.scss @@ -11,8 +11,4 @@ vn-client-summary .summary { font-family: 'salixfont' !important; content: "\e965"; } - vn-icon.tel { - font-size: 1.1em; - vertical-align: bottom; - } } diff --git a/modules/order/front/summary/index.html b/modules/order/front/summary/index.html index 52a1afd6d..218359992 100644 --- a/modules/order/front/summary/index.html +++ b/modules/order/front/summary/index.html @@ -48,17 +48,10 @@ - - {{$ctrl.summary.address.phone}} - - - - + + diff --git a/modules/order/front/summary/style.scss b/modules/order/front/summary/style.scss index 7abcd889b..a2537c58f 100644 --- a/modules/order/front/summary/style.scss +++ b/modules/order/front/summary/style.scss @@ -17,8 +17,4 @@ vn-order-summary .summary{ } } } - vn-icon.tel { - font-size: 1.1em; - vertical-align: bottom; - } } \ No newline at end of file diff --git a/modules/route/front/roadmap/summary/index.html b/modules/route/front/roadmap/summary/index.html index c8ba85456..9fab0bf87 100644 --- a/modules/route/front/roadmap/summary/index.html +++ b/modules/route/front/roadmap/summary/index.html @@ -26,15 +26,9 @@ - {{summary.phone}} - - - - + - {{$ctrl.summary.address.phone}} - - - - + - {{$ctrl.summary.address.mobile}} - - - - + - {{$ctrl.summary.client.phone}} - - - + - {{$ctrl.summary.client.mobile}} - - - + diff --git a/modules/worker/front/descriptor/index.html b/modules/worker/front/descriptor/index.html index ce318540f..1131d3d6c 100644 --- a/modules/worker/front/descriptor/index.html +++ b/modules/worker/front/descriptor/index.html @@ -36,34 +36,18 @@ value="{{$ctrl.worker.department.department.name}}"> - - - - {{$ctrl.worker.phone}} - - - - + label="Phone" + > + - - - - {{$ctrl.worker.sip.extension}} - - - - + label="Extension" + > +
diff --git a/modules/worker/front/descriptor/index.js b/modules/worker/front/descriptor/index.js index 446f8167c..a2aadf3b3 100644 --- a/modules/worker/front/descriptor/index.js +++ b/modules/worker/front/descriptor/index.js @@ -1,6 +1,5 @@ import ngModule from '../module'; import Descriptor from 'salix/components/descriptor'; -import './style.scss'; class Controller extends Descriptor { constructor($element, $, $rootScope) { super($element, $); diff --git a/modules/worker/front/descriptor/style.scss b/modules/worker/front/descriptor/style.scss deleted file mode 100644 index 6db663ae3..000000000 --- a/modules/worker/front/descriptor/style.scss +++ /dev/null @@ -1,6 +0,0 @@ -vn-worker-descriptor { - vn-icon.tel { - font-size: 1.1em; - vertical-align: bottom; - } -} \ No newline at end of file diff --git a/modules/worker/front/summary/index.html b/modules/worker/front/summary/index.html index 13924fe8d..0d9aef7f8 100644 --- a/modules/worker/front/summary/index.html +++ b/modules/worker/front/summary/index.html @@ -43,44 +43,20 @@ - - - - {{worker.mobileExtension}} - - - - + - - - - {{worker.phone}} - - - - + - - - - {{worker.client.phone}} - - - - + diff --git a/modules/worker/front/summary/index.js b/modules/worker/front/summary/index.js index 1e64527cf..212609f58 100644 --- a/modules/worker/front/summary/index.js +++ b/modules/worker/front/summary/index.js @@ -1,6 +1,5 @@ import ngModule from '../module'; import Summary from 'salix/components/summary'; -import './style.scss'; class Controller extends Summary { get worker() { return this._worker; diff --git a/modules/worker/front/summary/style.scss b/modules/worker/front/summary/style.scss deleted file mode 100644 index 2bde27129..000000000 --- a/modules/worker/front/summary/style.scss +++ /dev/null @@ -1,6 +0,0 @@ -vn-worker-summary { - vn-icon.tel { - font-size: 1.1em; - vertical-align: bottom; - } -} \ No newline at end of file From 52d698b0ebdd622b24337c370e75ed932d5266e8 Mon Sep 17 00:00:00 2001 From: jorgep Date: Fri, 1 Sep 2023 12:38:35 +0200 Subject: [PATCH 03/43] ref#6119 link fixed --- modules/worker/front/descriptor/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/worker/front/descriptor/index.html b/modules/worker/front/descriptor/index.html index 1131d3d6c..69271db23 100644 --- a/modules/worker/front/descriptor/index.html +++ b/modules/worker/front/descriptor/index.html @@ -39,7 +39,7 @@ label="Phone" > Date: Wed, 6 Sep 2023 14:33:31 +0200 Subject: [PATCH 04/43] ref #6119 scheme url removed --- front/core/components/link-phone/index.html | 4 ++-- front/core/components/link-phone/index.js | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/front/core/components/link-phone/index.html b/front/core/components/link-phone/index.html index 2e2e2338a..54bcc1e9f 100644 --- a/front/core/components/link-phone/index.html +++ b/front/core/components/link-phone/index.html @@ -3,7 +3,7 @@ {{ $ctrl.phoneNumber }} - + - + {{ $ctrl.phoneNumber }} diff --git a/front/core/components/link-phone/index.js b/front/core/components/link-phone/index.js index 7731487eb..d5c828f21 100644 --- a/front/core/components/link-phone/index.js +++ b/front/core/components/link-phone/index.js @@ -5,7 +5,6 @@ class Controller { this.phoneNumber = null; this.icon = true; this.showNumber = true; - this.schemeUrl = 'tel'; } } @@ -16,6 +15,5 @@ ngModule.vnComponent('vnLinkPhone', { phoneNumber: '<', icon: ' Date: Thu, 7 Sep 2023 09:50:13 +0200 Subject: [PATCH 05/43] ref #6119 simplifiy component --- front/core/components/link-phone/index.html | 34 +++++++------------ modules/client/front/summary/index.html | 2 ++ modules/order/front/summary/index.html | 1 + .../route/front/roadmap/summary/index.html | 1 + modules/ticket/front/summary/index.html | 4 +++ modules/worker/front/descriptor/index.html | 4 ++- modules/worker/front/summary/index.html | 3 ++ 7 files changed, 27 insertions(+), 22 deletions(-) diff --git a/front/core/components/link-phone/index.html b/front/core/components/link-phone/index.html index 54bcc1e9f..fc520cefd 100644 --- a/front/core/components/link-phone/index.html +++ b/front/core/components/link-phone/index.html @@ -1,21 +1,13 @@ - - - - {{ $ctrl.phoneNumber }} - - - - - - - - {{ $ctrl.phoneNumber }} - - -- \ No newline at end of file + + + + \ No newline at end of file diff --git a/modules/client/front/summary/index.html b/modules/client/front/summary/index.html index 8bec03d8b..a0c83ded1 100644 --- a/modules/client/front/summary/index.html +++ b/modules/client/front/summary/index.html @@ -46,12 +46,14 @@ value="{{$ctrl.summary.contact}}"> + {{$ctrl.summary.phone | dashIfEmpty}} + {{$ctrl.summary.mobile | dashIfEmpty}} diff --git a/modules/order/front/summary/index.html b/modules/order/front/summary/index.html index 218359992..e9bdf33b2 100644 --- a/modules/order/front/summary/index.html +++ b/modules/order/front/summary/index.html @@ -49,6 +49,7 @@ value="{{$ctrl.summary.landed | date: 'dd/MM/yyyy HH:mm'}}"> + {{$ctrl.summary.address.phone | dashIfEmpty}} diff --git a/modules/route/front/roadmap/summary/index.html b/modules/route/front/roadmap/summary/index.html index 9fab0bf87..aea7e717b 100644 --- a/modules/route/front/roadmap/summary/index.html +++ b/modules/route/front/roadmap/summary/index.html @@ -26,6 +26,7 @@ + {{summary.phone | dashIfEmpty}} diff --git a/modules/ticket/front/summary/index.html b/modules/ticket/front/summary/index.html index 3c60352a7..4a92daa39 100644 --- a/modules/ticket/front/summary/index.html +++ b/modules/ticket/front/summary/index.html @@ -84,6 +84,7 @@ + {{$ctrl.summary.address.phone | dashIfEmpty}} @@ -91,18 +92,21 @@ + {{$ctrl.summary.address.mobile | dashIfEmpty}} + {{$ctrl.summary.client.phone | dashIfEmpty}} + {{$ctrl.summary.client.mobile | dashIfEmpty}} diff --git a/modules/worker/front/descriptor/index.html b/modules/worker/front/descriptor/index.html index 69271db23..4a5fb894e 100644 --- a/modules/worker/front/descriptor/index.html +++ b/modules/worker/front/descriptor/index.html @@ -38,13 +38,15 @@ + {{$ctrl.worker.phone | dashIfEmpty}} + > + {{$ctrl.worker.sip.extension | dashIfEmpty}} diff --git a/modules/worker/front/summary/index.html b/modules/worker/front/summary/index.html index 0d9aef7f8..a95b96c5e 100644 --- a/modules/worker/front/summary/index.html +++ b/modules/worker/front/summary/index.html @@ -43,17 +43,20 @@ + {{worker.mobileExtension | dashIfEmpty}} + {{worker.phone | dashIfEmpty}} + {{worker.client.phone | dashIfEmpty}} From e20a8d215ddbb365621db07b3e7028723a2e3e31 Mon Sep 17 00:00:00 2001 From: guillermo Date: Thu, 7 Sep 2023 11:47:33 +0200 Subject: [PATCH 06/43] refs #5662 Add email modified-collection-volumetry --- .../assets/css/import.js | 12 +++++++++ .../assets/css/style.css | 8 ++++++ .../locale/en.yml | 3 +++ .../locale/es.yml | 3 +++ .../modified-collection-volumetry.html | 15 +++++++++++ .../modified-collection-volumetry.js | 25 +++++++++++++++++++ 6 files changed, 66 insertions(+) create mode 100644 print/templates/email/modified-collection-volumetry/assets/css/import.js create mode 100644 print/templates/email/modified-collection-volumetry/assets/css/style.css create mode 100644 print/templates/email/modified-collection-volumetry/locale/en.yml create mode 100644 print/templates/email/modified-collection-volumetry/locale/es.yml create mode 100644 print/templates/email/modified-collection-volumetry/modified-collection-volumetry.html create mode 100755 print/templates/email/modified-collection-volumetry/modified-collection-volumetry.js diff --git a/print/templates/email/modified-collection-volumetry/assets/css/import.js b/print/templates/email/modified-collection-volumetry/assets/css/import.js new file mode 100644 index 000000000..fec23d870 --- /dev/null +++ b/print/templates/email/modified-collection-volumetry/assets/css/import.js @@ -0,0 +1,12 @@ +const Stylesheet = require(`vn-print/core/stylesheet`); + +const path = require('path'); +const vnPrintPath = path.resolve('print'); + +module.exports = new Stylesheet([ + `${vnPrintPath}/common/css/spacing.css`, + `${vnPrintPath}/common/css/misc.css`, + `${vnPrintPath}/common/css/layout.css`, + `${vnPrintPath}/common/css/email.css`, + `${__dirname}/style.css`]) + .mergeStyles(); diff --git a/print/templates/email/modified-collection-volumetry/assets/css/style.css b/print/templates/email/modified-collection-volumetry/assets/css/style.css new file mode 100644 index 000000000..5e006baa2 --- /dev/null +++ b/print/templates/email/modified-collection-volumetry/assets/css/style.css @@ -0,0 +1,8 @@ +.jsonSection { + text-align: left; + background-color: #e4e4e4; + padding: 25px; + margin-left: 60px; + margin-right: 60px; + border-radius: 25px; +} \ No newline at end of file diff --git a/print/templates/email/modified-collection-volumetry/locale/en.yml b/print/templates/email/modified-collection-volumetry/locale/en.yml new file mode 100644 index 000000000..d29b5b8de --- /dev/null +++ b/print/templates/email/modified-collection-volumetry/locale/en.yml @@ -0,0 +1,3 @@ +subject: Modified collection volumetry +title: Modified collection volumetry +description: Action performed \ No newline at end of file diff --git a/print/templates/email/modified-collection-volumetry/locale/es.yml b/print/templates/email/modified-collection-volumetry/locale/es.yml new file mode 100644 index 000000000..c271183b5 --- /dev/null +++ b/print/templates/email/modified-collection-volumetry/locale/es.yml @@ -0,0 +1,3 @@ +subject: Volumetría de colección modificada +title: Volumetría de colección modificada +description: Acción realizada \ No newline at end of file diff --git a/print/templates/email/modified-collection-volumetry/modified-collection-volumetry.html b/print/templates/email/modified-collection-volumetry/modified-collection-volumetry.html new file mode 100644 index 000000000..32ad19fd4 --- /dev/null +++ b/print/templates/email/modified-collection-volumetry/modified-collection-volumetry.html @@ -0,0 +1,15 @@ + +
+
+
+

{{ $t('title') }}

+

{{ $t('description') }}: {{ data.action }} {{ `(${this.username})` }}

+
+ + {{ `${key}:` }} {{ value }}
+
+
+
+
+
+
diff --git a/print/templates/email/modified-collection-volumetry/modified-collection-volumetry.js b/print/templates/email/modified-collection-volumetry/modified-collection-volumetry.js new file mode 100755 index 000000000..4345ead47 --- /dev/null +++ b/print/templates/email/modified-collection-volumetry/modified-collection-volumetry.js @@ -0,0 +1,25 @@ +const Component = require(`vn-print/core/component`); +const emailBody = new Component('email-body'); +const models = require('vn-loopback/server/server').models; + +module.exports = { + name: 'modified-collection-volumetry', + components: { + 'email-body': emailBody.build(), + }, + async serverPrefetch() { + this.username = (this.data.userFk) ? await this.getUsername(this.data.userFk) : 'system'; + }, + methods: { + async getUsername(id) { + const account = await models.VnUser.findById(id); + return account.name; + } + }, + props: { + data: { + type: Object, + required: true + } + } +}; From ccfd8fad058b0f75deea374a7536a64974495a86 Mon Sep 17 00:00:00 2001 From: pablone Date: Mon, 11 Sep 2023 12:32:46 +0200 Subject: [PATCH 07/43] refs #6213 fixCreateError --- .../233801/00-supplierAccountCheckLength.sql | 1 + loopback/locale/es.json | 10 ++++++---- modules/supplier/back/models/supplier.js | 17 +++++++++++++++++ modules/supplier/front/create/index.html | 1 - modules/supplier/front/create/index.js | 1 + 5 files changed, 25 insertions(+), 5 deletions(-) create mode 100644 db/changes/233801/00-supplierAccountCheckLength.sql diff --git a/db/changes/233801/00-supplierAccountCheckLength.sql b/db/changes/233801/00-supplierAccountCheckLength.sql new file mode 100644 index 000000000..99f571ba1 --- /dev/null +++ b/db/changes/233801/00-supplierAccountCheckLength.sql @@ -0,0 +1 @@ +ALTER TABLE vn.supplier ADD CONSTRAINT supplier_CHECK CHECK (LENGTH(account) = 10); diff --git a/loopback/locale/es.json b/loopback/locale/es.json index ccd63e0ff..6388c01a4 100644 --- a/loopback/locale/es.json +++ b/loopback/locale/es.json @@ -216,6 +216,7 @@ "The worker has hours recorded that day": "El trabajador tiene horas fichadas ese día", "The worker has a marked absence that day": "El trabajador tiene marcada una ausencia ese día", "You can not modify is pay method checked": "No se puede modificar el campo método de pago validado", + "The account size must be exactly 10 characters": "El tamaño de la cuenta debe ser exactamente de 10 caracteres", "Can't transfer claimed sales": "No puedes transferir lineas reclamadas", "You don't have privileges to create refund": "No tienes permisos para crear un abono", "The item is required": "El artículo es requerido", @@ -307,14 +308,15 @@ "Negative basis of tickets": "Base negativa para los tickets: {{ticketsIds}}", "You cannot assign an alias that you are not assigned to": "No puede asignar un alias que no tenga asignado", "This ticket cannot be left empty.": "Este ticket no se puede dejar vacío. %s", - "The company has not informed the supplier account for bank transfers": "La empresa no tiene informado la cuenta de proveedor para transferencias bancarias", + "The company has not informed the supplier account for bank transfers": "La empresa no tiene informado la cuenta de proveedor para transferencias bancarias", "You cannot assign/remove an alias that you are not assigned to": "No puede asignar/eliminar un alias que no tenga asignado", "This invoice has a linked vehicle.": "Esta factura tiene un vehiculo vinculado", "You don't have enough privileges.": "No tienes suficientes permisos.", "This ticket is locked.": "Este ticket está bloqueado.", "This ticket is not editable.": "Este ticket no es editable.", "The ticket doesn't exist.": "No existe el ticket.", - "Social name should be uppercase": "La razón social debe ir en mayúscula", + "Social name should be uppercase": "La razón social debe ir en mayúscula", "Street should be uppercase": "La dirección fiscal debe ir en mayúscula", - "Ticket without Route": "Ticket sin ruta" -} + "Ticket without Route": "Ticket sin ruta", + "The account size must be exactly 10 characters": "The account size must be exactly 10 characters" +} \ No newline at end of file diff --git a/modules/supplier/back/models/supplier.js b/modules/supplier/back/models/supplier.js index 96042c9a0..28e53e3c5 100644 --- a/modules/supplier/back/models/supplier.js +++ b/modules/supplier/back/models/supplier.js @@ -112,9 +112,26 @@ module.exports = Self => { const hasChanges = orgData && changes; const isPayMethodCheckedChanged = hasChanges && orgData.isPayMethodChecked != isPayMethodChecked; + const isAccountChanged = hasChanges && orgData.account != changes.account; if (!editPayMethodCheck && isPayMethodCheckedChanged) throw new UserError('You can not modify is pay method checked'); + + if (isAccountChanged && !(changes.account.length === 10)) + throw new UserError('The account size must be exactly 10 characters'); + }); + + Self.observe('after save', async function(ctx) { + if (ctx.instance && ctx.isNewInstance) { + const supplierId = ctx.instance.id; + const models = Self.app.models; + + const supplier = await models.Supplier.findById(supplierId); + await supplier.updateAttribute( + 'account', + supplierId.toString().padStart(10, '0') + ); + } }); Self.validateAsync('name', 'countryFk', hasSupplierSameName, { diff --git a/modules/supplier/front/create/index.html b/modules/supplier/front/create/index.html index c3efcf6ae..eb6e7261e 100644 --- a/modules/supplier/front/create/index.html +++ b/modules/supplier/front/create/index.html @@ -18,7 +18,6 @@ Date: Mon, 11 Sep 2023 12:36:42 +0200 Subject: [PATCH 08/43] refs #6213 remove console log --- modules/supplier/front/create/index.js | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/supplier/front/create/index.js b/modules/supplier/front/create/index.js index f11df2884..c33367dac 100644 --- a/modules/supplier/front/create/index.js +++ b/modules/supplier/front/create/index.js @@ -4,7 +4,6 @@ import Section from 'salix/components/section'; class Controller extends Section { constructor($element, $) { super($element, $); - console.log($.name); } onSubmit() { From 6a753d26af5573c910732be2dc1f190f2b56ca8c Mon Sep 17 00:00:00 2001 From: pablone Date: Mon, 11 Sep 2023 18:28:47 +0200 Subject: [PATCH 09/43] refs #6213 default account value --- db/changes/233801/00-supplierAccountCheckLength.sql | 8 +++++++- modules/supplier/back/models/supplier.js | 9 +++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/db/changes/233801/00-supplierAccountCheckLength.sql b/db/changes/233801/00-supplierAccountCheckLength.sql index 99f571ba1..30ff739b8 100644 --- a/db/changes/233801/00-supplierAccountCheckLength.sql +++ b/db/changes/233801/00-supplierAccountCheckLength.sql @@ -1 +1,7 @@ -ALTER TABLE vn.supplier ADD CONSTRAINT supplier_CHECK CHECK (LENGTH(account) = 10); + +UPDATE `vn`.`supplier` + SET account = LPAD(id,10,'0') + WHERE account IS NULL; + +ALTER TABLE `vn`.`supplier` ADD CONSTRAINT supplierAccountTooShort CHECK (LENGTH(account) = 10); +ALTER TABLE vn.supplier MODIFY COLUMN account varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT 4100000000 NOT NULL COMMENT 'Default accounting code for suppliers.'; diff --git a/modules/supplier/back/models/supplier.js b/modules/supplier/back/models/supplier.js index 28e53e3c5..6bfec86d1 100644 --- a/modules/supplier/back/models/supplier.js +++ b/modules/supplier/back/models/supplier.js @@ -112,13 +112,9 @@ module.exports = Self => { const hasChanges = orgData && changes; const isPayMethodCheckedChanged = hasChanges && orgData.isPayMethodChecked != isPayMethodChecked; - const isAccountChanged = hasChanges && orgData.account != changes.account; if (!editPayMethodCheck && isPayMethodCheckedChanged) throw new UserError('You can not modify is pay method checked'); - - if (isAccountChanged && !(changes.account.length === 10)) - throw new UserError('The account size must be exactly 10 characters'); }); Self.observe('after save', async function(ctx) { @@ -126,10 +122,11 @@ module.exports = Self => { const supplierId = ctx.instance.id; const models = Self.app.models; - const supplier = await models.Supplier.findById(supplierId); + const supplier = await models.Supplier.findById(supplierId, null, ctx.options); await supplier.updateAttribute( 'account', - supplierId.toString().padStart(10, '0') + supplier.account + supplierId, + ctx.options ); } }); From f82af979ed5511e893c60651f2c1987892b31987 Mon Sep 17 00:00:00 2001 From: pablone Date: Wed, 13 Sep 2023 16:54:50 +0200 Subject: [PATCH 10/43] refs #6213 fixTraductionFile --- loopback/locale/es.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/loopback/locale/es.json b/loopback/locale/es.json index 6388c01a4..f568b9a58 100644 --- a/loopback/locale/es.json +++ b/loopback/locale/es.json @@ -317,6 +317,5 @@ "The ticket doesn't exist.": "No existe el ticket.", "Social name should be uppercase": "La razón social debe ir en mayúscula", "Street should be uppercase": "La dirección fiscal debe ir en mayúscula", - "Ticket without Route": "Ticket sin ruta", - "The account size must be exactly 10 characters": "The account size must be exactly 10 characters" + "Ticket without Route": "Ticket sin ruta" } \ No newline at end of file From 7ab8cb37cd4b2a34c3899ccfafac3a5c22e8d33f Mon Sep 17 00:00:00 2001 From: pablone Date: Wed, 13 Sep 2023 19:22:21 +0200 Subject: [PATCH 11/43] ref #6213 fixformat --- modules/supplier/back/models/supplier.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/modules/supplier/back/models/supplier.js b/modules/supplier/back/models/supplier.js index 6bfec86d1..0337fe9db 100644 --- a/modules/supplier/back/models/supplier.js +++ b/modules/supplier/back/models/supplier.js @@ -119,15 +119,12 @@ module.exports = Self => { Self.observe('after save', async function(ctx) { if (ctx.instance && ctx.isNewInstance) { - const supplierId = ctx.instance.id; - const models = Self.app.models; + const {id} = ctx.instance; + const {Supplier} = Self.app.models; - const supplier = await models.Supplier.findById(supplierId, null, ctx.options); - await supplier.updateAttribute( - 'account', - supplier.account + supplierId, - ctx.options - ); + const supplier = await Supplier.findById(id, null, ctx.options); + if (supplier) + await supplier.updateAttribute('account', `${supplier.account}${id}`, ctx.options); } }); From a44e5206a7f2701f9195fd9af64ae3a538c342c1 Mon Sep 17 00:00:00 2001 From: pablone Date: Thu, 14 Sep 2023 14:18:00 +0200 Subject: [PATCH 12/43] refs #6213 fixConcatBug --- modules/supplier/back/models/supplier.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/supplier/back/models/supplier.js b/modules/supplier/back/models/supplier.js index 0337fe9db..273c8c816 100644 --- a/modules/supplier/back/models/supplier.js +++ b/modules/supplier/back/models/supplier.js @@ -124,7 +124,7 @@ module.exports = Self => { const supplier = await Supplier.findById(id, null, ctx.options); if (supplier) - await supplier.updateAttribute('account', `${supplier.account}${id}`, ctx.options); + await supplier.updateAttribute('account', Number(supplier.account) + id, ctx.options); } }); From 55b53c86c436ca42f76a34c045dc9f961303106a Mon Sep 17 00:00:00 2001 From: pablone Date: Mon, 18 Sep 2023 07:38:30 +0200 Subject: [PATCH 13/43] refs #6213 formatfix --- modules/supplier/back/models/supplier.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/supplier/back/models/supplier.js b/modules/supplier/back/models/supplier.js index 273c8c816..5cf357c13 100644 --- a/modules/supplier/back/models/supplier.js +++ b/modules/supplier/back/models/supplier.js @@ -123,8 +123,7 @@ module.exports = Self => { const {Supplier} = Self.app.models; const supplier = await Supplier.findById(id, null, ctx.options); - if (supplier) - await supplier.updateAttribute('account', Number(supplier.account) + id, ctx.options); + await supplier?.updateAttribute('account', Number(supplier.account) + id, ctx.options); } }); From cdf0951a1b9106015ffcf187d4c3da96e2e889d6 Mon Sep 17 00:00:00 2001 From: pablone Date: Mon, 18 Sep 2023 10:12:32 +0200 Subject: [PATCH 14/43] refs #6213 newSuplierSpec --- .../back/models/specs/supplier.spec.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/modules/supplier/back/models/specs/supplier.spec.js b/modules/supplier/back/models/specs/supplier.spec.js index f317f1fb9..d75c80558 100644 --- a/modules/supplier/back/models/specs/supplier.spec.js +++ b/modules/supplier/back/models/specs/supplier.spec.js @@ -124,4 +124,22 @@ describe('loopback model Supplier', () => { } }); }); + + describe('after save observer', () => { + fit('should update the account attribute when a new supplier is created', async() => { + const tx = await models.Supplier.beginTransaction({}); + const options = {transaction: tx}; + + try { + const newSupplier = await models.Supplier.create({id: '6969', name: 'Alfred Pennyworth'}, options); + const fetchedSupplier = await models.Supplier.findById(newSupplier.id, null, options); + + expect(fetchedSupplier.account).toEqual('4100006969'); + await tx.rollback(); + } catch (e) { + await tx.rollback(); + throw e; + } + }); + }); }); From 361c2b4cad3cfccaddb2d012055ecd72ed10a77d Mon Sep 17 00:00:00 2001 From: pablone Date: Tue, 19 Sep 2023 07:33:27 +0200 Subject: [PATCH 15/43] refs #6213 fixSpec --- .../{233801 => 234001}/00-supplierAccountCheckLength.sql | 0 modules/supplier/back/models/specs/supplier.spec.js | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) rename db/changes/{233801 => 234001}/00-supplierAccountCheckLength.sql (100%) diff --git a/db/changes/233801/00-supplierAccountCheckLength.sql b/db/changes/234001/00-supplierAccountCheckLength.sql similarity index 100% rename from db/changes/233801/00-supplierAccountCheckLength.sql rename to db/changes/234001/00-supplierAccountCheckLength.sql diff --git a/modules/supplier/back/models/specs/supplier.spec.js b/modules/supplier/back/models/specs/supplier.spec.js index d75c80558..043399dc9 100644 --- a/modules/supplier/back/models/specs/supplier.spec.js +++ b/modules/supplier/back/models/specs/supplier.spec.js @@ -126,12 +126,12 @@ describe('loopback model Supplier', () => { }); describe('after save observer', () => { - fit('should update the account attribute when a new supplier is created', async() => { + it('should update the account attribute when a new supplier is created', async() => { const tx = await models.Supplier.beginTransaction({}); const options = {transaction: tx}; try { - const newSupplier = await models.Supplier.create({id: '6969', name: 'Alfred Pennyworth'}, options); + const newSupplier = await models.Supplier.create({id: '9999', name: 'Alfred Pennyworth'}, options); const fetchedSupplier = await models.Supplier.findById(newSupplier.id, null, options); expect(fetchedSupplier.account).toEqual('4100006969'); From 971d77a198148582d8411d5eee04c34760eba906 Mon Sep 17 00:00:00 2001 From: pablone Date: Tue, 19 Sep 2023 07:46:44 +0200 Subject: [PATCH 16/43] refs #6213 specChangeId --- modules/supplier/back/models/specs/supplier.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/supplier/back/models/specs/supplier.spec.js b/modules/supplier/back/models/specs/supplier.spec.js index 043399dc9..9dd84d9fa 100644 --- a/modules/supplier/back/models/specs/supplier.spec.js +++ b/modules/supplier/back/models/specs/supplier.spec.js @@ -134,7 +134,7 @@ describe('loopback model Supplier', () => { const newSupplier = await models.Supplier.create({id: '9999', name: 'Alfred Pennyworth'}, options); const fetchedSupplier = await models.Supplier.findById(newSupplier.id, null, options); - expect(fetchedSupplier.account).toEqual('4100006969'); + expect(fetchedSupplier.account).toEqual('4100009999'); await tx.rollback(); } catch (e) { await tx.rollback(); From 7b246b1bacb6d8501b9cb8fa5c77d66610081ae0 Mon Sep 17 00:00:00 2001 From: carlossa Date: Thu, 21 Sep 2023 13:15:00 +0200 Subject: [PATCH 17/43] refs #5768 trad choose address --- modules/client/front/sample/create/index.html | 17 +++++++++--- .../incoterms-authorization.html | 3 ++- .../incoterms-authorization.js | 3 +++ .../incoterms-authorization/locale/es.yml | 27 +++++++++---------- .../incoterms-authorization/locale/pt.yml | 21 +++++++-------- 5 files changed, 40 insertions(+), 31 deletions(-) diff --git a/modules/client/front/sample/create/index.html b/modules/client/front/sample/create/index.html index 5df2b29ef..7d6cab673 100644 --- a/modules/client/front/sample/create/index.html +++ b/modules/client/front/sample/create/index.html @@ -8,9 +8,9 @@ auto-load="true" url="Samples/visible" fields="[ - 'id', + 'id', 'code', - 'description', + 'description', 'model', 'hasCompany', 'hasPreview', @@ -65,7 +65,16 @@ model="ClientSample.companyFk" data="companiesData" show-field="code" - label="Company" + label="Company" + ng-if="sampleType.selection.hasCompany" + required="true"> + + @@ -85,7 +94,7 @@

diff --git a/print/templates/reports/incoterms-authorization/incoterms-authorization.js b/print/templates/reports/incoterms-authorization/incoterms-authorization.js index 53425487e..0fbbd10d2 100755 --- a/print/templates/reports/incoterms-authorization/incoterms-authorization.js +++ b/print/templates/reports/incoterms-authorization/incoterms-authorization.js @@ -17,6 +17,9 @@ module.exports = { companyId: { type: Number, required: true + }, + address: { + type: String } } }; diff --git a/print/templates/reports/incoterms-authorization/locale/es.yml b/print/templates/reports/incoterms-authorization/locale/es.yml index 6936ebda9..8bdce7085 100644 --- a/print/templates/reports/incoterms-authorization/locale/es.yml +++ b/print/templates/reports/incoterms-authorization/locale/es.yml @@ -1,28 +1,25 @@ reportName: autorizacion-incoterms description: '{socialName} una sociedad debidamente constituida con responsabilidad limitada -y registrada conforme al derecho de sociedades de {country} y aquí representada por -___________________. {socialName}, con domicilio en {address}, +y registrada conforme al derecho de sociedades de {country} y aquí representada por {socialName}, con domicilio en {address}, CIF {fiscalID}. En adelante denominada {name}.' issued: 'En {0}, a {1} de {2} de {3}' client: 'Cliente {0}' declaration: '{socialName} declara por la presente que:' declarations: - - 'Todas las compras realizadas por {socialName} con {companyName} se -entregan, Ex Works (Incoterms), en el almacén de {companyName} situado en -{companyCity}.' - - '{socialName} reconoce que es importante para {companyName} tener -comprobante de la entrega intracomunitaria de la mercancía a {destinationCountry} para + - 'Todas las compras realizadas por {socialName} con {companyName} se entregan según las condiciones definidas en el incoterm {incotermsFk} ({Incoterm description}).' + - '{socialName} reconoce que es importante para {companyName} tener +comprobante de la entrega intracomunitaria de la mercancía a {destinationCountry} para poder facturar con 0% de IVA.' - - 'Por tanto, al firmar este acuerdo, {socialName} declara que todos los bienes que + - 'Por tanto, al firmar este acuerdo, {socialName} declara que todos los bienes que se compren a {companyName} serán entregados a {destinationCountry}.' - - 'Además, {socialName} deberá, a primera solicitud de {companyName}, -proporcionar una prueba de que todos los productos comprados a {companyName} han + - 'Además, {socialName} deberá, a primera solicitud de {companyName}, +proporcionar una prueba de que todos los productos comprados a {companyName} han sido entregados en {destinationCountry}.' - - 'Además de lo anterior, {companyName} proporcionará a {socialName} -un resumen mensual en el que se incluyen todas las facturas (y las entregas correspondientes). -{socialName} firmará y devolverá el resumen mensual a {companyName}, + - 'Además de lo anterior, {companyName} proporcionará a {socialName} +un resumen mensual en el que se incluyen todas las facturas (y las entregas correspondientes). +{socialName} firmará y devolverá el resumen mensual a {companyName}, S.L. dentro de los 5 días posteriores a la recepción del resumen.' -signer: +signer: representative: Representante representativeRole: Cargo del representante signed: Fecha de firma @@ -39,4 +36,4 @@ months: - 'Septiembre' - 'Octubre' - 'Noviembre' - - 'Diciembre' \ No newline at end of file + - 'Diciembre' diff --git a/print/templates/reports/incoterms-authorization/locale/pt.yml b/print/templates/reports/incoterms-authorization/locale/pt.yml index 2d33e6a1a..996c0961e 100644 --- a/print/templates/reports/incoterms-authorization/locale/pt.yml +++ b/print/templates/reports/incoterms-authorization/locale/pt.yml @@ -1,28 +1,27 @@ reportName: autorizacion-incoterms description: '{socialName} uma sociedade devidamente constituída com responsabilidade limitada e registada -conforme ao direito de sociedades da {country} e aqui representada por -___________________. {socialName}, com domicílio em {address}, +conforme ao direito de sociedades da {country} e aqui representada por {socialName}, com domicílio em {address}, CIF {fiscalID}. Em adiante denominada {name}.' issued: 'Em {0}, em {1} de {2} de {3}' client: 'Cliente {0}' declaration: '{socialName} declara através da presente que:' declarations: - - 'Todas as compras realizadas por {socialName} a {companyName} se entregam, + - 'Todas as compras realizadas por {socialName} a {companyName} se entregam, Ex Works (Incoterms), no armazém da {companyName} situado em {companyCity}.' - - '{socialName} reconhece ser importante para {companyName} - ter o comprovante da entrega intracomunitária da mercadoria a {destinationCountry} + - '{socialName} reconhece ser importante para {companyName} + ter o comprovante da entrega intracomunitária da mercadoria em {destinationCountry} para poder faturar com 0% de IVA.' - - 'Portanto, ao assinar este acordo, {socialName} declara que todos os bens + - 'Portanto, ao assinar este acordo, {socialName} declara que todos os bens que se comprem na {companyName} serão entregues na {destinationCountry}.' - 'Além disto, {socialName} deverá, na primeira solicitude da {companyName}, - proporcionar uma prova de que todos os produtos comprados na {companyName} - foram entregues na {destinationCountry}.' - - 'Além do anterio, {companyName} proporcionará a {socialName} + proporcionar uma prova de que todos os produtos comprados em {companyName} + foram entregues em {destinationCountry}.' + - 'Além do anterior, {companyName} proporcionará a {socialName} um resumo mensal onde se incluem todas as faturas (e as entregas correspondentes). {socialName} assinará e devolverá o resumo mensal à {companyName}, dentro dos 5 dias posteriores à receção do resumo.' -signer: +signer: representative: Representante representativeRole: Cargo de representante signed: Data da assinatura @@ -39,4 +38,4 @@ months: - 'Setembro' - 'Outubro' - 'Novembro' - - 'Dezembro' \ No newline at end of file + - 'Dezembro' From c7e26f9155e3be023a7f7bdbc745fae1e5b6c23a Mon Sep 17 00:00:00 2001 From: carlossa Date: Fri, 22 Sep 2023 06:08:07 +0200 Subject: [PATCH 18/43] refs #5768 autocomplete --- modules/client/front/sample/create/index.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/client/front/sample/create/index.html b/modules/client/front/sample/create/index.html index 7d6cab673..134c097e8 100644 --- a/modules/client/front/sample/create/index.html +++ b/modules/client/front/sample/create/index.html @@ -69,15 +69,15 @@ ng-if="sampleType.selection.hasCompany" required="true"> - - + --> Date: Mon, 25 Sep 2023 08:23:23 +0200 Subject: [PATCH 19/43] refs #6213 unifyTest --- modules/supplier/back/models/specs/supplier.spec.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/modules/supplier/back/models/specs/supplier.spec.js b/modules/supplier/back/models/specs/supplier.spec.js index 9dd84d9fa..782c5cdf0 100644 --- a/modules/supplier/back/models/specs/supplier.spec.js +++ b/modules/supplier/back/models/specs/supplier.spec.js @@ -123,10 +123,8 @@ describe('loopback model Supplier', () => { throw e; } }); - }); - describe('after save observer', () => { - it('should update the account attribute when a new supplier is created', async() => { + fit('should update the account attribute when a new supplier is created', async() => { const tx = await models.Supplier.beginTransaction({}); const options = {transaction: tx}; From af8773612cf1b2e8da64a88df81ee30c94fc0b69 Mon Sep 17 00:00:00 2001 From: pablone Date: Mon, 25 Sep 2023 08:23:59 +0200 Subject: [PATCH 20/43] refs #6213 remove f --- modules/supplier/back/models/specs/supplier.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/supplier/back/models/specs/supplier.spec.js b/modules/supplier/back/models/specs/supplier.spec.js index 782c5cdf0..3db273a95 100644 --- a/modules/supplier/back/models/specs/supplier.spec.js +++ b/modules/supplier/back/models/specs/supplier.spec.js @@ -124,7 +124,7 @@ describe('loopback model Supplier', () => { } }); - fit('should update the account attribute when a new supplier is created', async() => { + it('should update the account attribute when a new supplier is created', async() => { const tx = await models.Supplier.beginTransaction({}); const options = {transaction: tx}; From 1307d4727c9ee4284278941395556701961d1067 Mon Sep 17 00:00:00 2001 From: alexm Date: Wed, 27 Sep 2023 15:08:36 +0200 Subject: [PATCH 21/43] refs #6254 feat(collection): add getTickets --- back/methods/collection/getTickets.js | 179 ++++++++++++++++++ .../collection/spec/getTickets.spec.js | 11 ++ back/models/collection.js | 1 + .../234001/00-collectionGetTicketsACL.sql | 3 + loopback/locale/en.json | 3 +- loopback/locale/es.json | 8 +- 6 files changed, 201 insertions(+), 4 deletions(-) create mode 100644 back/methods/collection/getTickets.js create mode 100644 back/methods/collection/spec/getTickets.spec.js create mode 100644 db/changes/234001/00-collectionGetTicketsACL.sql diff --git a/back/methods/collection/getTickets.js b/back/methods/collection/getTickets.js new file mode 100644 index 000000000..196ff0ce6 --- /dev/null +++ b/back/methods/collection/getTickets.js @@ -0,0 +1,179 @@ + +module.exports = Self => { + Self.remoteMethodCtx('getTickets', { + description: 'Make a new collection of tickets', + accessType: 'WRITE', + accepts: [{ + arg: 'paramId', + type: 'number', + description: 'The collection or ticket id', + required: true + }, { + arg: 'print', + type: 'boolean', + description: 'True if you want to print' + }], + returns: { + type: ['object'], + root: true + }, + http: { + path: `/getTickets`, + verb: 'POST' + } + }); + + Self.getTickets = async(ctx, paramId, print, options) => { + const userId = ctx.req.accessToken.userId; + const origin = ctx.req.headers.origin; + const $t = ctx.req.__; // $translate + const myOptions = {}; + + let tx; + + if (typeof options == 'object') + Object.assign(myOptions, options); + + if (!myOptions.transaction) { + tx = await Self.beginTransaction({}); + myOptions.transaction = tx; + } + myOptions.userId = userId; + + const promises = []; + try { + const [tickets] = await Self.rawSql(`CALL vn.collection_getTickets(?)`, [paramId], myOptions); + const sales = await Self.rawSql(` + SELECT + s.ticketFk, + sgd.saleGroupFk, + s.id saleFk, + s.itemFk, + i.longName, + i.size, + IFNULL(sub2.semaphore,st.semaphore) semaphore, + ic.color, + ip.productor, + o.code origin, + s.concept, + b.packing, + b.grouping, + s.isAdded, + c.workerFk, + i.packingShelve, + sm.id hasMistake, + s.originalQuantity, + s.quantity saleQuantity, + IF(p2.code IS NOT NULL, s.quantity, iss.quantity) reservedQuantity, + sh.code, + IFNULL(p2.code, p.code) parkingCode, + IFNULL(p2.pickingOrder, p.pickingOrder) pickingOrder, + iss.id itemShelvingSaleFk + FROM ticketCollection tc + LEFT JOIN collection c ON c.id = tc.collectionFk + JOIN ticket t ON t.id = tc.ticketFk + JOIN sale s ON s.ticketFk = t.id + LEFT JOIN saleGroupDetail sgd ON sgd.saleFk = s.id + LEFT JOIN saleGroup sg ON sg.id = sgd.saleGroupFk + LEFT JOIN parking p2 ON p2.id = sg.parkingFk + LEFT JOIN cache.last_buy lb ON lb.item_id = s.itemFk AND lb.warehouse_id = t.warehouseFk + LEFT JOIN buy b ON b.id = lb.buy_id + JOIN item i ON i.id = s.itemFk + LEFT JOIN itemShelvingSale iss ON iss.saleFk = s.id + LEFT JOIN itemShelving ish ON ish.id = iss.itemShelvingFk + LEFT JOIN shelving sh ON sh.code = ish.shelvingFk + LEFT JOIN parking p ON p.id = sh.parkingFk + LEFT JOIN ( + SELECT sub.saleFk, sub.isChecked, sub.stateFk, sub.originalQuantity, sub.semaphore + FROM ( + SELECT DISTINCT st.id, + st.saleFk, st.isChecked, st.stateFk, st.originalQuantity ,sta.semaphore + FROM ticketCollection tc + JOIN sale s ON s.ticketFk = tc.ticketFk + JOIN saleTracking st ON st.saleFk = s.id + JOIN state sta ON sta.id = st.stateFk + WHERE tc.collectionFk = ? + ORDER BY st.id DESC + LIMIT 10000000000000000000) sub + GROUP BY sub.saleFk, sub.stateFK + ) sub2 ON sub2.saleFk = s.id AND sub2.isChecked = 1 + LEFT JOIN state st ON st.id = sub2.stateFk + LEFT JOIN itemColor ic ON ic.itemFk = s.itemFk + LEFT JOIN itemProductor ip ON ip.itemFk = s.itemFk + LEFT JOIN origin o ON o.id = i.originFk + LEFT JOIN saleMistake sm ON sm.saleFk = s.id + WHERE tc.collectionFk = ? + GROUP BY s.id, p.code, p2.code + ORDER BY pickingOrder`, [paramId, paramId], myOptions); + + if (print) + await Self.rawSql(`CALL vn.collection_printSticker(?, ?)`, [paramId, null], myOptions); + + const collection = {collectionFk: paramId, tickets: []}; + if (tickets && tickets.length) { + for (let ticket of tickets) { + const ticketId = ticket.ticketFk; + + // SEND ROCKET + if (ticket.observaciones != '') { + for (observation of ticket.observaciones.split(' ')) { + if (['#', '@'].includes(observation.charAt(0))) { + promises.push(Self.app.models.Chat.send(ctx, observation, + $t('The ticket is in preparation', { + ticketId: ticketId, + ticketUrl: `${origin}/#!/ticket/${ticketId}/summary`, + salesPersonId: ticket.salesPersonFk + }))); + } + } + } + + // SET COLLECTION + if (sales && sales.length) { + // GET BARCODES + const barcodes = await Self.rawSql(` + SELECT s.id saleFk, b.code, c.id + FROM vn.sale s + LEFT JOIN vn.itemBarcode b ON b.itemFk = s.itemFk + LEFT JOIN vn.buy c ON c.itemFk = s.itemFk + LEFT JOIN vn.entry e ON e.id = c.entryFk + LEFT JOIN vn.travel tr ON tr.id = e.travelFk + WHERE s.ticketFk = ? AND tr.landed >= DATE_SUB(util.VN_CURDATE(), INTERVAL 1 YEAR)`, + [ticketId], myOptions); + + // BINDINGS + ticket.sales = sales.reduce((acc, sale) => { + if (sale.ticketFk == ticketId) { + sale.Barcodes = []; + if (barcodes && barcodes.length) { + sale.Barcodes = barcodes.reduce((bacc, barcode) => { + if (barcode.saleFk == sale.saleFk) { + for (let prop in barcode) { + if (['id', 'code'].includes(prop) && barcode[prop]) { + bacc.push(barcode[prop].toString()); + bacc.push('0' + barcode[prop]); + } + } + } + return bacc; + }, []); + } + acc.push(sale); + } + return acc; + }, []); + } + collection.tickets.push(ticket); + } + } + + if (tx) await tx.commit(); + await Promise.all(promises); + + return collection; + } catch (e) { + if (tx) await tx.rollback(); + throw e; + } + }; +}; diff --git a/back/methods/collection/spec/getTickets.spec.js b/back/methods/collection/spec/getTickets.spec.js new file mode 100644 index 000000000..eddbb21b1 --- /dev/null +++ b/back/methods/collection/spec/getTickets.spec.js @@ -0,0 +1,11 @@ +const models = require('vn-loopback/server/server').models; + +describe('collection getTickets()', () => { + it('should return a list of tickets from a collection', async() => { + let ctx = {req: {accessToken: {userId: 1107}}}; + let response = await models.Collection.getCollection(ctx); + + expect(response.length).toBeGreaterThan(0); + expect(response[0].collectionFk).toEqual(3); + }); +}); diff --git a/back/models/collection.js b/back/models/collection.js index a41742ee7..bfa906af6 100644 --- a/back/models/collection.js +++ b/back/models/collection.js @@ -4,4 +4,5 @@ module.exports = Self => { require('../methods/collection/getSectors')(Self); require('../methods/collection/setSaleQuantity')(Self); require('../methods/collection/previousLabel')(Self); + require('../methods/collection/getTickets')(Self); }; diff --git a/db/changes/234001/00-collectionGetTicketsACL.sql b/db/changes/234001/00-collectionGetTicketsACL.sql new file mode 100644 index 000000000..06b584386 --- /dev/null +++ b/db/changes/234001/00-collectionGetTicketsACL.sql @@ -0,0 +1,3 @@ +INSERT INTO `salix`.`ACL`(model, property, accessType, permission, principalType, principalId) + VALUES + ('Collection', 'getTickets', 'WRITE', 'ALLOW', 'ROLE', 'employee'); diff --git a/loopback/locale/en.json b/loopback/locale/en.json index fb4e72bd6..3ce4761a1 100644 --- a/loopback/locale/en.json +++ b/loopback/locale/en.json @@ -187,5 +187,6 @@ "This ticket is not editable.": "This ticket is not editable.", "The ticket doesn't exist.": "The ticket doesn't exist.", "The sales do not exists": "The sales do not exists", - "Ticket without Route": "Ticket without route" + "Ticket without Route": "Ticket without route", + "The ticket is in preparation": "The ticket [{{ticketId}}]({{{ticketUrl}}}) of the sales person {{salesPersonId}} is in preparation" } diff --git a/loopback/locale/es.json b/loopback/locale/es.json index 756ce301a..71a01f91a 100644 --- a/loopback/locale/es.json +++ b/loopback/locale/es.json @@ -314,8 +314,10 @@ "This ticket is locked.": "Este ticket está bloqueado.", "This ticket is not editable.": "Este ticket no es editable.", "The ticket doesn't exist.": "No existe el ticket.", - "Social name should be uppercase": "La razón social debe ir en mayúscula", + "Social name should be uppercase": "La razón social debe ir en mayúscula", "Street should be uppercase": "La dirección fiscal debe ir en mayúscula", "The response is not a PDF": "La respuesta no es un PDF", - "Ticket without Route": "Ticket sin ruta" -} + "Ticket without Route": "Ticket sin ruta", + "The ticket is in preparation": "El ticket [{{ticketId}}]({{{ticketUrl}}}) del comercial {{salesPersonId}} està en preparación", + "Invalid collection or ticket": "Invalid collection or ticket" +} \ No newline at end of file From d4e5815d417122c905e7583ef314311d21793fcf Mon Sep 17 00:00:00 2001 From: alexm Date: Thu, 28 Sep 2023 08:30:50 +0200 Subject: [PATCH 22/43] refs #6254 feat(collection_getTickets): refactor code and add test --- back/methods/collection/getTickets.js | 46 +++++++++---------- .../collection/spec/getTickets.spec.js | 38 +++++++++++++-- db/changes/233802/.gitkeep | 0 .../00-collectionGetTicketsACL.sql | 0 4 files changed, 56 insertions(+), 28 deletions(-) create mode 100644 db/changes/233802/.gitkeep rename db/changes/{234001 => 233802}/00-collectionGetTicketsACL.sql (100%) diff --git a/back/methods/collection/getTickets.js b/back/methods/collection/getTickets.js index 196ff0ce6..1d0daa43a 100644 --- a/back/methods/collection/getTickets.js +++ b/back/methods/collection/getTickets.js @@ -4,10 +4,11 @@ module.exports = Self => { description: 'Make a new collection of tickets', accessType: 'WRITE', accepts: [{ - arg: 'paramId', + arg: 'id', type: 'number', - description: 'The collection or ticket id', - required: true + description: 'The collection id', + required: true, + http: {source: 'path'} }, { arg: 'print', type: 'boolean', @@ -18,12 +19,12 @@ module.exports = Self => { root: true }, http: { - path: `/getTickets`, + path: `/:id/getTickets`, verb: 'POST' } }); - Self.getTickets = async(ctx, paramId, print, options) => { + Self.getTickets = async(ctx, id, print, options) => { const userId = ctx.req.accessToken.userId; const origin = ctx.req.headers.origin; const $t = ctx.req.__; // $translate @@ -42,7 +43,7 @@ module.exports = Self => { const promises = []; try { - const [tickets] = await Self.rawSql(`CALL vn.collection_getTickets(?)`, [paramId], myOptions); + const [tickets] = await Self.rawSql(`CALL vn.collection_getTickets(?)`, [id], myOptions); const sales = await Self.rawSql(` SELECT s.ticketFk, @@ -104,14 +105,14 @@ module.exports = Self => { LEFT JOIN saleMistake sm ON sm.saleFk = s.id WHERE tc.collectionFk = ? GROUP BY s.id, p.code, p2.code - ORDER BY pickingOrder`, [paramId, paramId], myOptions); + ORDER BY pickingOrder`, [id, id], myOptions); if (print) - await Self.rawSql(`CALL vn.collection_printSticker(?, ?)`, [paramId, null], myOptions); + await Self.rawSql(`CALL vn.collection_printSticker(?, ?)`, [id, null], myOptions); - const collection = {collectionFk: paramId, tickets: []}; + const collection = {collectionFk: id, tickets: []}; if (tickets && tickets.length) { - for (let ticket of tickets) { + for (const ticket of tickets) { const ticketId = ticket.ticketFk; // SEND ROCKET @@ -142,26 +143,25 @@ module.exports = Self => { [ticketId], myOptions); // BINDINGS - ticket.sales = sales.reduce((acc, sale) => { - if (sale.ticketFk == ticketId) { + ticket.sales = []; + for (const sale of sales) { + if (sale.ticketFk === ticketId) { sale.Barcodes = []; + if (barcodes && barcodes.length) { - sale.Barcodes = barcodes.reduce((bacc, barcode) => { - if (barcode.saleFk == sale.saleFk) { + for (const barcode of barcodes) { + if (barcode.saleFk === sale.saleFk) { for (let prop in barcode) { - if (['id', 'code'].includes(prop) && barcode[prop]) { - bacc.push(barcode[prop].toString()); - bacc.push('0' + barcode[prop]); - } + if (['id', 'code'].includes(prop) && barcode[prop]) + sale.Barcodes.push(barcode[prop].toString(), '0' + barcode[prop]); } } - return bacc; - }, []); + } } - acc.push(sale); + + ticket.sales.push(sale); } - return acc; - }, []); + } } collection.tickets.push(ticket); } diff --git a/back/methods/collection/spec/getTickets.spec.js b/back/methods/collection/spec/getTickets.spec.js index eddbb21b1..e6b9e6a17 100644 --- a/back/methods/collection/spec/getTickets.spec.js +++ b/back/methods/collection/spec/getTickets.spec.js @@ -1,11 +1,39 @@ const models = require('vn-loopback/server/server').models; describe('collection getTickets()', () => { - it('should return a list of tickets from a collection', async() => { - let ctx = {req: {accessToken: {userId: 1107}}}; - let response = await models.Collection.getCollection(ctx); + let ctx; + beforeAll(async() => { + ctx = { + req: { + accessToken: {userId: 9}, + headers: {origin: 'http://localhost'} + } + }; + }); - expect(response.length).toBeGreaterThan(0); - expect(response[0].collectionFk).toEqual(3); + it('should get tickets, sales and barcodes from collection', async() => { + const tx = await models.Collection.beginTransaction({}); + + try { + const options = {transaction: tx}; + const collectionId = 1; + + const collectionTickets = await models.Collection.getTickets(ctx, collectionId, null, options); + + expect(collectionTickets.collectionFk).toEqual(collectionId); + expect(collectionTickets.tickets.length).toEqual(3); + expect(collectionTickets.tickets[0].ticketFk).toEqual(1); + expect(collectionTickets.tickets[1].ticketFk).toEqual(2); + expect(collectionTickets.tickets[2].ticketFk).toEqual(23); + expect(collectionTickets.tickets[0].sales[0].ticketFk).toEqual(1); + expect(collectionTickets.tickets[0].sales[1].ticketFk).toEqual(1); + expect(collectionTickets.tickets[0].sales[2].ticketFk).toEqual(1); + expect(collectionTickets.tickets[0].sales[0].Barcodes.length).toBeTruthy(); + + await tx.rollback(); + } catch (e) { + await tx.rollback(); + throw e; + } }); }); diff --git a/db/changes/233802/.gitkeep b/db/changes/233802/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/db/changes/234001/00-collectionGetTicketsACL.sql b/db/changes/233802/00-collectionGetTicketsACL.sql similarity index 100% rename from db/changes/234001/00-collectionGetTicketsACL.sql rename to db/changes/233802/00-collectionGetTicketsACL.sql From f3c55cdee989fa8256bc7c19d83f3bc70d511b27 Mon Sep 17 00:00:00 2001 From: alexm Date: Thu, 28 Sep 2023 16:00:09 +0200 Subject: [PATCH 23/43] refs #5929 fix(isEditable): can edit if is weekly --- db/dump/fixtures.sql | 2 -- modules/ticket/back/methods/ticket/isEditableOrThrow.js | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql index 9187e2871..c10b5665a 100644 --- a/db/dump/fixtures.sql +++ b/db/dump/fixtures.sql @@ -1409,10 +1409,8 @@ INSERT INTO `cache`.`cache_calc`(`id`, `cache_id`, `cacheName`, `params`, `last_ INSERT INTO `vn`.`ticketWeekly`(`ticketFk`, `weekDay`) VALUES - (1, 0), (2, 1), (3, 2), - (4, 4), (5, 6), (15, 6); diff --git a/modules/ticket/back/methods/ticket/isEditableOrThrow.js b/modules/ticket/back/methods/ticket/isEditableOrThrow.js index 6a8bafa2c..f8285cecd 100644 --- a/modules/ticket/back/methods/ticket/isEditableOrThrow.js +++ b/modules/ticket/back/methods/ticket/isEditableOrThrow.js @@ -40,7 +40,7 @@ module.exports = Self => { if (!isEditable && !isRoleAdvanced) throw new ForbiddenError(`This ticket is not editable.`); - if (isLocked) + if (isLocked && !isWeekly) throw new ForbiddenError(`This ticket is locked.`); if (isWeekly && !canEditWeeklyTicket) From 542119983b303a093e8cec7caaad2c9818ddce42 Mon Sep 17 00:00:00 2001 From: alexm Date: Fri, 29 Sep 2023 09:28:23 +0200 Subject: [PATCH 24/43] refs #5929 test: fix test after fix ticket_isEditable --- e2e/helpers/selectors.js | 3 +-- e2e/paths/05-ticket/09_weekly.spec.js | 10 ++++++---- .../methods/ticket-request/specs/filter.spec.js | 10 +++++----- .../methods/ticket-weekly/specs/filter.spec.js | 14 +++++++------- .../back/methods/ticket/specs/isEditable.spec.js | 2 +- 5 files changed, 20 insertions(+), 19 deletions(-) diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index 1b18eb866..6f78d7c4e 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -520,8 +520,7 @@ export default { searchResultDate: 'vn-ticket-summary [label=Landed] span', topbarSearch: 'vn-searchbar', moreMenu: 'vn-ticket-index vn-icon-button[icon=more_vert]', - fourthWeeklyTicket: 'vn-ticket-weekly-index vn-card smart-table slot-table tr:nth-child(5)', - fiveWeeklyTicket: 'vn-ticket-weekly-index vn-card smart-table slot-table tr:nth-child(6)', + thirdWeeklyTicket: 'vn-ticket-weekly-index vn-card smart-table slot-table tr:nth-child(4)', weeklyTicket: 'vn-ticket-weekly-index vn-card smart-table slot-table table tbody tr', firstWeeklyTicketDeleteIcon: 'vn-ticket-weekly-index vn-card smart-table slot-table tr:nth-child(2) vn-icon-button[icon="delete"]', firstWeeklyTicketAgency: 'vn-ticket-weekly-index vn-card smart-table slot-table tr:nth-child(2) [ng-model="weekly.agencyModeFk"]', diff --git a/e2e/paths/05-ticket/09_weekly.spec.js b/e2e/paths/05-ticket/09_weekly.spec.js index a9cce2ead..74febfd01 100644 --- a/e2e/paths/05-ticket/09_weekly.spec.js +++ b/e2e/paths/05-ticket/09_weekly.spec.js @@ -19,7 +19,7 @@ describe('Ticket descriptor path', () => { it('should count the amount of tickets in the turns section', async() => { const result = await page.countElement(selectors.ticketsIndex.weeklyTicket); - expect(result).toEqual(7); + expect(result).toEqual(5); }); it('should go back to the ticket index then search and access a ticket summary', async() => { @@ -45,7 +45,7 @@ describe('Ticket descriptor path', () => { it('should confirm the ticket 11 was added to thursday', async() => { await page.accessToSection('ticket.weekly.index'); - const result = await page.waitToGetProperty(selectors.ticketsIndex.fourthWeeklyTicket, 'value'); + const result = await page.waitToGetProperty(selectors.ticketsIndex.thirdWeeklyTicket, 'value'); expect(result).toEqual('Thursday'); }); @@ -80,7 +80,9 @@ describe('Ticket descriptor path', () => { it('should confirm the ticket 11 was added on saturday', async() => { await page.accessToSection('ticket.weekly.index'); - const result = await page.waitToGetProperty(selectors.ticketsIndex.fiveWeeklyTicket, 'value'); + await page.waitForTimeout(5000); + + const result = await page.waitToGetProperty(selectors.ticketsIndex.thirdWeeklyTicket, 'value'); expect(result).toEqual('Saturday'); }); @@ -104,7 +106,7 @@ describe('Ticket descriptor path', () => { await page.doSearch(); const nResults = await page.countElement(selectors.ticketsIndex.searchWeeklyResult); - expect(nResults).toEqual(7); + expect(nResults).toEqual(5); }); it('should update the agency then remove it afterwards', async() => { diff --git a/modules/ticket/back/methods/ticket-request/specs/filter.spec.js b/modules/ticket/back/methods/ticket-request/specs/filter.spec.js index ae004a024..9ab89f009 100644 --- a/modules/ticket/back/methods/ticket-request/specs/filter.spec.js +++ b/modules/ticket/back/methods/ticket-request/specs/filter.spec.js @@ -14,7 +14,7 @@ describe('ticket-request filter()', () => { const result = await models.TicketRequest.filter(ctx, options); - expect(result.length).toEqual(3); + expect(result.length).toEqual(5); await tx.rollback(); } catch (e) { @@ -93,7 +93,7 @@ describe('ticket-request filter()', () => { const result = await models.TicketRequest.filter(ctx, options); const requestId = result[0].id; - expect(requestId).toEqual(3); + expect(requestId).toEqual(1); await tx.rollback(); } catch (e) { @@ -113,7 +113,7 @@ describe('ticket-request filter()', () => { const result = await models.TicketRequest.filter(ctx, options); const requestId = result[0].id; - expect(requestId).toEqual(3); + expect(requestId).toEqual(1); await tx.rollback(); } catch (e) { @@ -153,7 +153,7 @@ describe('ticket-request filter()', () => { const result = await models.TicketRequest.filter(ctx, {order: 'id'}, options); const requestId = result[0].id; - expect(requestId).toEqual(3); + expect(requestId).toEqual(1); await tx.rollback(); } catch (e) { @@ -173,7 +173,7 @@ describe('ticket-request filter()', () => { const result = await models.TicketRequest.filter(ctx, options); const requestId = result[0].id; - expect(requestId).toEqual(3); + expect(requestId).toEqual(1); await tx.rollback(); } catch (e) { diff --git a/modules/ticket/back/methods/ticket-weekly/specs/filter.spec.js b/modules/ticket/back/methods/ticket-weekly/specs/filter.spec.js index 2587b6657..453b7924f 100644 --- a/modules/ticket/back/methods/ticket-weekly/specs/filter.spec.js +++ b/modules/ticket/back/methods/ticket-weekly/specs/filter.spec.js @@ -16,8 +16,8 @@ describe('ticket-weekly filter()', () => { const firstRow = result[0]; - expect(firstRow.ticketFk).toEqual(1); - expect(result.length).toEqual(6); + expect(firstRow.ticketFk).toEqual(2); + expect(result.length).toEqual(4); await tx.rollback(); } catch (e) { @@ -52,12 +52,12 @@ describe('ticket-weekly filter()', () => { try { const options = {transaction: tx}; - const ctx = {req: {accessToken: {userId: authUserId}}, args: {search: 'bruce'}}; + const ctx = {req: {accessToken: {userId: authUserId}}, args: {search: 'max'}}; const result = await models.TicketWeekly.filter(ctx, null, options); const firstRow = result[0]; - expect(firstRow.clientName).toEqual('Bruce Wayne'); + expect(firstRow.clientName).toEqual('Max Eisenhardt'); await tx.rollback(); } catch (e) { @@ -72,13 +72,13 @@ describe('ticket-weekly filter()', () => { try { const options = {transaction: tx}; - const ctx = {req: {accessToken: {userId: authUserId}}, args: {search: 1101}}; + const ctx = {req: {accessToken: {userId: authUserId}}, args: {search: 1105}}; const result = await models.TicketWeekly.filter(ctx, null, options); const firstRow = result[0]; - expect(firstRow.clientFk).toEqual(1101); - expect(firstRow.clientName).toEqual('Bruce Wayne'); + expect(firstRow.clientFk).toEqual(1105); + expect(firstRow.clientName).toEqual('Max Eisenhardt'); await tx.rollback(); } catch (e) { diff --git a/modules/ticket/back/methods/ticket/specs/isEditable.spec.js b/modules/ticket/back/methods/ticket/specs/isEditable.spec.js index 301745ed3..9dd1f8544 100644 --- a/modules/ticket/back/methods/ticket/specs/isEditable.spec.js +++ b/modules/ticket/back/methods/ticket/specs/isEditable.spec.js @@ -8,7 +8,7 @@ describe('isEditable()', () => { try { const options = {transaction: tx}; const ctx = {req: {accessToken: {userId: 35}}}; - result = await models.Ticket.isEditable(ctx, 5, options); + result = await models.Ticket.isEditable(ctx, 19, options); await tx.rollback(); } catch (error) { await tx.rollback(); From a0a59b672f81ec0a58224da567375829cd28ff15 Mon Sep 17 00:00:00 2001 From: alexm Date: Fri, 29 Sep 2023 10:04:57 +0200 Subject: [PATCH 25/43] =?UTF-8?q?refs=20#6271=20hotFix(email):=20clientCre?= =?UTF-8?q?ditEmail=20=E2=86=92=20creditRequestEmail?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/client/back/methods/client/creditRequestEmail.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/client/back/methods/client/creditRequestEmail.js b/modules/client/back/methods/client/creditRequestEmail.js index 0255949e0..60047de77 100644 --- a/modules/client/back/methods/client/creditRequestEmail.js +++ b/modules/client/back/methods/client/creditRequestEmail.js @@ -1,5 +1,5 @@ module.exports = Self => { - Self.remoteMethodCtx('clientCreditEmail', { + Self.remoteMethodCtx('creditRequestEmail', { description: 'Sends the credit request email with an attached PDF', accessType: 'WRITE', accepts: [ @@ -40,5 +40,5 @@ module.exports = Self => { }, }); - Self.clientCreditEmail = ctx => Self.sendTemplate(ctx, 'credit-request'); + Self.creditRequestEmail = ctx => Self.sendTemplate(ctx, 'credit-request'); }; From 9536fdba583decd85c81809814edaa5ee935737e Mon Sep 17 00:00:00 2001 From: jorgep Date: Fri, 29 Sep 2023 10:10:58 +0200 Subject: [PATCH 26/43] ref #6119 refactor --- front/core/components/link-phone/index.html | 27 ++++++++++--------- front/core/components/link-phone/index.js | 4 --- modules/client/front/summary/index.html | 4 +-- modules/order/front/summary/index.html | 1 - .../route/front/roadmap/summary/index.html | 1 - modules/ticket/front/summary/index.html | 4 --- modules/worker/front/descriptor/index.html | 2 -- modules/worker/front/summary/index.html | 3 --- 8 files changed, 16 insertions(+), 30 deletions(-) diff --git a/front/core/components/link-phone/index.html b/front/core/components/link-phone/index.html index fc520cefd..2789ab75c 100644 --- a/front/core/components/link-phone/index.html +++ b/front/core/components/link-phone/index.html @@ -1,13 +1,14 @@ - - - - \ No newline at end of file + + {{$ctrl.phoneNumber}} + + + + + +- diff --git a/front/core/components/link-phone/index.js b/front/core/components/link-phone/index.js index d5c828f21..6f3eec5b1 100644 --- a/front/core/components/link-phone/index.js +++ b/front/core/components/link-phone/index.js @@ -3,8 +3,6 @@ import './style.scss'; class Controller { constructor() { this.phoneNumber = null; - this.icon = true; - this.showNumber = true; } } @@ -13,7 +11,5 @@ ngModule.vnComponent('vnLinkPhone', { controller: Controller, bindings: { phoneNumber: '<', - icon: '
- {{$ctrl.summary.phone | dashIfEmpty}} + - {{$ctrl.summary.mobile | dashIfEmpty}} + diff --git a/modules/order/front/summary/index.html b/modules/order/front/summary/index.html index e9bdf33b2..218359992 100644 --- a/modules/order/front/summary/index.html +++ b/modules/order/front/summary/index.html @@ -49,7 +49,6 @@ value="{{$ctrl.summary.landed | date: 'dd/MM/yyyy HH:mm'}}"> - {{$ctrl.summary.address.phone | dashIfEmpty}} diff --git a/modules/route/front/roadmap/summary/index.html b/modules/route/front/roadmap/summary/index.html index aea7e717b..9fab0bf87 100644 --- a/modules/route/front/roadmap/summary/index.html +++ b/modules/route/front/roadmap/summary/index.html @@ -26,7 +26,6 @@ - {{summary.phone | dashIfEmpty}} diff --git a/modules/ticket/front/summary/index.html b/modules/ticket/front/summary/index.html index 4a92daa39..3c60352a7 100644 --- a/modules/ticket/front/summary/index.html +++ b/modules/ticket/front/summary/index.html @@ -84,7 +84,6 @@ - {{$ctrl.summary.address.phone | dashIfEmpty}} @@ -92,21 +91,18 @@ - {{$ctrl.summary.address.mobile | dashIfEmpty}} - {{$ctrl.summary.client.phone | dashIfEmpty}} - {{$ctrl.summary.client.mobile | dashIfEmpty}} diff --git a/modules/worker/front/descriptor/index.html b/modules/worker/front/descriptor/index.html index 4a5fb894e..2dfa41ee3 100644 --- a/modules/worker/front/descriptor/index.html +++ b/modules/worker/front/descriptor/index.html @@ -38,7 +38,6 @@ - {{$ctrl.worker.phone | dashIfEmpty}} @@ -46,7 +45,6 @@ - {{$ctrl.worker.sip.extension | dashIfEmpty}} diff --git a/modules/worker/front/summary/index.html b/modules/worker/front/summary/index.html index 1826f30a8..2372634bc 100644 --- a/modules/worker/front/summary/index.html +++ b/modules/worker/front/summary/index.html @@ -43,20 +43,17 @@ - {{worker.mobileExtension | dashIfEmpty}} - {{worker.phone | dashIfEmpty}} - {{worker.client.phone | dashIfEmpty}} From b33700abc93d568d554e5715d05a192b62f226e5 Mon Sep 17 00:00:00 2001 From: alexm Date: Fri, 29 Sep 2023 11:57:25 +0200 Subject: [PATCH 27/43] refs #6216 feat(ticket_sale): open filtered ticketLog --- db/dump/fixtures.sql | 18 ++++++++-------- front/salix/components/index.js | 1 - .../salix/components/instance-log/index.html | 12 ----------- front/salix/components/instance-log/index.js | 21 ------------------- .../salix/components/instance-log/style.scss | 9 -------- front/salix/components/log/index.js | 9 ++++++++ modules/ticket/front/log/index.html | 7 ++++++- modules/ticket/front/routes.json | 2 +- modules/ticket/front/sale/index.html | 9 +------- modules/ticket/front/sale/index.js | 8 +++++++ 10 files changed, 34 insertions(+), 62 deletions(-) delete mode 100644 front/salix/components/instance-log/index.html delete mode 100644 front/salix/components/instance-log/index.js delete mode 100644 front/salix/components/instance-log/style.scss diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql index eb28c4a01..4b726a833 100644 --- a/db/dump/fixtures.sql +++ b/db/dump/fixtures.sql @@ -2834,24 +2834,24 @@ UPDATE `account`.`user` INSERT INTO `vn`.`ticketLog` (`originFk`, userFk, `action`, changedModel, oldInstance, newInstance, changedModelId, `description`) VALUES - (7, 18, 'update', 'Sale', '{"quantity":1}', '{"quantity":10}', 1, NULL), - (7, 18, 'update', 'Ticket', '{"quantity":1,"concept":"Chest ammo box"}', '{"quantity":10,"concept":"Chest ammo box"}', 1, NULL), - (7, 18, 'update', 'Sale', '{"price":3}', '{"price":5}', 1, NULL), + (7, 18, 'update', 'Sale', '{"quantity":1}', '{"quantity":10}', 22, NULL), + (7, 18, 'update', 'Ticket', '{"quantity":1,"concept":"Chest ammo box"}', '{"quantity":10,"concept":"Chest ammo box"}', 22, NULL), + (7, 18, 'update', 'Sale', '{"price":3}', '{"price":5}', 22, NULL), (7, 18, 'update', NULL, NULL, NULL, NULL, "Cambio cantidad Melee weapon heavy shield 100cm de '5' a '10'"), - (16, 9, 'update', 'Sale', '{"quantity":10,"concept":"Shield", "price": 10.5, "itemFk": 1}', '{"quantity":8,"concept":"Shield", "price": 10.5, "itemFk": 1}' , 5689, 'Shield'); + (16, 9, 'update', 'Sale', '{"quantity":10,"concept":"Shield", "price": 10.5, "itemFk": 1}', '{"quantity":8,"concept":"Shield", "price": 10.5, "itemFk": 1}' , 12, 'Shield'); INSERT INTO `vn`.`ticketLog` (originFk, userFk, `action`, creationDate, changedModel, changedModelId, changedModelValue, oldInstance, newInstance, description) VALUES (1, NULL, 'delete', '2001-06-09 11:00:04', 'Ticket', 45, 'Spider Man' , NULL, NULL, NULL), (1, 18, 'select', '2001-06-09 11:00:03', 'Ticket', 45, 'Spider Man' , NULL, NULL, NULL), - (1, NULL, 'update', '2001-05-09 10:00:02', 'Sale', 69854, 'Armor' , '{"isPicked": false}','{"isPicked": true}', NULL), - (1, 18, 'update', '2001-01-01 10:05:01', 'Sale', 69854, 'Armor' , NULL, NULL, 'Armor quantity changed from ''15'' to ''10'''), - (1, NULL, 'delete', '2001-01-01 10:00:10', 'Sale', 5689, 'Shield' , '{"quantity":10,"concept":"Shield"}', NULL, NULL), - (1, 18, 'insert', '2000-12-31 15:00:05', 'Sale', 69854, 'Armor' , NULL,'{"quantity":15,"concept":"Armor", "price": 345.99, "itemFk": 2}', NULL), + (1, NULL, 'update', '2001-05-09 10:00:02', 'Sale', 5, 'Armor' , '{"isPicked": false}','{"isPicked": true}', NULL), + (1, 18, 'update', '2001-01-01 10:05:01', 'Sale', 5, 'Armor' , NULL, NULL, 'Armor quantity changed from ''15'' to ''10'''), + (1, NULL, 'delete', '2001-01-01 10:00:10', 'Sale', 4, 'Shield' , '{"quantity":10,"concept":"Shield"}', NULL, NULL), + (1, 18, 'insert', '2000-12-31 15:00:05', 'Sale', 1, 'Armor' , NULL,'{"quantity":15,"concept":"Armor", "price": 345.99, "itemFk": 2}', NULL), (1, 18, 'update', '2000-12-28 08:40:45', 'Ticket', 45, 'Spider Man' , '{"warehouseFk":60,"shipped":"2023-05-16T22:00:00.000Z","nickname":"Super Man","isSigned":true,"isLabeled":true,"isPrinted":true,"packages":0,"hour":0,"isBlocked":false,"hasPriority":false,"companyFk":442,"landed":"2023-05-17T22:00:00.000Z","isBoxed":true,"isDeleted":true,"zoneFk":713,"zonePrice":13,"zoneBonus":0}','{"warehouseFk":61,"shipped":"2023-05-17T22:00:00.000Z","nickname":"Spider Man","isSigned":false,"isLabeled":false,"isPrinted":false,"packages":1,"hour":0,"isBlocked":true,"hasPriority":true,"companyFk":443,"landed":"2023-05-18T22:00:00.000Z","isBoxed":false,"isDeleted":false,"zoneFk":713,"zonePrice":13,"zoneBonus":1}', NULL), (1, 18, 'select', '2000-12-27 03:40:30', 'Ticket', 45, NULL , NULL, NULL, NULL), - (1, 18, 'insert', '2000-04-10 09:40:15', 'Sale', 5689, 'Shield' , NULL, '{"quantity":10,"concept":"Shield", "price": 10.5, "itemFk": 1}', NULL), + (1, 18, 'insert', '2000-04-10 09:40:15', 'Sale', 4, 'Shield' , NULL, '{"quantity":10,"concept":"Shield", "price": 10.5, "itemFk": 1}', NULL), (1, 18, 'insert', '1999-05-09 10:00:00', 'Ticket', 45, 'Super Man' , NULL, '{"id":45,"clientFk":8608,"warehouseFk":60,"shipped":"2023-05-16T22:00:00.000Z","nickname":"Super Man","addressFk":48637,"isSigned":true,"isLabeled":true,"isPrinted":true,"packages":0,"hour":0,"created":"2023-05-16T11:42:56.000Z","isBlocked":false,"hasPriority":false,"companyFk":442,"agencyModeFk":639,"landed":"2023-05-17T22:00:00.000Z","isBoxed":true,"isDeleted":true,"zoneFk":713,"zonePrice":13,"zoneBonus":0}', NULL); INSERT INTO `vn`.`osTicketConfig` (`id`, `host`, `user`, `password`, `oldStatus`, `newStatusId`, `day`, `comment`, `hostDb`, `userDb`, `passwordDb`, `portDb`, `responseType`, `fromEmailId`, `replyTo`) VALUES diff --git a/front/salix/components/index.js b/front/salix/components/index.js index 555a18450..9addc23c8 100644 --- a/front/salix/components/index.js +++ b/front/salix/components/index.js @@ -21,5 +21,4 @@ import './user-popover'; import './upload-photo'; import './bank-entity'; import './log'; -import './instance-log'; import './sendSms'; diff --git a/front/salix/components/instance-log/index.html b/front/salix/components/instance-log/index.html deleted file mode 100644 index 9794f75c2..000000000 --- a/front/salix/components/instance-log/index.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - diff --git a/front/salix/components/instance-log/index.js b/front/salix/components/instance-log/index.js deleted file mode 100644 index 6d8497c2d..000000000 --- a/front/salix/components/instance-log/index.js +++ /dev/null @@ -1,21 +0,0 @@ -import ngModule from '../../module'; -import Section from '../section'; -import './style.scss'; - -export default class Controller extends Section { - open() { - this.$.instanceLog.show(); - } -} - -ngModule.vnComponent('vnInstanceLog', { - controller: Controller, - template: require('./index.html'), - bindings: { - model: '<', - originId: '<', - changedModelId: '<', - changedModel: '@', - url: '@' - } -}); diff --git a/front/salix/components/instance-log/style.scss b/front/salix/components/instance-log/style.scss deleted file mode 100644 index f355e0ac8..000000000 --- a/front/salix/components/instance-log/style.scss +++ /dev/null @@ -1,9 +0,0 @@ -vn-log.vn-instance-log { - vn-card { - width: 900px; - visibility: hidden; - & > * { - visibility: visible; - } - } -} diff --git a/front/salix/components/log/index.js b/front/salix/components/log/index.js index 176815eef..790b7fbb8 100644 --- a/front/salix/components/log/index.js +++ b/front/salix/components/log/index.js @@ -72,6 +72,7 @@ export default class Controller extends Section { $postLink() { this.resetFilter(); + this.defaultFilter(); this.$.$watch( () => this.$.filter, () => this.applyFilter(), @@ -79,6 +80,14 @@ export default class Controller extends Section { ); } + defaultFilter() { + const defaultFilters = ['changedModel', 'changedModelId']; + for (const defaultFilter of defaultFilters) { + if (this[defaultFilter]) + this.$.filter[defaultFilter] = this[defaultFilter]; + } + } + get logs() { return this._logs; } diff --git a/modules/ticket/front/log/index.html b/modules/ticket/front/log/index.html index 91109d3eb..c36b0aa52 100644 --- a/modules/ticket/front/log/index.html +++ b/modules/ticket/front/log/index.html @@ -1 +1,6 @@ - \ No newline at end of file + + diff --git a/modules/ticket/front/routes.json b/modules/ticket/front/routes.json index e403ab02d..da39fbbf7 100644 --- a/modules/ticket/front/routes.json +++ b/modules/ticket/front/routes.json @@ -187,7 +187,7 @@ } }, { - "url" : "/log", + "url" : "/log?changedModel&changedModelId", "state": "ticket.card.log", "component": "vn-ticket-log", "description": "Log" diff --git a/modules/ticket/front/sale/index.html b/modules/ticket/front/sale/index.html index be9e81964..b10df317b 100644 --- a/modules/ticket/front/sale/index.html +++ b/modules/ticket/front/sale/index.html @@ -212,16 +212,9 @@ vn-none vn-tooltip="History" icon="history" - ng-click="log.open()" + ng-click="$ctrl.goToLog(sale.id)" ng-show="sale.$hasLogs"> - - diff --git a/modules/ticket/front/sale/index.js b/modules/ticket/front/sale/index.js index b68db6dc0..f946d0a25 100644 --- a/modules/ticket/front/sale/index.js +++ b/modules/ticket/front/sale/index.js @@ -558,6 +558,14 @@ class Controller extends Section { cancel() { this.$.editDiscount.hide(); } + + goToLog(saleId) { + this.$state.go('ticket.card.log', { + originId: this.$params.id, + changedModel: 'Sale', + changedModelId: saleId + }); + } } ngModule.vnComponent('vnTicketSale', { From 9a7cb3ef7b7074f1a6316197a3894b72406fb0bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Andr=C3=A9s?= Date: Fri, 29 Sep 2023 12:30:05 +0200 Subject: [PATCH 28/43] refs #6254 collection_getTickets --- back/methods/collection/getTickets.js | 155 ++++++++++---------------- loopback/locale/es.json | 3 +- 2 files changed, 62 insertions(+), 96 deletions(-) diff --git a/back/methods/collection/getTickets.js b/back/methods/collection/getTickets.js index 1d0daa43a..f39a71cdb 100644 --- a/back/methods/collection/getTickets.js +++ b/back/methods/collection/getTickets.js @@ -30,46 +30,37 @@ module.exports = Self => { const $t = ctx.req.__; // $translate const myOptions = {}; - let tx; - if (typeof options == 'object') Object.assign(myOptions, options); - if (!myOptions.transaction) { - tx = await Self.beginTransaction({}); - myOptions.transaction = tx; - } myOptions.userId = userId; const promises = []; - try { - const [tickets] = await Self.rawSql(`CALL vn.collection_getTickets(?)`, [id], myOptions); - const sales = await Self.rawSql(` - SELECT - s.ticketFk, + + const [tickets] = await Self.rawSql(`CALL vn.collection_getTickets(?)`, [id], myOptions); + const sales = await Self.rawSql(` + SELECT s.ticketFk, sgd.saleGroupFk, s.id saleFk, s.itemFk, i.longName, i.size, - IFNULL(sub2.semaphore,st.semaphore) semaphore, ic.color, - ip.productor, o.code origin, - s.concept, - b.packing, - b.grouping, + ish.packing, + ish.grouping, s.isAdded, - c.workerFk, - i.packingShelve, - sm.id hasMistake, - s.originalQuantity, + s.originalQuantity, s.quantity saleQuantity, - IF(p2.code IS NOT NULL, s.quantity, iss.quantity) reservedQuantity, + iss.quantity reservedQuantity, + SUM(iss.quantity) OVER (PARTITION BY s.id ORDER BY ish.id) accumulatedQuantity, + ROW_NUMBER () OVER (PARTITION BY s.id ORDER BY pickingOrder) currentItemShelving, + COUNT(*) OVER (PARTITION BY s.id ORDER BY s.id) totalItemShelving, sh.code, IFNULL(p2.code, p.code) parkingCode, IFNULL(p2.pickingOrder, p.pickingOrder) pickingOrder, iss.id itemShelvingSaleFk + iss.isChecked FROM ticketCollection tc LEFT JOIN collection c ON c.id = tc.collectionFk JOIN ticket t ON t.id = tc.ticketFk @@ -77,103 +68,79 @@ module.exports = Self => { LEFT JOIN saleGroupDetail sgd ON sgd.saleFk = s.id LEFT JOIN saleGroup sg ON sg.id = sgd.saleGroupFk LEFT JOIN parking p2 ON p2.id = sg.parkingFk - LEFT JOIN cache.last_buy lb ON lb.item_id = s.itemFk AND lb.warehouse_id = t.warehouseFk - LEFT JOIN buy b ON b.id = lb.buy_id JOIN item i ON i.id = s.itemFk LEFT JOIN itemShelvingSale iss ON iss.saleFk = s.id LEFT JOIN itemShelving ish ON ish.id = iss.itemShelvingFk LEFT JOIN shelving sh ON sh.code = ish.shelvingFk LEFT JOIN parking p ON p.id = sh.parkingFk - LEFT JOIN ( - SELECT sub.saleFk, sub.isChecked, sub.stateFk, sub.originalQuantity, sub.semaphore - FROM ( - SELECT DISTINCT st.id, - st.saleFk, st.isChecked, st.stateFk, st.originalQuantity ,sta.semaphore - FROM ticketCollection tc - JOIN sale s ON s.ticketFk = tc.ticketFk - JOIN saleTracking st ON st.saleFk = s.id - JOIN state sta ON sta.id = st.stateFk - WHERE tc.collectionFk = ? - ORDER BY st.id DESC - LIMIT 10000000000000000000) sub - GROUP BY sub.saleFk, sub.stateFK - ) sub2 ON sub2.saleFk = s.id AND sub2.isChecked = 1 - LEFT JOIN state st ON st.id = sub2.stateFk LEFT JOIN itemColor ic ON ic.itemFk = s.itemFk - LEFT JOIN itemProductor ip ON ip.itemFk = s.itemFk LEFT JOIN origin o ON o.id = i.originFk - LEFT JOIN saleMistake sm ON sm.saleFk = s.id WHERE tc.collectionFk = ? - GROUP BY s.id, p.code, p2.code - ORDER BY pickingOrder`, [id, id], myOptions); + GROUP BY ish.id, p.code, p2.code + ORDER BY pickingOrder;`, [id], myOptions); - if (print) - await Self.rawSql(`CALL vn.collection_printSticker(?, ?)`, [id, null], myOptions); + if (print) + await Self.rawSql(`CALL vn.collection_printSticker(?, ?)`, [id, null], myOptions); - const collection = {collectionFk: id, tickets: []}; - if (tickets && tickets.length) { - for (const ticket of tickets) { - const ticketId = ticket.ticketFk; + const collection = {collectionFk: id, tickets: []}; + if (tickets && tickets.length) { + for (const ticket of tickets) { + const ticketId = ticket.ticketFk; - // SEND ROCKET - if (ticket.observaciones != '') { - for (observation of ticket.observaciones.split(' ')) { - if (['#', '@'].includes(observation.charAt(0))) { - promises.push(Self.app.models.Chat.send(ctx, observation, - $t('The ticket is in preparation', { - ticketId: ticketId, - ticketUrl: `${origin}/#!/ticket/${ticketId}/summary`, - salesPersonId: ticket.salesPersonFk - }))); - } + // SEND ROCKET + if (ticket.observaciones != '') { + for (observation of ticket.observaciones.split(' ')) { + if (['#', '@'].includes(observation.charAt(0))) { + promises.push(Self.app.models.Chat.send(ctx, observation, + $t('The ticket is in preparation', { + ticketId: ticketId, + ticketUrl: `${origin}/#!/ticket/${ticketId}/summary`, + salesPersonId: ticket.salesPersonFk + }))); } } + } - // SET COLLECTION - if (sales && sales.length) { - // GET BARCODES - const barcodes = await Self.rawSql(` - SELECT s.id saleFk, b.code, c.id - FROM vn.sale s - LEFT JOIN vn.itemBarcode b ON b.itemFk = s.itemFk - LEFT JOIN vn.buy c ON c.itemFk = s.itemFk - LEFT JOIN vn.entry e ON e.id = c.entryFk - LEFT JOIN vn.travel tr ON tr.id = e.travelFk - WHERE s.ticketFk = ? AND tr.landed >= DATE_SUB(util.VN_CURDATE(), INTERVAL 1 YEAR)`, - [ticketId], myOptions); + // SET COLLECTION + if (sales && sales.length) { + // GET BARCODES + const barcodes = await Self.rawSql(` + SELECT s.id saleFk, b.code, c.id + FROM vn.sale s + LEFT JOIN vn.itemBarcode b ON b.itemFk = s.itemFk + LEFT JOIN vn.buy c ON c.itemFk = s.itemFk + LEFT JOIN vn.entry e ON e.id = c.entryFk + LEFT JOIN vn.travel tr ON tr.id = e.travelFk + WHERE s.ticketFk = ? + AND tr.landed >= util.VN_CURDATE() - INTERVAL 1 YEAR`, + [ticketId], myOptions); - // BINDINGS - ticket.sales = []; - for (const sale of sales) { - if (sale.ticketFk === ticketId) { - sale.Barcodes = []; + // BINDINGS + ticket.sales = []; + for (const sale of sales) { + if (sale.ticketFk === ticketId) { + sale.Barcodes = []; - if (barcodes && barcodes.length) { - for (const barcode of barcodes) { - if (barcode.saleFk === sale.saleFk) { - for (let prop in barcode) { - if (['id', 'code'].includes(prop) && barcode[prop]) - sale.Barcodes.push(barcode[prop].toString(), '0' + barcode[prop]); - } + if (barcodes && barcodes.length) { + for (const barcode of barcodes) { + if (barcode.saleFk === sale.saleFk) { + for (const prop in barcode) { + if (['id', 'code'].includes(prop) && barcode[prop]) + sale.Barcodes.push(barcode[prop].toString(), '0' + barcode[prop]); } } } - - ticket.sales.push(sale); } + + ticket.sales.push(sale); } } - collection.tickets.push(ticket); } + collection.tickets.push(ticket); } - - if (tx) await tx.commit(); - await Promise.all(promises); - - return collection; - } catch (e) { - if (tx) await tx.rollback(); - throw e; } + await Promise.all(promises); + + return collection; }; }; diff --git a/loopback/locale/es.json b/loopback/locale/es.json index 71a01f91a..87a41fcf6 100644 --- a/loopback/locale/es.json +++ b/loopback/locale/es.json @@ -318,6 +318,5 @@ "Street should be uppercase": "La dirección fiscal debe ir en mayúscula", "The response is not a PDF": "La respuesta no es un PDF", "Ticket without Route": "Ticket sin ruta", - "The ticket is in preparation": "El ticket [{{ticketId}}]({{{ticketUrl}}}) del comercial {{salesPersonId}} està en preparación", - "Invalid collection or ticket": "Invalid collection or ticket" + "The ticket is in preparation": "El ticket [{{ticketId}}]({{{ticketUrl}}}) del comercial {{salesPersonId}} està en preparación" } \ No newline at end of file From 17e6cffa3d1970462c43d6cf3961ca3e4b2e0395 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Andr=C3=A9s?= Date: Fri, 29 Sep 2023 13:47:29 +0200 Subject: [PATCH 29/43] refs #6254 collection getTickets --- back/methods/collection/getTickets.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/back/methods/collection/getTickets.js b/back/methods/collection/getTickets.js index 70c3eb351..445fc070d 100644 --- a/back/methods/collection/getTickets.js +++ b/back/methods/collection/getTickets.js @@ -27,7 +27,7 @@ module.exports = Self => { Self.getTickets = async(ctx, id, print, options) => { const userId = ctx.req.accessToken.userId; const origin = ctx.req.headers.origin; - const $t = ctx.req.__; // $translate + const $t = ctx.req.__; const myOptions = {}; if (typeof options == 'object') @@ -59,11 +59,7 @@ module.exports = Self => { sh.code, IFNULL(p2.code, p.code) parkingCode, IFNULL(p2.pickingOrder, p.pickingOrder) pickingOrder, -<<<<<<< Updated upstream - iss.id itemShelvingSaleFk -======= iss.id itemShelvingSaleFk, ->>>>>>> Stashed changes iss.isPicked FROM ticketCollection tc LEFT JOIN collection c ON c.id = tc.collectionFk From 0e5a7bbb85e55bd4c9ad8634ba528a325835a853 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Andr=C3=A9s?= Date: Fri, 29 Sep 2023 14:11:11 +0200 Subject: [PATCH 30/43] refs #6254 --- loopback/locale/en.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/loopback/locale/en.json b/loopback/locale/en.json index 3380d3dde..3ce4761a1 100644 --- a/loopback/locale/en.json +++ b/loopback/locale/en.json @@ -187,6 +187,6 @@ "This ticket is not editable.": "This ticket is not editable.", "The ticket doesn't exist.": "The ticket doesn't exist.", "The sales do not exists": "The sales do not exists", - "Ticket without Route": "Ticket sin ruta", + "Ticket without Route": "Ticket without route", "The ticket is in preparation": "The ticket [{{ticketId}}]({{{ticketUrl}}}) of the sales person {{salesPersonId}} is in preparation" } From c469a221c711dc055d93e051b73a7a70361ffb40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Andr=C3=A9s?= Date: Fri, 29 Sep 2023 14:16:35 +0200 Subject: [PATCH 31/43] refs #6254 --- loopback/locale/en.json | 1 + 1 file changed, 1 insertion(+) diff --git a/loopback/locale/en.json b/loopback/locale/en.json index 3ce4761a1..645a874e8 100644 --- a/loopback/locale/en.json +++ b/loopback/locale/en.json @@ -188,5 +188,6 @@ "The ticket doesn't exist.": "The ticket doesn't exist.", "The sales do not exists": "The sales do not exists", "Ticket without Route": "Ticket without route", + "Booking completed": "Booking complete", "The ticket is in preparation": "The ticket [{{ticketId}}]({{{ticketUrl}}}) of the sales person {{salesPersonId}} is in preparation" } From 3ba349b74ab50d3449a1c7a373a09e3b37e6b3db Mon Sep 17 00:00:00 2001 From: sergiodt Date: Mon, 2 Oct 2023 09:14:30 +0200 Subject: [PATCH 32/43] refs #5890 feat: itemShelvingSaleAsignado more calls --- db/changes/234002/.gitkeep | 0 db/changes/234002/00-aclClient.sql | 3 +++ modules/item/back/models/item-shelving.json | 5 +++++ modules/ticket/back/models/ticket-collection.json | 3 +++ modules/worker/back/models/worker.json | 3 +++ 5 files changed, 14 insertions(+) create mode 100644 db/changes/234002/.gitkeep create mode 100644 db/changes/234002/00-aclClient.sql diff --git a/db/changes/234002/.gitkeep b/db/changes/234002/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/db/changes/234002/00-aclClient.sql b/db/changes/234002/00-aclClient.sql new file mode 100644 index 000000000..3df9522cf --- /dev/null +++ b/db/changes/234002/00-aclClient.sql @@ -0,0 +1,3 @@ + +INSERT INTO `salix`.`ACL` ( model, property, accessType, permission, principalType, principalId) + VALUES('TicketCollection', '*', 'WRITE', 'ALLOW', 'ROLE', 'production'); diff --git a/modules/item/back/models/item-shelving.json b/modules/item/back/models/item-shelving.json index 34773e34c..61d05539e 100644 --- a/modules/item/back/models/item-shelving.json +++ b/modules/item/back/models/item-shelving.json @@ -47,6 +47,11 @@ "type": "belongsTo", "model": "VnUser", "foreignKey": "userFk" + }, + "shelving": { + "type": "belongsTo", + "model": "Shelving", + "foreignKey": "shelvingFk" } } } diff --git a/modules/ticket/back/models/ticket-collection.json b/modules/ticket/back/models/ticket-collection.json index e941ac2ce..4bd34f08e 100644 --- a/modules/ticket/back/models/ticket-collection.json +++ b/modules/ticket/back/models/ticket-collection.json @@ -10,6 +10,9 @@ "id": { "id": true, "type": "number" + }, + "usedShelves": { + "type": "number" } }, "relations": { diff --git a/modules/worker/back/models/worker.json b/modules/worker/back/models/worker.json index dbb3ed23f..ea4aecf67 100644 --- a/modules/worker/back/models/worker.json +++ b/modules/worker/back/models/worker.json @@ -47,6 +47,9 @@ }, "locker": { "type" : "number" + }, + "isF11Allowed": { + "type" : "boolean" } }, "relations": { From 96769d9ff9b178a01679329d87f84d0032bb71cc Mon Sep 17 00:00:00 2001 From: pablone Date: Tue, 3 Oct 2023 08:57:59 +0200 Subject: [PATCH 33/43] refs #6213 fixIntermitentError --- .../{234001 => 234201}/00-supplierAccountCheckLength.sql | 0 e2e/helpers/tests.js | 9 +++++++++ .../back/methods/supplier/specs/newSupplier.spec.js | 1 + modules/supplier/back/models/specs/supplier.spec.js | 4 ++-- 4 files changed, 12 insertions(+), 2 deletions(-) rename db/changes/{234001 => 234201}/00-supplierAccountCheckLength.sql (100%) diff --git a/db/changes/234001/00-supplierAccountCheckLength.sql b/db/changes/234201/00-supplierAccountCheckLength.sql similarity index 100% rename from db/changes/234001/00-supplierAccountCheckLength.sql rename to db/changes/234201/00-supplierAccountCheckLength.sql diff --git a/e2e/helpers/tests.js b/e2e/helpers/tests.js index 992ec051f..718b49834 100644 --- a/e2e/helpers/tests.js +++ b/e2e/helpers/tests.js @@ -52,6 +52,15 @@ async function test() { await backendStatus(); jasmine.jasmine.DEFAULT_TIMEOUT_INTERVAL = 30000; + const myReporter = { + specDone: function(result) { + for (const expectation of result.failedExpectations) { + console.warn('SpecFailed: ' + result.description); + console.warn('Failure: ' + expectation.message); + } + } + }; + jasmine.addReporter(myReporter); await jasmine.execute(); } diff --git a/modules/supplier/back/methods/supplier/specs/newSupplier.spec.js b/modules/supplier/back/methods/supplier/specs/newSupplier.spec.js index c368ec1b8..5fc2ea752 100644 --- a/modules/supplier/back/methods/supplier/specs/newSupplier.spec.js +++ b/modules/supplier/back/methods/supplier/specs/newSupplier.spec.js @@ -32,6 +32,7 @@ describe('Supplier newSupplier()', () => { const result = await models.Supplier.newSupplier(ctx, options); expect(result.name).toEqual('newSupplier'); + await tx.rollback(); } catch (e) { await tx.rollback(); throw e; diff --git a/modules/supplier/back/models/specs/supplier.spec.js b/modules/supplier/back/models/specs/supplier.spec.js index 3db273a95..fbd3a00db 100644 --- a/modules/supplier/back/models/specs/supplier.spec.js +++ b/modules/supplier/back/models/specs/supplier.spec.js @@ -129,10 +129,10 @@ describe('loopback model Supplier', () => { const options = {transaction: tx}; try { - const newSupplier = await models.Supplier.create({id: '9999', name: 'Alfred Pennyworth'}, options); + const newSupplier = await models.Supplier.create({name: 'Alfred Pennyworth'}, options); const fetchedSupplier = await models.Supplier.findById(newSupplier.id, null, options); - expect(fetchedSupplier.account).toEqual('4100009999'); + expect(Number(fetchedSupplier.account)).toEqual(4100000000 + newSupplier.id); await tx.rollback(); } catch (e) { await tx.rollback(); From bd46a77cb7160325f373d141720f53bccd9b60cd Mon Sep 17 00:00:00 2001 From: carlossa Date: Tue, 3 Oct 2023 10:15:16 +0200 Subject: [PATCH 34/43] refs #5768 incoterms addressFk --- modules/client/front/sample/create/index.html | 29 ++++++++-- modules/client/front/sample/create/index.js | 56 ++++++++++++++++++- .../incoterms-authorization.html | 5 +- .../incoterms-authorization.js | 5 +- .../incoterms-authorization/locale/es.yml | 2 +- .../incoterms-authorization/sql/address.sql | 9 +++ .../incoterms-authorization/sql/company.sql | 4 +- 7 files changed, 95 insertions(+), 15 deletions(-) create mode 100644 print/templates/reports/incoterms-authorization/sql/address.sql diff --git a/modules/client/front/sample/create/index.html b/modules/client/front/sample/create/index.html index 134c097e8..f9db03036 100644 --- a/modules/client/front/sample/create/index.html +++ b/modules/client/front/sample/create/index.html @@ -13,6 +13,7 @@ 'description', 'model', 'hasCompany', + 'hasAddress', 'hasPreview', 'datepickerEnabled' ]" @@ -69,15 +70,31 @@ ng-if="sampleType.selection.hasCompany" required="true"> - + ng-model="$ctrl.addressId" + model="ClientSample.addressFk" + order="isActive DESC"> + + {{::!isActive ? '(Inactive)' : ''}} + {{::nickname}} + + , {{::street}}, {{::city}}, {{::province.name}} - {{::agencyMode.name}} + + + + + + + { + if (res.data) + this.addresses = res.data; + }); + } + + getClientDefaultAddress(value) { + let query = `Clients/${value}`; + this.$http.get(query).then(res => { + if (res.data) + this.addressId = res.data.defaultAddressFk; + }); + } } Controller.$inject = ['$element', '$scope', 'vnEmail']; diff --git a/print/templates/reports/incoterms-authorization/incoterms-authorization.html b/print/templates/reports/incoterms-authorization/incoterms-authorization.html index 5b4e7829b..e4e4635f3 100644 --- a/print/templates/reports/incoterms-authorization/incoterms-authorization.html +++ b/print/templates/reports/incoterms-authorization/incoterms-authorization.html @@ -5,7 +5,7 @@ v-html="$t('description', { socialName: client.socialName, name: client.name, - address: client.street, + addressId: address.street, country: client.country, fiscalID: client.fi })" @@ -21,8 +21,7 @@ companyName: company.name, companyCity: company.city, socialName: client.socialName, - destinationCountry: client.country, - incotermsFk: address.incotermsFk + destinationCountry: client.country })" >

diff --git a/print/templates/reports/incoterms-authorization/incoterms-authorization.js b/print/templates/reports/incoterms-authorization/incoterms-authorization.js index 0fbbd10d2..e50cd99ec 100755 --- a/print/templates/reports/incoterms-authorization/incoterms-authorization.js +++ b/print/templates/reports/incoterms-authorization/incoterms-authorization.js @@ -7,6 +7,7 @@ module.exports = { this.client = await this.findOneFromDef('client', [this.id]); this.checkMainEntity(this.client); this.company = await this.findOneFromDef('company', [this.companyId]); + this.address = await this.findOneFromDef('address', [this.addressId]); }, props: { id: { @@ -18,8 +19,8 @@ module.exports = { type: Number, required: true }, - address: { - type: String + addressId: { + type: Number } } }; diff --git a/print/templates/reports/incoterms-authorization/locale/es.yml b/print/templates/reports/incoterms-authorization/locale/es.yml index 8bdce7085..ef63e9e3c 100644 --- a/print/templates/reports/incoterms-authorization/locale/es.yml +++ b/print/templates/reports/incoterms-authorization/locale/es.yml @@ -6,7 +6,7 @@ issued: 'En {0}, a {1} de {2} de {3}' client: 'Cliente {0}' declaration: '{socialName} declara por la presente que:' declarations: - - 'Todas las compras realizadas por {socialName} con {companyName} se entregan según las condiciones definidas en el incoterm {incotermsFk} ({Incoterm description}).' + - 'Todas las compras realizadas por {socialName} con {companyName} se entregan según las condiciones definidas en el incoterm.' - '{socialName} reconoce que es importante para {companyName} tener comprobante de la entrega intracomunitaria de la mercancía a {destinationCountry} para poder facturar con 0% de IVA.' diff --git a/print/templates/reports/incoterms-authorization/sql/address.sql b/print/templates/reports/incoterms-authorization/sql/address.sql new file mode 100644 index 000000000..a432c5e53 --- /dev/null +++ b/print/templates/reports/incoterms-authorization/sql/address.sql @@ -0,0 +1,9 @@ +SELECT + a.nickname, + a.street, + a.postalCode, + a.city, + p.name province +FROM address a + LEFT JOIN province p ON p.id = a.provinceFk +WHERE a.id = ? diff --git a/print/templates/reports/incoterms-authorization/sql/company.sql b/print/templates/reports/incoterms-authorization/sql/company.sql index 39c3290d1..8d94859e1 100644 --- a/print/templates/reports/incoterms-authorization/sql/company.sql +++ b/print/templates/reports/incoterms-authorization/sql/company.sql @@ -1,8 +1,8 @@ -SELECT +SELECT s.name, s.city, cl.name AS manager FROM company c JOIN supplier s ON s.id = c.id JOIN client cl ON cl.id = c.workerManagerFk -WHERE c.id = ? \ No newline at end of file +WHERE c.id = ? From ed3871f75c3c793d7e1b0dc4ec6603ff5eed1365 Mon Sep 17 00:00:00 2001 From: carlossa Date: Tue, 3 Oct 2023 14:03:59 +0200 Subject: [PATCH 35/43] refs #5861 edit css --- print/templates/reports/invoice/assets/css/style.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/print/templates/reports/invoice/assets/css/style.css b/print/templates/reports/invoice/assets/css/style.css index d4526ce56..f9f6f220f 100644 --- a/print/templates/reports/invoice/assets/css/style.css +++ b/print/templates/reports/invoice/assets/css/style.css @@ -44,3 +44,7 @@ h2 { .phytosanitary-info { margin-top: 10px } + +.panel { + margin-bottom: 0px; +} From e14049a082b485bce185797318704a415d2f67f6 Mon Sep 17 00:00:00 2001 From: pablone Date: Wed, 4 Oct 2023 07:48:00 +0200 Subject: [PATCH 36/43] refs #6213 fixJasmineConfiguration --- e2e/helpers/tests.js | 9 --------- 1 file changed, 9 deletions(-) diff --git a/e2e/helpers/tests.js b/e2e/helpers/tests.js index 718b49834..992ec051f 100644 --- a/e2e/helpers/tests.js +++ b/e2e/helpers/tests.js @@ -52,15 +52,6 @@ async function test() { await backendStatus(); jasmine.jasmine.DEFAULT_TIMEOUT_INTERVAL = 30000; - const myReporter = { - specDone: function(result) { - for (const expectation of result.failedExpectations) { - console.warn('SpecFailed: ' + result.description); - console.warn('Failure: ' + expectation.message); - } - } - }; - jasmine.addReporter(myReporter); await jasmine.execute(); } From 5b6eb0a2a62a9d481db230c3ffb966272b522026 Mon Sep 17 00:00:00 2001 From: carlossa Date: Thu, 5 Oct 2023 14:01:07 +0200 Subject: [PATCH 37/43] refs #5768 add address, nickname, pdf, email --- .../back/methods/client/incotermsAuthorizationEmail.js | 6 ++++++ .../back/methods/client/incotermsAuthorizationHtml.js | 6 ++++++ .../back/methods/client/incotermsAuthorizationPdf.js | 6 ++++++ modules/client/front/sample/create/index.html | 1 + .../incoterms-authorization/incoterms-authorization.js | 4 ++++ .../incoterms-authorization/incoterms-authorization.html | 8 ++++---- .../incoterms-authorization/incoterms-authorization.js | 3 ++- 7 files changed, 29 insertions(+), 5 deletions(-) diff --git a/modules/client/back/methods/client/incotermsAuthorizationEmail.js b/modules/client/back/methods/client/incotermsAuthorizationEmail.js index 4a21f20b0..9b3686b07 100644 --- a/modules/client/back/methods/client/incotermsAuthorizationEmail.js +++ b/modules/client/back/methods/client/incotermsAuthorizationEmail.js @@ -33,6 +33,12 @@ module.exports = Self => { type: 'number', description: 'The company id', required: true + }, + { + arg: 'addressId', + type: 'number', + description: 'The address id', + required: true } ], returns: { diff --git a/modules/client/back/methods/client/incotermsAuthorizationHtml.js b/modules/client/back/methods/client/incotermsAuthorizationHtml.js index 0a6bba0a8..af585b1ae 100644 --- a/modules/client/back/methods/client/incotermsAuthorizationHtml.js +++ b/modules/client/back/methods/client/incotermsAuthorizationHtml.js @@ -21,6 +21,12 @@ module.exports = Self => { type: 'number', description: 'The company id', required: true + }, + { + arg: 'addressId', + type: 'number', + description: 'The address id', + required: true } ], returns: [ diff --git a/modules/client/back/methods/client/incotermsAuthorizationPdf.js b/modules/client/back/methods/client/incotermsAuthorizationPdf.js index d37e473f1..ffe17c72f 100644 --- a/modules/client/back/methods/client/incotermsAuthorizationPdf.js +++ b/modules/client/back/methods/client/incotermsAuthorizationPdf.js @@ -21,6 +21,12 @@ module.exports = Self => { type: 'number', description: 'The company id', required: true + }, + { + arg: 'addressId', + type: 'number', + description: 'The address id', + required: true } ], returns: [ diff --git a/modules/client/front/sample/create/index.html b/modules/client/front/sample/create/index.html index f9db03036..9dce7ec72 100644 --- a/modules/client/front/sample/create/index.html +++ b/modules/client/front/sample/create/index.html @@ -71,6 +71,7 @@ required="true">

diff --git a/print/templates/reports/incoterms-authorization/incoterms-authorization.js b/print/templates/reports/incoterms-authorization/incoterms-authorization.js index e50cd99ec..22ae13167 100755 --- a/print/templates/reports/incoterms-authorization/incoterms-authorization.js +++ b/print/templates/reports/incoterms-authorization/incoterms-authorization.js @@ -20,7 +20,8 @@ module.exports = { required: true }, addressId: { - type: Number + type: Number, + required: true } } }; From 3b81b511c2d40262ed569ab746c5f5e8c5c45dbd Mon Sep 17 00:00:00 2001 From: carlossa Date: Thu, 5 Oct 2023 14:01:53 +0200 Subject: [PATCH 38/43] remove consolelog --- modules/client/front/sample/create/index.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/modules/client/front/sample/create/index.js b/modules/client/front/sample/create/index.js index 305591511..6a249e84e 100644 --- a/modules/client/front/sample/create/index.js +++ b/modules/client/front/sample/create/index.js @@ -80,8 +80,6 @@ class Controller extends Section { if (this.clientSample.addressId) params.addressId = this.clientSample.addressId; - - console.log(this.clientSample); } preview() { From 90fe65acc244fabd2c910bfe109ac00b408d6afc Mon Sep 17 00:00:00 2001 From: pablone Date: Fri, 6 Oct 2023 08:03:37 +0200 Subject: [PATCH 39/43] refs #6213 fixChanges --- db/changes/234201/00-supplierAccountCheckLength.sql | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/db/changes/234201/00-supplierAccountCheckLength.sql b/db/changes/234201/00-supplierAccountCheckLength.sql index 30ff739b8..55a68e37b 100644 --- a/db/changes/234201/00-supplierAccountCheckLength.sql +++ b/db/changes/234201/00-supplierAccountCheckLength.sql @@ -1,7 +1,6 @@ - UPDATE `vn`.`supplier` SET account = LPAD(id,10,'0') WHERE account IS NULL; ALTER TABLE `vn`.`supplier` ADD CONSTRAINT supplierAccountTooShort CHECK (LENGTH(account) = 10); -ALTER TABLE vn.supplier MODIFY COLUMN account varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT 4100000000 NOT NULL COMMENT 'Default accounting code for suppliers.'; +ALTER TABLE `vn`.`supplier` MODIFY COLUMN account varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT 4100000000 NOT NULL COMMENT 'Default accounting code for suppliers.'; From 4adee11c63f9a673468cba4dbe9cdc149791f59e Mon Sep 17 00:00:00 2001 From: carlossa Date: Tue, 10 Oct 2023 12:35:34 +0200 Subject: [PATCH 40/43] refs #5768 remove comment --- modules/client/front/sample/create/index.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/modules/client/front/sample/create/index.js b/modules/client/front/sample/create/index.js index 6a249e84e..5370aa8a8 100644 --- a/modules/client/front/sample/create/index.js +++ b/modules/client/front/sample/create/index.js @@ -142,9 +142,6 @@ class Controller extends Section { }); } - /* - * Autocompletes address on client change - */ clientAddressesList(value) { let filter = { include: [ From df9d6fd6f82d1700e4e6e323c2856d91861fefd0 Mon Sep 17 00:00:00 2001 From: jgallego Date: Wed, 11 Oct 2023 14:06:28 +0200 Subject: [PATCH 41/43] efectue con acento --- modules/ticket/front/descriptor/locale/es.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ticket/front/descriptor/locale/es.yml b/modules/ticket/front/descriptor/locale/es.yml index 86b1a6b57..e1006bed4 100644 --- a/modules/ticket/front/descriptor/locale/es.yml +++ b/modules/ticket/front/descriptor/locale/es.yml @@ -3,7 +3,7 @@ Are you sure you want to send it?: ¿Seguro que quieres enviarlo? Show pallet report: Ver hoja de pallet Change shipped hour: Cambiar hora de envío Shipped hour: Hora de envío -Make a payment: "Verdnatura le comunica:\rSu pedido está pendiente de pago.\rPor favor, entre en la página web y efectue el pago con tarjeta.\rMuchas gracias." +Make a payment: "Verdnatura le comunica:\rSu pedido está pendiente de pago.\rPor favor, entre en la página web y efectúe el pago con tarjeta.\rMuchas gracias." Minimum is needed: "Verdnatura le recuerda:\rEs necesario un importe mínimo de 50€ (Sin IVA) en su pedido {{ticketId}} del día {{created | date: 'dd/MM/yyyy'}} para recibirlo sin portes adicionales." Ticket invoiced: Ticket facturado Make invoice: Crear factura From 0028dd150a806c5befc148f058d154a84473bdab Mon Sep 17 00:00:00 2001 From: sergiodt Date: Wed, 11 Oct 2023 17:12:55 +0200 Subject: [PATCH 42/43] refs #5134 feat:models --- db/changes/234201/.gitkeep | 0 db/changes/234201/00-aclClient.sql | 3 +++ 2 files changed, 3 insertions(+) create mode 100644 db/changes/234201/.gitkeep create mode 100644 db/changes/234201/00-aclClient.sql diff --git a/db/changes/234201/.gitkeep b/db/changes/234201/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/db/changes/234201/00-aclClient.sql b/db/changes/234201/00-aclClient.sql new file mode 100644 index 000000000..3df9522cf --- /dev/null +++ b/db/changes/234201/00-aclClient.sql @@ -0,0 +1,3 @@ + +INSERT INTO `salix`.`ACL` ( model, property, accessType, permission, principalType, principalId) + VALUES('TicketCollection', '*', 'WRITE', 'ALLOW', 'ROLE', 'production'); From 1a7f7b6a00a8eaaa3b55ac4cd8db41cccbce0b3c Mon Sep 17 00:00:00 2001 From: sergiodt Date: Fri, 13 Oct 2023 08:02:00 +0200 Subject: [PATCH 43/43] refs #5134 feat:models --- db/changes/234002/00-aclClient.sql | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 db/changes/234002/00-aclClient.sql diff --git a/db/changes/234002/00-aclClient.sql b/db/changes/234002/00-aclClient.sql deleted file mode 100644 index 3df9522cf..000000000 --- a/db/changes/234002/00-aclClient.sql +++ /dev/null @@ -1,3 +0,0 @@ - -INSERT INTO `salix`.`ACL` ( model, property, accessType, permission, principalType, principalId) - VALUES('TicketCollection', '*', 'WRITE', 'ALLOW', 'ROLE', 'production');