From f88cef674569caab0b3f1984e10da7b872ab340e Mon Sep 17 00:00:00 2001 From: sergiodt Date: Wed, 31 Jan 2024 08:45:52 +0100 Subject: [PATCH 1/2] refs #6186 feat:deprecated packingShelve --- db/dump/fixtures.before.sql | 36 +++++++++---------- .../procedures/item_updatePackingShelve.sql | 17 --------- .../sale_getFromTicketOrCollection.sql | 1 - db/routines/vn/triggers/item_beforeUpdate.sql | 10 +----- .../10855-azureCamellia/00-firstScript.sql | 6 ++++ 5 files changed, 25 insertions(+), 45 deletions(-) delete mode 100644 db/routines/vn/procedures/item_updatePackingShelve.sql create mode 100644 db/versions/10855-azureCamellia/00-firstScript.sql diff --git a/db/dump/fixtures.before.sql b/db/dump/fixtures.before.sql index 0f608d19d..3803730bd 100644 --- a/db/dump/fixtures.before.sql +++ b/db/dump/fixtures.before.sql @@ -942,25 +942,25 @@ INSERT INTO `vn`.`itemFamily`(`code`, `description`) ('VT', 'Sales'); INSERT INTO `vn`.`item`(`id`, `typeFk`, `stems`, `originFk`, `description`, `producerFk`, `intrastatFk`, `expenseFk`, - `comment`, `relevancy`, `image`, `subName`, `minPrice`, `family`, `isFloramondo`, `genericFk`, `itemPackingTypeFk`, `hasMinPrice`, `packingShelve`, `weightByPiece`) + `comment`, `relevancy`, `image`, `subName`, `minPrice`, `family`, `isFloramondo`, `genericFk`, `itemPackingTypeFk`, `hasMinPrice`, `weightByPiece`) VALUES - (1, 2, 1, 1, NULL, 1, 06021010, 2000000000, NULL, 0, '1', NULL, 0, 'EMB', 0, NULL, 'V', 0, 15,3), - (2, 2, 1, 2, NULL, 1, 06021010, 2000000000, NULL, 0, '2', NULL, 0, 'VT', 0, NULL, 'H', 0, 10,2), - (3, 1, 1, 3, NULL, 1, 05080000, 4751000000, NULL, 0, '3', NULL, 0, 'VT', 0, NULL, NULL, 0, 5,5), - (4, 1, 1, 1, 'Increases block', 1, 05080000, 4751000000, NULL, 0, '4', NULL, 0, 'VT', 0, NULL, NULL, 0, NULL,NULL), - (5, 3, 1, 2, NULL, 2, 06021010, 4751000000, NULL, 0, '5', NULL, 0, 'VT', 0, NULL, NULL, 0, NULL,NULL), - (6, 5, 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '6', NULL, 0, 'VT', 0, NULL, NULL, 0, NULL,NULL), - (7, 5, 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '7', NULL, 0, 'VT', 0, NULL, NULL, 0, NULL,NULL), - (8, 2, 1, 1, NULL, 1, 06021010, 2000000000, NULL, 0, '8', NULL, 0, 'VT', 0, NULL, NULL, 0, NULL,NULL), - (9, 2, 1, 2, NULL, 1, 06021010, 2000000000, NULL, 0, '9', NULL, 0, 'VT', 1, NULL, NULL, 0, NULL,NULL), - (10, 1, 1, 3, NULL, 1, 05080000, 4751000000, NULL, 0, '10', NULL, 0, 'VT', 0, NULL, NULL, 0, NULL,NULL), - (11, 1, 1, 1, NULL, 1, 05080000, 4751000000, NULL, 0, '11', NULL, 0, 'VT', 0, NULL, NULL, 0, NULL,NULL), - (12, 3, 1, 2, NULL, 2, 06021010, 4751000000, NULL, 0, '12', NULL, 0, 'VT', 0, NULL, NULL, 0, NULL,NULL), - (13, 5, 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '13', NULL, 1, 'VT', 1, NULL, NULL, 1, NULL,NULL), - (14, 5, 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 'VT', 1, NULL, NULL, 0, NULL,NULL), - (15, 4, NULL, 1, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 'EMB', 0, NULL, NULL, 0, NULL,NULL), - (16, 6, NULL, 1, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 'EMB', 0, NULL, NULL, 0, NULL,NULL), - (71, 6, NULL, 1, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 'VT', 0, NULL, NULL, 0, NULL,NULL); + (1, 2, 1, 1, NULL, 1, 06021010, 2000000000, NULL, 0, '1', NULL, 0, 'EMB', 0, NULL, 'V', 0, 3), + (2, 2, 1, 2, NULL, 1, 06021010, 2000000000, NULL, 0, '2', NULL, 0, 'VT', 0, NULL, 'H', 0, 2), + (3, 1, 1, 3, NULL, 1, 05080000, 4751000000, NULL, 0, '3', NULL, 0, 'VT', 0, NULL, NULL, 0, 5), + (4, 1, 1, 1, 'Increases block', 1, 05080000, 4751000000, NULL, 0, '4', NULL, 0, 'VT', 0, NULL, NULL, 0, NULL), + (5, 3, 1, 2, NULL, 2, 06021010, 4751000000, NULL, 0, '5', NULL, 0, 'VT', 0, NULL, NULL, 0, NULL), + (6, 5, 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '6', NULL, 0, 'VT', 0, NULL, NULL, 0, NULL), + (7, 5, 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '7', NULL, 0, 'VT', 0, NULL, NULL, 0, NULL), + (8, 2, 1, 1, NULL, 1, 06021010, 2000000000, NULL, 0, '8', NULL, 0, 'VT', 0, NULL, NULL, 0, NULL), + (9, 2, 1, 2, NULL, 1, 06021010, 2000000000, NULL, 0, '9', NULL, 0, 'VT', 1, NULL, NULL, 0, NULL), + (10, 1, 1, 3, NULL, 1, 05080000, 4751000000, NULL, 0, '10', NULL, 0, 'VT', 0, NULL, NULL, 0, NULL), + (11, 1, 1, 1, NULL, 1, 05080000, 4751000000, NULL, 0, '11', NULL, 0, 'VT', 0, NULL, NULL, 0, NULL), + (12, 3, 1, 2, NULL, 2, 06021010, 4751000000, NULL, 0, '12', NULL, 0, 'VT', 0, NULL, NULL, 0, NULL), + (13, 5, 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '13', NULL, 1, 'VT', 1, NULL, NULL, 1, NULL), + (14, 5, 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 'VT', 1, NULL, NULL, 0, NULL), + (15, 4, NULL, 1, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 'EMB', 0, NULL, NULL, 0, NULL), + (16, 6, NULL, 1, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 'EMB', 0, NULL, NULL, 0, NULL), + (71, 6, NULL, 1, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 'VT', 0, NULL, NULL, 0, NULL); -- Update the taxClass after insert of the items UPDATE `vn`.`itemTaxCountry` SET `taxClassFk` = 2 diff --git a/db/routines/vn/procedures/item_updatePackingShelve.sql b/db/routines/vn/procedures/item_updatePackingShelve.sql deleted file mode 100644 index 23e449ef5..000000000 --- a/db/routines/vn/procedures/item_updatePackingShelve.sql +++ /dev/null @@ -1,17 +0,0 @@ -DELIMITER $$ -CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`item_updatePackingShelve`(vSelf INT, vPacking INT) -BEGIN - - /** - * Actualiza el valor de item.packingShelve - * - * @param vSelf Identificador de vn.item - * @param vPacking Cantidad de unidades de venta que caben en una bandeja - */ - - UPDATE vn.item i - SET i.packingShelve = vPacking - WHERE i.id = vSelf; - -END$$ -DELIMITER ; diff --git a/db/routines/vn/procedures/sale_getFromTicketOrCollection.sql b/db/routines/vn/procedures/sale_getFromTicketOrCollection.sql index f177abf59..e0cff202f 100644 --- a/db/routines/vn/procedures/sale_getFromTicketOrCollection.sql +++ b/db/routines/vn/procedures/sale_getFromTicketOrCollection.sql @@ -77,7 +77,6 @@ DECLARE vIsCollection BOOL; s.isAdded, IF(c.workerFk IS NULL, getUser(), c.workerFk) workerFk, IF(SUM(iss.quantity) IS NULL, 0, SUM(iss.quantity)) pickedQuantity, - i.packingShelve, MIN(iss.created) picked, IF(sm.id, TRUE, FALSE) hasMistake, sg.sectorFk diff --git a/db/routines/vn/triggers/item_beforeUpdate.sql b/db/routines/vn/triggers/item_beforeUpdate.sql index c7c8676de..3cf630d18 100644 --- a/db/routines/vn/triggers/item_beforeUpdate.sql +++ b/db/routines/vn/triggers/item_beforeUpdate.sql @@ -6,15 +6,7 @@ BEGIN DECLARE vNewPackingShelve INT; SET NEW.editorFk = account.myUser_getId(); - - IF ISNULL(NEW.packingShelve) AND NOT ISNULL(NEW.packingOut) THEN - SELECT NEW.packingOut * vc.shelveVolume / vc.standardFlowerBox - INTO vNewPackingShelve - FROM vn.volumeConfig vc; - - SET NEW.packingShelve = vNewPackingShelve; - END IF; - + IF NEW.itemPackingTypeFk = '' THEN SET NEW.itemPackingTypeFk = NULL; END IF; diff --git a/db/versions/10855-azureCamellia/00-firstScript.sql b/db/versions/10855-azureCamellia/00-firstScript.sql new file mode 100644 index 000000000..32ef11e78 --- /dev/null +++ b/db/versions/10855-azureCamellia/00-firstScript.sql @@ -0,0 +1,6 @@ +-- Place your SQL code here + +USE vn; + +ALTER TABLE vn.item CHANGE packingShelve packingShelve__ int(11) DEFAULT NULL NULL COMMENT '@deprecated 2024-31-01'; + From a8b483078f080ab1840afc307ae881e32f5e7d73 Mon Sep 17 00:00:00 2001 From: sergiodt Date: Wed, 31 Jan 2024 08:52:36 +0100 Subject: [PATCH 2/2] refs #6186 feat:deprecated packingShelve --- modules/item/back/models/item.json | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/modules/item/back/models/item.json b/modules/item/back/models/item.json index 595fb537d..9d48dcbfb 100644 --- a/modules/item/back/models/item.json +++ b/modules/item/back/models/item.json @@ -143,15 +143,12 @@ "isFloramondo": { "type": "boolean" }, - "packingShelve": { - "type": "number" - }, "isLaid": { "type": "boolean" }, "isPhotoRequested": { "type": "boolean", - "mysql":{ + "mysql": { "columnName": "doPhoto" } }, @@ -226,4 +223,4 @@ } } } -} +} \ No newline at end of file