From 989b68c33a85259243ecfd587cbff7dafcd5eff6 Mon Sep 17 00:00:00 2001 From: sergiodt Date: Thu, 17 Oct 2024 12:44:05 +0200 Subject: [PATCH 1/6] fix: refs #6861 setQuantity --- .../procedures/itemShelvingSale_setQuantity.sql | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/db/routines/vn/procedures/itemShelvingSale_setQuantity.sql b/db/routines/vn/procedures/itemShelvingSale_setQuantity.sql index cde1b6872..f141762b5 100644 --- a/db/routines/vn/procedures/itemShelvingSale_setQuantity.sql +++ b/db/routines/vn/procedures/itemShelvingSale_setQuantity.sql @@ -3,7 +3,8 @@ CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`itemShelvingSale_setQ vItemShelvingSaleFk INT(10), vQuantity DECIMAL(10,0), vIsItemShelvingSaleEmpty BOOLEAN, - vSectorFk INT + vSectorFk INT, + vShelvingFk VARCHAR(10) ) BEGIN /** @@ -24,6 +25,7 @@ BEGIN DECLARE vItemFk INT; DECLARE vTotalQuantity INT; DECLARE vStateCode VARCHAR(45); + DECLARE vCurrentShelvingFk VARCHAR(10); DECLARE EXIT HANDLER FOR SQLEXCEPTION BEGIN @@ -45,18 +47,25 @@ BEGIN iss.saleFk, iss.itemShelvingFk, SUM(IFNULL(iss.quantity,0)), - IF(sgd.id, 'PREVIOUS_PREPARATION', 'PREPARED') + IF(sgd.id, 'PREVIOUS_PREPARATION', 'PREPARED'), + ish.shelvingFk INTO vItemFk, vSaleFk, vItemShelvingFk, vReservedQuantity, - vStateCode + vStateCode, + vCurrentShelvingFk FROM itemShelvingSale iss JOIN sale s ON s.id = iss.saleFk + JOIN itemShelving ish ON ish.id = iss.itemShelvingFk LEFT JOIN vn.saleGroupDetail sgd ON sgd.saleFk = iss.saleFk WHERE iss.id = vItemShelvingSaleFk AND NOT iss.isPicked; + IF NOT (vCurrentShelvingFk <=> vShelvingFk) THEN + CALL util.throw('The shelving can not be different from the shelving reserved'); + END IF; + IF vQuantity > vReservedQuantity OR (vQuantity < vReservedQuantity AND NOT vIsItemShelvingSaleEmpty) OR (vQuantity = vReservedQuantity AND vIsItemShelvingSaleEmpty) THEN From 3a8c37aef83218ba5674ab45dc1437fe9d68814f Mon Sep 17 00:00:00 2001 From: sergiodt Date: Tue, 12 Nov 2024 11:59:51 +0100 Subject: [PATCH 2/6] fix: refs #6861 refs#6861 getTickets --- back/methods/collection/getTickets.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/back/methods/collection/getTickets.js b/back/methods/collection/getTickets.js index 48301a366..4e91839f2 100644 --- a/back/methods/collection/getTickets.js +++ b/back/methods/collection/getTickets.js @@ -57,10 +57,10 @@ module.exports = Self => { ROW_NUMBER () OVER (PARTITION BY s.id ORDER BY pickingOrder) currentItemShelving, COUNT(*) OVER (PARTITION BY s.id ORDER BY s.id) totalItemShelving, sh.code, - p2.code parkingCode, - p2.pickingOrder pickingOrder, - p.code parkingCodePrevia, - p.pickingOrder pickingOrderPrevia, + p2.code parkingCodePrevia, + p2.pickingOrder pickingOrderPrevia, + p.code parkingCode, + p.pickingOrder pickingOrder, iss.id itemShelvingSaleFk, iss.isPicked, iss.itemShelvingFk From 6ed521ae5ea9913f258240cbff344d0d70599711 Mon Sep 17 00:00:00 2001 From: Jon Date: Fri, 15 Nov 2024 13:10:19 +0100 Subject: [PATCH 3/6] fix: redirect to invoice-out summary from salix' descriptor --- modules/invoiceOut/front/index.js | 2 +- modules/invoiceOut/front/routes.json | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/modules/invoiceOut/front/index.js b/modules/invoiceOut/front/index.js index a5e51d439..6d58a0a45 100644 --- a/modules/invoiceOut/front/index.js +++ b/modules/invoiceOut/front/index.js @@ -1,7 +1,7 @@ export * from './module'; import './main'; -import './summary'; import './descriptor'; import './descriptor-popover'; import './descriptor-menu'; +import './summary'; diff --git a/modules/invoiceOut/front/routes.json b/modules/invoiceOut/front/routes.json index 7c7495cb9..eba34dbbb 100644 --- a/modules/invoiceOut/front/routes.json +++ b/modules/invoiceOut/front/routes.json @@ -34,6 +34,21 @@ "params": { "invoice-out": "$ctrl.invoiceOut" } + }, + { + "url": "/:id", + "state": "invoiceOut.card", + "abstract": true, + "component": "vn-invoice-out-card" + }, + { + "url": "/negative-bases", + "state": "invoiceOut.negative-bases", + "component": "vn-negative-bases", + "description": "Negative bases", + "acl": [ + "administrative" + ] } ] } From 4783cc23ac43ff999a1875368d8f3afcfce9125f Mon Sep 17 00:00:00 2001 From: Jon Date: Fri, 15 Nov 2024 14:22:19 +0100 Subject: [PATCH 4/6] refactor: deleted negative bases route due to not being used --- modules/invoiceOut/front/routes.json | 9 --------- 1 file changed, 9 deletions(-) diff --git a/modules/invoiceOut/front/routes.json b/modules/invoiceOut/front/routes.json index eba34dbbb..908df3972 100644 --- a/modules/invoiceOut/front/routes.json +++ b/modules/invoiceOut/front/routes.json @@ -40,15 +40,6 @@ "state": "invoiceOut.card", "abstract": true, "component": "vn-invoice-out-card" - }, - { - "url": "/negative-bases", - "state": "invoiceOut.negative-bases", - "component": "vn-negative-bases", - "description": "Negative bases", - "acl": [ - "administrative" - ] } ] } From 6619ec451c4a7dc98aa7a3adab4014dd00e9b0c1 Mon Sep 17 00:00:00 2001 From: carlossa Date: Mon, 18 Nov 2024 13:46:56 +0100 Subject: [PATCH 5/6] fix: getSales --- modules/ticket/back/methods/ticket/getSales.js | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/ticket/back/methods/ticket/getSales.js b/modules/ticket/back/methods/ticket/getSales.js index e721d90ae..5b2288d31 100644 --- a/modules/ticket/back/methods/ticket/getSales.js +++ b/modules/ticket/back/methods/ticket/getSales.js @@ -37,6 +37,7 @@ module.exports = Self => { 'name', 'subName', 'itemPackingTypeFk', + 'size', 'tag5', 'value5', 'tag6', From 33d9ba9b44117c1dde72c64449b340a011370371 Mon Sep 17 00:00:00 2001 From: pablone Date: Tue, 19 Nov 2024 06:21:00 +0100 Subject: [PATCH 6/6] fix: refs #7404 negative quantity --- db/routines/vn/procedures/stockBought_calculate.sql | 2 +- .../back/methods/stock-bought/getStockBoughtDetail.js | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/db/routines/vn/procedures/stockBought_calculate.sql b/db/routines/vn/procedures/stockBought_calculate.sql index c3b5a0dc6..c248d0deb 100644 --- a/db/routines/vn/procedures/stockBought_calculate.sql +++ b/db/routines/vn/procedures/stockBought_calculate.sql @@ -80,7 +80,7 @@ proc: BEGIN UPDATE stockBought s JOIN tStockSold ts ON ts.workerFk = s.workerFk - SET s.bought = IF(s.bought < ts.sold, ROUND(s.bought - ts.sold, 1), 0) + SET s.bought = IF(s.bought < ABS(ts.sold), 0, ROUND(s.bought - ABS(ts.sold), 1)) WHERE s.dated = vDated; DROP TEMPORARY TABLE tCurrentData, tmp.item, tmp.buyUltimate, tStockSold; diff --git a/modules/entry/back/methods/stock-bought/getStockBoughtDetail.js b/modules/entry/back/methods/stock-bought/getStockBoughtDetail.js index 60b099682..723e04cb9 100644 --- a/modules/entry/back/methods/stock-bought/getStockBoughtDetail.js +++ b/modules/entry/back/methods/stock-bought/getStockBoughtDetail.js @@ -50,8 +50,11 @@ module.exports = Self => { i.id itemFk, i.name itemName, ti.quantity, - ROUND((ac.conversionCoefficient * (ti.quantity / b.packing) * buy_getVolume(b.id)) - / (vc.trolleyM3 * 1000000),1) volume, + ROUND((ac.conversionCoefficient * + (ti.quantity / b.packing) * + buy_getVolume(b.id) + ) / (vc.trolleyM3 * 1000000), + 2) volume, b.packagingFk packagingFk, b.packing FROM tmp.item ti