diff --git a/db/.pullinfo.json b/db/.pullinfo.json
index f4afbc5fbb..0defed8458 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 4cabb0e337..bd6c69955f 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__;
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 2b743823ec..0000000000
--- 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');
- });
-});
diff --git a/modules/ticket/back/methods/ticket/closeAll.js b/modules/ticket/back/methods/ticket/closeAll.js
index e3cbc83e24..35b9b1e379 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 {
diff --git a/modules/worker/front/pda/index.html b/modules/worker/front/pda/index.html
deleted file mode 100644
index c6d31dc858..0000000000
--- a/modules/worker/front/pda/index.html
+++ /dev/null
@@ -1,50 +0,0 @@
-
-
diff --git a/modules/worker/front/pda/index.js b/modules/worker/front/pda/index.js
index 885261e5c4..c3616b41e4 100644
--- a/modules/worker/front/pda/index.js
+++ b/modules/worker/front/pda/index.js
@@ -1,53 +1,18 @@
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`);
+ this.$state.go('worker.card.summary', {id: this.$params.id});
+ window.location.href = url;
}
}
-Controller.$inject = ['$element', '$scope'];
-
ngModule.vnComponent('vnWorkerPda', {
- template: require('./index.html'),
- controller: Controller,
+ controller: Controller
});
diff --git a/modules/worker/front/pda/index.spec.js b/modules/worker/front/pda/index.spec.js
deleted file mode 100644
index a0540af45c..0000000000
--- 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 c55c9d2187..0000000000
--- a/modules/worker/front/pda/style.scss
+++ /dev/null
@@ -1,6 +0,0 @@
-@import "./variables";
-
-.text-grey {
- color: $color-font-light;
-}
-
diff --git a/package.json b/package.json
index 390b61be1b..c2f6309749 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",