From 11a0b98495d7f6a5b2d15db726a3dae261cd5c10 Mon Sep 17 00:00:00 2001 From: robert Date: Thu, 16 May 2024 10:20:08 +0200 Subject: [PATCH 01/42] feat: refs #7296 roadmapStop --- modules/route/back/methods/roadmap/clone.js | 10 +++++----- modules/route/back/model-config.json | 2 +- modules/route/back/models/roadmap.json | 2 +- ...{expedition-truck.json => roadmapStop.json} | 4 ++-- modules/route/front/roadmap/stops/index.html | 16 ++++++++-------- modules/route/front/roadmap/summary/index.html | 18 +++++++++--------- modules/route/front/roadmap/summary/index.js | 12 ++++++------ .../ticket/back/models/expeditionPallet.json | 2 +- myt.config.yml | 2 +- 9 files changed, 34 insertions(+), 34 deletions(-) rename modules/route/back/models/{expedition-truck.json => roadmapStop.json} (92%) diff --git a/modules/route/back/methods/roadmap/clone.js b/modules/route/back/methods/roadmap/clone.js index 456ed823d..2226b1e50 100644 --- a/modules/route/back/methods/roadmap/clone.js +++ b/modules/route/back/methods/roadmap/clone.js @@ -62,12 +62,12 @@ module.exports = Self => { const clone = await models.Roadmap.create(roadmap, options); - const expeditionTrucks = roadmap.expeditionTruck(); - expeditionTrucks.map(expeditionTruck => { - expeditionTruck.roadmapFk = clone.id; - return expeditionTruck; + const roadmapStops = roadmap.roadmapStop(); + roadmapStops.map(roadmapStop => { + roadmapStop.roadmapFk = clone.id; + return roadmapStop; }); - await models.ExpeditionTruck.create(expeditionTrucks, options); + await models.roadmapStop.create(roadmapStops, options); } await tx.commit(); diff --git a/modules/route/back/model-config.json b/modules/route/back/model-config.json index 6cf8da986..09cda6b2d 100644 --- a/modules/route/back/model-config.json +++ b/modules/route/back/model-config.json @@ -8,7 +8,7 @@ "DeliveryPoint": { "dataSource": "vn" }, - "ExpeditionTruck": { + "RoadmapStop": { "dataSource": "vn" }, "Roadmap": { diff --git a/modules/route/back/models/roadmap.json b/modules/route/back/models/roadmap.json index 2f6bb8c02..2b02c64f2 100644 --- a/modules/route/back/models/roadmap.json +++ b/modules/route/back/models/roadmap.json @@ -56,7 +56,7 @@ }, "expeditionTruck": { "type": "hasMany", - "model": "ExpeditionTruck", + "model": "roadmapStop", "foreignKey": "roadmapFk" } } diff --git a/modules/route/back/models/expedition-truck.json b/modules/route/back/models/roadmapStop.json similarity index 92% rename from modules/route/back/models/expedition-truck.json rename to modules/route/back/models/roadmapStop.json index 8edc7347f..51aa3a6db 100644 --- a/modules/route/back/models/expedition-truck.json +++ b/modules/route/back/models/roadmapStop.json @@ -1,9 +1,9 @@ { - "name": "ExpeditionTruck", + "name": "RoadmapStop", "base": "VnModel", "options": { "mysql": { - "table": "expeditionTruck" + "table": "roadmapStop" } }, "properties": { diff --git a/modules/route/front/roadmap/stops/index.html b/modules/route/front/roadmap/stops/index.html index b69492a21..82f30c326 100644 --- a/modules/route/front/roadmap/stops/index.html +++ b/modules/route/front/roadmap/stops/index.html @@ -1,22 +1,22 @@
- + + ng-model="roadmapStop.eta"> diff --git a/modules/route/front/roadmap/summary/index.html b/modules/route/front/roadmap/summary/index.html index 9fab0bf87..abf5ff90a 100644 --- a/modules/route/front/roadmap/summary/index.html +++ b/modules/route/front/roadmap/summary/index.html @@ -49,7 +49,7 @@ vn-bind="+" vn-tooltip="Add stop" icon="add_circle" - vn-click-stop="addExpeditionTruck.show()"> + vn-click-stop="addRoadmapStop.show()"> @@ -61,9 +61,9 @@ - - {{expeditionTruck.warehouse.name}} - {{expeditionTruck.eta | date:'dd/MM/yyyy HH:mm'}} + + {{roadmapStop.warehouse.name}} + {{roadmapStop.eta | date:'dd/MM/yyyy HH:mm'}} @@ -75,14 +75,14 @@ + ng-model="$ctrl.roadmapStop.eta"> diff --git a/modules/route/front/roadmap/summary/index.js b/modules/route/front/roadmap/summary/index.js index 041b43ce3..e0903f3a7 100644 --- a/modules/route/front/roadmap/summary/index.js +++ b/modules/route/front/roadmap/summary/index.js @@ -20,7 +20,7 @@ class Controller extends Component { include: [ {relation: 'supplier'}, {relation: 'worker'}, - {relation: 'expeditionTruck', + {relation: 'ExpeditionTruck', scope: { include: [ {relation: 'warehouse'} @@ -36,19 +36,19 @@ class Controller extends Component { const eta = new Date(this.roadmap.etd); eta.setDate(eta.getDate() + 1); - this.expeditionTruck = {eta: eta}; + this.roadmapStop = {eta: eta}; } onAddAccept() { try { const data = { roadmapFk: this.roadmap.id, - warehouseFk: this.expeditionTruck.warehouseFk, - eta: this.expeditionTruck.eta, - description: this.expeditionTruck.description + warehouseFk: this.roadmapStop.warehouseFk, + eta: this.roadmapStop.eta, + description: this.roadmapStop.description }; - this.$http.post(`ExpeditionTrucks`, data) + this.$http.post(`roadmapStops`, data) .then(() => { this.loadData(); this.vnApp.showSuccess(this.$t('Data saved!')); diff --git a/modules/ticket/back/models/expeditionPallet.json b/modules/ticket/back/models/expeditionPallet.json index cab3af6ec..8384ab883 100644 --- a/modules/ticket/back/models/expeditionPallet.json +++ b/modules/ticket/back/models/expeditionPallet.json @@ -25,7 +25,7 @@ "relations": { "expeditionTruck": { "type": "belongsTo", - "model": "ExpeditionTruck", + "model": "RoadmapStop", "foreignKey": "truckFk" } } diff --git a/myt.config.yml b/myt.config.yml index 17300aa37..56239ca3c 100755 --- a/myt.config.yml +++ b/myt.config.yml @@ -227,7 +227,7 @@ localFixtures: - expeditionScan - expeditionState - expeditionStateType - - expeditionTruck + - roadmapStop - expense - genus - greuge From 0b5f05cbed5305df285d47a491c637f2da75bff5 Mon Sep 17 00:00:00 2001 From: guillermo Date: Fri, 17 May 2024 12:36:54 +0200 Subject: [PATCH 02/42] refactor: refs #7375 Refactor clientsDisable --- db/routines/vn/events/client_userDisable.sql | 8 +++++ db/routines/vn/events/clientsDisable.sql | 25 -------------- .../vn/procedures/client_userDisable.sql | 33 +++++++++++++++++++ .../11055-wheatPaniculata/00-firstScript.sql | 5 +++ 4 files changed, 46 insertions(+), 25 deletions(-) create mode 100644 db/routines/vn/events/client_userDisable.sql delete mode 100644 db/routines/vn/events/clientsDisable.sql create mode 100644 db/routines/vn/procedures/client_userDisable.sql create mode 100644 db/versions/11055-wheatPaniculata/00-firstScript.sql diff --git a/db/routines/vn/events/client_userDisable.sql b/db/routines/vn/events/client_userDisable.sql new file mode 100644 index 000000000..b3354f8fd --- /dev/null +++ b/db/routines/vn/events/client_userDisable.sql @@ -0,0 +1,8 @@ +DELIMITER $$ +CREATE OR REPLACE DEFINER=`root`@`localhost` EVENT `vn`.`client_userDisable` + ON SCHEDULE EVERY 1 MONTH + STARTS '2023-06-01 00:00:00.000' + ON COMPLETION PRESERVE + ENABLE +DO CALL client_userDisable()$$ +DELIMITER ; diff --git a/db/routines/vn/events/clientsDisable.sql b/db/routines/vn/events/clientsDisable.sql deleted file mode 100644 index 35e6554a2..000000000 --- a/db/routines/vn/events/clientsDisable.sql +++ /dev/null @@ -1,25 +0,0 @@ -DELIMITER $$ -CREATE OR REPLACE DEFINER=`root`@`localhost` EVENT `vn`.`clientsDisable` - ON SCHEDULE EVERY 1 MONTH - STARTS '2023-06-01 00:00:00.000' - ON COMPLETION PRESERVE - ENABLE -DO BEGIN - UPDATE account.user u - JOIN client c ON c.id = u.id - LEFT JOIN account.account a ON a.id = u.id - SET u.active = FALSE - WHERE c.typeFk = 'normal' - AND a.id IS NULL - AND u.active - AND c.created < util.VN_CURDATE() - INTERVAL 12 MONTH - AND u.id NOT IN ( - SELECT DISTINCT c.id - FROM client c - LEFT JOIN ticket t ON t.clientFk = c.id - WHERE c.salesPersonFk IS NOT NULL - OR t.created > util.VN_CURDATE() - INTERVAL 12 MONTH - OR shipped > util.VN_CURDATE() - INTERVAL 12 MONTH - ); -END$$ -DELIMITER ; diff --git a/db/routines/vn/procedures/client_userDisable.sql b/db/routines/vn/procedures/client_userDisable.sql new file mode 100644 index 000000000..f2ba65c1c --- /dev/null +++ b/db/routines/vn/procedures/client_userDisable.sql @@ -0,0 +1,33 @@ +DELIMITER $$ +CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`client_userDisable`() +BEGIN +/** +* Desactiva los clientes inactivos en los últimos X meses. +*/ + DECLARE vMonths INT; + + SELECT monthsToDisableUser INTO vMonths + FROM clientConfig; + + IF vMonths IS NULL THEN + CALL util.throw('Config parameter not set'); + END IF; + + UPDATE account.user u + JOIN client c ON c.id = u.id + LEFT JOIN account.account a ON a.id = u.id + SET u.active = FALSE + WHERE c.typeFk = 'normal' + AND a.id IS NULL + AND u.active + AND c.created < util.VN_CURDATE() - INTERVAL vMonths MONTH + AND u.id NOT IN ( + SELECT DISTINCT c.id + FROM client c + LEFT JOIN ticket t ON t.clientFk = c.id + WHERE c.salesPersonFk IS NOT NULL + OR t.created > util.VN_CURDATE() - INTERVAL vMonths MONTH + OR shipped > util.VN_CURDATE() - INTERVAL vMonths MONTH + ); +END$$ +DELIMITER ; diff --git a/db/versions/11055-wheatPaniculata/00-firstScript.sql b/db/versions/11055-wheatPaniculata/00-firstScript.sql new file mode 100644 index 000000000..6eec62fd8 --- /dev/null +++ b/db/versions/11055-wheatPaniculata/00-firstScript.sql @@ -0,0 +1,5 @@ +ALTER TABLE vn.clientConfig + ADD monthsToDisableUser int(10) unsigned DEFAULT NULL NULL; + +UPDATE IGNORE vn.clientConfig + SET monthsToDisableUser = 12; \ No newline at end of file From 7fb6ecd6178c3064e420e9c9e8a867d62968b145 Mon Sep 17 00:00:00 2001 From: pablone Date: Fri, 17 May 2024 14:46:49 +0200 Subject: [PATCH 03/42] feat: refs #7187 redirect to lilium --- modules/worker/front/pda/index.html | 50 ------------------ modules/worker/front/pda/index.js | 48 +++-------------- modules/worker/front/pda/index.spec.js | 72 -------------------------- modules/worker/front/pda/style.scss | 6 --- 4 files changed, 8 insertions(+), 168 deletions(-) delete mode 100644 modules/worker/front/pda/index.html delete mode 100644 modules/worker/front/pda/index.spec.js delete mode 100644 modules/worker/front/pda/style.scss diff --git a/modules/worker/front/pda/index.html b/modules/worker/front/pda/index.html deleted file mode 100644 index c6d31dc85..000000000 --- a/modules/worker/front/pda/index.html +++ /dev/null @@ -1,50 +0,0 @@ -
- - - - - - - - - - -
- - - - - -
- ID: {{id}} -
-
- {{modelFk}}, {{serialNumber}} -
-
-
-
-
- - - - - diff --git a/modules/worker/front/pda/index.js b/modules/worker/front/pda/index.js index 885261e5c..b1f8dcac2 100644 --- a/modules/worker/front/pda/index.js +++ b/modules/worker/front/pda/index.js @@ -1,53 +1,21 @@ import ngModule from '../module'; import Section from 'salix/components/section'; -import './style.scss'; class Controller extends Section { constructor($element, $) { super($element, $); - const filter = { - where: {userFk: this.$params.id}, - include: {relation: 'deviceProduction'} - }; - this.$http.get('DeviceProductionUsers', {filter}). - then(res => { - if (res.data && res.data.length > 0) - this.setCurrentPDA(res.data[0]); - }); } - deallocatePDA() { - this.$http.post(`Workers/${this.$params.id}/deallocatePDA`, {pda: this.currentPDA.deviceProductionFk}) - .then(() => { - this.vnApp.showSuccess(this.$t('PDA deallocated')); - delete this.currentPDA; - }); - } - - allocatePDA() { - this.$http.post(`Workers/${this.$params.id}/allocatePDA`, {pda: this.newPDA}) - .then(res => { - if (res.data) - this.setCurrentPDA(res.data); - - this.vnApp.showSuccess(this.$t('PDA allocated')); - delete this.newPDA; - }); - } - - setCurrentPDA(data) { - this.currentPDA = data; - this.currentPDA.description = []; - this.currentPDA.description.push(`ID: ${this.currentPDA.deviceProductionFk}`); - this.currentPDA.description.push(`${this.$t('Model')}: ${this.currentPDA.deviceProduction.modelFk}`); - this.currentPDA.description.push(`${this.$t('Serial Number')}: ${this.currentPDA.deviceProduction.serialNumber}`); - this.currentPDA.description = this.currentPDA.description.join(' '); + async $onInit() { + const url = await this.vnApp.getUrl(`worker/${this.$params.id}/pda`); + console.log('url: ', url); + window.location.href = url; } } -Controller.$inject = ['$element', '$scope']; - -ngModule.vnComponent('vnWorkerPda', { - template: require('./index.html'), +ngModule.vnComponent('vnClaimPhotos', { controller: Controller, + bindings: { + claim: '<' + } }); diff --git a/modules/worker/front/pda/index.spec.js b/modules/worker/front/pda/index.spec.js deleted file mode 100644 index a0540af45..000000000 --- a/modules/worker/front/pda/index.spec.js +++ /dev/null @@ -1,72 +0,0 @@ -import './index'; - -describe('Worker', () => { - describe('Component vnWorkerPda', () => { - let $httpBackend; - let $scope; - let $element; - let controller; - - beforeEach(ngModule('worker')); - - beforeEach(inject(($componentController, $rootScope, _$httpBackend_) => { - $httpBackend = _$httpBackend_; - $scope = $rootScope.$new(); - $element = angular.element(''); - controller = $componentController('vnWorkerPda', {$element, $scope}); - $httpBackend.expectGET(`DeviceProductionUsers`).respond(); - })); - - describe('deallocatePDA()', () => { - it('should make an HTTP Post query to deallocatePDA', () => { - jest.spyOn(controller.vnApp, 'showSuccess'); - controller.currentPDA = {deviceProductionFk: 1}; - controller.$params.id = 1; - - $httpBackend - .expectPOST(`Workers/${controller.$params.id}/deallocatePDA`, - {pda: controller.currentPDA.deviceProductionFk}) - .respond(); - controller.deallocatePDA(); - $httpBackend.flush(); - - expect(controller.vnApp.showSuccess).toHaveBeenCalled(); - expect(controller.currentPDA).toBeUndefined(); - }); - }); - - describe('allocatePDA()', () => { - it('should make an HTTP Post query to allocatePDA', () => { - jest.spyOn(controller.vnApp, 'showSuccess'); - controller.newPDA = 4; - controller.$params.id = 1; - - $httpBackend - .expectPOST(`Workers/${controller.$params.id}/allocatePDA`, - {pda: controller.newPDA}) - .respond(); - controller.allocatePDA(); - $httpBackend.flush(); - - expect(controller.vnApp.showSuccess).toHaveBeenCalled(); - expect(controller.newPDA).toBeUndefined(); - }); - }); - - describe('setCurrentPDA()', () => { - it('should set CurrentPDA', () => { - const data = { - deviceProductionFk: 1, - deviceProduction: { - modelFk: 1, - serialNumber: 1 - } - }; - controller.setCurrentPDA(data); - - expect(controller.currentPDA).toBeDefined(); - expect(controller.currentPDA.description).toBeDefined(); - }); - }); - }); -}); diff --git a/modules/worker/front/pda/style.scss b/modules/worker/front/pda/style.scss deleted file mode 100644 index c55c9d218..000000000 --- a/modules/worker/front/pda/style.scss +++ /dev/null @@ -1,6 +0,0 @@ -@import "./variables"; - -.text-grey { - color: $color-font-light; -} - From 05f09d0b875f29b9d4838dcfbbe708ca1e447b36 Mon Sep 17 00:00:00 2001 From: carlossa Date: Fri, 17 May 2024 14:56:40 +0200 Subject: [PATCH 04/42] refs #7187 fix workerPda --- modules/worker/front/pda/index.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/worker/front/pda/index.js b/modules/worker/front/pda/index.js index b1f8dcac2..a57886556 100644 --- a/modules/worker/front/pda/index.js +++ b/modules/worker/front/pda/index.js @@ -8,12 +8,11 @@ class Controller extends Section { async $onInit() { const url = await this.vnApp.getUrl(`worker/${this.$params.id}/pda`); - console.log('url: ', url); window.location.href = url; } } -ngModule.vnComponent('vnClaimPhotos', { +ngModule.vnComponent('vnWorkerPda', { controller: Controller, bindings: { claim: '<' From 9a5acedd38b0ab3bfda5264507ab735722107417 Mon Sep 17 00:00:00 2001 From: Pako Date: Mon, 20 May 2024 08:21:54 +0200 Subject: [PATCH 05/42] improved proc --- .../supplierPackaging_ReportSource.sql | 88 ++++++++++++++++++- 1 file changed, 85 insertions(+), 3 deletions(-) diff --git a/db/routines/vn/procedures/supplierPackaging_ReportSource.sql b/db/routines/vn/procedures/supplierPackaging_ReportSource.sql index f9d43f925..2cf9b85c5 100644 --- a/db/routines/vn/procedures/supplierPackaging_ReportSource.sql +++ b/db/routines/vn/procedures/supplierPackaging_ReportSource.sql @@ -35,7 +35,7 @@ BEGIN itemFk, longName, supplier, - entryFk, + CONCAT('E',entryFk) entryFk, landed, `in`, `out`, @@ -49,16 +49,98 @@ BEGIN itemFk, longName, supplier, - 'previous', + 'E previous', vFromDated, SUM(`in`), SUM(`out`), NULL, - buyingValue + AVG(buyingValue) FROM supplierPackaging WHERE supplierFk = vSupplierFk AND landed < vFromDated GROUP BY itemFk + UNION ALL + SELECT vSupplierFk, + s.itemFk, + i.longName, + c.name, + CONCAT('T',s.ticketFk), + DATE(t.shipped), + -LEAST(s.quantity,0) `in`, + GREATEST(s.quantity,0) `out`, + t.warehouseFk, + s.price * (100 - s.discount) / 100 + FROM sale s + JOIN item i ON i.id = s.itemFk + JOIN packaging p ON p.itemFk = i.id + JOIN ticket t ON t.id = s.ticketFk + JOIN client c ON c.id = t.clientFk + JOIN supplier su ON su.nif = c.fi + WHERE su.id = vSupplierFk + AND t.shipped >= vFromDated + AND p.isPackageReturnable + UNION ALL + SELECT vSupplierFk, + s.itemFk, + i.longName, + c.name, + 'T previous', + vFromDated, + SUM(-LEAST(s.quantity,0)) `in`, + SUM(GREATEST(s.quantity,0)) `out`, + NULL, + AVG(s.price * (100 - s.discount) / 100) + FROM sale s + JOIN item i ON i.id = s.itemFk + JOIN packaging p ON p.itemFk = i.id + JOIN ticket t ON t.id = s.ticketFk + JOIN client c ON c.id = t.clientFk + JOIN supplier su ON su.nif = c.fi + WHERE su.id = vSupplierFk + AND t.shipped < vFromDated + AND p.isPackageReturnable + GROUP BY s.itemFk + UNION ALL + SELECT vSupplierFk, + p.itemFk, + i.longName, + c.name, + CONCAT('TP',tp.ticketFk), + DATE(t.shipped), + -LEAST(tp.quantity,0) `in`, + GREATEST(tp.quantity,0) `out`, + t.warehouseFk, + 0 + FROM ticketPackaging tp + JOIN packaging p ON p.id = tp.packagingFk + JOIN item i ON i.id = p.itemFk + JOIN ticket t ON t.id = tp.ticketFk + JOIN client c ON c.id = t.clientFk + JOIN supplier su ON su.nif = c.fi + WHERE su.id = vSupplierFk + AND t.shipped >= vFromDated + AND p.isPackageReturnable + UNION ALL + SELECT vSupplierFk, + p.itemFk, + i.longName, + c.name, + 'TP previous', + vFromDated, + SUM(-LEAST(tp.quantity,0)) `in`, + SUM(GREATEST(tp.quantity,0)) `out`, + NULL, + 0 + FROM ticketPackaging tp + JOIN packaging p ON p.id = tp.packagingFk + JOIN item i ON i.id = p.itemFk + JOIN ticket t ON t.id = tp.ticketFk + JOIN client c ON c.id = t.clientFk + JOIN supplier su ON su.nif = c.fi + WHERE su.id = vSupplierFk + AND t.shipped >= vFromDated + AND p.isPackageReturnable + GROUP BY p.itemFk ORDER BY itemFk, landed, entryFk ) sub WHERE `out` OR `in`; From 7f0f1b954710ec4b382c0ec551248a87a4c6430b Mon Sep 17 00:00:00 2001 From: guillermo Date: Mon, 20 May 2024 09:54:30 +0200 Subject: [PATCH 06/42] refactor: refs #7422 Deleted tables --- .../11057-chocolateMoss/00-firstScript.sql | 106 ++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 db/versions/11057-chocolateMoss/00-firstScript.sql diff --git a/db/versions/11057-chocolateMoss/00-firstScript.sql b/db/versions/11057-chocolateMoss/00-firstScript.sql new file mode 100644 index 000000000..7484b8c33 --- /dev/null +++ b/db/versions/11057-chocolateMoss/00-firstScript.sql @@ -0,0 +1,106 @@ +DROP TABLE vn2008.scanTree__; +DROP TABLE vn2008.payroll_embargos__; +DROP TABLE vn2008.unary_scan_line__; +DROP TABLE vn2008.unary_source__; +DROP TABLE vn2008.unary_scan__; +DROP TABLE vn2008.scan_line__; +DROP TABLE vn2008.Familias__; +DROP TABLE vn2008.language__; +DROP TABLE vn2008.Clientes_dits__; +DROP TABLE vn2008.unary_scan_line_expedition__; +DROP TABLE vn2008.warehouse_group__; +DROP TABLE vn2008.Espionajes__; +DROP TABLE vn2008.jerarquia__; +DROP TABLE vn2008.wks__; +DROP TABLE vn2008.Proveedores_comunicados__; +DROP TABLE vn2008.integra2_escala__; +DROP TABLE vn2008.cp__; +DROP TABLE vn2008.unary__; +DROP TABLE vn2008.Estados__; +DROP TABLE vn2008.agency_hour__; +DROP TABLE vn2008.Reservas__; +DROP TABLE vn2008.cyc_declaration__; +DROP TABLE vn2008.route__; +DROP TABLE vn2008.Proveedores_escritos__; +DROP TABLE vn2008.config__; +DROP TABLE vn2008.guillen__; +DROP TABLE vn2008.expeditions_deleted__; +DROP TABLE vn2008.Tipos_f11__; +DROP TABLE vn2008.commission__; +DROP TABLE vn2008.Movimientos_revisar__; +DROP TABLE vn2008.recibida_agricola__; +DROP TABLE vn2008.tipsa__; +DROP TABLE vn2008.rounding__; +DROP TABLE vn2008.Informes__; +DROP TABLE vn2008.Forms__; +DROP TABLE vn2008.Clientes_event__; +DROP TABLE vn2008.wh_selection__; +DROP TABLE vn2008.template_bionic_component__; +DROP TABLE vn2008.Agencias_province__; +DROP TABLE vn2008.travel_pattern__; +DROP TABLE vn2008.sort_merge_results_ernesto__; +DROP TABLE vn2008.Conteo__; +DROP TABLE vn2008.Consignatarios_devices__; +DROP TABLE vn2008.link__; +DROP TABLE vn2008.agency_warehouse__; +DROP TABLE vn2008.warehouse_lc__; +DROP TABLE vn2008.emp_day_pay__; +DROP TABLE vn2008.Entradas_kop__; +DROP TABLE vn2008.dock__; +DROP TABLE vn2008.unaryScanFilter__; +DROP TABLE vn2008.Grupos__; +DROP TABLE vn2008.nichos__; +DROP TABLE vn2008.form_query__; +DROP TABLE vn2008.filtros__; +DROP TABLE vn2008.Objetivos__; +DROP TABLE vn2008.zones__; +DROP TABLE vn2008.rec_translator__; +DROP TABLE vn2008.warehouse_joined__; +DROP TABLE vn2008.warehouse_filtro__; +DROP TABLE vn2008.viaxpress__; +DROP TABLE vn2008.cl_que__; +DROP TABLE vn2008.Recibos_recorded__; +DROP TABLE vn2008.cooler_path__; +DROP TABLE vn2008.payrroll_apEmpresarial__; +DROP TABLE vn2008.Compres_ok__; +DROP TABLE vn2008.Movimientos_avisar__; +DROP TABLE vn2008.Clases__; +DROP TABLE vn2008.payroll_tipobasess__; +DROP TABLE vn2008.guillen_carry__; +DROP TABLE vn2008.unary_scan_line_buy__; +DROP TABLE vn2008.Series__; +DROP TABLE vn2008.Permisos__; +DROP TABLE vn2008.container__; +DROP TABLE vn2008.travel_reserve__; +DROP TABLE vn2008.tmpNEWTARIFAS__; +DROP TABLE vn2008.Clientes_potenciales__; +DROP TABLE vn2008.duaDismissed__; +DROP TABLE vn2008.cl_pet__; +DROP TABLE vn2008.preparation_exception__; +DROP TABLE vn2008.Clientes_empresa__; +DROP TABLE vn2008.call_information__; +DROP TABLE vn2008.template_bionic_price__; +DROP TABLE vn2008.invoice_observation__; +DROP TABLE vn2008.edi_testigos__; +DROP TABLE vn2008.cl_dep__; +DROP TABLE vn2008.agencia_descuadre__; +DROP TABLE vn2008.Monitoring__; +DROP TABLE vn2008.payroll_datos__; +DROP TABLE vn2008.tblIVA__; +DROP TABLE vn2008.cyc__; +DROP TABLE vn2008.Tickets_stack__; +DROP TABLE vn2008.config_host_forms__; +DROP TABLE vn2008.template_bionic_lot__; +DROP TABLE vn2008.payroll_bonificaciones__; +DROP TABLE vn2008.widget__; +DROP TABLE vn2008.accion_dits__; +DROP TABLE vn2008.credit_card__; +DROP TABLE vn2008.Brasa__; +DROP TABLE vn2008.Jefes__; +DROP TABLE vn2008.call_option__; +DROP TABLE vn2008.expeditions_pictures__; +DROP TABLE vn2008.scan__; +DROP TABLE vn2008.trolley__; +DROP TABLE vn2008.transport__; +DROP TABLE vn2008.Baldas__; +DROP TABLE vn2008.payroll_basess__; \ No newline at end of file From 7f1210e712f43d38a874d8a92e76e796649a868b Mon Sep 17 00:00:00 2001 From: carlossa Date: Mon, 20 May 2024 10:26:09 +0200 Subject: [PATCH 07/42] refs #6820 fix back --- back/model-config.json | 3 +++ back/models/routeConfig.json | 21 +++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 back/models/routeConfig.json diff --git a/back/model-config.json b/back/model-config.json index e64386300..b643ab54f 100644 --- a/back/model-config.json +++ b/back/model-config.json @@ -186,5 +186,8 @@ }, "AgencyWorkCenter": { "dataSource": "vn" + }, + "RouteConfig": { + "dataSource": "vn" } } diff --git a/back/models/routeConfig.json b/back/models/routeConfig.json new file mode 100644 index 000000000..28adbe756 --- /dev/null +++ b/back/models/routeConfig.json @@ -0,0 +1,21 @@ +{ + "name": "RouteConfig", + "base": "VnModel", + "mixins": { + "Loggable": true + }, + "options": { + "mysql": { + "table": "routeConfig" + } + }, + "properties": { + "id": { + "type": "number", + "description": "Identifier" + }, + "kmMax": { + "type": "number" + } + } +} From abdacb362751559fe51bc0d8de6badb78ca3bb62 Mon Sep 17 00:00:00 2001 From: Pako Date: Mon, 20 May 2024 10:33:01 +0200 Subject: [PATCH 08/42] casting values --- db/routines/vn/procedures/supplierPackaging_ReportSource.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/db/routines/vn/procedures/supplierPackaging_ReportSource.sql b/db/routines/vn/procedures/supplierPackaging_ReportSource.sql index 2cf9b85c5..a3401843a 100644 --- a/db/routines/vn/procedures/supplierPackaging_ReportSource.sql +++ b/db/routines/vn/procedures/supplierPackaging_ReportSource.sql @@ -151,8 +151,8 @@ BEGIN supplier, entryFk, landed, - `in`, - `out`, + CAST(`in` AS DECIMAL(10,0)) `in`, + CAST(`out` AS DECIMAL(10,0)) `out`, warehouse, buyingValue, balance From 6d66c0f71f6c6765b46ae7fdad2a8747f02d0889 Mon Sep 17 00:00:00 2001 From: carlossa Date: Mon, 20 May 2024 11:14:30 +0200 Subject: [PATCH 09/42] hotfix TicketLog filter --- modules/ticket/back/models/ticket-log.json | 3 ++- modules/ticket/front/descriptor-menu/index.js | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/ticket/back/models/ticket-log.json b/modules/ticket/back/models/ticket-log.json index 32b4afd13..d75589f11 100644 --- a/modules/ticket/back/models/ticket-log.json +++ b/modules/ticket/back/models/ticket-log.json @@ -8,7 +8,8 @@ }, "properties": { "id": { - "type": "string" + "type": "number", + "id": true }, "originFk": { "type": "number" diff --git a/modules/ticket/front/descriptor-menu/index.js b/modules/ticket/front/descriptor-menu/index.js index 52cac141c..89590e86a 100644 --- a/modules/ticket/front/descriptor-menu/index.js +++ b/modules/ticket/front/descriptor-menu/index.js @@ -37,14 +37,15 @@ class Controller extends Section { }); const filter = { - fields: ['originFk', 'creationDate', 'newInstance'], + fields: ['id', 'originFk', 'creationDate', 'newInstance'], where: { originFk: value, newInstance: {like: '%"isDeleted":true%'} }, - order: 'creationDate DESC' + order: 'creationDate DESC', + limit: 1 }; - this.$http.get(`TicketLogs/findOne`, {filter}) + this.$http.get(`TicketLogs`, {filter}) .then(res => { if (res && res.data) { const now = Date.vnNew(); From f82b1054306ad370948010248e5cdfded6fff6b2 Mon Sep 17 00:00:00 2001 From: alexm Date: Mon, 20 May 2024 11:30:43 +0200 Subject: [PATCH 10/42] fix: TicketLog res.data --- modules/ticket/front/descriptor-menu/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/ticket/front/descriptor-menu/index.js b/modules/ticket/front/descriptor-menu/index.js index 89590e86a..32f245454 100644 --- a/modules/ticket/front/descriptor-menu/index.js +++ b/modules/ticket/front/descriptor-menu/index.js @@ -47,9 +47,9 @@ class Controller extends Section { }; this.$http.get(`TicketLogs`, {filter}) .then(res => { - if (res && res.data) { + if (res && res.data && res.data.length) { const now = Date.vnNew(); - const maxDate = new Date(res.data.creationDate); + const maxDate = new Date(res.data[0].creationDate); maxDate.setHours(maxDate.getHours() + 1); if (now <= maxDate) return this.canRestoreTicket = true; From b203d94b272d33131272cf47a152482c37565480 Mon Sep 17 00:00:00 2001 From: pablone Date: Mon, 20 May 2024 11:37:40 +0200 Subject: [PATCH 11/42] feat: refs #6021 add new column --- db/versions/11058-aquaCataractarum/00-firstScript.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 db/versions/11058-aquaCataractarum/00-firstScript.sql diff --git a/db/versions/11058-aquaCataractarum/00-firstScript.sql b/db/versions/11058-aquaCataractarum/00-firstScript.sql new file mode 100644 index 000000000..98fc910ad --- /dev/null +++ b/db/versions/11058-aquaCataractarum/00-firstScript.sql @@ -0,0 +1,2 @@ +-- Place your SQL code here +ALTER TABLE floranet.`order` ADD IF NOT EXISTS observations TEXT NULL; From d51c9fc12061bd612fd48697fe22ad4decfaf108 Mon Sep 17 00:00:00 2001 From: pablone Date: Mon, 20 May 2024 12:14:59 +0200 Subject: [PATCH 12/42] fix: refs #6404 fix cancel shipment --- back/methods/mrw-config/cancelShipment.js | 4 ++-- back/methods/mrw-config/createShipment.js | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/back/methods/mrw-config/cancelShipment.js b/back/methods/mrw-config/cancelShipment.js index 218b6a96b..dd33694ea 100644 --- a/back/methods/mrw-config/cancelShipment.js +++ b/back/methods/mrw-config/cancelShipment.js @@ -39,8 +39,8 @@ module.exports = Self => { const xmlString = response.data; const parser = new DOMParser(); const xmlDoc = parser.parseFromString(xmlString, 'text/xml'); - const [resultElement] = xmlDoc.getElementsByTagName('Mensaje'); + const resultElement = xmlDoc.getElementsByTagName('Mensaje')[0].textContent; - return resultElement.textContent; + return resultElement; }; }; diff --git a/back/methods/mrw-config/createShipment.js b/back/methods/mrw-config/createShipment.js index 12263de03..7d226a5bc 100644 --- a/back/methods/mrw-config/createShipment.js +++ b/back/methods/mrw-config/createShipment.js @@ -42,7 +42,8 @@ module.exports = Self => { throw new UserError(`Some mrwConfig parameters are not set`); const query = - `SELECT CASE co.code + `SELECT + CASE co.code WHEN 'ES' THEN a.postalCode WHEN 'PT' THEN LEFT(a.postalCode, 4) WHEN 'AD' THEN REPLACE(a.postalCode, 'AD', '00') From 143f9cf0bbbdf93e539ff15ae8db887096687a6e Mon Sep 17 00:00:00 2001 From: pablone Date: Mon, 20 May 2024 12:17:10 +0200 Subject: [PATCH 13/42] fix: refs #6404 fix return --- back/methods/mrw-config/cancelShipment.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/back/methods/mrw-config/cancelShipment.js b/back/methods/mrw-config/cancelShipment.js index dd33694ea..86bbb7410 100644 --- a/back/methods/mrw-config/cancelShipment.js +++ b/back/methods/mrw-config/cancelShipment.js @@ -39,8 +39,6 @@ module.exports = Self => { const xmlString = response.data; const parser = new DOMParser(); const xmlDoc = parser.parseFromString(xmlString, 'text/xml'); - const resultElement = xmlDoc.getElementsByTagName('Mensaje')[0].textContent; - - return resultElement; + return xmlDoc.getElementsByTagName('Mensaje')[0].textContent; }; }; From 62ca4885c4ccad02f9c8826f0e7bbeb79a8b27e7 Mon Sep 17 00:00:00 2001 From: robert Date: Mon, 20 May 2024 12:28:27 +0200 Subject: [PATCH 14/42] feat: refs #7296 requested changes --- modules/route/back/models/roadmap.json | 2 +- modules/ticket/back/models/expeditionPallet.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/route/back/models/roadmap.json b/modules/route/back/models/roadmap.json index 2b02c64f2..c7c1f15eb 100644 --- a/modules/route/back/models/roadmap.json +++ b/modules/route/back/models/roadmap.json @@ -54,7 +54,7 @@ "model": "Supplier", "foreignKey": "supplierFk" }, - "expeditionTruck": { + "roadmapStop": { "type": "hasMany", "model": "roadmapStop", "foreignKey": "roadmapFk" diff --git a/modules/ticket/back/models/expeditionPallet.json b/modules/ticket/back/models/expeditionPallet.json index 8384ab883..017c5e5d4 100644 --- a/modules/ticket/back/models/expeditionPallet.json +++ b/modules/ticket/back/models/expeditionPallet.json @@ -23,7 +23,7 @@ } }, "relations": { - "expeditionTruck": { + "RoadmapStop": { "type": "belongsTo", "model": "RoadmapStop", "foreignKey": "truckFk" From 34f48e46e7c8b18e4fef7e7c287bba0fba2c5e94 Mon Sep 17 00:00:00 2001 From: robert Date: Mon, 20 May 2024 13:19:01 +0200 Subject: [PATCH 15/42] feat: refs #7296 requested changes2 --- modules/route/front/roadmap/summary/index.js | 4 ++-- modules/ticket/back/models/expeditionPallet.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/route/front/roadmap/summary/index.js b/modules/route/front/roadmap/summary/index.js index e0903f3a7..46abe5ca2 100644 --- a/modules/route/front/roadmap/summary/index.js +++ b/modules/route/front/roadmap/summary/index.js @@ -20,7 +20,7 @@ class Controller extends Component { include: [ {relation: 'supplier'}, {relation: 'worker'}, - {relation: 'ExpeditionTruck', + {relation: 'roadmapStop', scope: { include: [ {relation: 'warehouse'} @@ -48,7 +48,7 @@ class Controller extends Component { description: this.roadmapStop.description }; - this.$http.post(`roadmapStops`, data) + this.$http.post(`RoadmapStops`, data) .then(() => { this.loadData(); this.vnApp.showSuccess(this.$t('Data saved!')); diff --git a/modules/ticket/back/models/expeditionPallet.json b/modules/ticket/back/models/expeditionPallet.json index 017c5e5d4..64b3092ae 100644 --- a/modules/ticket/back/models/expeditionPallet.json +++ b/modules/ticket/back/models/expeditionPallet.json @@ -23,7 +23,7 @@ } }, "relations": { - "RoadmapStop": { + "roadmapStop": { "type": "belongsTo", "model": "RoadmapStop", "foreignKey": "truckFk" From 823e8fd7a154a4631fdb454d04297658913d7e89 Mon Sep 17 00:00:00 2001 From: robert Date: Mon, 20 May 2024 13:27:38 +0200 Subject: [PATCH 16/42] feat: refs #7296 requested changes3 --- modules/route/back/methods/roadmap/clone.js | 2 +- modules/route/back/models/roadmap.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/route/back/methods/roadmap/clone.js b/modules/route/back/methods/roadmap/clone.js index 2226b1e50..b74cf803c 100644 --- a/modules/route/back/methods/roadmap/clone.js +++ b/modules/route/back/methods/roadmap/clone.js @@ -67,7 +67,7 @@ module.exports = Self => { roadmapStop.roadmapFk = clone.id; return roadmapStop; }); - await models.roadmapStop.create(roadmapStops, options); + await models.RoadmapStop.create(roadmapStops, options); } await tx.commit(); diff --git a/modules/route/back/models/roadmap.json b/modules/route/back/models/roadmap.json index c7c1f15eb..01572d718 100644 --- a/modules/route/back/models/roadmap.json +++ b/modules/route/back/models/roadmap.json @@ -56,7 +56,7 @@ }, "roadmapStop": { "type": "hasMany", - "model": "roadmapStop", + "model": "RoadmapStop", "foreignKey": "roadmapFk" } } From 3fa557f90d1e5adaefc826c74b2356ee836d62ea Mon Sep 17 00:00:00 2001 From: pablone Date: Mon, 20 May 2024 13:58:32 +0200 Subject: [PATCH 17/42] fix: refs #6404 create shipment --- back/methods/mrw-config/createShipment.js | 11 +++-------- back/methods/mrw-config/specs/createShipment.spec.js | 4 ++-- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/back/methods/mrw-config/createShipment.js b/back/methods/mrw-config/createShipment.js index 7d226a5bc..081a83382 100644 --- a/back/methods/mrw-config/createShipment.js +++ b/back/methods/mrw-config/createShipment.js @@ -90,14 +90,9 @@ module.exports = Self => { const getLabelResponse = await sendXmlDoc('getLabel', {mrw, shipmentId}, 'text/xml'); const file = getTextByTag(getLabelResponse, 'EtiquetaFile'); - try { - await models.Expedition.updateAll({id: expeditionFk}, {externalId: shipmentId}, myOptions); - if (tx) await tx.commit(); - } catch (error) { - if (tx) await tx.rollback(); - throw error; - } - return file; + if (tx) await tx.commit(); + + return {shipmentId, file}; }; function getTextByTag(xmlDoc, tag) { diff --git a/back/methods/mrw-config/specs/createShipment.spec.js b/back/methods/mrw-config/specs/createShipment.spec.js index 0f48bc2d3..f05f9a81d 100644 --- a/back/methods/mrw-config/specs/createShipment.spec.js +++ b/back/methods/mrw-config/specs/createShipment.spec.js @@ -81,9 +81,9 @@ describe('MRWConfig createShipment()', () => { spyOn(axios, 'post').and.callFake(() => Promise.resolve(mockPostResponses.pop())); - const base64Binary = await models.MrwConfig.createShipment(expedition1.id, options); + const {file} = await models.MrwConfig.createShipment(expedition1.id, options); - expect(base64Binary).toEqual(mockBase64Binary); + expect(file).toEqual(mockBase64Binary); }); it('should fail if mrwConfig has no data', async() => { From 119102b0b3cf5fef4390364e7e6d16ff6788cd17 Mon Sep 17 00:00:00 2001 From: carlossa Date: Mon, 20 May 2024 16:00:38 +0200 Subject: [PATCH 18/42] refs #6820 acl --- db/versions/11059-crimsonAnthurium/00-firstScript.sql | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 db/versions/11059-crimsonAnthurium/00-firstScript.sql diff --git a/db/versions/11059-crimsonAnthurium/00-firstScript.sql b/db/versions/11059-crimsonAnthurium/00-firstScript.sql new file mode 100644 index 000000000..7fe3e01ca --- /dev/null +++ b/db/versions/11059-crimsonAnthurium/00-firstScript.sql @@ -0,0 +1,3 @@ +-- Place your SQL code here +INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) + VALUES ('RouteConfig','*','*','ALLOW','ROLE','employee'); From 335b9caaa40337e4db2661cd68f19e582f16de0c Mon Sep 17 00:00:00 2001 From: pablone Date: Tue, 21 May 2024 01:10:53 +0200 Subject: [PATCH 19/42] fix: refs #7187 got summary before lilium --- modules/worker/front/pda/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/worker/front/pda/index.js b/modules/worker/front/pda/index.js index a57886556..099e0e34c 100644 --- a/modules/worker/front/pda/index.js +++ b/modules/worker/front/pda/index.js @@ -8,6 +8,7 @@ class Controller extends Section { async $onInit() { const url = await this.vnApp.getUrl(`worker/${this.$params.id}/pda`); + this.$state.go('worker.card.summary', {id: this.$params.id}); window.location.href = url; } } From 82d985ff3a8a77e72698f0afcff4e2e70bc0fda3 Mon Sep 17 00:00:00 2001 From: guillermo Date: Tue, 21 May 2024 07:19:04 +0200 Subject: [PATCH 20/42] refs #7422 Fix --- .../11057-chocolateMoss/00-firstScript.sql | 106 ------------------ db/versions/11057-chocolateMoss/00-part.sql | 26 +++++ db/versions/11057-chocolateMoss/01-part.sql | 26 +++++ db/versions/11057-chocolateMoss/02-part.sql | 26 +++++ db/versions/11057-chocolateMoss/03-part.sql | 28 +++++ 5 files changed, 106 insertions(+), 106 deletions(-) delete mode 100644 db/versions/11057-chocolateMoss/00-firstScript.sql create mode 100644 db/versions/11057-chocolateMoss/00-part.sql create mode 100644 db/versions/11057-chocolateMoss/01-part.sql create mode 100644 db/versions/11057-chocolateMoss/02-part.sql create mode 100644 db/versions/11057-chocolateMoss/03-part.sql diff --git a/db/versions/11057-chocolateMoss/00-firstScript.sql b/db/versions/11057-chocolateMoss/00-firstScript.sql deleted file mode 100644 index 7484b8c33..000000000 --- a/db/versions/11057-chocolateMoss/00-firstScript.sql +++ /dev/null @@ -1,106 +0,0 @@ -DROP TABLE vn2008.scanTree__; -DROP TABLE vn2008.payroll_embargos__; -DROP TABLE vn2008.unary_scan_line__; -DROP TABLE vn2008.unary_source__; -DROP TABLE vn2008.unary_scan__; -DROP TABLE vn2008.scan_line__; -DROP TABLE vn2008.Familias__; -DROP TABLE vn2008.language__; -DROP TABLE vn2008.Clientes_dits__; -DROP TABLE vn2008.unary_scan_line_expedition__; -DROP TABLE vn2008.warehouse_group__; -DROP TABLE vn2008.Espionajes__; -DROP TABLE vn2008.jerarquia__; -DROP TABLE vn2008.wks__; -DROP TABLE vn2008.Proveedores_comunicados__; -DROP TABLE vn2008.integra2_escala__; -DROP TABLE vn2008.cp__; -DROP TABLE vn2008.unary__; -DROP TABLE vn2008.Estados__; -DROP TABLE vn2008.agency_hour__; -DROP TABLE vn2008.Reservas__; -DROP TABLE vn2008.cyc_declaration__; -DROP TABLE vn2008.route__; -DROP TABLE vn2008.Proveedores_escritos__; -DROP TABLE vn2008.config__; -DROP TABLE vn2008.guillen__; -DROP TABLE vn2008.expeditions_deleted__; -DROP TABLE vn2008.Tipos_f11__; -DROP TABLE vn2008.commission__; -DROP TABLE vn2008.Movimientos_revisar__; -DROP TABLE vn2008.recibida_agricola__; -DROP TABLE vn2008.tipsa__; -DROP TABLE vn2008.rounding__; -DROP TABLE vn2008.Informes__; -DROP TABLE vn2008.Forms__; -DROP TABLE vn2008.Clientes_event__; -DROP TABLE vn2008.wh_selection__; -DROP TABLE vn2008.template_bionic_component__; -DROP TABLE vn2008.Agencias_province__; -DROP TABLE vn2008.travel_pattern__; -DROP TABLE vn2008.sort_merge_results_ernesto__; -DROP TABLE vn2008.Conteo__; -DROP TABLE vn2008.Consignatarios_devices__; -DROP TABLE vn2008.link__; -DROP TABLE vn2008.agency_warehouse__; -DROP TABLE vn2008.warehouse_lc__; -DROP TABLE vn2008.emp_day_pay__; -DROP TABLE vn2008.Entradas_kop__; -DROP TABLE vn2008.dock__; -DROP TABLE vn2008.unaryScanFilter__; -DROP TABLE vn2008.Grupos__; -DROP TABLE vn2008.nichos__; -DROP TABLE vn2008.form_query__; -DROP TABLE vn2008.filtros__; -DROP TABLE vn2008.Objetivos__; -DROP TABLE vn2008.zones__; -DROP TABLE vn2008.rec_translator__; -DROP TABLE vn2008.warehouse_joined__; -DROP TABLE vn2008.warehouse_filtro__; -DROP TABLE vn2008.viaxpress__; -DROP TABLE vn2008.cl_que__; -DROP TABLE vn2008.Recibos_recorded__; -DROP TABLE vn2008.cooler_path__; -DROP TABLE vn2008.payrroll_apEmpresarial__; -DROP TABLE vn2008.Compres_ok__; -DROP TABLE vn2008.Movimientos_avisar__; -DROP TABLE vn2008.Clases__; -DROP TABLE vn2008.payroll_tipobasess__; -DROP TABLE vn2008.guillen_carry__; -DROP TABLE vn2008.unary_scan_line_buy__; -DROP TABLE vn2008.Series__; -DROP TABLE vn2008.Permisos__; -DROP TABLE vn2008.container__; -DROP TABLE vn2008.travel_reserve__; -DROP TABLE vn2008.tmpNEWTARIFAS__; -DROP TABLE vn2008.Clientes_potenciales__; -DROP TABLE vn2008.duaDismissed__; -DROP TABLE vn2008.cl_pet__; -DROP TABLE vn2008.preparation_exception__; -DROP TABLE vn2008.Clientes_empresa__; -DROP TABLE vn2008.call_information__; -DROP TABLE vn2008.template_bionic_price__; -DROP TABLE vn2008.invoice_observation__; -DROP TABLE vn2008.edi_testigos__; -DROP TABLE vn2008.cl_dep__; -DROP TABLE vn2008.agencia_descuadre__; -DROP TABLE vn2008.Monitoring__; -DROP TABLE vn2008.payroll_datos__; -DROP TABLE vn2008.tblIVA__; -DROP TABLE vn2008.cyc__; -DROP TABLE vn2008.Tickets_stack__; -DROP TABLE vn2008.config_host_forms__; -DROP TABLE vn2008.template_bionic_lot__; -DROP TABLE vn2008.payroll_bonificaciones__; -DROP TABLE vn2008.widget__; -DROP TABLE vn2008.accion_dits__; -DROP TABLE vn2008.credit_card__; -DROP TABLE vn2008.Brasa__; -DROP TABLE vn2008.Jefes__; -DROP TABLE vn2008.call_option__; -DROP TABLE vn2008.expeditions_pictures__; -DROP TABLE vn2008.scan__; -DROP TABLE vn2008.trolley__; -DROP TABLE vn2008.transport__; -DROP TABLE vn2008.Baldas__; -DROP TABLE vn2008.payroll_basess__; \ No newline at end of file diff --git a/db/versions/11057-chocolateMoss/00-part.sql b/db/versions/11057-chocolateMoss/00-part.sql new file mode 100644 index 000000000..f58507e4f --- /dev/null +++ b/db/versions/11057-chocolateMoss/00-part.sql @@ -0,0 +1,26 @@ +DROP TABLE IF EXISTS vn2008.scanTree__; +DROP TABLE IF EXISTS vn2008.payroll_embargos__; +DROP TABLE IF EXISTS vn2008.unary_scan_line__; +DROP TABLE IF EXISTS vn2008.unary_source__; +DROP TABLE IF EXISTS vn2008.unary_scan__; +DROP TABLE IF EXISTS vn2008.scan_line__; +DROP TABLE IF EXISTS vn2008.Familias__; +DROP TABLE IF EXISTS vn2008.language__; +DROP TABLE IF EXISTS vn2008.Clientes_dits__; +DROP TABLE IF EXISTS vn2008.unary_scan_line_expedition__; +DROP TABLE IF EXISTS vn2008.warehouse_group__; +DROP TABLE IF EXISTS vn2008.Espionajes__; +DROP TABLE IF EXISTS vn2008.jerarquia__; +DROP TABLE IF EXISTS vn2008.wks__; +DROP TABLE IF EXISTS vn2008.Proveedores_comunicados__; +DROP TABLE IF EXISTS vn2008.integra2_escala__; +DROP TABLE IF EXISTS vn2008.cp__; +DROP TABLE IF EXISTS vn2008.unary__; +DROP TABLE IF EXISTS vn2008.Estados__; +DROP TABLE IF EXISTS vn2008.agency_hour__; +DROP TABLE IF EXISTS vn2008.Reservas__; +DROP TABLE IF EXISTS vn2008.cyc_declaration__; +DROP TABLE IF EXISTS vn2008.route__; +DROP TABLE IF EXISTS vn2008.Proveedores_escritos__; +DROP TABLE IF EXISTS vn2008.config__; +DROP TABLE IF EXISTS vn2008.guillen__; diff --git a/db/versions/11057-chocolateMoss/01-part.sql b/db/versions/11057-chocolateMoss/01-part.sql new file mode 100644 index 000000000..bba2167aa --- /dev/null +++ b/db/versions/11057-chocolateMoss/01-part.sql @@ -0,0 +1,26 @@ +DROP TABLE IF EXISTS vn2008.expeditions_deleted__; +DROP TABLE IF EXISTS vn2008.Tipos_f11__; +DROP TABLE IF EXISTS vn2008.commission__; +DROP TABLE IF EXISTS vn2008.Movimientos_revisar__; +DROP TABLE IF EXISTS vn2008.recibida_agricola__; +DROP TABLE IF EXISTS vn2008.tipsa__; +DROP TABLE IF EXISTS vn2008.rounding__; +DROP TABLE IF EXISTS vn2008.Informes__; +DROP TABLE IF EXISTS vn2008.Forms__; +DROP TABLE IF EXISTS vn2008.Clientes_event__; +DROP TABLE IF EXISTS vn2008.wh_selection__; +DROP TABLE IF EXISTS vn2008.template_bionic_component__; +DROP TABLE IF EXISTS vn2008.Agencias_province__; +DROP TABLE IF EXISTS vn2008.travel_pattern__; +DROP TABLE IF EXISTS vn2008.sort_merge_results_ernesto__; +DROP TABLE IF EXISTS vn2008.Conteo__; +DROP TABLE IF EXISTS vn2008.Consignatarios_devices__; +DROP TABLE IF EXISTS vn2008.link__; +DROP TABLE IF EXISTS vn2008.agency_warehouse__; +DROP TABLE IF EXISTS vn2008.warehouse_lc__; +DROP TABLE IF EXISTS vn2008.emp_day_pay__; +DROP TABLE IF EXISTS vn2008.Entradas_kop__; +DROP TABLE IF EXISTS vn2008.dock__; +DROP TABLE IF EXISTS vn2008.unaryScanFilter__; +DROP TABLE IF EXISTS vn2008.Grupos__; +DROP TABLE IF EXISTS vn2008.nichos__; diff --git a/db/versions/11057-chocolateMoss/02-part.sql b/db/versions/11057-chocolateMoss/02-part.sql new file mode 100644 index 000000000..d3b083775 --- /dev/null +++ b/db/versions/11057-chocolateMoss/02-part.sql @@ -0,0 +1,26 @@ +DROP TABLE IF EXISTS vn2008.form_query__; +DROP TABLE IF EXISTS vn2008.filtros__; +DROP TABLE IF EXISTS vn2008.Objetivos__; +DROP TABLE IF EXISTS vn2008.zones__; +DROP TABLE IF EXISTS vn2008.rec_translator__; +DROP TABLE IF EXISTS vn2008.warehouse_joined__; +DROP TABLE IF EXISTS vn2008.warehouse_filtro__; +DROP TABLE IF EXISTS vn2008.viaxpress__; +DROP TABLE IF EXISTS vn2008.cl_que__; +DROP TABLE IF EXISTS vn2008.Recibos_recorded__; +DROP TABLE IF EXISTS vn2008.cooler_path__; +DROP TABLE IF EXISTS vn2008.payrroll_apEmpresarial__; +DROP TABLE IF EXISTS vn2008.Compres_ok__; +DROP TABLE IF EXISTS vn2008.Movimientos_avisar__; +DROP TABLE IF EXISTS vn2008.Clases__; +DROP TABLE IF EXISTS vn2008.payroll_tipobasess__; +DROP TABLE IF EXISTS vn2008.guillen_carry__; +DROP TABLE IF EXISTS vn2008.unary_scan_line_buy__; +DROP TABLE IF EXISTS vn2008.Series__; +DROP TABLE IF EXISTS vn2008.Permisos__; +DROP TABLE IF EXISTS vn2008.container__; +DROP TABLE IF EXISTS vn2008.travel_reserve__; +DROP TABLE IF EXISTS vn2008.tmpNEWTARIFAS__; +DROP TABLE IF EXISTS vn2008.Clientes_potenciales__; +DROP TABLE IF EXISTS vn2008.duaDismissed__; +DROP TABLE IF EXISTS vn2008.cl_pet__; diff --git a/db/versions/11057-chocolateMoss/03-part.sql b/db/versions/11057-chocolateMoss/03-part.sql new file mode 100644 index 000000000..f5e4e45c0 --- /dev/null +++ b/db/versions/11057-chocolateMoss/03-part.sql @@ -0,0 +1,28 @@ +DROP TABLE IF EXISTS vn2008.preparation_exception__; +DROP TABLE IF EXISTS vn2008.Clientes_empresa__; +DROP TABLE IF EXISTS vn2008.call_information__; +DROP TABLE IF EXISTS vn2008.template_bionic_price__; +DROP TABLE IF EXISTS vn2008.invoice_observation__; +DROP TABLE IF EXISTS vn2008.edi_testigos__; +DROP TABLE IF EXISTS vn2008.cl_dep__; +DROP TABLE IF EXISTS vn2008.agencia_descuadre__; +DROP TABLE IF EXISTS vn2008.Monitoring__; +DROP TABLE IF EXISTS vn2008.payroll_datos__; +DROP TABLE IF EXISTS vn2008.tblIVA__; +DROP TABLE IF EXISTS vn2008.cyc__; +DROP TABLE IF EXISTS vn2008.Tickets_stack__; +DROP TABLE IF EXISTS vn2008.config_host_forms__; +DROP TABLE IF EXISTS vn2008.template_bionic_lot__; +DROP TABLE IF EXISTS vn2008.payroll_bonificaciones__; +DROP TABLE IF EXISTS vn2008.widget__; +DROP TABLE IF EXISTS vn2008.accion_dits__; +DROP TABLE IF EXISTS vn2008.credit_card__; +DROP TABLE IF EXISTS vn2008.Brasa__; +DROP TABLE IF EXISTS vn2008.Jefes__; +DROP TABLE IF EXISTS vn2008.call_option__; +DROP TABLE IF EXISTS vn2008.expeditions_pictures__; +DROP TABLE IF EXISTS vn2008.scan__; +DROP TABLE IF EXISTS vn2008.trolley__; +DROP TABLE IF EXISTS vn2008.transport__; +DROP TABLE IF EXISTS vn2008.Baldas__; +DROP TABLE IF EXISTS vn2008.payroll_basess__; From cc2b5764e97ad30c71d9da163ed4aa1851353580 Mon Sep 17 00:00:00 2001 From: guillermo Date: Tue, 21 May 2024 07:26:54 +0200 Subject: [PATCH 21/42] refs #7422 Fix --- db/versions/11057-chocolateMoss/00-part.sql | 6 ++++-- db/versions/11057-chocolateMoss/02-part.sql | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/db/versions/11057-chocolateMoss/00-part.sql b/db/versions/11057-chocolateMoss/00-part.sql index f58507e4f..09555d0d6 100644 --- a/db/versions/11057-chocolateMoss/00-part.sql +++ b/db/versions/11057-chocolateMoss/00-part.sql @@ -1,8 +1,11 @@ DROP TABLE IF EXISTS vn2008.scanTree__; DROP TABLE IF EXISTS vn2008.payroll_embargos__; -DROP TABLE IF EXISTS vn2008.unary_scan_line__; DROP TABLE IF EXISTS vn2008.unary_source__; +ALTER TABLE vn2008.unary_scan__ DROP FOREIGN KEY unary_scan; +ALTER TABLE vn2008.unary_scan_line__ DROP FOREIGN KEY unary_line; DROP TABLE IF EXISTS vn2008.unary_scan__; +DROP TABLE IF EXISTS vn2008.unary_scan_line_buy__; +DROP TABLE IF EXISTS vn2008.unary_scan_line__; DROP TABLE IF EXISTS vn2008.scan_line__; DROP TABLE IF EXISTS vn2008.Familias__; DROP TABLE IF EXISTS vn2008.language__; @@ -23,4 +26,3 @@ DROP TABLE IF EXISTS vn2008.cyc_declaration__; DROP TABLE IF EXISTS vn2008.route__; DROP TABLE IF EXISTS vn2008.Proveedores_escritos__; DROP TABLE IF EXISTS vn2008.config__; -DROP TABLE IF EXISTS vn2008.guillen__; diff --git a/db/versions/11057-chocolateMoss/02-part.sql b/db/versions/11057-chocolateMoss/02-part.sql index d3b083775..dbdd6b3c4 100644 --- a/db/versions/11057-chocolateMoss/02-part.sql +++ b/db/versions/11057-chocolateMoss/02-part.sql @@ -14,8 +14,8 @@ DROP TABLE IF EXISTS vn2008.Compres_ok__; DROP TABLE IF EXISTS vn2008.Movimientos_avisar__; DROP TABLE IF EXISTS vn2008.Clases__; DROP TABLE IF EXISTS vn2008.payroll_tipobasess__; +DROP TABLE IF EXISTS vn2008.guillen__; DROP TABLE IF EXISTS vn2008.guillen_carry__; -DROP TABLE IF EXISTS vn2008.unary_scan_line_buy__; DROP TABLE IF EXISTS vn2008.Series__; DROP TABLE IF EXISTS vn2008.Permisos__; DROP TABLE IF EXISTS vn2008.container__; From 93314d67b62ae342db55826a4a6aaf06dbd6fc2f Mon Sep 17 00:00:00 2001 From: guillermo Date: Tue, 21 May 2024 07:31:24 +0200 Subject: [PATCH 22/42] refs #7422 Fix --- db/versions/11057-chocolateMoss/00-part.sql | 2 -- 1 file changed, 2 deletions(-) diff --git a/db/versions/11057-chocolateMoss/00-part.sql b/db/versions/11057-chocolateMoss/00-part.sql index 09555d0d6..4cabb0e33 100644 --- a/db/versions/11057-chocolateMoss/00-part.sql +++ b/db/versions/11057-chocolateMoss/00-part.sql @@ -1,8 +1,6 @@ DROP TABLE IF EXISTS vn2008.scanTree__; DROP TABLE IF EXISTS vn2008.payroll_embargos__; DROP TABLE IF EXISTS vn2008.unary_source__; -ALTER TABLE vn2008.unary_scan__ DROP FOREIGN KEY unary_scan; -ALTER TABLE vn2008.unary_scan_line__ DROP FOREIGN KEY unary_line; DROP TABLE IF EXISTS vn2008.unary_scan__; DROP TABLE IF EXISTS vn2008.unary_scan_line_buy__; DROP TABLE IF EXISTS vn2008.unary_scan_line__; From cbf9a4c4e902a452d24b74bda85a78af08748761 Mon Sep 17 00:00:00 2001 From: guillermo Date: Tue, 21 May 2024 07:58:51 +0200 Subject: [PATCH 23/42] refs #7422 Fixed all problems --- db/versions/11057-chocolateMoss/01-part.sql | 67 +++++++++++++-------- db/versions/11057-chocolateMoss/02-part.sql | 53 ++++++++-------- db/versions/11057-chocolateMoss/03-part.sql | 2 - 3 files changed, 68 insertions(+), 54 deletions(-) diff --git a/db/versions/11057-chocolateMoss/01-part.sql b/db/versions/11057-chocolateMoss/01-part.sql index bba2167aa..db6a5774d 100644 --- a/db/versions/11057-chocolateMoss/01-part.sql +++ b/db/versions/11057-chocolateMoss/01-part.sql @@ -1,26 +1,41 @@ -DROP TABLE IF EXISTS vn2008.expeditions_deleted__; -DROP TABLE IF EXISTS vn2008.Tipos_f11__; -DROP TABLE IF EXISTS vn2008.commission__; -DROP TABLE IF EXISTS vn2008.Movimientos_revisar__; -DROP TABLE IF EXISTS vn2008.recibida_agricola__; -DROP TABLE IF EXISTS vn2008.tipsa__; -DROP TABLE IF EXISTS vn2008.rounding__; -DROP TABLE IF EXISTS vn2008.Informes__; -DROP TABLE IF EXISTS vn2008.Forms__; -DROP TABLE IF EXISTS vn2008.Clientes_event__; -DROP TABLE IF EXISTS vn2008.wh_selection__; -DROP TABLE IF EXISTS vn2008.template_bionic_component__; -DROP TABLE IF EXISTS vn2008.Agencias_province__; -DROP TABLE IF EXISTS vn2008.travel_pattern__; -DROP TABLE IF EXISTS vn2008.sort_merge_results_ernesto__; -DROP TABLE IF EXISTS vn2008.Conteo__; -DROP TABLE IF EXISTS vn2008.Consignatarios_devices__; -DROP TABLE IF EXISTS vn2008.link__; -DROP TABLE IF EXISTS vn2008.agency_warehouse__; -DROP TABLE IF EXISTS vn2008.warehouse_lc__; -DROP TABLE IF EXISTS vn2008.emp_day_pay__; -DROP TABLE IF EXISTS vn2008.Entradas_kop__; -DROP TABLE IF EXISTS vn2008.dock__; -DROP TABLE IF EXISTS vn2008.unaryScanFilter__; -DROP TABLE IF EXISTS vn2008.Grupos__; -DROP TABLE IF EXISTS vn2008.nichos__; +DROP TABLE IF EXISTS vn2008.form_query__; +DROP TABLE IF EXISTS vn2008.filtros__; +DROP TABLE IF EXISTS vn2008.Objetivos__; +UPDATE IGNORE vn.province + SET zoneFk = NULL + WHERE zoneFk IN ( + SELECT zoneFk + FROM vn.province + WHERE zoneFk IS NOT NULL AND zoneFk NOT IN (SELECT id FROM vn.`zone`) + ); +ALTER TABLE vn.province DROP FOREIGN KEY province_zone_fk; +ALTER TABLE vn.province MODIFY COLUMN zoneFk int(11) DEFAULT NULL NULL; +ALTER TABLE vn.province ADD CONSTRAINT + province_zone_FK FOREIGN KEY (zoneFk) REFERENCES vn.`zone`(id) ON DELETE CASCADE ON UPDATE CASCADE; +DROP TABLE IF EXISTS vn2008.zones__; +DROP TABLE IF EXISTS vn2008.rec_translator__; +DROP TABLE IF EXISTS vn2008.warehouse_joined__; +DROP TABLE IF EXISTS vn2008.warehouse_filtro__; +DROP TABLE IF EXISTS vn2008.viaxpress__; +DROP TABLE IF EXISTS vn2008.cl_que__; +DROP TABLE IF EXISTS vn2008.Recibos_recorded__; +RENAME TABLE vn.coolerPathDetail TO vn.coolerPathDetail__; +ALTER TABLE vn.coolerPathDetail DROP FOREIGN KEY coolerPathDetail_FK; +DROP TABLE IF EXISTS vn2008.cooler_path__; +DROP TABLE IF EXISTS vn2008.payrroll_apEmpresarial__; +DROP TABLE IF EXISTS vn2008.Compres_ok__; +DROP TABLE IF EXISTS vn2008.Movimientos_avisar__; +DROP TABLE IF EXISTS vn2008.Clases__; +DROP TABLE IF EXISTS vn2008.payroll_basess__; +DROP TABLE IF EXISTS vn2008.payroll_tipobasess__; +DROP TABLE IF EXISTS vn2008.guillen__; +DROP TABLE IF EXISTS vn2008.guillen_carry__; +DROP TABLE IF EXISTS vn2008.Series__; +DROP TABLE IF EXISTS vn2008.Permisos__; +ALTER TABLE vn.buy DROP FOREIGN KEY buy_FK_1; +DROP TABLE IF EXISTS vn2008.container__; +DROP TABLE IF EXISTS vn2008.travel_reserve__; +DROP TABLE IF EXISTS vn2008.tmpNEWTARIFAS__; +DROP TABLE IF EXISTS vn2008.Clientes_potenciales__; +DROP TABLE IF EXISTS vn2008.duaDismissed__; +DROP TABLE IF EXISTS vn2008.cl_pet__; diff --git a/db/versions/11057-chocolateMoss/02-part.sql b/db/versions/11057-chocolateMoss/02-part.sql index dbdd6b3c4..46cda539a 100644 --- a/db/versions/11057-chocolateMoss/02-part.sql +++ b/db/versions/11057-chocolateMoss/02-part.sql @@ -1,26 +1,27 @@ -DROP TABLE IF EXISTS vn2008.form_query__; -DROP TABLE IF EXISTS vn2008.filtros__; -DROP TABLE IF EXISTS vn2008.Objetivos__; -DROP TABLE IF EXISTS vn2008.zones__; -DROP TABLE IF EXISTS vn2008.rec_translator__; -DROP TABLE IF EXISTS vn2008.warehouse_joined__; -DROP TABLE IF EXISTS vn2008.warehouse_filtro__; -DROP TABLE IF EXISTS vn2008.viaxpress__; -DROP TABLE IF EXISTS vn2008.cl_que__; -DROP TABLE IF EXISTS vn2008.Recibos_recorded__; -DROP TABLE IF EXISTS vn2008.cooler_path__; -DROP TABLE IF EXISTS vn2008.payrroll_apEmpresarial__; -DROP TABLE IF EXISTS vn2008.Compres_ok__; -DROP TABLE IF EXISTS vn2008.Movimientos_avisar__; -DROP TABLE IF EXISTS vn2008.Clases__; -DROP TABLE IF EXISTS vn2008.payroll_tipobasess__; -DROP TABLE IF EXISTS vn2008.guillen__; -DROP TABLE IF EXISTS vn2008.guillen_carry__; -DROP TABLE IF EXISTS vn2008.Series__; -DROP TABLE IF EXISTS vn2008.Permisos__; -DROP TABLE IF EXISTS vn2008.container__; -DROP TABLE IF EXISTS vn2008.travel_reserve__; -DROP TABLE IF EXISTS vn2008.tmpNEWTARIFAS__; -DROP TABLE IF EXISTS vn2008.Clientes_potenciales__; -DROP TABLE IF EXISTS vn2008.duaDismissed__; -DROP TABLE IF EXISTS vn2008.cl_pet__; +DROP TABLE IF EXISTS vn2008.expeditions_deleted__; +DROP TABLE IF EXISTS vn2008.Tipos_f11__; +DROP TABLE IF EXISTS vn2008.commission__; +DROP TABLE IF EXISTS vn2008.Movimientos_revisar__; +DROP TABLE IF EXISTS vn2008.recibida_agricola__; +DROP TABLE IF EXISTS vn2008.tipsa__; +DROP TABLE IF EXISTS vn2008.rounding__; +DROP TABLE IF EXISTS vn2008.Informes__; +DROP TABLE IF EXISTS vn2008.Monitoring__; +DROP TABLE IF EXISTS vn2008.Forms__; +DROP TABLE IF EXISTS vn2008.Clientes_event__; +DROP TABLE IF EXISTS vn2008.wh_selection__; +DROP TABLE IF EXISTS vn2008.template_bionic_component__; +DROP TABLE IF EXISTS vn2008.Agencias_province__; +DROP TABLE IF EXISTS vn2008.travel_pattern__; +DROP TABLE IF EXISTS vn2008.sort_merge_results_ernesto__; +DROP TABLE IF EXISTS vn2008.Conteo__; +DROP TABLE IF EXISTS vn2008.Consignatarios_devices__; +DROP TABLE IF EXISTS vn2008.link__; +DROP TABLE IF EXISTS vn2008.agency_warehouse__; +DROP TABLE IF EXISTS vn2008.warehouse_lc__; +DROP TABLE IF EXISTS vn2008.emp_day_pay__; +DROP TABLE IF EXISTS vn2008.Entradas_kop__; +DROP TABLE IF EXISTS vn2008.dock__; +DROP TABLE IF EXISTS vn2008.unaryScanFilter__; +DROP TABLE IF EXISTS vn2008.Grupos__; +DROP TABLE IF EXISTS vn2008.nichos__; diff --git a/db/versions/11057-chocolateMoss/03-part.sql b/db/versions/11057-chocolateMoss/03-part.sql index f5e4e45c0..e1947f064 100644 --- a/db/versions/11057-chocolateMoss/03-part.sql +++ b/db/versions/11057-chocolateMoss/03-part.sql @@ -6,7 +6,6 @@ DROP TABLE IF EXISTS vn2008.invoice_observation__; DROP TABLE IF EXISTS vn2008.edi_testigos__; DROP TABLE IF EXISTS vn2008.cl_dep__; DROP TABLE IF EXISTS vn2008.agencia_descuadre__; -DROP TABLE IF EXISTS vn2008.Monitoring__; DROP TABLE IF EXISTS vn2008.payroll_datos__; DROP TABLE IF EXISTS vn2008.tblIVA__; DROP TABLE IF EXISTS vn2008.cyc__; @@ -25,4 +24,3 @@ DROP TABLE IF EXISTS vn2008.scan__; DROP TABLE IF EXISTS vn2008.trolley__; DROP TABLE IF EXISTS vn2008.transport__; DROP TABLE IF EXISTS vn2008.Baldas__; -DROP TABLE IF EXISTS vn2008.payroll_basess__; From ac2ed0956b94cc6c2b010c67b69d6dd8fb2a4c34 Mon Sep 17 00:00:00 2001 From: guillermo Date: Tue, 21 May 2024 08:04:28 +0200 Subject: [PATCH 24/42] refs #7422 Fixed all problems --- db/versions/11057-chocolateMoss/01-part.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/versions/11057-chocolateMoss/01-part.sql b/db/versions/11057-chocolateMoss/01-part.sql index db6a5774d..59df77f20 100644 --- a/db/versions/11057-chocolateMoss/01-part.sql +++ b/db/versions/11057-chocolateMoss/01-part.sql @@ -20,7 +20,7 @@ DROP TABLE IF EXISTS vn2008.viaxpress__; DROP TABLE IF EXISTS vn2008.cl_que__; DROP TABLE IF EXISTS vn2008.Recibos_recorded__; RENAME TABLE vn.coolerPathDetail TO vn.coolerPathDetail__; -ALTER TABLE vn.coolerPathDetail DROP FOREIGN KEY coolerPathDetail_FK; +ALTER TABLE vn.coolerPathDetail__ DROP FOREIGN KEY coolerPathDetail_FK; DROP TABLE IF EXISTS vn2008.cooler_path__; DROP TABLE IF EXISTS vn2008.payrroll_apEmpresarial__; DROP TABLE IF EXISTS vn2008.Compres_ok__; From 030106f06d653263a0331642a057a75e5c9880cc Mon Sep 17 00:00:00 2001 From: guillermo Date: Tue, 21 May 2024 08:13:06 +0200 Subject: [PATCH 25/42] refactor: refs #7422 Deprecated column --- db/versions/11061-silverMastic/00-firstScript.sql | 1 + 1 file changed, 1 insertion(+) create mode 100644 db/versions/11061-silverMastic/00-firstScript.sql diff --git a/db/versions/11061-silverMastic/00-firstScript.sql b/db/versions/11061-silverMastic/00-firstScript.sql new file mode 100644 index 000000000..32dbc0c2e --- /dev/null +++ b/db/versions/11061-silverMastic/00-firstScript.sql @@ -0,0 +1 @@ +ALTER TABLE vn.buy CHANGE containerFk containerFk__ smallint(5) unsigned DEFAULT NULL NULL; From c4b8cef4f8697eb8f6dc5178b2c14c940e5923d6 Mon Sep 17 00:00:00 2001 From: guillermo Date: Tue, 21 May 2024 08:17:37 +0200 Subject: [PATCH 26/42] refactor: refs #7422 Deleted column of Compres --- db/routines/vn2008/views/Compres.sql | 1 - 1 file changed, 1 deletion(-) diff --git a/db/routines/vn2008/views/Compres.sql b/db/routines/vn2008/views/Compres.sql index 557136192..b99dd2b73 100644 --- a/db/routines/vn2008/views/Compres.sql +++ b/db/routines/vn2008/views/Compres.sql @@ -28,6 +28,5 @@ AS SELECT `c`.`id` AS `Id_Compra`, `c`.`workerFk` AS `Id_Trabajador`, `c`.`weight` AS `weight`, `c`.`dispatched` AS `dispatched`, - `c`.`containerFk` AS `container_id`, `c`.`itemOriginalFk` AS `itemOriginalFk` FROM `vn`.`buy` `c` From 1fef00789f5636c4839a074a87f4c1664bb627bb Mon Sep 17 00:00:00 2001 From: pablone Date: Tue, 21 May 2024 08:54:53 +0200 Subject: [PATCH 27/42] fix: refs #7187 remove bindings --- modules/worker/front/pda/index.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/modules/worker/front/pda/index.js b/modules/worker/front/pda/index.js index 099e0e34c..c3616b41e 100644 --- a/modules/worker/front/pda/index.js +++ b/modules/worker/front/pda/index.js @@ -14,8 +14,5 @@ class Controller extends Section { } ngModule.vnComponent('vnWorkerPda', { - controller: Controller, - bindings: { - claim: '<' - } + controller: Controller }); From 6438ce3a164464c92156b348cf9468b63007d23c Mon Sep 17 00:00:00 2001 From: pablone Date: Tue, 21 May 2024 09:13:31 +0200 Subject: [PATCH 28/42] fix: refs #7187 e2e --- e2e/paths/03-worker/07_pda.spec.js | 41 ------------------------------ 1 file changed, 41 deletions(-) delete mode 100644 e2e/paths/03-worker/07_pda.spec.js diff --git a/e2e/paths/03-worker/07_pda.spec.js b/e2e/paths/03-worker/07_pda.spec.js deleted file mode 100644 index 2b743823e..000000000 --- a/e2e/paths/03-worker/07_pda.spec.js +++ /dev/null @@ -1,41 +0,0 @@ -import selectors from '../../helpers/selectors.js'; -import getBrowser from '../../helpers/puppeteer'; - -describe('Worker pda path', () => { - let browser; - let page; - beforeAll(async() => { - browser = await getBrowser(); - page = browser.page; - await page.loginAndModule('hr', 'worker'); - await page.accessToSearchResult('employeeNick'); - await page.accessToSection('worker.card.pda'); - }); - - afterAll(async() => { - await browser.close(); - }); - - it('should check if worker has already a PDA allocated', async() => { - expect(await page.waitToGetProperty(selectors.workerPda.currentPDA, 'value')).toContain('serialNumber1'); - }); - - it('should deallocate the PDA', async() => { - await page.waitToClick(selectors.workerPda.delete); - let message = await page.waitForSnackbar(); - - expect(message.text).toContain('PDA deallocated'); - }); - - it('should allocate a new PDA', async() => { - await page.autocompleteSearch(selectors.workerPda.newPDA, 'serialNumber2'); - await page.waitToClick(selectors.workerPda.submit); - let message = await page.waitForSnackbar(); - - expect(message.text).toContain('PDA allocated'); - }); - - it('should check if a new PDA has been allocated', async() => { - expect(await page.waitToGetProperty(selectors.workerPda.currentPDA, 'value')).toContain('serialNumber2'); - }); -}); From cb866b4ab77992af7e2a0b5ba5a3fa0b0f8fc1cb Mon Sep 17 00:00:00 2001 From: sergiodt Date: Tue, 21 May 2024 09:16:47 +0200 Subject: [PATCH 29/42] refs #7431 feat: itemPlacementSupplyStockGetTargetList --- .../procedures/itemPlacementSupplyStockGetTargetList.sql | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/db/routines/vn/procedures/itemPlacementSupplyStockGetTargetList.sql b/db/routines/vn/procedures/itemPlacementSupplyStockGetTargetList.sql index bdc13ae9d..0a99703f3 100644 --- a/db/routines/vn/procedures/itemPlacementSupplyStockGetTargetList.sql +++ b/db/routines/vn/procedures/itemPlacementSupplyStockGetTargetList.sql @@ -18,11 +18,12 @@ BEGIN JOIN vn.parking p ON p.id = sh.parkingFk JOIN vn.sector sc ON sc.id = p.sectorFk JOIN vn.warehouse w ON w.id = sc.warehouseFk - WHERE sc.id = vSectorFk - AND ish.visible > 0 + WHERE ish.visible > 0 AND ish.itemFk = vItemFk GROUP BY ish.id - ORDER BY sh.priority DESC, + ORDER BY + (sc.id = vSectorFk) DESC + sh.priority DESC, ish.created, p.pickingOrder; END$$ From 6dad3d8af4fb9dea158e2d01626c213e7a7cc9ed Mon Sep 17 00:00:00 2001 From: sergiodt Date: Tue, 21 May 2024 09:37:29 +0200 Subject: [PATCH 30/42] refs #7431 feat: itemPlacementSupplyStockGetTargetList --- .../vn/procedures/itemPlacementSupplyStockGetTargetList.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/routines/vn/procedures/itemPlacementSupplyStockGetTargetList.sql b/db/routines/vn/procedures/itemPlacementSupplyStockGetTargetList.sql index 0a99703f3..86d62cad4 100644 --- a/db/routines/vn/procedures/itemPlacementSupplyStockGetTargetList.sql +++ b/db/routines/vn/procedures/itemPlacementSupplyStockGetTargetList.sql @@ -22,7 +22,7 @@ BEGIN AND ish.itemFk = vItemFk GROUP BY ish.id ORDER BY - (sc.id = vSectorFk) DESC + (sc.id = vSectorFk) DESC, sh.priority DESC, ish.created, p.pickingOrder; From 6f9826421d1b07abcd4db09567f60879c792f077 Mon Sep 17 00:00:00 2001 From: guillermo Date: Tue, 21 May 2024 09:39:09 +0200 Subject: [PATCH 31/42] refactor: refs #7422 Fix e2e --- db/routines/vn/procedures/buy_clone.sql | 2 -- db/routines/vn/procedures/entry_fixMisfit.sql | 2 -- db/routines/vn/procedures/entry_moveNotPrinted.sql | 4 ---- db/routines/vn/procedures/entry_splitByShelving.sql | 2 -- db/routines/vn/procedures/item_devalueA2.sql | 3 --- modules/entry/back/methods/entry/addFromBuy.js | 1 - modules/entry/back/models/buy.json | 3 --- 7 files changed, 17 deletions(-) diff --git a/db/routines/vn/procedures/buy_clone.sql b/db/routines/vn/procedures/buy_clone.sql index d3fbf888d..7b77204c9 100644 --- a/db/routines/vn/procedures/buy_clone.sql +++ b/db/routines/vn/procedures/buy_clone.sql @@ -19,7 +19,6 @@ BEGIN packing, `grouping`, groupingMode, - containerFk, comissionValue, packageValue, price1, @@ -41,7 +40,6 @@ BEGIN b.packing, b.`grouping`, b.groupingMode, - b.containerFk, b.comissionValue, b.packageValue, b.price1, diff --git a/db/routines/vn/procedures/entry_fixMisfit.sql b/db/routines/vn/procedures/entry_fixMisfit.sql index 3e57d362e..986a0ae9e 100644 --- a/db/routines/vn/procedures/entry_fixMisfit.sql +++ b/db/routines/vn/procedures/entry_fixMisfit.sql @@ -26,7 +26,6 @@ BEGIN packing, `grouping`, groupingMode, - containerFk, comissionValue, packageValue, location, @@ -46,7 +45,6 @@ BEGIN packing, `grouping`, groupingMode, - containerFk, comissionValue, packageValue, location, diff --git a/db/routines/vn/procedures/entry_moveNotPrinted.sql b/db/routines/vn/procedures/entry_moveNotPrinted.sql index 526ae9d43..3a12007d1 100644 --- a/db/routines/vn/procedures/entry_moveNotPrinted.sql +++ b/db/routines/vn/procedures/entry_moveNotPrinted.sql @@ -56,7 +56,6 @@ BEGIN packing, `grouping`, groupingMode, - containerFk, comissionValue, packageValue, packagingFk, @@ -77,7 +76,6 @@ BEGIN packing, `grouping`, groupingMode, - containerFk, comissionValue, packageValue, packagingFk, @@ -114,7 +112,6 @@ BEGIN packing, `grouping`, groupingMode, - containerFk, comissionValue, packageValue, location, @@ -133,7 +130,6 @@ BEGIN packing, `grouping`, groupingMode, - containerFk, comissionValue, packageValue, location, diff --git a/db/routines/vn/procedures/entry_splitByShelving.sql b/db/routines/vn/procedures/entry_splitByShelving.sql index b7d9c77b3..2898141ea 100644 --- a/db/routines/vn/procedures/entry_splitByShelving.sql +++ b/db/routines/vn/procedures/entry_splitByShelving.sql @@ -76,7 +76,6 @@ BEGIN packing, `grouping`, groupingMode, - containerFk, comissionValue, packageValue, location, @@ -103,7 +102,6 @@ BEGIN packing, `grouping`, groupingMode, - containerFk, comissionValue, packageValue, location, diff --git a/db/routines/vn/procedures/item_devalueA2.sql b/db/routines/vn/procedures/item_devalueA2.sql index f331c7230..c9f716d8f 100644 --- a/db/routines/vn/procedures/item_devalueA2.sql +++ b/db/routines/vn/procedures/item_devalueA2.sql @@ -319,7 +319,6 @@ BEGIN packing, `grouping`, groupingMode, - containerFk, comissionValue, packageValue, price1, @@ -341,7 +340,6 @@ BEGIN packing, `grouping`, groupingMode, - containerFk, comissionValue, packageValue, price1, @@ -366,7 +364,6 @@ BEGIN packing, `grouping`, groupingMode, - containerFk, comissionValue, packageValue, price1, diff --git a/modules/entry/back/methods/entry/addFromBuy.js b/modules/entry/back/methods/entry/addFromBuy.js index 307c04b97..e5cc427a8 100644 --- a/modules/entry/back/methods/entry/addFromBuy.js +++ b/modules/entry/back/methods/entry/addFromBuy.js @@ -76,7 +76,6 @@ module.exports = Self => { packing: buyUltimate.packing, grouping: buyUltimate.grouping, groupingMode: buyUltimate.groupingMode, - containerFk: buyUltimate.containerFk, comissionValue: buyUltimate.comissionValue, packageValue: buyUltimate.packageValue, location: buyUltimate.location, diff --git a/modules/entry/back/models/buy.json b/modules/entry/back/models/buy.json index 35861fd81..14cafde06 100644 --- a/modules/entry/back/models/buy.json +++ b/modules/entry/back/models/buy.json @@ -63,9 +63,6 @@ "isIgnored": { "type": "boolean" }, - "containerFk": { - "type": "number" - }, "location": { "type": "number" }, From 35e892a90c1d8dbba89f3501ad8e65e443aec69f Mon Sep 17 00:00:00 2001 From: guillermo Date: Tue, 21 May 2024 10:07:51 +0200 Subject: [PATCH 32/42] refs #7422 Fix --- db/.pullinfo.json | 2 +- db/versions/11057-chocolateMoss/00-part.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/db/.pullinfo.json b/db/.pullinfo.json index f4afbc5fb..0defed845 100644 --- a/db/.pullinfo.json +++ b/db/.pullinfo.json @@ -9,7 +9,7 @@ }, "vn": { "view": { - "expeditionPallet_Print": "288cbd6e8289df083ed5eb1a2c808f7a82ba4c90c8ad9781104808a7a54471fb" + "expeditionPallet_Print": "06613719475fcdba8309607c38cc78efc2e348cca7bc96b48dc3ae3c12426f54" } } } diff --git a/db/versions/11057-chocolateMoss/00-part.sql b/db/versions/11057-chocolateMoss/00-part.sql index 4cabb0e33..bd6c69955 100644 --- a/db/versions/11057-chocolateMoss/00-part.sql +++ b/db/versions/11057-chocolateMoss/00-part.sql @@ -1,9 +1,9 @@ DROP TABLE IF EXISTS vn2008.scanTree__; DROP TABLE IF EXISTS vn2008.payroll_embargos__; DROP TABLE IF EXISTS vn2008.unary_source__; -DROP TABLE IF EXISTS vn2008.unary_scan__; DROP TABLE IF EXISTS vn2008.unary_scan_line_buy__; DROP TABLE IF EXISTS vn2008.unary_scan_line__; +DROP TABLE IF EXISTS vn2008.unary_scan__; DROP TABLE IF EXISTS vn2008.scan_line__; DROP TABLE IF EXISTS vn2008.Familias__; DROP TABLE IF EXISTS vn2008.language__; From da75bf95c99b50462b5e12a559233771afb44907 Mon Sep 17 00:00:00 2001 From: alexm Date: Tue, 21 May 2024 11:16:12 +0200 Subject: [PATCH 33/42] deploy: init version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 390b61be1..c2f630974 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "salix-back", - "version": "24.22.0", + "version": "24.24.0", "author": "Verdnatura Levante SL", "description": "Salix backend", "license": "GPL-3.0", From d672385776020c1a97236e15880f27260012f0b9 Mon Sep 17 00:00:00 2001 From: guillermo Date: Tue, 21 May 2024 11:44:11 +0200 Subject: [PATCH 34/42] =?UTF-8?q?hotfix:=20Rectificaci=C3=B3n=20Pepe?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/ticket/back/methods/ticket/closeAll.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/ticket/back/methods/ticket/closeAll.js b/modules/ticket/back/methods/ticket/closeAll.js index e3cbc83e2..35b9b1e37 100644 --- a/modules/ticket/back/methods/ticket/closeAll.js +++ b/modules/ticket/back/methods/ticket/closeAll.js @@ -138,9 +138,12 @@ module.exports = Self => { JOIN alertLevel al ON al.id = ts.alertLevel JOIN agencyMode am ON am.id = t.agencyModeFk JOIN deliveryMethod dm ON dm.id = am.deliveryMethodFk + LEFT JOIN ticketObservation tob ON tob.ticketFk = t.id SET t.routeFk = NULL WHERE DATE(t.shipped) BETWEEN ? - INTERVAL 2 DAY AND util.dayEnd(?) AND al.code NOT IN ('DELIVERED', 'PACKED') + AND NOT t.packages + AND tob.id IS NULL AND t.routeFk`, [toDate, toDate], {userId: ctx.req.accessToken.userId}); return { From dfde2f684650e045bde67d6617a94a071f901bd9 Mon Sep 17 00:00:00 2001 From: Pako Date: Tue, 21 May 2024 13:28:05 +0200 Subject: [PATCH 35/42] evita facturacion proveedores --- db/routines/vn/procedures/ticketPackaging_add.sql | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/db/routines/vn/procedures/ticketPackaging_add.sql b/db/routines/vn/procedures/ticketPackaging_add.sql index d669b95f5..f96068b56 100644 --- a/db/routines/vn/procedures/ticketPackaging_add.sql +++ b/db/routines/vn/procedures/ticketPackaging_add.sql @@ -27,7 +27,10 @@ BEGIN SELECT DISTINCT clientFk FROM ( SELECT clientFk, SUM(quantity) totalQuantity - FROM tmp.packagingToInvoice + FROM tmp.packagingToInvoice tpi + JOIN client c ON c.id = tpi.clientFk + LEFT JOIN supplier s ON s.nif = c.fi + WHERE s.id IS NULL GROUP BY itemFk, clientFk HAVING totalQuantity > 0)sub; From 18bb8a4ea558fc1a722bcd9b18c2a792ee1a63f1 Mon Sep 17 00:00:00 2001 From: alexm Date: Tue, 21 May 2024 13:50:45 +0200 Subject: [PATCH 36/42] fix: checking process.env.NODE_ENV --- back/methods/chat/sendCheckingPresence.js | 2 +- back/methods/chat/sendQueued.js | 4 ++-- back/methods/dms/deleteTrashFiles.js | 2 +- back/methods/docuware/upload.js | 2 +- back/methods/image/scrub.js | 3 +-- back/methods/image/upload.js | 2 +- back/methods/notification/send.js | 2 +- loopback/common/methods/application/isProduction.js | 3 +++ loopback/common/models/application.js | 5 +++++ modules/account/back/models/ldap-config.js | 3 ++- modules/account/back/models/samba-config.js | 3 ++- modules/client/back/methods/sms/send.js | 2 +- modules/invoiceOut/back/methods/invoiceOut/download.js | 2 +- modules/invoiceOut/back/models/invoice-out.js | 2 +- modules/mdb/back/methods/mdbVersion/upload.js | 2 +- 15 files changed, 24 insertions(+), 15 deletions(-) create mode 100644 loopback/common/methods/application/isProduction.js diff --git a/back/methods/chat/sendCheckingPresence.js b/back/methods/chat/sendCheckingPresence.js index 85b66e94b..12cadec04 100644 --- a/back/methods/chat/sendCheckingPresence.js +++ b/back/methods/chat/sendCheckingPresence.js @@ -37,7 +37,7 @@ module.exports = Self => { if (!recipient) throw new Error(`Could not send message "${message}" to worker id ${recipientId} from user ${userId}`); - if (process.env.NODE_ENV == 'test') + if (!Self.app.models.Application.isProduction()) message = `[Test:Environment to user ${userId}] ` + message; const chat = await models.Chat.create({ diff --git a/back/methods/chat/sendQueued.js b/back/methods/chat/sendQueued.js index 9a23af379..1ab4cb6e0 100644 --- a/back/methods/chat/sendQueued.js +++ b/back/methods/chat/sendQueued.js @@ -94,7 +94,7 @@ module.exports = Self => { * @return {Promise} - The request promise */ Self.sendMessage = async function sendMessage(senderFk, recipient, message) { - if (process.env.NODE_ENV !== 'production') { + if (!Self.app.models.Application.isProduction()) { return new Promise(resolve => { return resolve({ statusCode: 200, @@ -149,7 +149,7 @@ module.exports = Self => { * @return {Promise} - The request promise */ Self.getUserStatus = async function getUserStatus(username) { - if (process.env.NODE_ENV !== 'production') { + if (!Self.app.models.Application.isProduction()) { return new Promise(resolve => { return resolve({ data: { diff --git a/back/methods/dms/deleteTrashFiles.js b/back/methods/dms/deleteTrashFiles.js index 239d654ef..77e33929a 100644 --- a/back/methods/dms/deleteTrashFiles.js +++ b/back/methods/dms/deleteTrashFiles.js @@ -22,7 +22,7 @@ module.exports = Self => { if (typeof options == 'object') Object.assign(myOptions, options); - if (process.env.NODE_ENV == 'test') + if (!Self.app.models.Application.isProduction()) throw new UserError(`Action not allowed on the test environment`); const models = Self.app.models; diff --git a/back/methods/docuware/upload.js b/back/methods/docuware/upload.js index 27be72295..ae3989def 100644 --- a/back/methods/docuware/upload.js +++ b/back/methods/docuware/upload.js @@ -119,7 +119,7 @@ module.exports = Self => { ] }; - if (process.env.NODE_ENV != 'production') + if (!Self.app.models.Application.isProduction(false)) throw new UserError('Action not allowed on the test environment'); // delete old diff --git a/back/methods/image/scrub.js b/back/methods/image/scrub.js index 99c6bcbf3..4af2d8d49 100644 --- a/back/methods/image/scrub.js +++ b/back/methods/image/scrub.js @@ -43,8 +43,7 @@ module.exports = Self => { Self.scrub = async function(collection, remove, limit, dryRun, skipLock) { const $ = Self.app.models; - const env = process.env.NODE_ENV; - dryRun = dryRun || (env && env !== 'production'); + dryRun = dryRun || !Self.app.models.Application.isProduction(false); const instance = await $.ImageCollection.findOne({ fields: ['id'], diff --git a/back/methods/image/upload.js b/back/methods/image/upload.js index 51da327f6..81d9759e6 100644 --- a/back/methods/image/upload.js +++ b/back/methods/image/upload.js @@ -41,7 +41,7 @@ module.exports = Self => { if (!hasWriteRole) throw new UserError(`You don't have enough privileges`); - if (process.env.NODE_ENV == 'test') + if (!Self.app.models.Application.isProduction()) throw new UserError(`Action not allowed on the test environment`); // Upload file to temporary path diff --git a/back/methods/notification/send.js b/back/methods/notification/send.js index b2748477d..4f8f436da 100644 --- a/back/methods/notification/send.js +++ b/back/methods/notification/send.js @@ -70,7 +70,7 @@ module.exports = Self => { const newParams = Object.assign({}, queueParams, sendParams); const email = new Email(queueName, newParams); - if (process.env.NODE_ENV != 'test') + if (Self.app.models.Application.isProduction()) await email.send(); await queue.updateAttribute('status', statusSent); diff --git a/loopback/common/methods/application/isProduction.js b/loopback/common/methods/application/isProduction.js new file mode 100644 index 000000000..9479b67af --- /dev/null +++ b/loopback/common/methods/application/isProduction.js @@ -0,0 +1,3 @@ +module.exports = (localAsProduction = true) => { + if ((!process.env.NODE_ENV && localAsProduction) || process.env.NODE_ENV == 'production') return true; +}; diff --git a/loopback/common/models/application.js b/loopback/common/models/application.js index 6bdc2c13a..70db17de2 100644 --- a/loopback/common/models/application.js +++ b/loopback/common/models/application.js @@ -1,3 +1,4 @@ +const isProductionFn = require('../methods/application/isProduction'); module.exports = function(Self) { require('../methods/application/status')(Self); @@ -6,4 +7,8 @@ module.exports = function(Self) { require('../methods/application/executeProc')(Self); require('../methods/application/executeFunc')(Self); require('../methods/application/getEnumValues')(Self); + + Self.isProduction = (localAsProduction = true) => { + return isProductionFn(localAsProduction); + }; }; diff --git a/modules/account/back/models/ldap-config.js b/modules/account/back/models/ldap-config.js index 89f0add48..4f5c0218d 100644 --- a/modules/account/back/models/ldap-config.js +++ b/modules/account/back/models/ldap-config.js @@ -3,9 +3,10 @@ const app = require('vn-loopback/server/server'); const ldap = require('../util/ldapjs-extra'); const crypto = require('crypto'); const nthash = require('smbhash').nthash; +const isProduction = require('vn-loopback/common/methods/application/isProduction'); module.exports = Self => { - const shouldSync = process.env.NODE_ENV !== 'test'; + const shouldSync = isProduction(); Self.getLinker = async function() { return await Self.findOne({ diff --git a/modules/account/back/models/samba-config.js b/modules/account/back/models/samba-config.js index 927510a29..aa68af35d 100644 --- a/modules/account/back/models/samba-config.js +++ b/modules/account/back/models/samba-config.js @@ -1,6 +1,7 @@ const ldap = require('../util/ldapjs-extra'); const execFile = require('child_process').execFile; +const isProduction = require('vn-loopback/common/methods/application/isProduction'); /** * Summary of userAccountControl flags: @@ -12,7 +13,7 @@ const UserAccountControlFlags = { }; module.exports = Self => { - const shouldSync = process.env.NODE_ENV !== 'test'; + const shouldSync = isProduction(); Self.getLinker = async function() { return await Self.findOne({ diff --git a/modules/client/back/methods/sms/send.js b/modules/client/back/methods/sms/send.js index 94b2b6c27..269dedacb 100644 --- a/modules/client/back/methods/sms/send.js +++ b/modules/client/back/methods/sms/send.js @@ -47,7 +47,7 @@ module.exports = Self => { let response; try { - if (process.env.NODE_ENV !== 'production') + if (!Self.app.models.Application.isProduction(false)) response = {result: [{status: 'ok'}]}; else { const jsonTest = { diff --git a/modules/invoiceOut/back/methods/invoiceOut/download.js b/modules/invoiceOut/back/methods/invoiceOut/download.js index 748e2df17..5a9d5bc51 100644 --- a/modules/invoiceOut/back/methods/invoiceOut/download.js +++ b/modules/invoiceOut/back/methods/invoiceOut/download.js @@ -66,7 +66,7 @@ module.exports = Self => { console.error(err); }); - if (process.env.NODE_ENV == 'test') { + if (!Self.app.models.Application.isProduction()) { try { await fs.access(file.path); } catch (error) { diff --git a/modules/invoiceOut/back/models/invoice-out.js b/modules/invoiceOut/back/models/invoice-out.js index e4fcc1a69..166565fe2 100644 --- a/modules/invoiceOut/back/models/invoice-out.js +++ b/modules/invoiceOut/back/models/invoice-out.js @@ -59,7 +59,7 @@ module.exports = Self => { hasPdf: true }, options); - if (process.env.NODE_ENV !== 'test') { + if (Self.app.models.Application.isProduction()) { await print.storage.write(buffer, { type: 'invoice', path: pdfFile.path, diff --git a/modules/mdb/back/methods/mdbVersion/upload.js b/modules/mdb/back/methods/mdbVersion/upload.js index 58fc46abb..9edaf454f 100644 --- a/modules/mdb/back/methods/mdbVersion/upload.js +++ b/modules/mdb/back/methods/mdbVersion/upload.js @@ -111,7 +111,7 @@ module.exports = Self => { const destinationFile = path.join( accessContainer.client.root, accessContainer.name, appName, `${toVersion}.7z`); - if (process.env.NODE_ENV == 'test') + if (!Self.app.models.Application.isProduction()) await fs.unlink(srcFile); else { await fs.move(srcFile, destinationFile, { From d8841920665fcf07e3c0eb63a9e5e81f953bebf8 Mon Sep 17 00:00:00 2001 From: alexm Date: Tue, 21 May 2024 13:52:50 +0200 Subject: [PATCH 37/42] fix: checking process.env.NODE_ENV --- back/methods/chat/sendQueued.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/back/methods/chat/sendQueued.js b/back/methods/chat/sendQueued.js index 1ab4cb6e0..ee1a82be2 100644 --- a/back/methods/chat/sendQueued.js +++ b/back/methods/chat/sendQueued.js @@ -94,7 +94,7 @@ module.exports = Self => { * @return {Promise} - The request promise */ Self.sendMessage = async function sendMessage(senderFk, recipient, message) { - if (!Self.app.models.Application.isProduction()) { + if (!Self.app.models.Application.isProduction(false)) { return new Promise(resolve => { return resolve({ statusCode: 200, @@ -149,7 +149,7 @@ module.exports = Self => { * @return {Promise} - The request promise */ Self.getUserStatus = async function getUserStatus(username) { - if (!Self.app.models.Application.isProduction()) { + if (!Self.app.models.Application.isProduction(false)) { return new Promise(resolve => { return resolve({ data: { From 1f2017c2727ce8e653e61124445735ea3436650f Mon Sep 17 00:00:00 2001 From: alexm Date: Tue, 21 May 2024 14:03:13 +0200 Subject: [PATCH 38/42] fix: simplify --- loopback/common/methods/application/isProduction.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/loopback/common/methods/application/isProduction.js b/loopback/common/methods/application/isProduction.js index 9479b67af..151afa9cb 100644 --- a/loopback/common/methods/application/isProduction.js +++ b/loopback/common/methods/application/isProduction.js @@ -1,3 +1,3 @@ module.exports = (localAsProduction = true) => { - if ((!process.env.NODE_ENV && localAsProduction) || process.env.NODE_ENV == 'production') return true; + return (!process.env.NODE_ENV && localAsProduction) || process.env.NODE_ENV == 'production'; }; From 2ffdce3c64753453d8b0f53fe0e34eb5efb2808d Mon Sep 17 00:00:00 2001 From: guillermo Date: Tue, 21 May 2024 14:40:42 +0200 Subject: [PATCH 39/42] refactor: refs #7398 Refactor and change ekt_scan --- db/routines/edi/procedures/ekt_scan.sql | 66 +++++++++++++------------ 1 file changed, 34 insertions(+), 32 deletions(-) diff --git a/db/routines/edi/procedures/ekt_scan.sql b/db/routines/edi/procedures/ekt_scan.sql index b0b75a6a7..ccb9adf0a 100644 --- a/db/routines/edi/procedures/ekt_scan.sql +++ b/db/routines/edi/procedures/ekt_scan.sql @@ -23,42 +23,39 @@ BEGIN DECLARE vXtraLongAgj INT; DECLARE vDefaultKlo INT; - SELECT - ec.usefulAuctionLeftSegmentLength, - ec.standardBarcodeLength, - ec.floridayBarcodeLength, - ec.floramondoBarcodeLength, - ec.defaultKlo - INTO - vUsefulAuctionLeftSegmentLength, + SELECT usefulAuctionLeftSegmentLength, + standardBarcodeLength, + floridayBarcodeLength, + floramondoBarcodeLength, + defaultKlo + INTO vUsefulAuctionLeftSegmentLength, vStandardBarcodeLength, vFloridayBarcodeLength, vFloramondoBarcodeLength, vDefaultKlo - FROM edi.ektConfig ec; + FROM ektConfig; - DROP TEMPORARY TABLE IF EXISTS tmp.ekt; - CREATE TEMPORARY TABLE tmp.ekt + CREATE OR REPLACE TEMPORARY TABLE tmp.ekt ENGINE = MEMORY SELECT id ektFk FROM ekt LIMIT 0; - CASE + CASE WHEN LENGTH(vBarcode) <= vFloridayBarcodeLength THEN INSERT INTO tmp.ekt SELECT id - FROM edi.ektRecent e + FROM ektRecent e WHERE e.cps = vBarcode OR e.batchNumber = vBarcode; WHEN LENGTH(vBarcode) = vFloramondoBarcodeLength THEN INSERT INTO tmp.ekt SELECT e.id - FROM edi.ektRecent e + FROM ektRecent e WHERE e.pro = MID(vBarcode,2,6) - AND CAST(e.ptd AS SIGNED) = MID(vBarcode,8,5); + AND CAST(e.ptd AS SIGNED) = MID(vBarcode, 8, 5); ELSE - SET vBarcode = LPAD(vBarcode,vStandardBarcodeLength,'0'); + SET vBarcode = LPAD(vBarcode, vStandardBarcodeLength, '0'); SET vAuction = MID(vBarcode, 1, 3); SET vKlo = MID(vBarcode, 4, 2); SET vFec = MAKEDATE(YEAR(util.VN_CURDATE()), MID(vBarcode, 6, 3)); @@ -69,21 +66,25 @@ BEGIN -- Clásico de subasta -- Trade standard -- Trade que construye como la subasta - -- Trade como el anterior pero sin trade code + -- Trade como el anterior pero sin trade code INSERT INTO tmp.ekt SELECT id FROM ekt WHERE fec >= vFec - INTERVAL 1 DAY - AND (( - vKlo = vDefaultKlo + AND ( + (vKlo = vDefaultKlo AND (klo = vKlo OR klo IS NULL OR klo = 0) - AND agj IN (vShortAgj, vLongAgj, vXtraLongAgj)) - OR (klo = vKlo + AND agj IN (vShortAgj, vLongAgj, vXtraLongAgj) + ) OR ( + klo = vKlo AND auction = vAuction - AND agj = vShortAgj) + AND agj = vShortAgj + ) OR ( + klo = auction -- No se si se refiere a esto + ) ) - ORDER BY agj DESC, fec DESC - LIMIT 1; + ORDER BY agj DESC, fec DESC + LIMIT 1; SELECT COUNT(*) FROM tmp.ekt INTO vIsFound; @@ -91,9 +92,11 @@ BEGIN IF NOT vIsFound THEN INSERT INTO tmp.ekt SELECT id - FROM edi.ektRecent e - WHERE e.batchNumber - = LEFT(vBarcode,vUsefulAuctionLeftSegmentLength) + FROM ektRecent e + WHERE e.batchNumber = LEFT( + vBarcode, + vUsefulAuctionLeftSegmentLength + ) AND e.batchNumber > 0; SELECT COUNT(*) FROM tmp.ekt INTO vIsFound; @@ -103,7 +106,7 @@ BEGIN IF NOT vIsFound THEN INSERT INTO tmp.ekt SELECT id - FROM edi.ektRecent e + FROM ektRecent e WHERE e.putOrderFk = vBarcode; SELECT COUNT(*) FROM tmp.ekt INTO vIsFound; @@ -113,9 +116,8 @@ BEGIN IF NOT vIsFound THEN INSERT INTO tmp.ekt SELECT id - FROM edi.ektRecent e - WHERE e.deliveryNumber - = MID(vBarcode, 4, 13) + FROM ektRecent e + WHERE e.deliveryNumber = MID(vBarcode, 4, 13) AND e.deliveryNumber > 0; SELECT COUNT(*) FROM tmp.ekt INTO vIsFound; @@ -124,7 +126,7 @@ BEGIN IF vIsFound THEN UPDATE ekt e - JOIN tmp.ekt t ON t.ektFk = e.id + JOIN tmp.ekt t ON t.ektFk = e.id SET e.scanned = TRUE; END IF; END$$ From ff33c926af40723cbb57ed05641deefe8c6c64f6 Mon Sep 17 00:00:00 2001 From: alexm Date: Tue, 21 May 2024 15:11:32 +0200 Subject: [PATCH 40/42] fix: move to boot --- back/methods/chat/sendCheckingPresence.js | 4 +++- back/methods/chat/sendQueued.js | 6 ++++-- back/methods/dms/deleteTrashFiles.js | 3 ++- back/methods/docuware/upload.js | 3 ++- back/methods/image/scrub.js | 3 ++- back/methods/image/upload.js | 3 ++- back/methods/notification/send.js | 3 ++- loopback/common/models/application.js | 6 ------ .../methods/application => server/boot}/isProduction.js | 0 modules/account/back/models/ldap-config.js | 2 +- modules/account/back/models/samba-config.js | 2 +- modules/client/back/methods/sms/send.js | 3 ++- modules/invoiceOut/back/methods/invoiceOut/download.js | 3 ++- modules/invoiceOut/back/models/invoice-out.js | 3 ++- modules/mdb/back/methods/mdbVersion/upload.js | 3 ++- 15 files changed, 27 insertions(+), 20 deletions(-) rename loopback/{common/methods/application => server/boot}/isProduction.js (100%) diff --git a/back/methods/chat/sendCheckingPresence.js b/back/methods/chat/sendCheckingPresence.js index 12cadec04..7ab5d63fe 100644 --- a/back/methods/chat/sendCheckingPresence.js +++ b/back/methods/chat/sendCheckingPresence.js @@ -1,3 +1,5 @@ +const isProduction = require('vn-loopback/server/boot/isProduction'); + module.exports = Self => { Self.remoteMethodCtx('sendCheckingPresence', { description: 'Creates a message in the chat model checking the user status', @@ -37,7 +39,7 @@ module.exports = Self => { if (!recipient) throw new Error(`Could not send message "${message}" to worker id ${recipientId} from user ${userId}`); - if (!Self.app.models.Application.isProduction()) + if (!isProduction()) message = `[Test:Environment to user ${userId}] ` + message; const chat = await models.Chat.create({ diff --git a/back/methods/chat/sendQueued.js b/back/methods/chat/sendQueued.js index ee1a82be2..abda2ddc1 100644 --- a/back/methods/chat/sendQueued.js +++ b/back/methods/chat/sendQueued.js @@ -1,4 +1,6 @@ const axios = require('axios'); +const isProduction = require('vn-loopback/server/boot/isProduction'); + module.exports = Self => { Self.remoteMethodCtx('sendQueued', { description: 'Send a RocketChat message', @@ -94,7 +96,7 @@ module.exports = Self => { * @return {Promise} - The request promise */ Self.sendMessage = async function sendMessage(senderFk, recipient, message) { - if (!Self.app.models.Application.isProduction(false)) { + if (!isProduction(false)) { return new Promise(resolve => { return resolve({ statusCode: 200, @@ -149,7 +151,7 @@ module.exports = Self => { * @return {Promise} - The request promise */ Self.getUserStatus = async function getUserStatus(username) { - if (!Self.app.models.Application.isProduction(false)) { + if (!isProduction(false)) { return new Promise(resolve => { return resolve({ data: { diff --git a/back/methods/dms/deleteTrashFiles.js b/back/methods/dms/deleteTrashFiles.js index 77e33929a..e07f93c90 100644 --- a/back/methods/dms/deleteTrashFiles.js +++ b/back/methods/dms/deleteTrashFiles.js @@ -1,6 +1,7 @@ const UserError = require('vn-loopback/util/user-error'); const fs = require('fs-extra'); const path = require('path'); +const isProduction = require('vn-loopback/server/boot/isProduction'); module.exports = Self => { Self.remoteMethod('deleteTrashFiles', { @@ -22,7 +23,7 @@ module.exports = Self => { if (typeof options == 'object') Object.assign(myOptions, options); - if (!Self.app.models.Application.isProduction()) + if (!isProduction()) throw new UserError(`Action not allowed on the test environment`); const models = Self.app.models; diff --git a/back/methods/docuware/upload.js b/back/methods/docuware/upload.js index ae3989def..0102911e0 100644 --- a/back/methods/docuware/upload.js +++ b/back/methods/docuware/upload.js @@ -1,5 +1,6 @@ const UserError = require('vn-loopback/util/user-error'); const axios = require('axios'); +const isProduction = require('vn-loopback/server/boot/isProduction'); module.exports = Self => { Self.remoteMethodCtx('upload', { @@ -119,7 +120,7 @@ module.exports = Self => { ] }; - if (!Self.app.models.Application.isProduction(false)) + if (!isProduction(false)) throw new UserError('Action not allowed on the test environment'); // delete old diff --git a/back/methods/image/scrub.js b/back/methods/image/scrub.js index 4af2d8d49..3c83b3be7 100644 --- a/back/methods/image/scrub.js +++ b/back/methods/image/scrub.js @@ -1,6 +1,7 @@ const fs = require('fs-extra'); const path = require('path'); const UserError = require('vn-loopback/util/user-error'); +const isProduction = require('vn-loopback/server/boot/isProduction'); module.exports = Self => { Self.remoteMethod('scrub', { @@ -43,7 +44,7 @@ module.exports = Self => { Self.scrub = async function(collection, remove, limit, dryRun, skipLock) { const $ = Self.app.models; - dryRun = dryRun || !Self.app.models.Application.isProduction(false); + dryRun = dryRun || !isProduction(false); const instance = await $.ImageCollection.findOne({ fields: ['id'], diff --git a/back/methods/image/upload.js b/back/methods/image/upload.js index 81d9759e6..b3cdfb88b 100644 --- a/back/methods/image/upload.js +++ b/back/methods/image/upload.js @@ -1,6 +1,7 @@ const UserError = require('vn-loopback/util/user-error'); const fs = require('fs/promises'); const path = require('path'); +const isProduction = require('vn-loopback/server/boot/isProduction'); module.exports = Self => { Self.remoteMethodCtx('upload', { @@ -41,7 +42,7 @@ module.exports = Self => { if (!hasWriteRole) throw new UserError(`You don't have enough privileges`); - if (!Self.app.models.Application.isProduction()) + if (!isProduction()) throw new UserError(`Action not allowed on the test environment`); // Upload file to temporary path diff --git a/back/methods/notification/send.js b/back/methods/notification/send.js index 4f8f436da..1bff7f686 100644 --- a/back/methods/notification/send.js +++ b/back/methods/notification/send.js @@ -1,4 +1,5 @@ const {Email} = require('vn-print'); +const isProduction = require('vn-loopback/server/boot/isProduction'); module.exports = Self => { Self.remoteMethod('send', { @@ -70,7 +71,7 @@ module.exports = Self => { const newParams = Object.assign({}, queueParams, sendParams); const email = new Email(queueName, newParams); - if (Self.app.models.Application.isProduction()) + if (isProduction()) await email.send(); await queue.updateAttribute('status', statusSent); diff --git a/loopback/common/models/application.js b/loopback/common/models/application.js index 70db17de2..80c58ddc1 100644 --- a/loopback/common/models/application.js +++ b/loopback/common/models/application.js @@ -1,5 +1,3 @@ -const isProductionFn = require('../methods/application/isProduction'); - module.exports = function(Self) { require('../methods/application/status')(Self); require('../methods/application/post')(Self); @@ -7,8 +5,4 @@ module.exports = function(Self) { require('../methods/application/executeProc')(Self); require('../methods/application/executeFunc')(Self); require('../methods/application/getEnumValues')(Self); - - Self.isProduction = (localAsProduction = true) => { - return isProductionFn(localAsProduction); - }; }; diff --git a/loopback/common/methods/application/isProduction.js b/loopback/server/boot/isProduction.js similarity index 100% rename from loopback/common/methods/application/isProduction.js rename to loopback/server/boot/isProduction.js diff --git a/modules/account/back/models/ldap-config.js b/modules/account/back/models/ldap-config.js index 4f5c0218d..583ce084b 100644 --- a/modules/account/back/models/ldap-config.js +++ b/modules/account/back/models/ldap-config.js @@ -3,7 +3,7 @@ const app = require('vn-loopback/server/server'); const ldap = require('../util/ldapjs-extra'); const crypto = require('crypto'); const nthash = require('smbhash').nthash; -const isProduction = require('vn-loopback/common/methods/application/isProduction'); +const isProduction = require('vn-loopback/server/boot/isProduction'); module.exports = Self => { const shouldSync = isProduction(); diff --git a/modules/account/back/models/samba-config.js b/modules/account/back/models/samba-config.js index aa68af35d..359b4b187 100644 --- a/modules/account/back/models/samba-config.js +++ b/modules/account/back/models/samba-config.js @@ -1,7 +1,7 @@ const ldap = require('../util/ldapjs-extra'); const execFile = require('child_process').execFile; -const isProduction = require('vn-loopback/common/methods/application/isProduction'); +const isProduction = require('vn-loopback/server/boot/isProduction'); /** * Summary of userAccountControl flags: diff --git a/modules/client/back/methods/sms/send.js b/modules/client/back/methods/sms/send.js index 269dedacb..2b5674f86 100644 --- a/modules/client/back/methods/sms/send.js +++ b/modules/client/back/methods/sms/send.js @@ -1,5 +1,6 @@ const got = require('got'); const UserError = require('vn-loopback/util/user-error'); +const isProduction = require('vn-loopback/server/boot/isProduction'); module.exports = Self => { Self.remoteMethod('send', { @@ -47,7 +48,7 @@ module.exports = Self => { let response; try { - if (!Self.app.models.Application.isProduction(false)) + if (!isProduction(false)) response = {result: [{status: 'ok'}]}; else { const jsonTest = { diff --git a/modules/invoiceOut/back/methods/invoiceOut/download.js b/modules/invoiceOut/back/methods/invoiceOut/download.js index 5a9d5bc51..f8d42072c 100644 --- a/modules/invoiceOut/back/methods/invoiceOut/download.js +++ b/modules/invoiceOut/back/methods/invoiceOut/download.js @@ -1,5 +1,6 @@ const fs = require('fs-extra'); const path = require('path'); +const isProduction = require('vn-loopback/server/boot/isProduction'); module.exports = Self => { Self.remoteMethodCtx('download', { @@ -66,7 +67,7 @@ module.exports = Self => { console.error(err); }); - if (!Self.app.models.Application.isProduction()) { + if (!isProduction()) { try { await fs.access(file.path); } catch (error) { diff --git a/modules/invoiceOut/back/models/invoice-out.js b/modules/invoiceOut/back/models/invoice-out.js index 166565fe2..b0e05b626 100644 --- a/modules/invoiceOut/back/models/invoice-out.js +++ b/modules/invoiceOut/back/models/invoice-out.js @@ -1,6 +1,7 @@ const print = require('vn-print'); const path = require('path'); const UserError = require('vn-loopback/util/user-error'); +const isProduction = require('vn-loopback/server/boot/isProduction'); module.exports = Self => { require('../methods/invoiceOut/filter')(Self); @@ -59,7 +60,7 @@ module.exports = Self => { hasPdf: true }, options); - if (Self.app.models.Application.isProduction()) { + if (isProduction()) { await print.storage.write(buffer, { type: 'invoice', path: pdfFile.path, diff --git a/modules/mdb/back/methods/mdbVersion/upload.js b/modules/mdb/back/methods/mdbVersion/upload.js index 9edaf454f..64de72679 100644 --- a/modules/mdb/back/methods/mdbVersion/upload.js +++ b/modules/mdb/back/methods/mdbVersion/upload.js @@ -1,6 +1,7 @@ const fs = require('fs-extra'); const path = require('path'); const UserError = require('vn-loopback/util/user-error'); +const isProduction = require('vn-loopback/server/boot/isProduction'); module.exports = Self => { Self.remoteMethodCtx('upload', { @@ -111,7 +112,7 @@ module.exports = Self => { const destinationFile = path.join( accessContainer.client.root, accessContainer.name, appName, `${toVersion}.7z`); - if (!Self.app.models.Application.isProduction()) + if (!isProduction()) await fs.unlink(srcFile); else { await fs.move(srcFile, destinationFile, { From 0d620c6f33cb061abbf3f9aa6efd03b80ea11c7d Mon Sep 17 00:00:00 2001 From: guillermo Date: Wed, 22 May 2024 08:11:27 +0200 Subject: [PATCH 41/42] feat: refs #7398 Change --- db/routines/edi/procedures/ekt_scan.sql | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/db/routines/edi/procedures/ekt_scan.sql b/db/routines/edi/procedures/ekt_scan.sql index ccb9adf0a..0cf8bb466 100644 --- a/db/routines/edi/procedures/ekt_scan.sql +++ b/db/routines/edi/procedures/ekt_scan.sql @@ -79,8 +79,6 @@ BEGIN klo = vKlo AND auction = vAuction AND agj = vShortAgj - ) OR ( - klo = auction -- No se si se refiere a esto ) ) ORDER BY agj DESC, fec DESC @@ -122,6 +120,17 @@ BEGIN SELECT COUNT(*) FROM tmp.ekt INTO vIsFound; END IF; + + -- Solo campo agj + IF NOT vIsFound THEN + INSERT INTO tmp.ekt + SELECT id + FROM ektRecent + WHERE agj = vShortAgj; + + SELECT COUNT(*) FROM tmp.ekt INTO vIsFound; + END IF; + END CASE; IF vIsFound THEN From 4dee90ff57ff0e6283bb2d622eb4e4fea34a39aa Mon Sep 17 00:00:00 2001 From: carlossa Date: Wed, 22 May 2024 14:56:46 +0200 Subject: [PATCH 42/42] refs #6820 fix pr --- back/models/routeConfig.json | 3 --- db/versions/11059-crimsonAnthurium/00-firstScript.sql | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/back/models/routeConfig.json b/back/models/routeConfig.json index 28adbe756..f3d929749 100644 --- a/back/models/routeConfig.json +++ b/back/models/routeConfig.json @@ -1,9 +1,6 @@ { "name": "RouteConfig", "base": "VnModel", - "mixins": { - "Loggable": true - }, "options": { "mysql": { "table": "routeConfig" diff --git a/db/versions/11059-crimsonAnthurium/00-firstScript.sql b/db/versions/11059-crimsonAnthurium/00-firstScript.sql index 7fe3e01ca..b0eade302 100644 --- a/db/versions/11059-crimsonAnthurium/00-firstScript.sql +++ b/db/versions/11059-crimsonAnthurium/00-firstScript.sql @@ -1,3 +1,3 @@ -- Place your SQL code here INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) - VALUES ('RouteConfig','*','*','ALLOW','ROLE','employee'); + VALUES ('RouteConfig','*','READ','ALLOW','ROLE','employee');