From eb0e6dd985b433f2a41a3d99f07f1761440cbcca Mon Sep 17 00:00:00 2001 From: alexm Date: Mon, 25 Sep 2023 13:06:28 +0200 Subject: [PATCH 01/16] refs #6033 feat(VnLog): can use accountDescriptor --- front/salix/components/log/index.html | 5 ++++- front/salix/components/log/index.js | 5 ++++- .../front/descriptor-popover/index.html | 4 ++++ .../account/front/descriptor-popover/index.js | 9 ++++++++ modules/account/front/descriptor/index.js | 22 +++++++++++++++++++ modules/account/front/index.js | 1 + 6 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 modules/account/front/descriptor-popover/index.html create mode 100644 modules/account/front/descriptor-popover/index.js diff --git a/front/salix/components/log/index.html b/front/salix/components/log/index.html index 6a1367e28..c75030100 100644 --- a/front/salix/components/log/index.html +++ b/front/salix/components/log/index.html @@ -28,7 +28,7 @@ + ng-click="$ctrl.showDescriptor($event, userLog)"> @@ -260,3 +260,6 @@ + + diff --git a/front/salix/components/log/index.js b/front/salix/components/log/index.js index 176815eef..a77f0b984 100644 --- a/front/salix/components/log/index.js +++ b/front/salix/components/log/index.js @@ -362,7 +362,10 @@ export default class Controller extends Section { } } - showWorkerDescriptor(event, userLog) { + showDescriptor(event, userLog) { + if (this.$state.current.name.split('.')[0] == 'account') + return this.$.accountDescriptor.show(event.target, userLog.userFk); + if (userLog.user?.worker) this.$.workerDescriptor.show(event.target, userLog.userFk); } diff --git a/modules/account/front/descriptor-popover/index.html b/modules/account/front/descriptor-popover/index.html new file mode 100644 index 000000000..f3131a84b --- /dev/null +++ b/modules/account/front/descriptor-popover/index.html @@ -0,0 +1,4 @@ + + + + diff --git a/modules/account/front/descriptor-popover/index.js b/modules/account/front/descriptor-popover/index.js new file mode 100644 index 000000000..d7b052473 --- /dev/null +++ b/modules/account/front/descriptor-popover/index.js @@ -0,0 +1,9 @@ +import ngModule from '../module'; +import DescriptorPopover from 'salix/components/descriptor-popover'; + +class Controller extends DescriptorPopover {} + +ngModule.vnComponent('vnAccountDescriptorPopover', { + slotTemplate: require('./index.html'), + controller: Controller +}); diff --git a/modules/account/front/descriptor/index.js b/modules/account/front/descriptor/index.js index 150c9d660..786870d36 100644 --- a/modules/account/front/descriptor/index.js +++ b/modules/account/front/descriptor/index.js @@ -24,6 +24,28 @@ class Controller extends Descriptor { .then(res => this.hasAccount = res.data.exists); } + loadData() { + const filter = { + where: {id: this.$params.id}, + include: { + relation: 'role', + scope: { + fields: ['id', 'name'] + } + } + }; + + return Promise.all([ + this.$http.get(`VnUsers/preview`, {filter}) + .then(res => { + const [user] = res.data; + this.user = user; + }), + this.$http.get(`Accounts/${this.$params.id}/exists`) + .then(res => this.hasAccount = res.data.exists) + ]); + } + onDelete() { return this.$http.delete(`VnUsers/${this.id}`) .then(() => this.$state.go('account.index')) diff --git a/modules/account/front/index.js b/modules/account/front/index.js index 695f36967..4d6aedcae 100644 --- a/modules/account/front/index.js +++ b/modules/account/front/index.js @@ -9,6 +9,7 @@ import './acl'; import './summary'; import './card'; import './descriptor'; +import './descriptor-popover'; import './search-panel'; import './create'; import './basic-data'; From 5a3094cd7021ca3b8c8ed3c8931136a4f04f1a40 Mon Sep 17 00:00:00 2001 From: alexm Date: Mon, 25 Sep 2023 13:24:30 +0200 Subject: [PATCH 02/16] refs #6033 feat(VnLog): better if --- front/salix/components/log/index.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/front/salix/components/log/index.js b/front/salix/components/log/index.js index a77f0b984..1edaa72ae 100644 --- a/front/salix/components/log/index.js +++ b/front/salix/components/log/index.js @@ -363,11 +363,10 @@ export default class Controller extends Section { } showDescriptor(event, userLog) { - if (this.$state.current.name.split('.')[0] == 'account') - return this.$.accountDescriptor.show(event.target, userLog.userFk); + if (userLog.user?.worker && this.$state.current.name.split('.')[0] != 'account') + return this.$.workerDescriptor.show(event.target, userLog.userFk); - if (userLog.user?.worker) - this.$.workerDescriptor.show(event.target, userLog.userFk); + this.$.accountDescriptor.show(event.target, userLog.userFk); } } From e36f98195c413f65c67486ae4df02ca06354cccc Mon Sep 17 00:00:00 2001 From: alexm Date: Tue, 26 Sep 2023 08:15:19 +0200 Subject: [PATCH 03/16] refs #6033 feat: create user-photo component for worker and user descriptor --- front/salix/components/index.js | 1 + front/salix/components/user-photo/index.html | 15 +++++++++ front/salix/components/user-photo/index.js | 31 +++++++++++++++++++ .../salix/components/user-photo/locale/es.yml | 6 ++++ modules/account/front/descriptor/index.html | 3 ++ modules/worker/front/descriptor/index.html | 16 +--------- modules/worker/front/descriptor/index.js | 11 ------- 7 files changed, 57 insertions(+), 26 deletions(-) create mode 100644 front/salix/components/user-photo/index.html create mode 100644 front/salix/components/user-photo/index.js create mode 100644 front/salix/components/user-photo/locale/es.yml diff --git a/front/salix/components/index.js b/front/salix/components/index.js index 555a18450..f632904c4 100644 --- a/front/salix/components/index.js +++ b/front/salix/components/index.js @@ -18,6 +18,7 @@ import './section'; import './summary'; import './topbar/topbar'; import './user-popover'; +import './user-photo'; import './upload-photo'; import './bank-entity'; import './log'; diff --git a/front/salix/components/user-photo/index.html b/front/salix/components/user-photo/index.html new file mode 100644 index 000000000..2d7bbcb82 --- /dev/null +++ b/front/salix/components/user-photo/index.html @@ -0,0 +1,15 @@ +
+ + + +
+ + + diff --git a/front/salix/components/user-photo/index.js b/front/salix/components/user-photo/index.js new file mode 100644 index 000000000..23190c1b6 --- /dev/null +++ b/front/salix/components/user-photo/index.js @@ -0,0 +1,31 @@ +import ngModule from '../../module'; + +export default class Controller { + constructor($element, $, $rootScope) { + Object.assign(this, { + $element, + $, + $rootScope, + }); + } + + onUploadResponse() { + const timestamp = Date.vnNew().getTime(); + const src = this.$rootScope.imagePath('user', '520x520', this.userId); + const zoomSrc = this.$rootScope.imagePath('user', '1600x1600', this.userId); + const newSrc = `${src}&t=${timestamp}`; + const newZoomSrc = `${zoomSrc}&t=${timestamp}`; + + this.$.photo.setAttribute('src', newSrc); + this.$.photo.setAttribute('zoom-image', newZoomSrc); + } +} +Controller.$inject = ['$element', '$scope', '$rootScope']; + +ngModule.vnComponent('vnUserPhoto', { + template: require('./index.html'), + controller: Controller, + bindings: { + userId: '@?', + } +}); diff --git a/front/salix/components/user-photo/locale/es.yml b/front/salix/components/user-photo/locale/es.yml new file mode 100644 index 000000000..7518a98bc --- /dev/null +++ b/front/salix/components/user-photo/locale/es.yml @@ -0,0 +1,6 @@ +My account: Mi cuenta +Local warehouse: Almacén local +Local bank: Banco local +Local company: Empresa local +User warehouse: Almacén del usuario +User company: Empresa del usuario \ No newline at end of file diff --git a/modules/account/front/descriptor/index.html b/modules/account/front/descriptor/index.html index 381b2991c..94497aaa9 100644 --- a/modules/account/front/descriptor/index.html +++ b/modules/account/front/descriptor/index.html @@ -2,6 +2,9 @@ module="account" description="$ctrl.user.nickname" summary="$ctrl.$.summary"> + + + -
- - - -
+
@@ -76,8 +67,3 @@ - - - diff --git a/modules/worker/front/descriptor/index.js b/modules/worker/front/descriptor/index.js index a53528ef2..0214f8500 100644 --- a/modules/worker/front/descriptor/index.js +++ b/modules/worker/front/descriptor/index.js @@ -71,17 +71,6 @@ class Controller extends Descriptor { return this.getData(`Workers/${this.id}`, {filter}) .then(res => this.entity = res.data); } - - onUploadResponse() { - const timestamp = Date.vnNew().getTime(); - const src = this.$rootScope.imagePath('user', '520x520', this.worker.id); - const zoomSrc = this.$rootScope.imagePath('user', '1600x1600', this.worker.id); - const newSrc = `${src}&t=${timestamp}`; - const newZoomSrc = `${zoomSrc}&t=${timestamp}`; - - this.$.photo.setAttribute('src', newSrc); - this.$.photo.setAttribute('zoom-image', newZoomSrc); - } } Controller.$inject = ['$element', '$scope', '$rootScope']; From 3ffc4e39f1d214e5f94f3fa7c4cf0fe15bdb0c7e Mon Sep 17 00:00:00 2001 From: alexm Date: Tue, 26 Sep 2023 08:19:17 +0200 Subject: [PATCH 04/16] refs #6033 add changeLog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 79688cb56..373a6ec71 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,9 +9,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [2340.01] - 2023-10-05 ### Added +- (Usuarios -> Foto) Se muestra la foto del trabajador + ### Changed ### Fixed +- (Usuarios -> Historial) Abre el descriptor del usuario correctamente ## [2338.01] - 2023-09-21 From a7c0949f0ea80cf1606547cb91d4d535178ed92f Mon Sep 17 00:00:00 2001 From: jorgep Date: Wed, 27 Sep 2023 08:57:31 +0200 Subject: [PATCH 05/16] ref #6065 replace then by async/await --- modules/worker/front/card/index.js | 11 +++++------ modules/worker/front/time-control/index.js | 11 +++++------ 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/modules/worker/front/card/index.js b/modules/worker/front/card/index.js index b8b533c5d..dcba2efcd 100644 --- a/modules/worker/front/card/index.js +++ b/modules/worker/front/card/index.js @@ -2,7 +2,7 @@ import ngModule from '../module'; import ModuleCard from 'salix/components/module-card'; class Controller extends ModuleCard { - reload() { + async reload() { const filter = { include: [ { @@ -31,13 +31,12 @@ class Controller extends ModuleCard { } ] }; - - return Promise.all([ - this.$http.get(`Workers/${this.$params.id}`, {filter}) - .then(res => this.worker = res.data), + const promises = await Promise.all([ + this.$http.get(`Workers/${this.$params.id}`, {filter}), this.$http.get(`Workers/${this.$params.id}/activeContract`) - .then(res => this.hasWorkCenter = res.data?.workCenterFk) ]); + this.worker = await promises[0].data; + this.worker.hasWorkCenter = await promises[1].data?.workCenterFk; } } diff --git a/modules/worker/front/time-control/index.js b/modules/worker/front/time-control/index.js index 38e6721d6..e21bfbfbb 100644 --- a/modules/worker/front/time-control/index.js +++ b/modules/worker/front/time-control/index.js @@ -132,7 +132,7 @@ class Controller extends Section { } } - fetchHours() { + async fetchHours() { const params = {workerFk: this.$params.id}; const filter = { where: {and: [ @@ -140,12 +140,11 @@ class Controller extends Section { {timed: {lte: this.ended}} ]} }; - this.$.model.applyFilter(filter, params).then(() => { - if (!this.card.hasWorkCenter) return; + await this.$.model.applyFilter(filter, params); + if (!this.worker.hasWorkCenter) return; - this.getWorkedHours(this.started, this.ended); - this.getAbsences(); - }); + await this.getWorkedHours(this.started, this.ended); + await this.getAbsences(); } hasEvents(day) { From ac3e9c811d124a8ce496e96eeb11960d5bb1ccff Mon Sep 17 00:00:00 2001 From: sergiodt Date: Wed, 27 Sep 2023 14:01:17 +0200 Subject: [PATCH 06/16] refs #5890 feat: itemShelvingSaleAsignado --- db/changes/234001/01-itemShelvingSale.sql | 299 ++++++++++++++++++ loopback/locale/en.json | 3 +- loopback/locale/es.json | 7 +- .../itemShelvingSaleByCollection.js | 22 ++ .../itemShelvingSaleSetQuantity.js | 31 ++ .../item/back/models/item-shelving-sale.js | 2 + 6 files changed, 360 insertions(+), 4 deletions(-) create mode 100644 db/changes/234001/01-itemShelvingSale.sql create mode 100644 modules/item/back/methods/item-shelving-sale/itemShelvingSaleByCollection.js create mode 100644 modules/item/back/methods/item-shelving-sale/itemShelvingSaleSetQuantity.js diff --git a/db/changes/234001/01-itemShelvingSale.sql b/db/changes/234001/01-itemShelvingSale.sql new file mode 100644 index 000000000..af68d465a --- /dev/null +++ b/db/changes/234001/01-itemShelvingSale.sql @@ -0,0 +1,299 @@ + +ALTER TABLE vn.itemShelvingSale ADD isPicked TINYINT(1) DEFAULT FALSE NOT NULL; + +DELIMITER $$ +CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`itemShelvingSale_addByCollection`( + vCollectionFk INT(11) +) +BEGIN +/** + * Guarda la ubicación para el contenido de una colección + * + * @param vCollectionFk Identificador de collection + */ + CREATE OR REPLACE TEMPORARY TABLE tmp.sale + (INDEX(saleFk)) + ENGINE = MEMORY + SELECT s.id saleFk, NULL userFk + FROM ticketCollection tc + JOIN sale s ON s.ticketFk = tc.ticketFk + LEFT JOIN ( + SELECT DISTINCT saleFk + FROM saleTracking st + JOIN state s ON s.id = st.stateFk + WHERE st.isChecked + AND s.semaphore = 1)st ON st.saleFk = s.id + WHERE tc.collectionFk = vCollectionFk + AND st.saleFk IS NULL + AND NOT s.isPicked; + + CALL itemShelvingSale_addNew(); +END$$ +DELIMITER ; + + +DELIMITER $$ +CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`itemShelvingSale_setQuantity`( + vItemShelvingSaleFk INT(10), + vQuantity DECIMAL(10,0), + vIsItemShelvingSaleEmpty BOOLEAN +) +BEGIN +/** + * Gestiona la reserva de un itemShelvingFk, actualizando isPicked y quantity + * en vn.itemShelvingSale y vn.sale.isPicked en caso necesario. + * Si la reserva de la ubicación es fallida, se regulariza la situación + * + * @param vItemShelvingSaleFk Id itemShelvingSaleFK + * @param vQuantity Cantidad real que se ha cogido de la ubicación + * @param vIsItemShelvingSaleEmpty determina si ka ubicación itemShelvingSale se ha + * quedado vacio tras el movimiento + */ + DECLARE vSaleFk INT; + DECLARE vCursorSaleFk INT; + DECLARE vItemShelvingFk INT; + DECLARE vReservedQuantity INT; + DECLARE vRemainingQuantity INT; + DECLARE vItemFk INT; + DECLARE vUserFk INT; + DECLARE vDone BOOLEAN DEFAULT FALSE; + DECLARE vSales CURSOR FOR + SELECT iss.saleFk, iss.userFk + FROM itemShelvingSale iss + JOIN sale s ON s.id = iss.saleFk + WHERE iss.id = vItemShelvingSaleFk + AND s.itemFk = vItemFk + AND NOT iss.isPicked; + + DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE; + + IF (SELECT isPicked FROM itemShelvingSale WHERE id = vItemShelvingSaleFk) THEN + CALL util.throw('Booking completed'); + END IF; + + SELECT s.itemFk, iss.saleFk, iss.itemShelvingFk + INTO vItemFk, vSaleFk, vItemShelvingFk + FROM itemShelvingSale iss + JOIN sale s ON s.id = iss.saleFk + WHERE iss.id = vItemShelvingSaleFk + AND NOT iss.isPicked; + + UPDATE itemShelvingSale + SET isPicked = TRUE, + quantity = vQuantity + WHERE id = vItemShelvingSaleFk; + + UPDATE itemShelving + SET visible = IF(vIsItemShelvingSaleEmpty, 0, GREATEST(0,visible - vQuantity)) + WHERE id = vItemShelvingFk; + + /*Se podría preguntar por la cantidad correcta de la ubicació o insertar en una tabla + para que lo tenga en cuenta la gente que está haciendo inventario*/ + + IF vIsItemShelvingSaleEmpty THEN + OPEN vSales; +l: LOOP + SET vDone = FALSE; + FETCH vSales INTO vCursorSaleFk, vUserFk; + IF vDone THEN + LEAVE l; + END IF; + + CREATE OR REPLACE TEMPORARY TABLE tmp.sale + (INDEX(saleFk, userFk)) + ENGINE = MEMORY + SELECT vCursorSaleFk, vUserFk; + + CALL itemShelvingSale_addNewWhitUser(); + DROP TEMPORARY TABLE tmp.sale; + + END LOOP; + CLOSE vSales; + + DELETE iss + FROM itemShelvingSale iss + JOIN sale s ON s.id = iss.saleFk + WHERE iss.id = vItemShelvingSaleFk + AND s.itemFk = vItemFk + AND NOT iss.isPicked; + END IF; + + SELECT SUM(quantity) INTO vRemainingQuantity + FROM itemShelvingSale + WHERE saleFk = vSaleFk + AND NOT isPicked; + + IF vRemainingQuantity THEN + CALL itemShelvingSale_addBySale (vSaleFk, vRemainingQuantity, NULL); + + SELECT SUM(quantity) INTO vRemainingQuantity + FROM itemShelvingSale + WHERE saleFk = vSaleFk + AND NOT isPicked; + + IF NOT vRemainingQuantity <=> 0 THEN + SELECT SUM(iss.quantity) + INTO vReservedQuantity + FROM itemShelvingSale iss + WHERE iss.saleFk = vSaleFk; + + CALL saleTracking_new( + vSaleFk, + TRUE, + vReservedQuantity, + `account`.`myUser_getId`(), + NULL, + 'PREPARED', + TRUE); + + UPDATE sale s + SET s.quantity = vReservedQuantity + WHERE s.id = vSaleFk ; + END IF; + END IF; +END$$ +DELIMITER ; + + +DELIMITER $$ +CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`itemShelvingSale_addNew`() +BEGIN +/** + * Guarda la ubicacion para un conjunto de sales del mismo wareHouse + * + * @table tmp.sale(saleFk, userFk) + */ + DECLARE vCalcFk INT; + DECLARE vWarehouseFk INT; + DECLARE vCurrentYear INT DEFAULT YEAR(util.VN_NOW()); + DECLARE vLastPickingOrder INT; + + SELECT t.warehouseFk, MAX(p.pickingOrder) + INTO vWarehouseFk, vLastPickingOrder + FROM ticket t + JOIN sale s ON s.ticketFk = t.id + JOIN tmp.sale ts ON ts.saleFk = s.id + LEFT JOIN itemShelvingSale iss ON iss.saleFk = ts.saleFk + LEFT JOIN itemShelving ish ON ish.id = iss.itemShelvingFk + LEFT JOIN shelving sh ON sh.code = ish.shelvingFk + LEFT JOIN parking p ON p.id = sh.parkingFk + WHERE t.warehouseFk IS NOT NULL; + + IF vWarehouseFk IS NULL THEN + CALL util.throw('Warehouse not set'); + END IF; + + CALL cache.visible_refresh(vCalcFk, FALSE, vWarehouseFk); + + SET @outstanding = 0; + SET @oldsaleFk = 0; + + CREATE OR REPLACE TEMPORARY TABLE tSalePlacementQuantity + (INDEX(saleFk)) + ENGINE = MEMORY + SELECT saleFk, userFk, quantityToReserve, itemShelvingFk + FROM( SELECT saleFk, + sub.userFk, + itemShelvingFk , + IF(saleFk <> @oldsaleFk, @outstanding := quantity, @outstanding), + @qtr := LEAST(@outstanding, available) quantityToReserve, + @outStanding := @outStanding - @qtr, + @oldsaleFk := saleFk + FROM( + SELECT ts.saleFk, + ts.userFk, + s.quantity, + ish.id itemShelvingFk, + ish.visible - IFNULL(ishr.reservedQuantity, 0) available + FROM tmp.sale ts + JOIN sale s ON s.id = ts.saleFk + JOIN itemShelving ish ON ish.itemFk = s.itemFk + LEFT JOIN ( + SELECT itemShelvingFk, SUM(quantity) reservedQuantity + FROM itemShelvingSale + WHERE NOT isPicked + GROUP BY itemShelvingFk) ishr ON ishr.itemShelvingFk = ish.id + JOIN shelving sh ON sh.code = ish.shelvingFk + JOIN parking p ON p.id = sh.parkingFk + JOIN sector sc ON sc.id = p.sectorFk + JOIN warehouse w ON w.id = sc.warehouseFk + JOIN productionConfig pc + WHERE w.id = vWarehouseFk + AND NOT sc.isHideForPickers + ORDER BY + s.id, + p.pickingOrder >= vLastPickingOrder, + sh.priority DESC, + ish.visible >= s.quantity DESC, + s.quantity MOD ish.grouping = 0 DESC, + ish.grouping DESC, + IF(pc.orderMode = 'Location', p.pickingOrder, ish.created) + LIMIT 100000000000000000 + )sub + )sub2 + WHERE quantityToReserve > 0 + ; + + INSERT INTO itemShelvingSale( + itemShelvingFk, + saleFk, + quantity, + userFk) + SELECT itemShelvingFk, + saleFk, + quantityToReserve, + IFNULL(userFk, getUser()) + FROM tSalePlacementQuantity spl; + + DROP TEMPORARY TABLE tmp.sale; +END$$ +DELIMITER ; + + + +DELIMITER $$ +CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`itemShelvingSale_addBySale`( + vSelf INT , + vQuantity INT, + vUserFk INT +) +BEGIN +/** + * Reserva la ubicación para una saleFk + * + * @param vSelf Identificador de la venta + * @param vQuantity Cantidad a reservar + * @param vUserFk Id de usuario que realiza la reserva + */ + CREATE OR REPLACE TEMPORARY TABLE tmp.sale + ENGINE = MEMORY + SELECT vSelf saleFk, vUserFk userFk; + + CALL itemShelvingSale_addNew(); +END$$ +DELIMITER ; + + + +DELIMITER $$ +CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`itemShelvingSale_AFTER_INSERT` + AFTER INSERT ON `itemShelvingSale` + FOR EACH ROW +BEGIN + + UPDATE vn.sale + SET isPicked = TRUE + WHERE id = NEW.saleFk; + +END$$ +DELIMITER ; + +ALTER TABLE vn.itemShelvingSale DROP COLUMN IF EXISTS isPicked; + +ALTER TABLE vn.itemShelvingSale + ADD isPicked TINYINT(1) DEFAULT FALSE NOT NULL; + +ALTER TABLE vn.productionConfig DROP COLUMN IF EXISTS orderMode; + +ALTER TABLE vn.productionConfig + ADD orderMode ENUM('Location', 'Age') NOT NULL DEFAULT 'Location'; \ No newline at end of file diff --git a/loopback/locale/en.json b/loopback/locale/en.json index fb4e72bd6..7e194451f 100644 --- a/loopback/locale/en.json +++ b/loopback/locale/en.json @@ -187,5 +187,6 @@ "This ticket is not editable.": "This ticket is not editable.", "The ticket doesn't exist.": "The ticket doesn't exist.", "The sales do not exists": "The sales do not exists", - "Ticket without Route": "Ticket without route" + "Ticket without Route": "Ticket without route", + "Booking completed": "Booking completed" } diff --git a/loopback/locale/es.json b/loopback/locale/es.json index 756ce301a..034f267d0 100644 --- a/loopback/locale/es.json +++ b/loopback/locale/es.json @@ -314,8 +314,9 @@ "This ticket is locked.": "Este ticket está bloqueado.", "This ticket is not editable.": "Este ticket no es editable.", "The ticket doesn't exist.": "No existe el ticket.", - "Social name should be uppercase": "La razón social debe ir en mayúscula", + "Social name should be uppercase": "La razón social debe ir en mayúscula", "Street should be uppercase": "La dirección fiscal debe ir en mayúscula", "The response is not a PDF": "La respuesta no es un PDF", - "Ticket without Route": "Ticket sin ruta" -} + "Ticket without Route": "Ticket sin ruta", + "Booking completed": "Reserva completada" +} \ No newline at end of file diff --git a/modules/item/back/methods/item-shelving-sale/itemShelvingSaleByCollection.js b/modules/item/back/methods/item-shelving-sale/itemShelvingSaleByCollection.js new file mode 100644 index 000000000..2eb61a875 --- /dev/null +++ b/modules/item/back/methods/item-shelving-sale/itemShelvingSaleByCollection.js @@ -0,0 +1,22 @@ +module.exports = Self => { + Self.remoteMethod('itemShelvingSaleByCollection', { + description: 'Insert sales of the collection in itemShelvingSale', + accessType: 'WRITE', + accepts: [ + { + arg: 'id', + type: 'Number', + description: 'The collection id', + http: {source: 'path'} + } + ], + http: { + path: `/:id/itemShelvingSaleByCollection`, + verb: 'POST' + } + }); + + Self.itemShelvingSaleByCollection = async id => { + await Self.rawSql(`CALL vn.itemShelvingSale_addByCollection(?)`, [id]); + }; +}; diff --git a/modules/item/back/methods/item-shelving-sale/itemShelvingSaleSetQuantity.js b/modules/item/back/methods/item-shelving-sale/itemShelvingSaleSetQuantity.js new file mode 100644 index 000000000..bb2c4db0a --- /dev/null +++ b/modules/item/back/methods/item-shelving-sale/itemShelvingSaleSetQuantity.js @@ -0,0 +1,31 @@ +module.exports = Self => { + Self.remoteMethod('itemShelvingSaleSetQuantity', { + description: 'Set quanitity of a sale in itemShelvingSale', + accessType: 'WRITE', + accepts: [ + { + arg: 'id', + type: 'Number', + description: 'The sale id', + }, + { + arg: 'quantity', + type: 'Number', + description: 'The quantity to set', + }, + { + arg: 'isItemShelvingSaleEmpty', + type: 'Boolean', + description: 'True if the shelvingFk is empty ', + } + ], + http: { + path: `/itemShelvingSaleSetQuantity`, + verb: 'POST' + } + }); + + Self.itemShelvingSaleSetQuantity = async(id, quantity, isItemShelvingSaleEmpty) => { + await Self.rawSql(`CALL vn.itemShelvingSale_setQuantity(?, ?, ? )`, [id, quantity, isItemShelvingSaleEmpty]); + }; +}; diff --git a/modules/item/back/models/item-shelving-sale.js b/modules/item/back/models/item-shelving-sale.js index b89be9f00..e2d27564a 100644 --- a/modules/item/back/models/item-shelving-sale.js +++ b/modules/item/back/models/item-shelving-sale.js @@ -1,3 +1,5 @@ module.exports = Self => { require('../methods/item-shelving-sale/filter')(Self); + require('../methods/item-shelving-sale/itemShelvingSaleByCollection')(Self); + require('../methods/item-shelving-sale/itemShelvingSaleSetQuantity')(Self); }; From 4048627c765553f7acb6b804b5b42bbf7a4e5ab5 Mon Sep 17 00:00:00 2001 From: sergiodt Date: Thu, 28 Sep 2023 08:08:40 +0200 Subject: [PATCH 07/16] refs #5890 fix: format --- db/changes/234001/01-itemShelvingSale.sql | 8 ++++---- .../item-shelving-sale/itemShelvingSaleByCollection.js | 3 ++- .../item-shelving-sale/itemShelvingSaleSetQuantity.js | 9 ++++++--- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/db/changes/234001/01-itemShelvingSale.sql b/db/changes/234001/01-itemShelvingSale.sql index af68d465a..3b01f7da7 100644 --- a/db/changes/234001/01-itemShelvingSale.sql +++ b/db/changes/234001/01-itemShelvingSale.sql @@ -288,12 +288,12 @@ BEGIN END$$ DELIMITER ; -ALTER TABLE vn.itemShelvingSale DROP COLUMN IF EXISTS isPicked; +ALTER TABLE `vn`.`itemShelvingSale` DROP COLUMN IF EXISTS isPicked; -ALTER TABLE vn.itemShelvingSale +ALTER TABLE`vn`.`itemShelvingSale` ADD isPicked TINYINT(1) DEFAULT FALSE NOT NULL; -ALTER TABLE vn.productionConfig DROP COLUMN IF EXISTS orderMode; +ALTER TABLE `vn`.`productionConfig` DROP COLUMN IF EXISTS orderMode; -ALTER TABLE vn.productionConfig +ALTER TABLE `vn`.`productionConfig` ADD orderMode ENUM('Location', 'Age') NOT NULL DEFAULT 'Location'; \ No newline at end of file diff --git a/modules/item/back/methods/item-shelving-sale/itemShelvingSaleByCollection.js b/modules/item/back/methods/item-shelving-sale/itemShelvingSaleByCollection.js index 2eb61a875..2128d68a9 100644 --- a/modules/item/back/methods/item-shelving-sale/itemShelvingSaleByCollection.js +++ b/modules/item/back/methods/item-shelving-sale/itemShelvingSaleByCollection.js @@ -5,8 +5,9 @@ module.exports = Self => { accepts: [ { arg: 'id', - type: 'Number', + type: 'number', description: 'The collection id', + required: true, http: {source: 'path'} } ], diff --git a/modules/item/back/methods/item-shelving-sale/itemShelvingSaleSetQuantity.js b/modules/item/back/methods/item-shelving-sale/itemShelvingSaleSetQuantity.js index bb2c4db0a..6fe0e28a0 100644 --- a/modules/item/back/methods/item-shelving-sale/itemShelvingSaleSetQuantity.js +++ b/modules/item/back/methods/item-shelving-sale/itemShelvingSaleSetQuantity.js @@ -5,17 +5,20 @@ module.exports = Self => { accepts: [ { arg: 'id', - type: 'Number', + type: 'number', + required: true, description: 'The sale id', }, { arg: 'quantity', - type: 'Number', + type: 'number', + required: true, description: 'The quantity to set', }, { arg: 'isItemShelvingSaleEmpty', - type: 'Boolean', + type: 'boolean', + required: true, description: 'True if the shelvingFk is empty ', } ], From 65b0ec387f844bebb502771401161d2399c3d50d Mon Sep 17 00:00:00 2001 From: sergiodt Date: Thu, 28 Sep 2023 08:09:54 +0200 Subject: [PATCH 08/16] refs #5890 fix: format --- db/changes/234001/01-itemShelvingSale.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/changes/234001/01-itemShelvingSale.sql b/db/changes/234001/01-itemShelvingSale.sql index 3b01f7da7..b98004bc5 100644 --- a/db/changes/234001/01-itemShelvingSale.sql +++ b/db/changes/234001/01-itemShelvingSale.sql @@ -1,5 +1,5 @@ -ALTER TABLE vn.itemShelvingSale ADD isPicked TINYINT(1) DEFAULT FALSE NOT NULL; +ALTER TABLE `vn`.`itemShelvingSale` ADD isPicked TINYINT(1) DEFAULT FALSE NOT NULL; DELIMITER $$ CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`itemShelvingSale_addByCollection`( From 869bdab7ced8ca982a0cbb59e67d36eb895c8903 Mon Sep 17 00:00:00 2001 From: jorgep Date: Thu, 28 Sep 2023 11:36:03 +0200 Subject: [PATCH 09/16] ref #6065 fetchHours relocated --- modules/worker/front/card/index.js | 11 +- modules/worker/front/time-control/index.js | 181 +++++++++--------- .../worker/front/time-control/index.spec.js | 3 +- 3 files changed, 99 insertions(+), 96 deletions(-) diff --git a/modules/worker/front/card/index.js b/modules/worker/front/card/index.js index dcba2efcd..b8b533c5d 100644 --- a/modules/worker/front/card/index.js +++ b/modules/worker/front/card/index.js @@ -2,7 +2,7 @@ import ngModule from '../module'; import ModuleCard from 'salix/components/module-card'; class Controller extends ModuleCard { - async reload() { + reload() { const filter = { include: [ { @@ -31,12 +31,13 @@ class Controller extends ModuleCard { } ] }; - const promises = await Promise.all([ - this.$http.get(`Workers/${this.$params.id}`, {filter}), + + return Promise.all([ + this.$http.get(`Workers/${this.$params.id}`, {filter}) + .then(res => this.worker = res.data), this.$http.get(`Workers/${this.$params.id}/activeContract`) + .then(res => this.hasWorkCenter = res.data?.workCenterFk) ]); - this.worker = await promises[0].data; - this.worker.hasWorkCenter = await promises[1].data?.workCenterFk; } } diff --git a/modules/worker/front/time-control/index.js b/modules/worker/front/time-control/index.js index e21bfbfbb..943b40eb1 100644 --- a/modules/worker/front/time-control/index.js +++ b/modules/worker/front/time-control/index.js @@ -52,6 +52,28 @@ class Controller extends Section { set worker(value) { this._worker = value; + this.fetchHours(); + } + + /** + * Worker hours data + */ + get hours() { + return this._hours; + } + + set hours(value) { + this._hours = value; + + for (const weekDay of this.weekDays) { + if (value) { + let day = weekDay.dated.getDay(); + weekDay.hours = value + .filter(hour => new Date(hour.timed).getDay() == day) + .sort((a, b) => new Date(a.timed) - new Date(b.timed)); + } else + weekDay.hours = null; + } } /** @@ -87,10 +109,17 @@ class Controller extends Section { dayIndex.setDate(dayIndex.getDate() + 1); } - this.fetchHours(); this.getWeekData(); } + set weekTotalHours(totalHours) { + this._weekTotalHours = this.formatHours(totalHours); + } + + get weekTotalHours() { + return this._weekTotalHours; + } + getWeekData() { const filter = { where: { @@ -101,38 +130,19 @@ class Controller extends Section { }; this.$http.get('WorkerTimeControlMails', {filter}) .then(res => { - const workerTimeControlMail = res.data; - if (!workerTimeControlMail.length) { + const mail = res.data; + if (!mail.length) { this.state = null; return; } - this.state = workerTimeControlMail[0].state; - this.reason = workerTimeControlMail[0].reason; + this.state = mail[0].state; + this.reason = mail[0].reason; }); } - /** - * Worker hours data - */ - get hours() { - return this._hours; - } + fetchHours() { + if (!this.worker || !this.date) return; - set hours(value) { - this._hours = value; - - for (const weekDay of this.weekDays) { - if (value) { - let day = weekDay.dated.getDay(); - weekDay.hours = value - .filter(hour => new Date(hour.timed).getDay() == day) - .sort((a, b) => new Date(a.timed) - new Date(b.timed)); - } else - weekDay.hours = null; - } - } - - async fetchHours() { const params = {workerFk: this.$params.id}; const filter = { where: {and: [ @@ -140,62 +150,11 @@ class Controller extends Section { {timed: {lte: this.ended}} ]} }; - await this.$.model.applyFilter(filter, params); - if (!this.worker.hasWorkCenter) return; + this.$.model.applyFilter(filter, params).then(() => { + if (!this.card.hasWorkCenter) return; - await this.getWorkedHours(this.started, this.ended); - await this.getAbsences(); - } - - hasEvents(day) { - return day >= this.started && day < this.ended; - } - - getAbsences() { - const fullYear = this.started.getFullYear(); - let params = { - workerFk: this.$params.id, - businessFk: null, - year: fullYear - }; - - return this.$http.get(`Calendars/absences`, {params}) - .then(res => this.onData(res.data)); - } - - onData(data) { - const events = {}; - - const addEvent = (day, event) => { - events[new Date(day).getTime()] = event; - }; - - if (data.holidays) { - data.holidays.forEach(holiday => { - const holidayDetail = holiday.detail && holiday.detail.description; - const holidayType = holiday.type && holiday.type.name; - const holidayName = holidayDetail || holidayType; - - addEvent(holiday.dated, { - name: holidayName, - color: '#ff0' - }); - }); - } - if (data.absences) { - data.absences.forEach(absence => { - const type = absence.absenceType; - addEvent(absence.dated, { - name: type.name, - color: type.rgb - }); - }); - } - - this.weekDays.forEach(day => { - const timestamp = day.dated.getTime(); - if (events[timestamp]) - day.event = events[timestamp]; + this.getWorkedHours(this.started, this.ended); + this.getAbsences(); }); } @@ -238,6 +197,58 @@ class Controller extends Section { }); } + getAbsences() { + const fullYear = this.started.getFullYear(); + let params = { + workerFk: this.$params.id, + businessFk: null, + year: fullYear + }; + + return this.$http.get(`Calendars/absences`, {params}) + .then(res => this.onData(res.data)); + } + + hasEvents(day) { + return day >= this.started && day < this.ended; + } + + onData(data) { + const events = {}; + + const addEvent = (day, event) => { + events[new Date(day).getTime()] = event; + }; + + if (data.holidays) { + data.holidays.forEach(holiday => { + const holidayDetail = holiday.detail && holiday.detail.description; + const holidayType = holiday.type && holiday.type.name; + const holidayName = holidayDetail || holidayType; + + addEvent(holiday.dated, { + name: holidayName, + color: '#ff0' + }); + }); + } + if (data.absences) { + data.absences.forEach(absence => { + const type = absence.absenceType; + addEvent(absence.dated, { + name: type.name, + color: type.rgb + }); + }); + } + + this.weekDays.forEach(day => { + const timestamp = day.dated.getTime(); + if (events[timestamp]) + day.event = events[timestamp]; + }); + } + getFinishTime() { if (!this.weekDays) return; @@ -266,14 +277,6 @@ class Controller extends Section { } } - set weekTotalHours(totalHours) { - this._weekTotalHours = this.formatHours(totalHours); - } - - get weekTotalHours() { - return this._weekTotalHours; - } - formatHours(timestamp = 0) { let hour = Math.floor(timestamp / 3600); let min = Math.floor(timestamp / 60 - 60 * hour); diff --git a/modules/worker/front/time-control/index.spec.js b/modules/worker/front/time-control/index.spec.js index 6d8510ba8..10e8aba0d 100644 --- a/modules/worker/front/time-control/index.spec.js +++ b/modules/worker/front/time-control/index.spec.js @@ -22,7 +22,7 @@ describe('Component vnWorkerTimeControl', () => { })); describe('date() setter', () => { - it(`should set the weekDays, the date in the controller and call fetchHours`, () => { + it(`should set the weekDays and the date in the controller`, () => { let today = Date.vnNew(); jest.spyOn(controller, 'fetchHours').mockReturnThis(); @@ -32,7 +32,6 @@ describe('Component vnWorkerTimeControl', () => { expect(controller.started).toBeDefined(); expect(controller.ended).toBeDefined(); expect(controller.weekDays.length).toEqual(7); - expect(controller.fetchHours).toHaveBeenCalledWith(); }); }); From e209ab28f467a3c252fb33046981b753cff35402 Mon Sep 17 00:00:00 2001 From: jorgep Date: Thu, 28 Sep 2023 11:53:09 +0200 Subject: [PATCH 10/16] ref #6065 first time hours load fixed --- modules/worker/front/time-control/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/worker/front/time-control/index.js b/modules/worker/front/time-control/index.js index 943b40eb1..71de1cef4 100644 --- a/modules/worker/front/time-control/index.js +++ b/modules/worker/front/time-control/index.js @@ -109,6 +109,7 @@ class Controller extends Section { dayIndex.setDate(dayIndex.getDate() + 1); } + if (!this.weekTotalHours) this.fetchHours(); this.getWeekData(); } From e51df063d3cdd8d819368f6bdd1f53cae03ac506 Mon Sep 17 00:00:00 2001 From: alexm Date: Thu, 28 Sep 2023 13:26:05 +0200 Subject: [PATCH 11/16] refs #5890 feat: add userId in rawSql --- .../itemShelvingSaleByCollection.js | 11 ++++++++--- .../itemShelvingSaleSetQuantity.js | 13 ++++++++++--- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/modules/item/back/methods/item-shelving-sale/itemShelvingSaleByCollection.js b/modules/item/back/methods/item-shelving-sale/itemShelvingSaleByCollection.js index 2128d68a9..2059c28c9 100644 --- a/modules/item/back/methods/item-shelving-sale/itemShelvingSaleByCollection.js +++ b/modules/item/back/methods/item-shelving-sale/itemShelvingSaleByCollection.js @@ -1,5 +1,5 @@ module.exports = Self => { - Self.remoteMethod('itemShelvingSaleByCollection', { + Self.remoteMethodCtx('itemShelvingSaleByCollection', { description: 'Insert sales of the collection in itemShelvingSale', accessType: 'WRITE', accepts: [ @@ -17,7 +17,12 @@ module.exports = Self => { } }); - Self.itemShelvingSaleByCollection = async id => { - await Self.rawSql(`CALL vn.itemShelvingSale_addByCollection(?)`, [id]); + Self.itemShelvingSaleByCollection = async(ctx, id, options) => { + const myOptions = {userId: ctx.req.accessToken.userId}; + + if (typeof options == 'object') + Object.assign(myOptions, options); + + await Self.rawSql(`CALL vn.itemShelvingSale_addByCollection(?)`, [id], myOptions); }; }; diff --git a/modules/item/back/methods/item-shelving-sale/itemShelvingSaleSetQuantity.js b/modules/item/back/methods/item-shelving-sale/itemShelvingSaleSetQuantity.js index 6fe0e28a0..90e66c066 100644 --- a/modules/item/back/methods/item-shelving-sale/itemShelvingSaleSetQuantity.js +++ b/modules/item/back/methods/item-shelving-sale/itemShelvingSaleSetQuantity.js @@ -1,5 +1,5 @@ module.exports = Self => { - Self.remoteMethod('itemShelvingSaleSetQuantity', { + Self.remoteMethodCtx('itemShelvingSaleSetQuantity', { description: 'Set quanitity of a sale in itemShelvingSale', accessType: 'WRITE', accepts: [ @@ -28,7 +28,14 @@ module.exports = Self => { } }); - Self.itemShelvingSaleSetQuantity = async(id, quantity, isItemShelvingSaleEmpty) => { - await Self.rawSql(`CALL vn.itemShelvingSale_setQuantity(?, ?, ? )`, [id, quantity, isItemShelvingSaleEmpty]); + Self.itemShelvingSaleSetQuantity = async(ctx, id, quantity, isItemShelvingSaleEmpty, options) => { + const myOptions = {userId: ctx.req.accessToken.userId}; + + if (typeof options == 'object') + Object.assign(myOptions, options); + + await Self.rawSql(`CALL vn.itemShelvingSale_setQuantity(?, ?, ? )`, + [id, quantity, isItemShelvingSaleEmpty], + myOptions); }; }; From 934b4c4b364d74b5e00d46af3159e85fe3000406 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Andr=C3=A9s?= Date: Fri, 29 Sep 2023 10:53:06 +0200 Subject: [PATCH 12/16] refs #5890 --- db/changes/234002/.gitkeep | 0 .../01-itemShelvingSale.sql | 48 ++++++++----------- 2 files changed, 20 insertions(+), 28 deletions(-) create mode 100644 db/changes/234002/.gitkeep rename db/changes/{234001 => 234002}/01-itemShelvingSale.sql (90%) diff --git a/db/changes/234002/.gitkeep b/db/changes/234002/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/db/changes/234001/01-itemShelvingSale.sql b/db/changes/234002/01-itemShelvingSale.sql similarity index 90% rename from db/changes/234001/01-itemShelvingSale.sql rename to db/changes/234002/01-itemShelvingSale.sql index b98004bc5..817c6317a 100644 --- a/db/changes/234001/01-itemShelvingSale.sql +++ b/db/changes/234002/01-itemShelvingSale.sql @@ -1,13 +1,20 @@ +ALTER TABLE `vn`.`itemShelvingSale` DROP COLUMN IF EXISTS isPicked; -ALTER TABLE `vn`.`itemShelvingSale` ADD isPicked TINYINT(1) DEFAULT FALSE NOT NULL; +ALTER TABLE`vn`.`itemShelvingSale` + ADD isPicked TINYINT(1) DEFAULT FALSE NOT NULL; + +ALTER TABLE `vn`.`productionConfig` DROP COLUMN IF EXISTS orderMode; + +ALTER TABLE `vn`.`productionConfig` + ADD orderMode ENUM('Location', 'Age') NOT NULL DEFAULT 'Location'; DELIMITER $$ -CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`itemShelvingSale_addByCollection`( +CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`itemShelvingSale_reserveByCollection`( vCollectionFk INT(11) ) BEGIN /** - * Guarda la ubicación para el contenido de una colección + * Reserva cantidades con ubicaciones para el contenido de una colección * * @param vCollectionFk Identificador de collection */ @@ -27,7 +34,7 @@ BEGIN AND st.saleFk IS NULL AND NOT s.isPicked; - CALL itemShelvingSale_addNew(); + CALL itemShelvingSale_reserve(); END$$ DELIMITER ; @@ -87,9 +94,6 @@ BEGIN SET visible = IF(vIsItemShelvingSaleEmpty, 0, GREATEST(0,visible - vQuantity)) WHERE id = vItemShelvingFk; - /*Se podría preguntar por la cantidad correcta de la ubicació o insertar en una tabla - para que lo tenga en cuenta la gente que está haciendo inventario*/ - IF vIsItemShelvingSaleEmpty THEN OPEN vSales; l: LOOP @@ -104,7 +108,7 @@ l: LOOP ENGINE = MEMORY SELECT vCursorSaleFk, vUserFk; - CALL itemShelvingSale_addNewWhitUser(); + CALL itemShelvingSale_reserveWhitUser(); DROP TEMPORARY TABLE tmp.sale; END LOOP; @@ -124,7 +128,7 @@ l: LOOP AND NOT isPicked; IF vRemainingQuantity THEN - CALL itemShelvingSale_addBySale (vSaleFk, vRemainingQuantity, NULL); + CALL itemShelvingSale_reserveBySale (vSaleFk, vRemainingQuantity, NULL); SELECT SUM(quantity) INTO vRemainingQuantity FROM itemShelvingSale @@ -156,10 +160,10 @@ DELIMITER ; DELIMITER $$ -CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`itemShelvingSale_addNew`() +CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`itemShelvingSale_reserve`() BEGIN /** - * Guarda la ubicacion para un conjunto de sales del mismo wareHouse + * Reserva cantidades con ubicaciones para un conjunto de sales del mismo wareHouse * * @table tmp.sale(saleFk, userFk) */ @@ -227,12 +231,10 @@ BEGIN ish.visible >= s.quantity DESC, s.quantity MOD ish.grouping = 0 DESC, ish.grouping DESC, - IF(pc.orderMode = 'Location', p.pickingOrder, ish.created) - LIMIT 100000000000000000 + IF(pc.orderMode = 'Location', p.pickingOrder, ish.created) )sub )sub2 - WHERE quantityToReserve > 0 - ; + WHERE quantityToReserve > 0; INSERT INTO itemShelvingSale( itemShelvingFk, @@ -252,14 +254,14 @@ DELIMITER ; DELIMITER $$ -CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`itemShelvingSale_addBySale`( +CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`itemShelvingSale_reserveBySale`( vSelf INT , vQuantity INT, vUserFk INT ) BEGIN /** - * Reserva la ubicación para una saleFk + * Reserva cantida y ubicación para una saleFk * * @param vSelf Identificador de la venta * @param vQuantity Cantidad a reservar @@ -269,7 +271,7 @@ BEGIN ENGINE = MEMORY SELECT vSelf saleFk, vUserFk userFk; - CALL itemShelvingSale_addNew(); + CALL itemShelvingSale_reserve(); END$$ DELIMITER ; @@ -287,13 +289,3 @@ BEGIN END$$ DELIMITER ; - -ALTER TABLE `vn`.`itemShelvingSale` DROP COLUMN IF EXISTS isPicked; - -ALTER TABLE`vn`.`itemShelvingSale` - ADD isPicked TINYINT(1) DEFAULT FALSE NOT NULL; - -ALTER TABLE `vn`.`productionConfig` DROP COLUMN IF EXISTS orderMode; - -ALTER TABLE `vn`.`productionConfig` - ADD orderMode ENUM('Location', 'Age') NOT NULL DEFAULT 'Location'; \ No newline at end of file From 6e06d21f9eb6e29f15e2b773b8d7dd759a40f231 Mon Sep 17 00:00:00 2001 From: alexm Date: Fri, 29 Sep 2023 12:36:36 +0200 Subject: [PATCH 13/16] refs #5890 deploy: merge dev in test 234002 --- db/changes/234201/.gitkeep | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 db/changes/234201/.gitkeep diff --git a/db/changes/234201/.gitkeep b/db/changes/234201/.gitkeep deleted file mode 100644 index e69de29bb..000000000 From 10de00ea45392ce1dc9b8383daf4795aceff1853 Mon Sep 17 00:00:00 2001 From: alexm Date: Fri, 29 Sep 2023 12:37:53 +0200 Subject: [PATCH 14/16] refs #5890 deploy: test to dev --- db/changes/234201/.gitkeep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 db/changes/234201/.gitkeep diff --git a/db/changes/234201/.gitkeep b/db/changes/234201/.gitkeep new file mode 100644 index 000000000..e69de29bb From 1d440d5c02557a4273379746ea42b6fa7f591b72 Mon Sep 17 00:00:00 2001 From: alexm Date: Fri, 29 Sep 2023 12:40:11 +0200 Subject: [PATCH 15/16] refs #5890 correct version 234002 --- CHANGELOG.md | 7 ------- package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e95ac0f64..bc31f0579 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,17 +5,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [2342.01] - 2023-10-19 - -### Added -### Changed -### Fixed - ## [2340.01] - 2023-10-05 ### Added ### Changed - ### Fixed ## [2338.01] - 2023-09-21 diff --git a/package-lock.json b/package-lock.json index c3f88bc2c..feb7e7165 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "salix-back", - "version": "23.42.01", + "version": "23.40.02", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "salix-back", - "version": "23.42.01", + "version": "23.40.02", "license": "GPL-3.0", "dependencies": { "axios": "^1.2.2", diff --git a/package.json b/package.json index 3320705f5..f142d7179 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "salix-back", - "version": "23.42.01", + "version": "23.40.02", "author": "Verdnatura Levante SL", "description": "Salix backend", "license": "GPL-3.0", From 5797398cf2df712771022b654170501bfe770128 Mon Sep 17 00:00:00 2001 From: alexm Date: Fri, 29 Sep 2023 12:41:23 +0200 Subject: [PATCH 16/16] refs #5890 correct version 234201 in dev --- CHANGELOG.md | 6 ++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bc31f0579..64333df48 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2342.01] - 2023-10-19 + +### Added +### Changed +### Fixed + ## [2340.01] - 2023-10-05 ### Added diff --git a/package-lock.json b/package-lock.json index feb7e7165..c3f88bc2c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "salix-back", - "version": "23.40.02", + "version": "23.42.01", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "salix-back", - "version": "23.40.02", + "version": "23.42.01", "license": "GPL-3.0", "dependencies": { "axios": "^1.2.2", diff --git a/package.json b/package.json index f142d7179..3320705f5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "salix-back", - "version": "23.40.02", + "version": "23.42.01", "author": "Verdnatura Levante SL", "description": "Salix backend", "license": "GPL-3.0",