From bafd4456ef6b6f2c22ae4dec19a81a27cb7e3b96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Andr=C3=A9s?= Date: Fri, 15 Mar 2024 14:46:43 +0100 Subject: [PATCH 01/12] feat: conversion art. A1 a A2 refs #4979 --- db/routines/vn/procedures/buy_clone.sql | 61 +++ db/routines/vn/procedures/buy_cloneByBuy.sql | 23 ++ .../vn/procedures/entry_cloneHeader.sql | 2 +- db/routines/vn/procedures/entry_copyBuys.sql | 57 +-- db/routines/vn/procedures/item_devalueA2.sql | 352 ++++++++++++++++++ .../10955-orangeRuscus/00-firstScript.sql | 17 + 6 files changed, 462 insertions(+), 50 deletions(-) create mode 100644 db/routines/vn/procedures/buy_clone.sql create mode 100644 db/routines/vn/procedures/buy_cloneByBuy.sql create mode 100644 db/routines/vn/procedures/item_devalueA2.sql create mode 100644 db/versions/10955-orangeRuscus/00-firstScript.sql diff --git a/db/routines/vn/procedures/buy_clone.sql b/db/routines/vn/procedures/buy_clone.sql new file mode 100644 index 000000000..bbf742b23 --- /dev/null +++ b/db/routines/vn/procedures/buy_clone.sql @@ -0,0 +1,61 @@ +DELIMITER $$ +CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`buy_clone`(vEntryFk INT) +BEGIN +/** + * Clone buys to an entry + * + * @param vEntryFk The entry id + * @table tmp.buy(id) + */ + INSERT INTO buy( + entryFk, + itemFk, + quantity, + buyingValue, + freightValue, + isIgnored, + stickers, + packagingFk, + packing, + `grouping`, + groupingMode, + containerFk, + comissionValue, + packageValue, + packageFk, + price1, + price2, + price3, + minPrice, + isChecked, + location, + weight, + itemOriginalFk) + SELECT vEntryFk, + b.itemFk, + b.quantity, + b.buyingValue, + b.freightValue, + b.isIgnored, + b.stickers, + b.packagingFk, + b.packing, + b.`grouping`, + b.groupingMode, + b.containerFk, + b.comissionValue, + b.packageValue, + b.packageFk, + b.price1, + b.price2, + b.price3, + b.minPrice, + b.isChecked, + b.location, + b.weight, + b.itemOriginalFk + FROM tmp.buy tb + JOIN vn.buy b ON b.id = tb.id; + +END$$ +DELIMITER ; \ No newline at end of file diff --git a/db/routines/vn/procedures/buy_cloneByBuy.sql b/db/routines/vn/procedures/buy_cloneByBuy.sql new file mode 100644 index 000000000..73e91a9df --- /dev/null +++ b/db/routines/vn/procedures/buy_cloneByBuy.sql @@ -0,0 +1,23 @@ +DELIMITER $$ +CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`buy_cloneByBuy`( + OUT vBuyClonedFk INT, + IN vSelf INT, + IN vEntryFk INT +) +BEGIN +/** + * Clone a buy to an entry + * + * @param OUT vBuyClonedFk The new cloned buy id + * @param vSelf The buy id to clone + * @param vEntryFk The destination entry id + */ + CREATE OR REPLACE TEMPORARY TABLE tmp.buy + SELECT vSelf id; + + CALL buy_clone(vEntryFk); + SET vBuyClonedFk = LAST_INSERT_ID(); + + DROP TEMPORARY TABLE tmp.buy; +END$$ +DELIMITER ; \ No newline at end of file diff --git a/db/routines/vn/procedures/entry_cloneHeader.sql b/db/routines/vn/procedures/entry_cloneHeader.sql index 6a6df9194..7f9426663 100644 --- a/db/routines/vn/procedures/entry_cloneHeader.sql +++ b/db/routines/vn/procedures/entry_cloneHeader.sql @@ -9,8 +9,8 @@ BEGIN * Clones an entry header. * * @param vSelf The entry id + * @param OUT vNewEntryFk The new entry id * @param vTravelFk Travel for the new entry or %NULL to use the source entry travel - * @param vNewEntryFk The new entry id */ INSERT INTO entry( travelFk, diff --git a/db/routines/vn/procedures/entry_copyBuys.sql b/db/routines/vn/procedures/entry_copyBuys.sql index a00fbc846..9bf4a55e4 100644 --- a/db/routines/vn/procedures/entry_copyBuys.sql +++ b/db/routines/vn/procedures/entry_copyBuys.sql @@ -1,59 +1,18 @@ DELIMITER $$ -CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`entry_copyBuys`(vSelf INT, vCopyTo INT) +CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`entry_copyBuys`(vSelf INT, vDestinationEntryFk INT) BEGIN /** - * Copies an entry buys to another buy. + * Copies all buys from an entry to an entry. * * @param vSelf The entry id - * @param vCopyTo The destination entry id + * @param vDestinationEntryFk The destination entry id */ - INSERT INTO buy( - entryFk, - itemFk, - quantity, - buyingValue, - freightValue, - isIgnored, - stickers, - packing, - `grouping`, - groupingMode, - containerFk, - comissionValue, - packageValue, - packagingFk, - price1, - price2, - price3, - minPrice, - isChecked, - location, - weight, - itemOriginalFk - ) - SELECT vCopyTo, - itemFk, - quantity, - buyingValue, - freightValue, - isIgnored, - stickers, - packing, - `grouping`, - groupingMode, - containerFk, - comissionValue, - packageValue, - packagingFk, - price1, - price2, - price3, - minPrice, - isChecked, - location, - weight, - itemOriginalFk + CREATE OR REPLACE TEMPORARY TABLE tmp.buy + SELECT id FROM buy WHERE entryFk = vSelf; + + CALL buy_clone(vDestinationEntryFk); + DROP TEMPORARY TABLE tmp.buy; END$$ DELIMITER ; diff --git a/db/routines/vn/procedures/item_devalueA2.sql b/db/routines/vn/procedures/item_devalueA2.sql new file mode 100644 index 000000000..e1fb08388 --- /dev/null +++ b/db/routines/vn/procedures/item_devalueA2.sql @@ -0,0 +1,352 @@ +DELIMITER $$ +CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`item_devalueA2`( + vShelvingFK VARCHAR(10), + vItemFk INT, + vBuyingValue DECIMAL(10,4), + vQuantity INT +) +BEGIN +/** + * Devalua un item modificando su calidad de A1 a A2. + * Si no existe el item A2 lo crea y genera los movimientos de las entradas + * de almacén y shelvings correspondientes + * + * @param vShelvingFK Ubicación actual del artículo + * @param vItemFk Id de artículo a devaluar + * @param vBuyingValue Nuevo precio de coste + */ + DECLARE vItemA2Fk INT; + DECLARE vLastBuyFk BIGINT; + DECLARE vA1BuyFk INT; + DECLARE vA2BuyFk INT; + DECLARE vTargetEntryFk INT; + DECLARE vTargetEntryDate DATE; + DECLARE vTargetItemShelvingFk BIGINT; + DECLARE vWarehouseFk INT; + DECLARE vCacheFk INT; + DECLARE vLastEntryFk INT; + DECLARE vCurrentVisible INT; + DECLARE vInventoryTravelFk INT; + DECLARE vCurdate DATE; + + DECLARE CONTINUE HANDLER FOR SQLEXCEPTION + BEGIN + ROLLBACK; + RESIGNAL; + END; + + IF (SELECT TRUE FROM item WHERE id = vItemFk AND (category <> 'A1' OR category IS NULL)) THEN + CALL util.throw('Item has not category A1'); + END IF; + + SELECT warehouseFk INTO vWarehouseFk + FROM userConfig + WHERE userFk = account.myUser_getId(); + + IF NOT vWarehouseFk OR vWarehouseFk IS NULL THEN + CALL util.throw ('Operator has not a valid warehouse'); + END IF; + + SELECT util.VN_CURDATE() INTO vCurdate; + + SELECT t.id INTO vInventoryTravelFk + FROM travel t + JOIN travelConfig tc + WHERE t.shipped = vCurdate + AND t.landed = vCurdate + AND t.warehouseInFk = vWarehouseFk + AND t.warehouseOutFk = tc.devalueWarehouseOutFk + AND t.agencyModeFk = tc.devalueAgencyModeFk + LIMIT 1; + + IF NOT vInventoryTravelFk OR vInventoryTravelFk IS NULL THEN + INSERT INTO travel ( + shipped, + landed, + warehouseInFk, + warehouseOutFk, + `ref`, + isReceived, + agencyModeFk) + SELECT vCurdate, + vCurdate, + vWarehouseFk, + tc.devalueWarehouseOutFk, + tc.devalueRef, + TRUE, + tc.devalueAgencyModeFk + FROM travelConfig tc; + SET vInventoryTravelFk = LAST_INSERT_ID(); + END IF; + + SELECT id, dated INTO vTargetEntryFk, vTargetEntryDate + FROM `entry` e + WHERE created = vCurdate + AND typeFk ='devaluation' + AND travelFk = vInventoryTravelFk + ORDER BY created DESC + LIMIT 1; + + CALL buyUltimate(vWarehouseFk, vCurdate); + + SELECT b.entryFk, bu.buyFk INTO vLastEntryFk,vLastBuyFk + FROM tmp.buyUltimate bu + JOIN vn.buy b ON b.id =bu.buyFk + WHERE bu.itemFk = vItemFk + AND bu.warehouseFk = vWarehouseFk; + + SELECT id,visible INTO vTargetItemShelvingFk,vCurrentVisible + FROM itemShelving + WHERE shelvingFk = vShelvingFK COLLATE utf8mb3_general_ci + AND itemFk = vItemFk + LIMIT 1; + + IF vQuantity >= vCurrentVisible THEN + CALL util.throw('Quantity is greater than visible'); + END IF; + + START TRANSACTION; + + IF NOT vTargetEntryFk OR vTargetEntryFk IS NULL + OR NOT vTargetEntryDate <=> vCurdate THEN + INSERT INTO entry( + travelFk, + supplierFk, + dated, + commission, + currencyFk, + companyFk, + clonedFrom, + typeFk + ) + SELECT vInventoryTravelFk, + supplierFk, + vCurdate, + commission, + currencyFk, + companyFk, + vLastEntryFk, + 'devaluation' + FROM entry + WHERE id = vLastEntryFk; + + SET vTargetEntryFk = LAST_INSERT_ID(); + END IF; + + SELECT i.id INTO vItemA2Fk + FROM item i + JOIN ( + SELECT i.id, + i.name, + i.subname, + i.value5, + i.value6, + i.value7, + i.value8, + i.value9, + i.value10, + i.NumberOfItemsPerCask, + i.EmbalageCode, + i.quality + FROM item i + WHERE i.id = vItemFk + )i2 ON i2.name <=> i.name + AND i2.subname <=> i.subname + AND i2.value5 <=> i.value5 + AND i2.value6 <=> i.value6 + AND i2.value8 <=> i.value8 + AND i2.value9 <=> i.value9 + AND i2.value10 <=> i.value10 + AND i2.NumberOfItemsPerCask <=> i.NumberOfItemsPerCask + AND i2.EmbalageCode <=> i.EmbalageCode + AND i2.quality <=> i.quality + WHERE i.id <> i2.id + AND i.category = 'A2' + LIMIT 1; + + IF vItemA2Fk IS NULL THEN + INSERT INTO item ( + equivalent, + name, + `size`, + stems, + minPrice, + isToPrint, + family, + box, + category, + originFk, + doPhoto, + image, + inkFk, + intrastatFk, + hasMinPrice, + created, + comment, + typeFk, + generic, + producerFk, + description, + density, + relevancy, + expenseFk, + isActive, + longName, + subName, + tag5, + value5, + tag6, + value6, + tag7, + value7, + tag8, + value8, + tag9, + value9, + tag10, + value10, + minimum, + upToDown, + supplyResponseFk, + hasKgPrice, + isFloramondo, + isFragile, + numberOfItemsPerCask, + embalageCode, + quality, + stemMultiplier, + itemPackingTypeFk, + packingOut, + genericFk, + isLaid, + lastUsed, + weightByPiece, + editorFk, + recycledPlastic, + nonRecycledPlastic) + SELECT equivalent, + name, + `size`, + stems, + minPrice, + isToPrint, + family, + box, + 'A2', + originFk, + doPhoto, + image, + inkFk, + intrastatFk, + hasMinPrice, + created, + comment, + typeFk, + generic, + producerFk, + description, + density, + relevancy, + expenseFk, + isActive, + longName, + subName, + tag5, + value5, + tag6, + value6, + tag7, + value7, + tag8, + value8, + tag9, + value9, + tag10, + value10, + minimum, + upToDown, + supplyResponseFk, + hasKgPrice, + isFloramondo, + isFragile, + numberOfItemsPerCask, + embalageCode, + quality, + stemMultiplier, + itemPackingTypeFk, + packingOut, + genericFk, + isLaid, + lastUsed, + weightByPiece, + editorFk, + recycledPlastic, + nonRecycledPlastic + FROM item + WHERE id = vItemFk; + + SET vItemA2Fk = LAST_INSERT_ID(); + + UPDATE itemTaxCountry itc + JOIN itemTaxCountry itc2 ON itc2.itemFk = vItemFk + AND itc2.countryFk = itc.countryFk + SET itc2.taxClassFk = itc.taxClassFk + WHERE itc.id = vItemA2Fk; + + INSERT INTO itemBotanical (itemFk, genusFk, specieFk) + SELECT vItemA2Fk, genusFk, specieFk + FROM itemBotanical + WHERE itemFk = vItemFk; + END IF; + + IF vQuantity = vCurrentVisible THEN + DELETE FROM itemShelving + WHERE id = vTargetItemShelvingFk; + ELSE + UPDATE itemShelving + SET visible = vCurrentVisible - vQuantity + WHERE id = vTargetItemShelvingFk; + END IF; + + CALL buy_cloneByBuy(vA1BuyFk, vLastBuyFk, vTargetEntryFk); + UPDATE buy + SET quantity = - LEAST(vQuantity,vCurrentVisible), + isIgnored = TRUE, + buyingValue = vBuyingValue + WHERE id = vA1BuyFk; + + CALL buy_cloneByBuy(vA2BuyFk, vLastBuyFk, vTargetEntryFk); + UPDATE buy + SET quantity = vQuantity, + isIgnored = TRUE, + buyingValue = vBuyingValue, + itemFk = vItemA2Fk + WHERE id = vA2BuyFk; + + INSERT INTO itemShelving ( + itemFk, + shelvingFk, + visible, + `grouping`, + packing, + packagingFk, + userFk, + isChecked) + SELECT vItemA2Fk, + shelvingFk, + vQuantity, + `grouping`, + packing, + packagingFk, + account.myUser_getId(), + isChecked + FROM itemShelving + WHERE itemFK = vItemFk + AND shelvingFk = vShelvingFK COLLATE utf8mb3_general_ci; + + COMMIT; + CALL cache.visible_refresh(vCacheFk, TRUE, vWarehouseFk); + CALL cache.available_refresh(vCacheFk, TRUE, vWarehouseFk, vCurdate); + CALL buy_recalcPricesByBuy(vA2BuyFk); +END$$ +DELIMITER ; \ No newline at end of file diff --git a/db/versions/10955-orangeRuscus/00-firstScript.sql b/db/versions/10955-orangeRuscus/00-firstScript.sql new file mode 100644 index 000000000..745c058bf --- /dev/null +++ b/db/versions/10955-orangeRuscus/00-firstScript.sql @@ -0,0 +1,17 @@ +INSERT IGNORE INTO vn.entryType (code, description) + VALUES ('devaluation', 'Devaluación'); + +ALTER TABLE vn.travelConfig ADD IF NOT EXISTS devalueWarehouseOutFk SMALLINT(6) UNSIGNED NULL + COMMENT 'Datos del travel para las entradas generadas al devaluar artículos de A1 a A2'; + +ALTER TABLE vn.travelConfig ADD IF NOT EXISTS devalueAgencyModeFk INT(11) NULL; +ALTER TABLE vn.travelConfig ADD IF NOT EXISTS devalueRef varchar(20) NULL; + +ALTER TABLE vn.travelConfig DROP FOREIGN KEY IF EXISTS travelConfig_agencyMode_FK; + +ALTER TABLE vn.travelConfig ADD CONSTRAINT travelConfig_agencyMode_FK + FOREIGN KEY (devalueAgencyModeFk) REFERENCES vn.agencyMode(id) ON DELETE SET NULL ON UPDATE CASCADE; + +ALTER TABLE vn.travelConfig DROP FOREIGN KEY IF EXISTS travelConfig_warehouse_FK; +ALTER TABLE vn.travelConfig ADD CONSTRAINT travelConfig_warehouse_FK + FOREIGN KEY (devalueWarehouseOutFk) REFERENCES vn.warehouse(id) ON DELETE SET NULL ON UPDATE CASCADE; From d6451a94e3f080fed07f6406d92396ea2f1627d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Andr=C3=A9s?= Date: Wed, 8 May 2024 17:38:52 +0200 Subject: [PATCH 02/12] feat: conversion art. A1 a A2 refs #4979 --- db/routines/vn/procedures/buy_clone.sql | 2 - db/routines/vn/procedures/buy_cloneByBuy.sql | 23 ----- db/routines/vn/procedures/item_devalueA2.sql | 88 ++++++++++++++++---- 3 files changed, 73 insertions(+), 40 deletions(-) delete mode 100644 db/routines/vn/procedures/buy_cloneByBuy.sql diff --git a/db/routines/vn/procedures/buy_clone.sql b/db/routines/vn/procedures/buy_clone.sql index bbf742b23..d3fbf888d 100644 --- a/db/routines/vn/procedures/buy_clone.sql +++ b/db/routines/vn/procedures/buy_clone.sql @@ -22,7 +22,6 @@ BEGIN containerFk, comissionValue, packageValue, - packageFk, price1, price2, price3, @@ -45,7 +44,6 @@ BEGIN b.containerFk, b.comissionValue, b.packageValue, - b.packageFk, b.price1, b.price2, b.price3, diff --git a/db/routines/vn/procedures/buy_cloneByBuy.sql b/db/routines/vn/procedures/buy_cloneByBuy.sql deleted file mode 100644 index 73e91a9df..000000000 --- a/db/routines/vn/procedures/buy_cloneByBuy.sql +++ /dev/null @@ -1,23 +0,0 @@ -DELIMITER $$ -CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`buy_cloneByBuy`( - OUT vBuyClonedFk INT, - IN vSelf INT, - IN vEntryFk INT -) -BEGIN -/** - * Clone a buy to an entry - * - * @param OUT vBuyClonedFk The new cloned buy id - * @param vSelf The buy id to clone - * @param vEntryFk The destination entry id - */ - CREATE OR REPLACE TEMPORARY TABLE tmp.buy - SELECT vSelf id; - - CALL buy_clone(vEntryFk); - SET vBuyClonedFk = LAST_INSERT_ID(); - - DROP TEMPORARY TABLE tmp.buy; -END$$ -DELIMITER ; \ No newline at end of file diff --git a/db/routines/vn/procedures/item_devalueA2.sql b/db/routines/vn/procedures/item_devalueA2.sql index e1fb08388..4ad6fcfa2 100644 --- a/db/routines/vn/procedures/item_devalueA2.sql +++ b/db/routines/vn/procedures/item_devalueA2.sql @@ -308,21 +308,79 @@ BEGIN WHERE id = vTargetItemShelvingFk; END IF; - CALL buy_cloneByBuy(vA1BuyFk, vLastBuyFk, vTargetEntryFk); - UPDATE buy - SET quantity = - LEAST(vQuantity,vCurrentVisible), - isIgnored = TRUE, - buyingValue = vBuyingValue - WHERE id = vA1BuyFk; - - CALL buy_cloneByBuy(vA2BuyFk, vLastBuyFk, vTargetEntryFk); - UPDATE buy - SET quantity = vQuantity, - isIgnored = TRUE, - buyingValue = vBuyingValue, - itemFk = vItemA2Fk - WHERE id = vA2BuyFk; - + INSERT INTO buy( + entryFk, + itemFk, + quantity, + buyingValue, + freightValue, + isIgnored, + stickers, + packagingFk, + packing, + `grouping`, + groupingMode, + containerFk, + comissionValue, + packageValue, + price1, + price2, + price3, + minPrice, + isChecked, + location, + weight, + itemOriginalFk) + SELECT vTargetEntryFk, + itemFk, + - LEAST(vQuantity, vCurrentVisible), + vBuyingValue, + freightValue, + TRUE, + stickers, + packagingFk, + packing, + `grouping`, + groupingMode, + containerFk, + comissionValue, + packageValue, + price1, + price2, + price3, + minPrice, + isChecked, + location, + weight, + itemOriginalFk + FROM vn.buy + WHERE id = vLastBuyFk + UNION + SELECT vTargetEntryFk, + vItemA2Fk, + vQuantity, + vBuyingValue, + freightValue, + TRUE, + stickers, + packagingFk, + packing, + `grouping`, + groupingMode, + containerFk, + comissionValue, + packageValue, + price1, + price2, + price3, + minPrice, + isChecked, + location, + weight, + itemOriginalFk + FROM vn.buy + WHERE id = vLastBuyFk; + INSERT INTO itemShelving ( itemFk, shelvingFk, From cc941de606be39dfebce5cc529e84b1c609d503e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Andr=C3=A9s?= Date: Thu, 9 May 2024 14:24:20 +0200 Subject: [PATCH 03/12] feat: conversion art. A1 a A2 refs #4979 --- .../vn/procedures/buy_recalcPricesByBuy.sql | 2 +- db/routines/vn/procedures/item_devalueA2.sql | 99 +++++++++---------- 2 files changed, 48 insertions(+), 53 deletions(-) diff --git a/db/routines/vn/procedures/buy_recalcPricesByBuy.sql b/db/routines/vn/procedures/buy_recalcPricesByBuy.sql index b963bae14..12c0df985 100644 --- a/db/routines/vn/procedures/buy_recalcPricesByBuy.sql +++ b/db/routines/vn/procedures/buy_recalcPricesByBuy.sql @@ -8,7 +8,7 @@ BEGIN */ DROP TEMPORARY TABLE IF EXISTS tmp.buyRecalc; - CREATE TEMPORARY TABLE tmp.buyRecalc + CREATE TEMPORARY TABLE tmp.buyRecalc SELECT vBuyFk id; CALL buy_recalcPrices(); diff --git a/db/routines/vn/procedures/item_devalueA2.sql b/db/routines/vn/procedures/item_devalueA2.sql index 4ad6fcfa2..276c5b508 100644 --- a/db/routines/vn/procedures/item_devalueA2.sql +++ b/db/routines/vn/procedures/item_devalueA2.sql @@ -1,7 +1,7 @@ DELIMITER $$ CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`item_devalueA2`( + vSelf INT, vShelvingFK VARCHAR(10), - vItemFk INT, vBuyingValue DECIMAL(10,4), vQuantity INT ) @@ -11,8 +11,8 @@ BEGIN * Si no existe el item A2 lo crea y genera los movimientos de las entradas * de almacén y shelvings correspondientes * + * @param vSelf Id de artículo a devaluar * @param vShelvingFK Ubicación actual del artículo - * @param vItemFk Id de artículo a devaluar * @param vBuyingValue Nuevo precio de coste */ DECLARE vItemA2Fk INT; @@ -26,7 +26,7 @@ BEGIN DECLARE vCacheFk INT; DECLARE vLastEntryFk INT; DECLARE vCurrentVisible INT; - DECLARE vInventoryTravelFk INT; + DECLARE vDevalueTravelFk INT; DECLARE vCurdate DATE; DECLARE CONTINUE HANDLER FOR SQLEXCEPTION @@ -35,7 +35,7 @@ BEGIN RESIGNAL; END; - IF (SELECT TRUE FROM item WHERE id = vItemFk AND (category <> 'A1' OR category IS NULL)) THEN + IF (SELECT TRUE FROM item WHERE id = vSelf AND (category <> 'A1' OR category IS NULL)) THEN CALL util.throw('Item has not category A1'); END IF; @@ -47,11 +47,15 @@ BEGIN CALL util.throw ('Operator has not a valid warehouse'); END IF; + IF vQuantity <= 0 OR vQuantity IS NULL THEN + CALL util.throw ('The quantity is incorrect'); + END IF; + SELECT util.VN_CURDATE() INTO vCurdate; - SELECT t.id INTO vInventoryTravelFk + SELECT t.id INTO vDevalueTravelFk FROM travel t - JOIN travelConfig tc + JOIN travelConfig tc WHERE t.shipped = vCurdate AND t.landed = vCurdate AND t.warehouseInFk = vWarehouseFk @@ -59,7 +63,7 @@ BEGIN AND t.agencyModeFk = tc.devalueAgencyModeFk LIMIT 1; - IF NOT vInventoryTravelFk OR vInventoryTravelFk IS NULL THEN + IF NOT vDevalueTravelFk OR vDevalueTravelFk IS NULL THEN INSERT INTO travel ( shipped, landed, @@ -76,14 +80,14 @@ BEGIN TRUE, tc.devalueAgencyModeFk FROM travelConfig tc; - SET vInventoryTravelFk = LAST_INSERT_ID(); + SET vDevalueTravelFk = LAST_INSERT_ID(); END IF; - SELECT id, dated INTO vTargetEntryFk, vTargetEntryDate + SELECT id, DATE(dated) INTO vTargetEntryFk, vTargetEntryDate FROM `entry` e - WHERE created = vCurdate + WHERE DATE(dated) = vCurdate AND typeFk ='devaluation' - AND travelFk = vInventoryTravelFk + AND travelFk = vDevalueTravelFk ORDER BY created DESC LIMIT 1; @@ -92,23 +96,31 @@ BEGIN SELECT b.entryFk, bu.buyFk INTO vLastEntryFk,vLastBuyFk FROM tmp.buyUltimate bu JOIN vn.buy b ON b.id =bu.buyFk - WHERE bu.itemFk = vItemFk + WHERE bu.itemFk = vSelf AND bu.warehouseFk = vWarehouseFk; - SELECT id,visible INTO vTargetItemShelvingFk,vCurrentVisible + IF vLastEntryFk IS NULL OR vLastBuyFk IS NULL THEN + CALL util.throw ('The item has not a buy'); + END IF; + + SELECT id,visible INTO vTargetItemShelvingFk, vCurrentVisible FROM itemShelving WHERE shelvingFk = vShelvingFK COLLATE utf8mb3_general_ci - AND itemFk = vItemFk + AND itemFk = vSelf LIMIT 1; - IF vQuantity >= vCurrentVisible THEN + IF vCurrentVisible IS NULL THEN + CALL util.throw ('The shelving has not a visible for this item'); + END IF; + + IF vQuantity > vCurrentVisible THEN CALL util.throw('Quantity is greater than visible'); END IF; START TRANSACTION; IF NOT vTargetEntryFk OR vTargetEntryFk IS NULL - OR NOT vTargetEntryDate <=> vCurdate THEN + OR NOT vTargetEntryDate <=> vCurdate THEN INSERT INTO entry( travelFk, supplierFk, @@ -119,7 +131,7 @@ BEGIN clonedFrom, typeFk ) - SELECT vInventoryTravelFk, + SELECT vDevalueTravelFk, supplierFk, vCurdate, commission, @@ -149,7 +161,7 @@ BEGIN i.EmbalageCode, i.quality FROM item i - WHERE i.id = vItemFk + WHERE i.id = vSelf )i2 ON i2.name <=> i.name AND i2.subname <=> i.subname AND i2.value5 <=> i.value5 @@ -193,18 +205,6 @@ BEGIN isActive, longName, subName, - tag5, - value5, - tag6, - value6, - tag7, - value7, - tag8, - value8, - tag9, - value9, - tag10, - value10, minimum, upToDown, supplyResponseFk, @@ -250,19 +250,7 @@ BEGIN expenseFk, isActive, longName, - subName, - tag5, - value5, - tag6, - value6, - tag7, - value7, - tag8, - value8, - tag9, - value9, - tag10, - value10, + subName, minimum, upToDown, supplyResponseFk, @@ -283,20 +271,25 @@ BEGIN recycledPlastic, nonRecycledPlastic FROM item - WHERE id = vItemFk; + WHERE id = vSelf; SET vItemA2Fk = LAST_INSERT_ID(); + INSERT INTO itemTag (itemFk, tagFk, `value`, intValue, priority, editorFk) + SELECT vItemA2Fk, tagFk, `value`, intValue, priority, editorFk + FROM itemTag + WHERE id = vSelf; + UPDATE itemTaxCountry itc - JOIN itemTaxCountry itc2 ON itc2.itemFk = vItemFk + JOIN itemTaxCountry itc2 ON itc2.itemFk = vSelf AND itc2.countryFk = itc.countryFk SET itc2.taxClassFk = itc.taxClassFk WHERE itc.id = vItemA2Fk; - + INSERT INTO itemBotanical (itemFk, genusFk, specieFk) SELECT vItemA2Fk, genusFk, specieFk FROM itemBotanical - WHERE itemFk = vItemFk; + WHERE itemFk = vSelf; END IF; IF vQuantity = vCurrentVisible THEN @@ -334,7 +327,7 @@ BEGIN SELECT vTargetEntryFk, itemFk, - LEAST(vQuantity, vCurrentVisible), - vBuyingValue, + buyingValue, freightValue, TRUE, stickers, @@ -381,7 +374,7 @@ BEGIN FROM vn.buy WHERE id = vLastBuyFk; - INSERT INTO itemShelving ( + INSERT IGNORE INTO itemShelving ( itemFk, shelvingFk, visible, @@ -392,15 +385,17 @@ BEGIN isChecked) SELECT vItemA2Fk, shelvingFk, - vQuantity, + vQuantity , `grouping`, packing, packagingFk, account.myUser_getId(), isChecked FROM itemShelving - WHERE itemFK = vItemFk - AND shelvingFk = vShelvingFK COLLATE utf8mb3_general_ci; + WHERE itemFK = vSelf + AND shelvingFk = vShelvingFK COLLATE utf8mb3_general_ci + ON DUPLICATE KEY UPDATE + visible = vQuantity + VALUES(visible); COMMIT; CALL cache.visible_refresh(vCacheFk, TRUE, vWarehouseFk); From 9b73cdfa6ffe0edfa39a228b0e9d40fc241a868b Mon Sep 17 00:00:00 2001 From: sergiodt Date: Wed, 15 May 2024 17:03:33 +0200 Subject: [PATCH 04/12] refs #4979 feat:getInfoDetails && item_devalueA2 --- .../itemShelving_getItemDetails.sql | 90 +++++++++++++++++++ db/routines/vn/procedures/item_devalueA2.sql | 14 ++- 2 files changed, 100 insertions(+), 4 deletions(-) create mode 100644 db/routines/vn/procedures/itemShelving_getItemDetails.sql diff --git a/db/routines/vn/procedures/itemShelving_getItemDetails.sql b/db/routines/vn/procedures/itemShelving_getItemDetails.sql new file mode 100644 index 000000000..2134f00c4 --- /dev/null +++ b/db/routines/vn/procedures/itemShelving_getItemDetails.sql @@ -0,0 +1,90 @@ +DELIMITER $$ +CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`itemShelving_getItemDetails`(vBarcodeItem INT, vShelvingFK VARCHAR(10) ) +BEGIN + +/** + * Obtiene el precio y visible de un item + * + * @param vBarcodeItem barcode de artículo + * @param vBarcodeItem Ubicación actual del artículo + */ + DECLARE vIsItem BOOL; + DECLARE vItemFk INT; + DECLARE vItemCost DECIMAL(10,4); + DECLARE vCacheVisibleFk INT; + DECLARE vWarehouseFk INT; + DECLARE vVisible INT; + + + SELECT COUNT(*)>0 INTO vIsItem + FROM vn.item + WHERE id = vBarcodeItem; + + IF NOT vIsItem THEN + + SELECT IFNULL(b.buyingValue, 0) + + IFNULL(b.freightValue, 0) + + IFNULL(b.comissionValue, 0) + + IFNULL(b.packageValue, 0), + SUM(is2.visible) , + b.itemFk + INTO vItemCost, vVisible, vItemFk + FROM itemShelving is2 + JOIN buy b ON b.itemFk = is2.itemFk AND b.id = vBarcodeItem + WHERE is2.shelvingFk = vShelvingFK COLLATE utf8mb3_general_ci + GROUP BY shelvingFK; + + SELECT vItemFk itemFk, + vShelvingFK shelvingFk, + vItemCost itemCost, + vVisible quantity; + + END IF; + + IF vItemCost IS NULL THEN + + SELECT warehouseFk INTO vWarehouseFk + FROM operator + WHERE workerFk = account.myUser_getId(); + + SELECT barcodeToItem(vBarcodeItem) INTO vItemFk; + + IF vItemFk IS NULL THEN + CALL util.throw ('Item not valid'); + ELSE + CALL buyUltimate(vWarehouseFk, util.VN_CURDATE()); + + SELECT IFNULL(b.buyingValue, 0) + + IFNULL(b.freightValue, 0) + + IFNULL(b.comissionValue, 0) + + IFNULL(b.packageValue, 0) itemCost, + SUM(is2.visible) visible, + is2.itemFk + INTO vItemCost, vVisible, vItemFk + FROM itemShelving is2 + JOIN tmp.buyUltimate bu ON bu.itemFk = is2.itemFk + JOIN buy b ON b.id = bu.buyFk + WHERE is2.itemFk = vBarcodeItem AND + is2.shelvingFk = vShelvingFK COLLATE utf8mb3_general_ci; + + IF vItemFk IS NULL THEN + CALL util.throw ('Item not valid'); + ELSE + SELECT vItemFk itemFk, + vShelvingFK shelvingFk, + vItemCost itemCost, + vVisible quantity; + END IF; + + DELETE FROM tmp.buyUltimate; + + END IF; + + END IF; + + IF vItemCost IS NULL THEN + CALL util.throw ('Item not valid'); + END IF; + +END$$ +DELIMITER ; \ No newline at end of file diff --git a/db/routines/vn/procedures/item_devalueA2.sql b/db/routines/vn/procedures/item_devalueA2.sql index 276c5b508..f331c7230 100644 --- a/db/routines/vn/procedures/item_devalueA2.sql +++ b/db/routines/vn/procedures/item_devalueA2.sql @@ -14,6 +14,7 @@ BEGIN * @param vSelf Id de artículo a devaluar * @param vShelvingFK Ubicación actual del artículo * @param vBuyingValue Nuevo precio de coste + * @param vQuantity Cantidad del ítem a pasar a A2 */ DECLARE vItemA2Fk INT; DECLARE vLastBuyFk BIGINT; @@ -28,6 +29,7 @@ BEGIN DECLARE vCurrentVisible INT; DECLARE vDevalueTravelFk INT; DECLARE vCurdate DATE; + DECLARE vBuyingValueOriginal DECIMAL(10,4); DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN @@ -86,19 +88,23 @@ BEGIN SELECT id, DATE(dated) INTO vTargetEntryFk, vTargetEntryDate FROM `entry` e WHERE DATE(dated) = vCurdate - AND typeFk ='devaluation' + AND typeFk = 'devaluation' AND travelFk = vDevalueTravelFk ORDER BY created DESC LIMIT 1; CALL buyUltimate(vWarehouseFk, vCurdate); - SELECT b.entryFk, bu.buyFk INTO vLastEntryFk,vLastBuyFk + SELECT b.entryFk, bu.buyFk,IFNULL(b.buyingValue, 0) INTO vLastEntryFk, vLastBuyFk, vBuyingValueOriginal FROM tmp.buyUltimate bu - JOIN vn.buy b ON b.id =bu.buyFk + JOIN vn.buy b ON b.id = bu.buyFk WHERE bu.itemFk = vSelf AND bu.warehouseFk = vWarehouseFk; - + + IF vBuyingValue > vBuyingValueOriginal THEN + CALL util.throw ('Price not valid'); + END IF; + IF vLastEntryFk IS NULL OR vLastBuyFk IS NULL THEN CALL util.throw ('The item has not a buy'); END IF; From 135526e5131b2cbaf400fbb956966a08ee6f0084 Mon Sep 17 00:00:00 2001 From: sergiodt Date: Fri, 17 May 2024 11:20:26 +0200 Subject: [PATCH 05/12] refs #4979 feat:getInfoDetails && item_devalueA2 --- db/routines/vn/procedures/itemShelving_getItemDetails.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/routines/vn/procedures/itemShelving_getItemDetails.sql b/db/routines/vn/procedures/itemShelving_getItemDetails.sql index 2134f00c4..fdfd2a5b6 100644 --- a/db/routines/vn/procedures/itemShelving_getItemDetails.sql +++ b/db/routines/vn/procedures/itemShelving_getItemDetails.sql @@ -6,7 +6,7 @@ BEGIN * Obtiene el precio y visible de un item * * @param vBarcodeItem barcode de artículo - * @param vBarcodeItem Ubicación actual del artículo + * @param vShelvingFK Ubicación actual del artículo */ DECLARE vIsItem BOOL; DECLARE vItemFk INT; From 968effc93641ab9948274122a2d3966b8ba9c552 Mon Sep 17 00:00:00 2001 From: guillermo Date: Fri, 17 May 2024 11:56:04 +0200 Subject: [PATCH 06/12] hotfix: ticket 135539 Unroute tickets --- modules/ticket/back/methods/ticket/closeAll.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/modules/ticket/back/methods/ticket/closeAll.js b/modules/ticket/back/methods/ticket/closeAll.js index d35bd1e3e..e3cbc83e2 100644 --- a/modules/ticket/back/methods/ticket/closeAll.js +++ b/modules/ticket/back/methods/ticket/closeAll.js @@ -138,12 +138,10 @@ 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 - JOIN zone z ON z.id = t.zoneFk SET t.routeFk = NULL WHERE DATE(t.shipped) BETWEEN ? - INTERVAL 2 DAY AND util.dayEnd(?) - AND al.code NOT IN('DELIVERED','PACKED') - AND t.routeFk - AND z.name LIKE '%MADRID%'`, [toDate, toDate], {userId: ctx.req.accessToken.userId}); + AND al.code NOT IN ('DELIVERED', 'PACKED') + AND t.routeFk`, [toDate, toDate], {userId: ctx.req.accessToken.userId}); return { message: 'Success' From c8db0a3aa817e1bbd1e4a7e4891414e9364f1cc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Andr=C3=A9s?= Date: Fri, 17 May 2024 12:48:16 +0200 Subject: [PATCH 07/12] refs #4979 feat:getInfoDetails && item_devalueA2 --- db/.pullinfo.json | 2 +- .../itemShelving_getItemDetails.sql | 101 ++++++------------ 2 files changed, 34 insertions(+), 69 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/routines/vn/procedures/itemShelving_getItemDetails.sql b/db/routines/vn/procedures/itemShelving_getItemDetails.sql index fdfd2a5b6..25afd192b 100644 --- a/db/routines/vn/procedures/itemShelving_getItemDetails.sql +++ b/db/routines/vn/procedures/itemShelving_getItemDetails.sql @@ -1,7 +1,9 @@ DELIMITER $$ -CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`itemShelving_getItemDetails`(vBarcodeItem INT, vShelvingFK VARCHAR(10) ) +CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`itemShelving_getItemDetails`( + vBarcodeItem INT, + vShelvingFK VARCHAR(10) +) BEGIN - /** * Obtiene el precio y visible de un item * @@ -9,82 +11,45 @@ BEGIN * @param vShelvingFK Ubicación actual del artículo */ DECLARE vIsItem BOOL; - DECLARE vItemFk INT; - DECLARE vItemCost DECIMAL(10,4); - DECLARE vCacheVisibleFk INT; + DECLARE vBuyFk INT; DECLARE vWarehouseFk INT; - DECLARE vVisible INT; - - SELECT COUNT(*)>0 INTO vIsItem - FROM vn.item + SELECT COUNT(*) > 0 INTO vIsItem + FROM item WHERE id = vBarcodeItem; - IF NOT vIsItem THEN - - SELECT IFNULL(b.buyingValue, 0) + - IFNULL(b.freightValue, 0) + - IFNULL(b.comissionValue, 0) + - IFNULL(b.packageValue, 0), - SUM(is2.visible) , - b.itemFk - INTO vItemCost, vVisible, vItemFk - FROM itemShelving is2 - JOIN buy b ON b.itemFk = is2.itemFk AND b.id = vBarcodeItem - WHERE is2.shelvingFk = vShelvingFK COLLATE utf8mb3_general_ci - GROUP BY shelvingFK; - - SELECT vItemFk itemFk, - vShelvingFK shelvingFk, - vItemCost itemCost, - vVisible quantity; - - END IF; - - IF vItemCost IS NULL THEN - + IF vIsItem THEN SELECT warehouseFk INTO vWarehouseFk FROM operator WHERE workerFk = account.myUser_getId(); - SELECT barcodeToItem(vBarcodeItem) INTO vItemFk; + CALL buyUltimate(vWarehouseFk, util.VN_CURDATE()); - IF vItemFk IS NULL THEN - CALL util.throw ('Item not valid'); - ELSE - CALL buyUltimate(vWarehouseFk, util.VN_CURDATE()); - - SELECT IFNULL(b.buyingValue, 0) + - IFNULL(b.freightValue, 0) + - IFNULL(b.comissionValue, 0) + - IFNULL(b.packageValue, 0) itemCost, - SUM(is2.visible) visible, - is2.itemFk - INTO vItemCost, vVisible, vItemFk - FROM itemShelving is2 - JOIN tmp.buyUltimate bu ON bu.itemFk = is2.itemFk - JOIN buy b ON b.id = bu.buyFk - WHERE is2.itemFk = vBarcodeItem AND - is2.shelvingFk = vShelvingFK COLLATE utf8mb3_general_ci; - - IF vItemFk IS NULL THEN - CALL util.throw ('Item not valid'); - ELSE - SELECT vItemFk itemFk, - vShelvingFK shelvingFk, - vItemCost itemCost, - vVisible quantity; - END IF; - - DELETE FROM tmp.buyUltimate; - - END IF; + SELECT buyFk INTO vBuyFk + FROM tmp.buyUltimate + WHERE itemFk = vBarcodeItem + AND warehouseFk = vWarehouseFk; + DELETE FROM tmp.buyUltimate; + ELSE + SELECT vBarcodeItem INTO vBuyFk; END IF; - - IF vItemCost IS NULL THEN - CALL util.throw ('Item not valid'); - END IF; - + + WITH visible AS( + SELECT itemFk, + IFNULL(buyingValue, 0) + + IFNULL(freightValue, 0) + + IFNULL(comissionValue, 0) + + IFNULL(packageValue, 0) itemCost + FROM vn.buy b + WHERE b.id = vBuyFk + ) SELECT v.itemFk, + vShelvingFK, + v.itemCost, + SUM(ish.visible) visible + FROM vn.itemShelving ish + JOIN visible v + WHERE ish.shelvingFK = vShelvingFK + AND ish.itemFk = v.itemFk; END$$ DELIMITER ; \ No newline at end of file From 6a576e69e1f64546b9ed95815bd5353950043714 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Andr=C3=A9s?= Date: Fri, 17 May 2024 12:50:51 +0200 Subject: [PATCH 08/12] refs #4979 feat:getInfoDetails && item_devalueA2 --- db/.pullinfo.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/.pullinfo.json b/db/.pullinfo.json index 0defed845..f4afbc5fb 100644 --- a/db/.pullinfo.json +++ b/db/.pullinfo.json @@ -9,7 +9,7 @@ }, "vn": { "view": { - "expeditionPallet_Print": "06613719475fcdba8309607c38cc78efc2e348cca7bc96b48dc3ae3c12426f54" + "expeditionPallet_Print": "288cbd6e8289df083ed5eb1a2c808f7a82ba4c90c8ad9781104808a7a54471fb" } } } From 2694f277d28009dd3da7796040dbf41486e03cac Mon Sep 17 00:00:00 2001 From: jorgep Date: Fri, 17 May 2024 12:59:39 +0200 Subject: [PATCH 09/12] fix: refs #6744 add es locale --- loopback/locale/es.json | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/loopback/locale/es.json b/loopback/locale/es.json index f1c57455e..bc3a8c2a5 100644 --- a/loopback/locale/es.json +++ b/loopback/locale/es.json @@ -355,6 +355,7 @@ "No results found": "No se han encontrado resultados", "InvoiceIn is already booked": "La factura recibida está contabilizada", "This workCenter is already assigned to this agency": "Este centro de trabajo ya está asignado a esta agencia", - "Select ticket or client": "Elija un ticket o un client", - "It was not able to create the invoice": "No se pudo crear la factura" -} + "Select ticket or client": "Elija un ticket o un client", + "It was not able to create the invoice": "No se pudo crear la factura", + "ticketCommercial": "El ticket {{ ticket }} para el vendedor {{ salesMan }} está en preparación. (mensaje generado automáticamente)" +} \ No newline at end of file From dd7ee27e9b8b1cabdb487b6cddc453efbb5e7e88 Mon Sep 17 00:00:00 2001 From: carlossa Date: Fri, 17 May 2024 14:28:28 +0200 Subject: [PATCH 10/12] refs #7396 fix worker model --- loopback/locale/en.json | 9 +++++---- modules/worker/back/models/worker.json | 16 ++++++++++++++++ 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/loopback/locale/en.json b/loopback/locale/en.json index ca76eae42..601a26f5b 100644 --- a/loopback/locale/en.json +++ b/loopback/locale/en.json @@ -223,7 +223,8 @@ "printerNotExists": "The printer does not exist", "There are not picking tickets": "There are not picking tickets", "ticketCommercial": "The ticket {{ ticket }} for the salesperson {{ salesMan }} is in preparation. (automatically generated message)", - "This password can only be changed by the user themselves": "This password can only be changed by the user themselves", - "They're not your subordinate": "They're not your subordinate", - "InvoiceIn is already booked": "InvoiceIn is already booked" -} + "This password can only be changed by the user themselves": "This password can only be changed by the user themselves", + "They're not your subordinate": "They're not your subordinate", + "InvoiceIn is already booked": "InvoiceIn is already booked", + "This workCenter is already assigned to this agency": "This workCenter is already assigned to this agency" +} \ No newline at end of file diff --git a/modules/worker/back/models/worker.json b/modules/worker/back/models/worker.json index adfe2c58e..4e7617aab 100644 --- a/modules/worker/back/models/worker.json +++ b/modules/worker/back/models/worker.json @@ -62,7 +62,23 @@ }, "isFreelance": { "type" : "boolean" + }, + "fiDueDate": { + "type": "date" + }, + "hasMachineryAuthorized": { + "type": "boolean" + }, + "seniority": { + "type": "date" + }, + "isDisable": { + "type": "boolean" + }, + "isSsDiscounted": { + "type": "boolean" } + }, "relations": { "user": { From c822a64dc7b2074c5a4a01bc1363c8d77901acf3 Mon Sep 17 00:00:00 2001 From: sergiodt Date: Fri, 17 May 2024 16:38:11 +0200 Subject: [PATCH 11/12] refs #4979 feat:getInfoDetails && item_devalueA2 --- db/routines/vn/procedures/itemShelving_getItemDetails.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/routines/vn/procedures/itemShelving_getItemDetails.sql b/db/routines/vn/procedures/itemShelving_getItemDetails.sql index 25afd192b..c01bc348c 100644 --- a/db/routines/vn/procedures/itemShelving_getItemDetails.sql +++ b/db/routines/vn/procedures/itemShelving_getItemDetails.sql @@ -49,7 +49,7 @@ BEGIN SUM(ish.visible) visible FROM vn.itemShelving ish JOIN visible v - WHERE ish.shelvingFK = vShelvingFK + WHERE ish.shelvingFK = vShelvingFK COLLATE utf8mb3_general_ci AND ish.itemFk = v.itemFk; END$$ DELIMITER ; \ No newline at end of file From 9d98ae4a037f6c672708637167f5e5c229e3e360 Mon Sep 17 00:00:00 2001 From: guillermo Date: Mon, 20 May 2024 07:02:00 +0200 Subject: [PATCH 12/12] Merge branch 'test' into dev --- loopback/locale/es.json | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/loopback/locale/es.json b/loopback/locale/es.json index 458f5b1f0..77e707590 100644 --- a/loopback/locale/es.json +++ b/loopback/locale/es.json @@ -357,9 +357,6 @@ "This workCenter is already assigned to this agency": "Este centro de trabajo ya está asignado a esta agencia", "Select ticket or client": "Elija un ticket o un client", "It was not able to create the invoice": "No se pudo crear la factura", -<<<<<<< HEAD - "This PDA is already assigned to another user": "This PDA is already assigned to another user" -======= + "This PDA is already assigned to another user": "This PDA is already assigned to another user", "ticketCommercial": "El ticket {{ ticket }} para el vendedor {{ salesMan }} está en preparación. (mensaje generado automáticamente)" ->>>>>>> test } \ No newline at end of file