From fe741fa7e1fcf1a67a3decf89988c611e09e5e22 Mon Sep 17 00:00:00 2001 From: jgallego Date: Tue, 1 Oct 2024 12:22:33 +0200 Subject: [PATCH 01/10] fix: getSimilar daysInForward --- db/routines/vn/procedures/item_getSimilar.sql | 62 +++++++++---------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/db/routines/vn/procedures/item_getSimilar.sql b/db/routines/vn/procedures/item_getSimilar.sql index b524e30a7..56afd92e9 100644 --- a/db/routines/vn/procedures/item_getSimilar.sql +++ b/db/routines/vn/procedures/item_getSimilar.sql @@ -1,10 +1,10 @@ DELIMITER $$ CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`item_getSimilar`( - vSelf INT, - vWarehouseFk INT, - vDated DATE, - vShowType BOOL, - vDaysInForward INT + vSelf INT, + vWarehouseFk INT, + vDated DATE, + vShowType BOOL, + vDaysInForward INT ) BEGIN /** @@ -17,48 +17,48 @@ BEGIN * @param vShowType Mostrar tipos * @param vDaysInForward Días de alcance para las ventas */ - DECLARE vAvailableCalcFk INT; - DECLARE vPriority INT DEFAULT 1; + DECLARE vAvailableCalcFk INT; + DECLARE vPriority INT DEFAULT 1; - CALL cache.available_refresh(vAvailableCalcFk, FALSE, vWarehouseFk, vDated); + CALL cache.available_refresh(vAvailableCalcFk, FALSE, vWarehouseFk, vDated); - WITH itemTags AS ( - SELECT i.id, - typeFk, - tag5, - value5, - tag6, - value6, - tag7, - value7, - tag8, - value8, - t.name, - it.value + WITH itemTags AS ( + SELECT i.id, + typeFk, + tag5, + value5, + tag6, + value6, + tag7, + value7, + tag8, + value8, + t.name, + it.value FROM vn.item i LEFT JOIN vn.itemTag it ON it.itemFk = i.id AND it.priority = vPriority LEFT JOIN vn.tag t ON t.id = it.tagFk WHERE i.id = vSelf - ), - stock AS ( - SELECT itemFk, SUM(visible) stock + ), + stock AS ( + SELECT itemFk, SUM(visible) stock FROM vn.itemShelvingStock WHERE warehouseFk = vWarehouseFk GROUP BY itemFk - ), - sold AS ( - SELECT SUM(s.quantity) quantity, s.itemFk + ), + sold AS ( + SELECT SUM(s.quantity) quantity, s.itemFk FROM vn.sale s JOIN vn.ticket t ON t.id = s.ticketFk LEFT JOIN vn.itemShelvingSale iss ON iss.saleFk = s.id - WHERE t.shipped BETWEEN CURDATE() AND CURDATE() + INTERVAL vDaysInForward DAY + WHERE t.shipped >= CURDATE() + INTERVAL vDaysInForward DAY AND iss.saleFk IS NULL AND t.warehouseFk = vWarehouseFk GROUP BY s.itemFk - ) - SELECT i.id itemFk, - CAST(sd.quantity AS INT) advanceable, + ) + SELECT i.id itemFk, + LEAST(CAST(sd.quantity AS INT), sk.stock) advanceable, i.longName, i.subName, i.tag5, From 1cf14035d562481cef8fa3a0e072e39134708b87 Mon Sep 17 00:00:00 2001 From: jgallego Date: Tue, 1 Oct 2024 15:51:30 +0200 Subject: [PATCH 02/10] feat: existingRefund without ticketRefund --- modules/ticket/back/methods/sale/clone.js | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/modules/ticket/back/methods/sale/clone.js b/modules/ticket/back/methods/sale/clone.js index 24346f3ba..0b658a69e 100644 --- a/modules/ticket/back/methods/sale/clone.js +++ b/modules/ticket/back/methods/sale/clone.js @@ -142,12 +142,19 @@ module.exports = Self => { ctx.args.addressId = ticket.addressFk; const newTicket = await models.Ticket.new(ctx, myOptions); - - await models.TicketRefund.create({ - originalTicketFk: ticketId, - refundTicketFk: newTicket.id - }, myOptions); - + const existingRefund = await models.TicketRefund.findOne({ + where: { + originalTicketFk: ticketId, + refundTicketFk: newTicket.id + }, + myOptions + }); + if (!existingRefund) { + await models.TicketRefund.create({ + originalTicketFk: ticketId, + refundTicketFk: newTicket.id + }, myOptions); + } return newTicket; } }; From a48843a5cfc15f6a3e6b976419c2654e357fb769 Mon Sep 17 00:00:00 2001 From: Pako Date: Wed, 2 Oct 2024 07:30:49 +0200 Subject: [PATCH 03/10] feat: refs #8030 new field vn.priceDelta.zoneGeoFk --- .../procedures/catalog_componentCalculate.sql | 39 ++++++++++--------- .../00-firstScript.sql | 5 +++ 2 files changed, 26 insertions(+), 18 deletions(-) create mode 100644 db/versions/11278-crimsonEucalyptus/00-firstScript.sql diff --git a/db/routines/vn/procedures/catalog_componentCalculate.sql b/db/routines/vn/procedures/catalog_componentCalculate.sql index d4ce88ca7..e29e13a8c 100644 --- a/db/routines/vn/procedures/catalog_componentCalculate.sql +++ b/db/routines/vn/procedures/catalog_componentCalculate.sql @@ -29,21 +29,24 @@ BEGIN (INDEX (itemFk)) ENGINE = MEMORY SELECT i.id itemFk, - SUM(IFNULL(pd.absIncreasing,0)) absIncreasing, - SUM(IFNULL(pd.ratIncreasing,0)) ratIncreasing, - pd.warehouseFk - FROM item i - JOIN priceDelta pd - ON pd.itemTypeFk = i.typeFk - AND (pd.minSize IS NULL OR pd.minSize <= i.`size`) - AND (pd.maxSize IS NULL OR pd.maxSize >= i.`size`) - AND (pd.inkFk IS NULL OR pd.inkFk = i.inkFk) - AND (pd.originFk IS NULL OR pd.originFk = i.originFk) - AND (pd.producerFk IS NULL OR pd.producerFk = i.producerFk) - AND (pd.warehouseFk IS NULL OR pd.warehouseFk = vWarehouseFk) - WHERE (pd.fromDated IS NULL OR pd.fromDated <= vShipped) - AND (pd.toDated IS NULL OR pd.toDated >= vShipped) - GROUP BY i.id; + SUM(IFNULL(pd.absIncreasing,0)) absIncreasing, + SUM(IFNULL(pd.ratIncreasing,0)) ratIncreasing, + pd.warehouseFk + FROM item i + JOIN priceDelta pd + ON pd.itemTypeFk = i.typeFk + AND (pd.minSize IS NULL OR pd.minSize <= i.`size`) + AND (pd.maxSize IS NULL OR pd.maxSize >= i.`size`) + AND (pd.inkFk IS NULL OR pd.inkFk = i.inkFk) + AND (pd.originFk IS NULL OR pd.originFk = i.originFk) + AND (pd.producerFk IS NULL OR pd.producerFk = i.producerFk) + AND (pd.warehouseFk IS NULL OR pd.warehouseFk = vWarehouseFk) + LEFT JOIN zoneGeo zg ON zg.id = pd.zoneGeoFk + LEFT JOIN zoneGeo zg2 ON zg2.id = address_getGeo(vAddressFk) + WHERE (pd.fromDated IS NULL OR pd.fromDated <= vShipped) + AND (pd.toDated IS NULL OR pd.toDated >= vShipped) + AND (pd.zoneGeoFk IS NULL OR zg2.lft BETWEEN zg.lft AND zg.rgt) + GROUP BY itemFk; CREATE OR REPLACE TEMPORARY TABLE tSpecialPrice (INDEX (itemFk)) @@ -130,15 +133,15 @@ BEGIN -- Bonus del comprador a un rango de productos INSERT INTO tmp.ticketComponent(warehouseFk, itemFk, componentFk, cost) - SELECT + SELECT tcb.warehouseFk, tcb.itemFk, c.id, IFNULL(tcb.base * tpd.ratIncreasing / 100,0) + IFNULL(tpd.absIncreasing,0) FROM tmp.ticketComponentBase tcb JOIN component c ON c.code = 'bonus' - JOIN tPriceDelta tpd - ON tpd.itemFk = tcb.itemFk + JOIN tPriceDelta tpd + ON tpd.itemFk = tcb.itemFk AND tpd.warehouseFk = tcb.warehouseFk; -- RECOBRO diff --git a/db/versions/11278-crimsonEucalyptus/00-firstScript.sql b/db/versions/11278-crimsonEucalyptus/00-firstScript.sql new file mode 100644 index 000000000..5686fee80 --- /dev/null +++ b/db/versions/11278-crimsonEucalyptus/00-firstScript.sql @@ -0,0 +1,5 @@ +-- Place your SQL code here + +ALTER TABLE vn.priceDelta ADD IF NOT EXISTS zoneGeoFk int(11) NULL; + +ALTER TABLE vn.priceDelta ADD CONSTRAINT priceDelta_XDiario_FK FOREIGN KEY IF NOT EXISTS (zoneGeoFk) REFERENCES vn.XDiario(id) ON DELETE RESTRICT ON UPDATE CASCADE; From 3c89d1e5e0ce208f90a8d0ca47ec2790a55ab5b5 Mon Sep 17 00:00:00 2001 From: Pako Date: Wed, 2 Oct 2024 07:34:57 +0200 Subject: [PATCH 04/10] fix: refs #8030 foreign key zoneGeo --- db/versions/11278-crimsonEucalyptus/00-firstScript.sql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/db/versions/11278-crimsonEucalyptus/00-firstScript.sql b/db/versions/11278-crimsonEucalyptus/00-firstScript.sql index 5686fee80..1c606b1cc 100644 --- a/db/versions/11278-crimsonEucalyptus/00-firstScript.sql +++ b/db/versions/11278-crimsonEucalyptus/00-firstScript.sql @@ -2,4 +2,5 @@ ALTER TABLE vn.priceDelta ADD IF NOT EXISTS zoneGeoFk int(11) NULL; -ALTER TABLE vn.priceDelta ADD CONSTRAINT priceDelta_XDiario_FK FOREIGN KEY IF NOT EXISTS (zoneGeoFk) REFERENCES vn.XDiario(id) ON DELETE RESTRICT ON UPDATE CASCADE; +ALTER TABLE vn.priceDelta ADD CONSTRAINT priceDelta_zoneGeo_FK FOREIGN KEY IF NOT EXISTS (zoneGeoFk) +REFERENCES `zoneGeo` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE; From 7d3c2a4a1cb306f827133cb3668b947301f51ea3 Mon Sep 17 00:00:00 2001 From: Pako Date: Wed, 2 Oct 2024 07:36:04 +0200 Subject: [PATCH 05/10] fix: refs #8030 schema missing in zoneGeo table --- db/versions/11278-crimsonEucalyptus/00-firstScript.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/versions/11278-crimsonEucalyptus/00-firstScript.sql b/db/versions/11278-crimsonEucalyptus/00-firstScript.sql index 1c606b1cc..f69f75f1d 100644 --- a/db/versions/11278-crimsonEucalyptus/00-firstScript.sql +++ b/db/versions/11278-crimsonEucalyptus/00-firstScript.sql @@ -3,4 +3,4 @@ ALTER TABLE vn.priceDelta ADD IF NOT EXISTS zoneGeoFk int(11) NULL; ALTER TABLE vn.priceDelta ADD CONSTRAINT priceDelta_zoneGeo_FK FOREIGN KEY IF NOT EXISTS (zoneGeoFk) -REFERENCES `zoneGeo` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE; +REFERENCES vn.zoneGeo (`id`) ON DELETE RESTRICT ON UPDATE CASCADE; From 02ef314ed91fda85821d883921c657ee77e1ee92 Mon Sep 17 00:00:00 2001 From: Pako Date: Wed, 2 Oct 2024 07:40:26 +0200 Subject: [PATCH 06/10] feat: refs #8030 new field vn.priceDelta.zoneGeoFk --- .../procedures/catalog_componentCalculate.sql | 39 ++++++++++--------- .../11279-turquoiseDendro/00-firstScript.sql | 6 +++ 2 files changed, 27 insertions(+), 18 deletions(-) create mode 100644 db/versions/11279-turquoiseDendro/00-firstScript.sql diff --git a/db/routines/vn/procedures/catalog_componentCalculate.sql b/db/routines/vn/procedures/catalog_componentCalculate.sql index d4ce88ca7..e29e13a8c 100644 --- a/db/routines/vn/procedures/catalog_componentCalculate.sql +++ b/db/routines/vn/procedures/catalog_componentCalculate.sql @@ -29,21 +29,24 @@ BEGIN (INDEX (itemFk)) ENGINE = MEMORY SELECT i.id itemFk, - SUM(IFNULL(pd.absIncreasing,0)) absIncreasing, - SUM(IFNULL(pd.ratIncreasing,0)) ratIncreasing, - pd.warehouseFk - FROM item i - JOIN priceDelta pd - ON pd.itemTypeFk = i.typeFk - AND (pd.minSize IS NULL OR pd.minSize <= i.`size`) - AND (pd.maxSize IS NULL OR pd.maxSize >= i.`size`) - AND (pd.inkFk IS NULL OR pd.inkFk = i.inkFk) - AND (pd.originFk IS NULL OR pd.originFk = i.originFk) - AND (pd.producerFk IS NULL OR pd.producerFk = i.producerFk) - AND (pd.warehouseFk IS NULL OR pd.warehouseFk = vWarehouseFk) - WHERE (pd.fromDated IS NULL OR pd.fromDated <= vShipped) - AND (pd.toDated IS NULL OR pd.toDated >= vShipped) - GROUP BY i.id; + SUM(IFNULL(pd.absIncreasing,0)) absIncreasing, + SUM(IFNULL(pd.ratIncreasing,0)) ratIncreasing, + pd.warehouseFk + FROM item i + JOIN priceDelta pd + ON pd.itemTypeFk = i.typeFk + AND (pd.minSize IS NULL OR pd.minSize <= i.`size`) + AND (pd.maxSize IS NULL OR pd.maxSize >= i.`size`) + AND (pd.inkFk IS NULL OR pd.inkFk = i.inkFk) + AND (pd.originFk IS NULL OR pd.originFk = i.originFk) + AND (pd.producerFk IS NULL OR pd.producerFk = i.producerFk) + AND (pd.warehouseFk IS NULL OR pd.warehouseFk = vWarehouseFk) + LEFT JOIN zoneGeo zg ON zg.id = pd.zoneGeoFk + LEFT JOIN zoneGeo zg2 ON zg2.id = address_getGeo(vAddressFk) + WHERE (pd.fromDated IS NULL OR pd.fromDated <= vShipped) + AND (pd.toDated IS NULL OR pd.toDated >= vShipped) + AND (pd.zoneGeoFk IS NULL OR zg2.lft BETWEEN zg.lft AND zg.rgt) + GROUP BY itemFk; CREATE OR REPLACE TEMPORARY TABLE tSpecialPrice (INDEX (itemFk)) @@ -130,15 +133,15 @@ BEGIN -- Bonus del comprador a un rango de productos INSERT INTO tmp.ticketComponent(warehouseFk, itemFk, componentFk, cost) - SELECT + SELECT tcb.warehouseFk, tcb.itemFk, c.id, IFNULL(tcb.base * tpd.ratIncreasing / 100,0) + IFNULL(tpd.absIncreasing,0) FROM tmp.ticketComponentBase tcb JOIN component c ON c.code = 'bonus' - JOIN tPriceDelta tpd - ON tpd.itemFk = tcb.itemFk + JOIN tPriceDelta tpd + ON tpd.itemFk = tcb.itemFk AND tpd.warehouseFk = tcb.warehouseFk; -- RECOBRO diff --git a/db/versions/11279-turquoiseDendro/00-firstScript.sql b/db/versions/11279-turquoiseDendro/00-firstScript.sql new file mode 100644 index 000000000..a241e6af2 --- /dev/null +++ b/db/versions/11279-turquoiseDendro/00-firstScript.sql @@ -0,0 +1,6 @@ +-- Place your SQL code here + +ALTER TABLE vn.priceDelta ADD IF NOT EXISTS zoneGeoFk int(11) NULL; + +ALTER TABLE vn.priceDelta ADD CONSTRAINT priceDelta_zoneGeo_FK FOREIGN KEY IF NOT EXISTS (zoneGeoFk) +REFERENCES vn.zoneGeo (`id`) ON DELETE RESTRICT ON UPDATE CASCADE; \ No newline at end of file From 6e4244866c382b4a03b2fa77f2a80180aae21307 Mon Sep 17 00:00:00 2001 From: robert Date: Wed, 2 Oct 2024 07:53:53 +0200 Subject: [PATCH 07/10] feat: refs #8012 create column --- db/dump/fixtures.before.sql | 2 +- .../vn/procedures/travel_cloneWithEntries.sql | 8 +++---- .../11280-goldenCamellia/00-firstScript.sql | 24 +++++++++++++++++++ 3 files changed, 29 insertions(+), 5 deletions(-) create mode 100644 db/versions/11280-goldenCamellia/00-firstScript.sql diff --git a/db/dump/fixtures.before.sql b/db/dump/fixtures.before.sql index 6992dd6f8..8311bdda8 100644 --- a/db/dump/fixtures.before.sql +++ b/db/dump/fixtures.before.sql @@ -3180,7 +3180,7 @@ UPDATE vn.department SET workerFk = null; INSERT INTO vn.packaging - VALUES('--', 2745600.00, 100.00, 120.00, 220.00, 0.00, 1, '2001-01-01 00:00:00.000', NULL, NULL, NULL, 0.00, 16, 0.00, 0, NULL, 0.00, NULL, NULL, 0, NULL, 0, 0,0); + VALUES('--', 2745600.00, 100.00, 120.00, 220.00, 0.00, 1, '2001-01-01 00:00:00.000', NULL, NULL, NULL, 0.00, 16, 0.00, 0, NULL, 0.00, NULL, NULL, 0, NULL, 0, 0,0,1); INSERT IGNORE INTO vn.intrastat diff --git a/db/routines/vn/procedures/travel_cloneWithEntries.sql b/db/routines/vn/procedures/travel_cloneWithEntries.sql index ee26aea32..95e778a5b 100644 --- a/db/routines/vn/procedures/travel_cloneWithEntries.sql +++ b/db/routines/vn/procedures/travel_cloneWithEntries.sql @@ -24,7 +24,7 @@ BEGIN DECLARE vEvaNotes VARCHAR(255); DECLARE vDone BOOL; DECLARE vAuxEntryFk INT; - DECLARE vIsRequiredTx BOOLEAN DEFAULT NOT @@in_transaction; + DECLARE vIsRequiredTx BOOLEAN DEFAULT NOT @@in_transaction; DECLARE vRsEntry CURSOR FOR SELECT e.id FROM entry e @@ -39,7 +39,7 @@ BEGIN RESIGNAL; END; - CALL util.tx_start(vIsRequiredTx); + CALL util.tx_start(vIsRequiredTx); INSERT INTO travel (shipped, landed, warehouseInFk, warehouseOutFk, agencyModeFk, `ref`, isDelivered, isReceived, m3, cargoSupplierFk, kg,clonedFrom) SELECT vDateStart, vDateEnd, vWarehouseInFk, vWarehouseOutFk, vAgencyModeFk, vRef, isDelivered, isReceived, m3,cargoSupplierFk, kg,vTravelFk @@ -62,7 +62,7 @@ BEGIN END IF; CALL entry_cloneHeader(vAuxEntryFk, vNewEntryFk, vNewTravelFk); - CALL entry_copyBuys(vAuxEntryFk, vNewEntryFk); + CALL entry_copyBuys(vAuxEntryFk, vNewEntryFk); SELECT evaNotes INTO vEvaNotes FROM entry @@ -76,6 +76,6 @@ BEGIN SET @isModeInventory = FALSE; CLOSE vRsEntry; - CALL util.tx_commit(vIsRequiredTx); + CALL util.tx_commit(vIsRequiredTx); END$$ DELIMITER ; diff --git a/db/versions/11280-goldenCamellia/00-firstScript.sql b/db/versions/11280-goldenCamellia/00-firstScript.sql new file mode 100644 index 000000000..8f3f7e41f --- /dev/null +++ b/db/versions/11280-goldenCamellia/00-firstScript.sql @@ -0,0 +1,24 @@ +ALTER TABLE `vn`.`packaging` +ADD COLUMN IF NOT EXISTS `isActive` TINYINT(1) DEFAULT 1; + +UPDATE vn.packaging + SET isActive = FALSE + WHERE id IN('06x04x06','07x04x03','1000','100SM','1031','104','105','1060','10x04x06','10x04x07','1100','118','119','1200','129','1300', + '134','146','147','148','158','159','17x01x02','17X01X03','17x01x04','17x01x05','18X01X04','198','199', + '20P','20x01x03','246','273','278','279','280','290','359','37247','382','40P','453','463','464','465','466', + '467','469','471','473','494','508','509','511','512','514','515','516','518','519-50B','575','598-3x6','604','605','606', + '607','609','647','67515','676','680','682','685','687','688','691','692','693','694','695','730','751','7808','790','7910', + '7920','79450','7950','7952','7960','7976','7982','7986','7988', + '7993','8000','8046','8049','8053','8057','8058','8065','8076','8085','8086','8088', + '8091','8095','8096','8097','8101','8106','8108','8110','8112','8124','8134','8140','8141','8143','8145','8149','8150', + '8170','8174','8192','8200','8210','8249','8270','8275','8288','8300','8350','8375','8399','8400','8420','845','847','8480','8500', + '855','858','8600','862','869','871','872','8720','878','879','880','8800','882','885','910','911','912','914','916','917','918','919', + '920','921','922','923','924','925','926','927','930','9300','932','934','935','936','938','942','948','9600','980','984','9920', + 'B20x16','B43x13','Bande Rota','bb3','Bcesta','BcestaOVAL','BcestaRED','Bcirios','BciriosG','BjarronBLN','BjarronNGR', + 'Btazon','Bvelas','cactus200','Caja040','CajaTGLF','CC Alza Pl','CC_falso', + 'EB-RSMINA','EMB 1_4','EMB 2_5','espuma','FB-BENCH','granel','Grenex','guzma1200','guzma1400','guzma330','guzma400','guzma650','guzma900','HB-ALEX', + 'HB-APOSENT','HB-MAGIC','HB-NATUF','HB-RSMINA','HB-TES-RSR','HB068','HB117','HB2-CIRCA','JB-AROMA','jumboX3','kalan330','kalan400', + 'kalan577','kalan900','L12','L120','L14','L2-120','L200','L3-120','L4-120','L44','L6','L6-180','L8','L8-200','MB-BENCH','MBOLA','mc_11', + 'mc_13','Msp','NO VALIDO','NO-002','PANIC','PBLG','PISOCC/3','PISOCC/4','PISOCC/5','PISOCC/6', + 'procona','QB-CARDENA','QB-PANDERO','QB-TES-RSR','QB7-TOSCA','QB9-TOSCA','RB-BENCH','SemiEuroPa','spolette','t_flori11','T26x23', + 'T26x25','T27x24','T27x30','T28x26','T30x24','T33x30','THA50','ti_13','Tumbado','UB-BENCH') \ No newline at end of file From 0dd9be96ddf38f4324791f1659841952b623d189 Mon Sep 17 00:00:00 2001 From: robert Date: Wed, 2 Oct 2024 07:54:57 +0200 Subject: [PATCH 08/10] feat: refs #8012 restore --- db/routines/vn/procedures/travel_cloneWithEntries.sql | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/db/routines/vn/procedures/travel_cloneWithEntries.sql b/db/routines/vn/procedures/travel_cloneWithEntries.sql index 95e778a5b..ee26aea32 100644 --- a/db/routines/vn/procedures/travel_cloneWithEntries.sql +++ b/db/routines/vn/procedures/travel_cloneWithEntries.sql @@ -24,7 +24,7 @@ BEGIN DECLARE vEvaNotes VARCHAR(255); DECLARE vDone BOOL; DECLARE vAuxEntryFk INT; - DECLARE vIsRequiredTx BOOLEAN DEFAULT NOT @@in_transaction; + DECLARE vIsRequiredTx BOOLEAN DEFAULT NOT @@in_transaction; DECLARE vRsEntry CURSOR FOR SELECT e.id FROM entry e @@ -39,7 +39,7 @@ BEGIN RESIGNAL; END; - CALL util.tx_start(vIsRequiredTx); + CALL util.tx_start(vIsRequiredTx); INSERT INTO travel (shipped, landed, warehouseInFk, warehouseOutFk, agencyModeFk, `ref`, isDelivered, isReceived, m3, cargoSupplierFk, kg,clonedFrom) SELECT vDateStart, vDateEnd, vWarehouseInFk, vWarehouseOutFk, vAgencyModeFk, vRef, isDelivered, isReceived, m3,cargoSupplierFk, kg,vTravelFk @@ -62,7 +62,7 @@ BEGIN END IF; CALL entry_cloneHeader(vAuxEntryFk, vNewEntryFk, vNewTravelFk); - CALL entry_copyBuys(vAuxEntryFk, vNewEntryFk); + CALL entry_copyBuys(vAuxEntryFk, vNewEntryFk); SELECT evaNotes INTO vEvaNotes FROM entry @@ -76,6 +76,6 @@ BEGIN SET @isModeInventory = FALSE; CLOSE vRsEntry; - CALL util.tx_commit(vIsRequiredTx); + CALL util.tx_commit(vIsRequiredTx); END$$ DELIMITER ; From a3d79f3c56cf2c7a0db5c8ec08069e64b408d646 Mon Sep 17 00:00:00 2001 From: robert Date: Wed, 2 Oct 2024 07:59:00 +0200 Subject: [PATCH 09/10] feat: refs #8012 format --- .../11280-goldenCamellia/00-firstScript.sql | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/db/versions/11280-goldenCamellia/00-firstScript.sql b/db/versions/11280-goldenCamellia/00-firstScript.sql index 8f3f7e41f..fd55760c1 100644 --- a/db/versions/11280-goldenCamellia/00-firstScript.sql +++ b/db/versions/11280-goldenCamellia/00-firstScript.sql @@ -1,24 +1,24 @@ ALTER TABLE `vn`.`packaging` -ADD COLUMN IF NOT EXISTS `isActive` TINYINT(1) DEFAULT 1; + ADD COLUMN IF NOT EXISTS `isActive` TINYINT(1) DEFAULT 1; UPDATE vn.packaging SET isActive = FALSE WHERE id IN('06x04x06','07x04x03','1000','100SM','1031','104','105','1060','10x04x06','10x04x07','1100','118','119','1200','129','1300', - '134','146','147','148','158','159','17x01x02','17X01X03','17x01x04','17x01x05','18X01X04','198','199', - '20P','20x01x03','246','273','278','279','280','290','359','37247','382','40P','453','463','464','465','466', - '467','469','471','473','494','508','509','511','512','514','515','516','518','519-50B','575','598-3x6','604','605','606', - '607','609','647','67515','676','680','682','685','687','688','691','692','693','694','695','730','751','7808','790','7910', - '7920','79450','7950','7952','7960','7976','7982','7986','7988', - '7993','8000','8046','8049','8053','8057','8058','8065','8076','8085','8086','8088', - '8091','8095','8096','8097','8101','8106','8108','8110','8112','8124','8134','8140','8141','8143','8145','8149','8150', - '8170','8174','8192','8200','8210','8249','8270','8275','8288','8300','8350','8375','8399','8400','8420','845','847','8480','8500', - '855','858','8600','862','869','871','872','8720','878','879','880','8800','882','885','910','911','912','914','916','917','918','919', - '920','921','922','923','924','925','926','927','930','9300','932','934','935','936','938','942','948','9600','980','984','9920', - 'B20x16','B43x13','Bande Rota','bb3','Bcesta','BcestaOVAL','BcestaRED','Bcirios','BciriosG','BjarronBLN','BjarronNGR', - 'Btazon','Bvelas','cactus200','Caja040','CajaTGLF','CC Alza Pl','CC_falso', - 'EB-RSMINA','EMB 1_4','EMB 2_5','espuma','FB-BENCH','granel','Grenex','guzma1200','guzma1400','guzma330','guzma400','guzma650','guzma900','HB-ALEX', - 'HB-APOSENT','HB-MAGIC','HB-NATUF','HB-RSMINA','HB-TES-RSR','HB068','HB117','HB2-CIRCA','JB-AROMA','jumboX3','kalan330','kalan400', - 'kalan577','kalan900','L12','L120','L14','L2-120','L200','L3-120','L4-120','L44','L6','L6-180','L8','L8-200','MB-BENCH','MBOLA','mc_11', - 'mc_13','Msp','NO VALIDO','NO-002','PANIC','PBLG','PISOCC/3','PISOCC/4','PISOCC/5','PISOCC/6', - 'procona','QB-CARDENA','QB-PANDERO','QB-TES-RSR','QB7-TOSCA','QB9-TOSCA','RB-BENCH','SemiEuroPa','spolette','t_flori11','T26x23', - 'T26x25','T27x24','T27x30','T28x26','T30x24','T33x30','THA50','ti_13','Tumbado','UB-BENCH') \ No newline at end of file + '134','146','147','148','158','159','17x01x02','17X01X03','17x01x04','17x01x05','18X01X04','198','199', + '20P','20x01x03','246','273','278','279','280','290','359','37247','382','40P','453','463','464','465','466', + '467','469','471','473','494','508','509','511','512','514','515','516','518','519-50B','575','598-3x6','604','605','606', + '607','609','647','67515','676','680','682','685','687','688','691','692','693','694','695','730','751','7808','790','7910', + '7920','79450','7950','7952','7960','7976','7982','7986','7988', + '7993','8000','8046','8049','8053','8057','8058','8065','8076','8085','8086','8088', + '8091','8095','8096','8097','8101','8106','8108','8110','8112','8124','8134','8140','8141','8143','8145','8149','8150', + '8170','8174','8192','8200','8210','8249','8270','8275','8288','8300','8350','8375','8399','8400','8420','845','847','8480','8500', + '855','858','8600','862','869','871','872','8720','878','879','880','8800','882','885','910','911','912','914','916','917','918','919', + '920','921','922','923','924','925','926','927','930','9300','932','934','935','936','938','942','948','9600','980','984','9920', + 'B20x16','B43x13','Bande Rota','bb3','Bcesta','BcestaOVAL','BcestaRED','Bcirios','BciriosG','BjarronBLN','BjarronNGR', + 'Btazon','Bvelas','cactus200','Caja040','CajaTGLF','CC Alza Pl','CC_falso', + 'EB-RSMINA','EMB 1_4','EMB 2_5','espuma','FB-BENCH','granel','Grenex','guzma1200','guzma1400','guzma330','guzma400','guzma650','guzma900','HB-ALEX', + 'HB-APOSENT','HB-MAGIC','HB-NATUF','HB-RSMINA','HB-TES-RSR','HB068','HB117','HB2-CIRCA','JB-AROMA','jumboX3','kalan330','kalan400', + 'kalan577','kalan900','L12','L120','L14','L2-120','L200','L3-120','L4-120','L44','L6','L6-180','L8','L8-200','MB-BENCH','MBOLA','mc_11', + 'mc_13','Msp','NO VALIDO','NO-002','PANIC','PBLG','PISOCC/3','PISOCC/4','PISOCC/5','PISOCC/6', + 'procona','QB-CARDENA','QB-PANDERO','QB-TES-RSR','QB7-TOSCA','QB9-TOSCA','RB-BENCH','SemiEuroPa','spolette','t_flori11','T26x23', + 'T26x25','T27x24','T27x30','T28x26','T30x24','T33x30','THA50','ti_13','Tumbado','UB-BENCH') \ No newline at end of file From 4ad070ab665286f94442a9c3714ff580692e1ea6 Mon Sep 17 00:00:00 2001 From: robert Date: Wed, 2 Oct 2024 08:26:38 +0200 Subject: [PATCH 10/10] feat: refs #8012 cubos --- db/routines/vn2008/views/Cubos.sql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/db/routines/vn2008/views/Cubos.sql b/db/routines/vn2008/views/Cubos.sql index 4ece9c435..1b23af4fc 100644 --- a/db/routines/vn2008/views/Cubos.sql +++ b/db/routines/vn2008/views/Cubos.sql @@ -17,5 +17,6 @@ AS SELECT `p`.`id` AS `Id_Cubo`, `p`.`upload` AS `Suben`, `p`.`base` AS `Base`, `p`.`isBox` AS `box`, - `p`.`returnCost` AS `costeRetorno` + `p`.`returnCost` AS `costeRetorno`, + `p`.`isActive` AS `isActive` FROM `vn`.`packaging` `p`