From f1370d69603c64fb099f6277f6a600a4c962cd3e Mon Sep 17 00:00:00 2001 From: Jbreso Date: Tue, 29 Oct 2024 12:13:25 +0100 Subject: [PATCH 01/12] feat: refs#8174 simSupplier --- .../11327-maroonOak/00-firstScript.sql | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 db/versions/11327-maroonOak/00-firstScript.sql diff --git a/db/versions/11327-maroonOak/00-firstScript.sql b/db/versions/11327-maroonOak/00-firstScript.sql new file mode 100644 index 000000000..973050fba --- /dev/null +++ b/db/versions/11327-maroonOak/00-firstScript.sql @@ -0,0 +1,19 @@ +CREATE TABLE IF NOT EXISTS `vn`.`simSupplier` ( + `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, + `line` int(9) unsigned DEFAULT NULL, + `ext` int(10) unsigned DEFAULT NULL, + `pin` int(4) unsigned DEFAULT NULL, + `sim` VARCHAR(25), + `puk` int(10) unsigned DEFAULT NULL, + `statusWeb` varchar(50) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `sim_UNIQUE` (`sim`) +) ENGINE=InnoDB AUTO_INCREMENT=1 + DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; + +ALTER TABLE `deviceProductionUser` +MODIFY `simSerialNumber` VARCHAR(25); + +ALTER TABLE vn.deviceProductionUser ADD CONSTRAINT deviceProductionUser_simSupplier_FK + FOREIGN KEY (simSerialNumber) REFERENCES vn.simSupplier(sim); + From fc1e0672a4469ae56446707ecd37cc696ff9ef43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Andr=C3=A9s?= Date: Fri, 29 Nov 2024 11:59:36 +0100 Subject: [PATCH 02/12] fix: refs #8087 refs#8087 errores travel_moveRaids --- .../vn/procedures/travel_checkRaid.sql | 17 ----- .../vn/procedures/travel_moveRaids.sql | 69 +++++++++++-------- .../vn/triggers/travel_beforeInsert.sql | 4 -- 3 files changed, 41 insertions(+), 49 deletions(-) delete mode 100644 db/routines/vn/procedures/travel_checkRaid.sql diff --git a/db/routines/vn/procedures/travel_checkRaid.sql b/db/routines/vn/procedures/travel_checkRaid.sql deleted file mode 100644 index 64f3355e2..000000000 --- a/db/routines/vn/procedures/travel_checkRaid.sql +++ /dev/null @@ -1,17 +0,0 @@ -DELIMITER $$ -CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`travel_checkRaid`( - vIsRaid BOOL, - vDaysInForward INT -) -BEGIN -/** - * Check if the values of isRaid and daysInforward are correct - * - * @param vIsRaid idRaid value - * @param vDaysInForward daysInForward value - */ - IF (NOT vIsRaid AND vDaysInForward IS NOT NULL) OR (vIsRaid AND vDaysInForward IS NULL) THEN - CALL util.throw('The raid information is not correct'); - END IF; -END$$ -DELIMITER ; diff --git a/db/routines/vn/procedures/travel_moveRaids.sql b/db/routines/vn/procedures/travel_moveRaids.sql index cf0fce23c..52f6707bf 100644 --- a/db/routines/vn/procedures/travel_moveRaids.sql +++ b/db/routines/vn/procedures/travel_moveRaids.sql @@ -8,22 +8,16 @@ BEGIN DECLARE vDone BOOL DEFAULT FALSE; DECLARE vBuyerEmail VARCHAR(40); DECLARE vTravelLink TEXT; - DECLARE vMailBody TEXT DEFAULT ''; + DECLARE vMailBody TEXT; + DECLARE vIsMovible BOOL; + DECLARE vSubject VARCHAR(30); - DECLARE vCur CURSOR FOR - SELECT GROUP_CONCAT(DISTINCT - CONCAT('https://salix.verdnatura.es/#!/travel/', - ttm.travelFk, - '/summary ') - ORDER BY ttm.travelFk SEPARATOR '\n\r') travelLink, - CONCAT(u.name, '@verdnatura.es') buyerEmail - FROM tTravelToMove ttm - JOIN entry e ON e.travelFk = ttm.travelFk - JOIN buy b ON b.entryFk = e.id - JOIN item i ON i.id = b.itemFk - JOIN itemType it ON it.id = i.typeFk - JOIN account.user u ON u.id = it.workerFk - GROUP BY u.name; + DECLARE vTravels CURSOR FOR + SELECT GROUP_CONCAT(DISTINCT travelLink ORDER BY id SEPARATOR '\n\r'), + buyerEmail, + isMovable + FROM tTravelToMove + GROUP BY isMovable, buyerEmail; DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE; @@ -34,35 +28,54 @@ BEGIN END; CREATE OR REPLACE TEMPORARY TABLE tTravelToMove - SELECT id travelFk, - util.VN_CURDATE() + INTERVAL daysInForward DAY newLanded + WITH travels AS ( + SELECT id , + CONCAT('https://salix.verdnatura.es/#!/travel/', id,'/summary') travelLink, + util.VN_CURDATE() + INTERVAL daysInForward DAY newLanded, + shipped <= util.VN_CURDATE() + INTERVAL daysInForward DAY isMovable FROM travel WHERE isRaid - AND daysInForward; + AND daysInForward + )SELECT t.*, + CONCAT(u.name, '@verdnatura.es') buyerEmail + FROM travels t + STRAIGHT_JOIN entry e ON e.travelFk = t.id + JOIN buy b ON b.entryFk = e.id + JOIN item i ON i.id = b.itemFk + JOIN itemType it ON it.id = i.typeFk + JOIN account.user u ON u.id = it.workerFk + GROUP BY t.id; START TRANSACTION; UPDATE travel tr - JOIN tTravelToMove ttm ON ttm.travelFk = tr.id - SET tr.landed = ttm.newLanded; + JOIN tTravelToMove ttm ON ttm.id = tr.id + SET tr.landed = ttm.newLanded + WHERE ttm.isMovable; - OPEN vCur; + OPEN vTravels; l: LOOP SET vDone = FALSE; - FETCH vCur INTO vTravelLink, vBuyerEmail; + FETCH vTravels INTO vTravelLink, vBuyerEmail, vIsMovible; IF vDone THEN LEAVE l; END IF; - CALL `vn`.`mail_insert`( - vBuyerEmail, - 'noreply@verdnatura.es', - 'Cambio de fecha en Redadas', - CONCAT('Se ha movido los siguientes travels: \n\r ', vTravelLink)); + IF vIsMovible THEN + SET vSubject = 'Cambio de fecha en Redadas'; + SET vMailBody = 'Se ha movido los siguientes travels'; + ELSE + SET vSubject = 'ERROR al cambiar la fecha en Redadas'; + SET vMailBody = 'Ha ocurrido un error con las fechas al mover los siguiente travels'; + END IF; + + SET vMailBody = CONCAT(vMailBody, ': \n\r ', vTravelLink); + + CALL mail_insert(vBuyerEmail, 'noreply@verdnatura.es', vSubject, vMailBody); END LOOP; - CLOSE vCur; + CLOSE vTravels; COMMIT; DROP TEMPORARY TABLE tTravelToMove; END$$ diff --git a/db/routines/vn/triggers/travel_beforeInsert.sql b/db/routines/vn/triggers/travel_beforeInsert.sql index 5356ed537..50331ba6a 100644 --- a/db/routines/vn/triggers/travel_beforeInsert.sql +++ b/db/routines/vn/triggers/travel_beforeInsert.sql @@ -9,10 +9,6 @@ BEGIN CALL travel_checkWarehouseIsFeedStock(NEW.warehouseInFk); - IF NEW.isRaid IS NOT NULL OR NEW.daysInForward IS NOT NULL THEN - CALL travel_checkRaid(NEW.isRaid, NEW.daysInForward); - END IF; - IF NEW.awbFk IS NOT NULL THEN CALL travel_throwAwb(NEW.id); END IF; From b0ee1f3e24260098d712565c1b2a83a8c1cade89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Andr=C3=A9s?= Date: Fri, 29 Nov 2024 17:18:25 +0100 Subject: [PATCH 03/12] fix: refs #8087 refs#8087 errores travel_moveRaids --- .../vn/procedures/travel_checkRaid.sql | 17 +++++++++ .../vn/procedures/travel_moveRaids.sql | 38 ++++++++----------- .../vn/triggers/travel_beforeInsert.sql | 4 ++ .../vn/triggers/travel_beforeUpdate.sql | 4 ++ 4 files changed, 40 insertions(+), 23 deletions(-) create mode 100644 db/routines/vn/procedures/travel_checkRaid.sql diff --git a/db/routines/vn/procedures/travel_checkRaid.sql b/db/routines/vn/procedures/travel_checkRaid.sql new file mode 100644 index 000000000..885fc718a --- /dev/null +++ b/db/routines/vn/procedures/travel_checkRaid.sql @@ -0,0 +1,17 @@ +DELIMITER $$ +CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`travel_checkRaid`( + vIsRaid BOOL, + vDaysInForward INT +) +BEGIN +/** + * Check if the values of isRaid and daysInforward are correct + * + * @param vIsRaid idRaid value + * @param vDaysInForward daysInForward value + */ + IF NOT vIsRaid AND vDaysInForward THEN + CALL util.throw('If daysInForward has a value, the raid cannot be unchecked'); + END IF; +END$$ +DELIMITER ; diff --git a/db/routines/vn/procedures/travel_moveRaids.sql b/db/routines/vn/procedures/travel_moveRaids.sql index 52f6707bf..7f2593a3b 100644 --- a/db/routines/vn/procedures/travel_moveRaids.sql +++ b/db/routines/vn/procedures/travel_moveRaids.sql @@ -9,15 +9,14 @@ BEGIN DECLARE vBuyerEmail VARCHAR(40); DECLARE vTravelLink TEXT; DECLARE vMailBody TEXT; - DECLARE vIsMovible BOOL; + DECLARE vDaysBetweenDates INT; DECLARE vSubject VARCHAR(30); DECLARE vTravels CURSOR FOR SELECT GROUP_CONCAT(DISTINCT travelLink ORDER BY id SEPARATOR '\n\r'), - buyerEmail, - isMovable + buyerEmail FROM tTravelToMove - GROUP BY isMovable, buyerEmail; + GROUP BY buyerEmail; DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE; @@ -29,20 +28,20 @@ BEGIN CREATE OR REPLACE TEMPORARY TABLE tTravelToMove WITH travels AS ( - SELECT id , + SELECT id, CONCAT('https://salix.verdnatura.es/#!/travel/', id,'/summary') travelLink, util.VN_CURDATE() + INTERVAL daysInForward DAY newLanded, - shipped <= util.VN_CURDATE() + INTERVAL daysInForward DAY isMovable - FROM travel + util.VN_CURDATE() - INTERVAL DATEDIFF(landed, shipped) + daysInForward DAY newShipped + FROM vn.travel WHERE isRaid AND daysInForward )SELECT t.*, CONCAT(u.name, '@verdnatura.es') buyerEmail FROM travels t - STRAIGHT_JOIN entry e ON e.travelFk = t.id - JOIN buy b ON b.entryFk = e.id - JOIN item i ON i.id = b.itemFk - JOIN itemType it ON it.id = i.typeFk + STRAIGHT_JOIN vn.entry e ON e.travelFk = t.id + JOIN vn.buy b ON b.entryFk = e.id + JOIN vn.item i ON i.id = b.itemFk + JOIN vn.itemType it ON it.id = i.typeFk JOIN account.user u ON u.id = it.workerFk GROUP BY t.id; @@ -50,28 +49,21 @@ BEGIN UPDATE travel tr JOIN tTravelToMove ttm ON ttm.id = tr.id - SET tr.landed = ttm.newLanded - WHERE ttm.isMovable; + SET tr.landed = ttm.newLanded, + tr.shipped = ttm.newShipped; OPEN vTravels; l: LOOP SET vDone = FALSE; - FETCH vTravels INTO vTravelLink, vBuyerEmail, vIsMovible; + FETCH vTravels INTO vTravelLink, vBuyerEmail; IF vDone THEN LEAVE l; END IF; - IF vIsMovible THEN - SET vSubject = 'Cambio de fecha en Redadas'; - SET vMailBody = 'Se ha movido los siguientes travels'; - ELSE - SET vSubject = 'ERROR al cambiar la fecha en Redadas'; - SET vMailBody = 'Ha ocurrido un error con las fechas al mover los siguiente travels'; - END IF; - - SET vMailBody = CONCAT(vMailBody, ': \n\r ', vTravelLink); + SET vSubject = 'Cambio de fecha en Redadas', + vMailBody = CONCAT('Se ha movido los siguientes travels: \n\r ', vTravelLink); CALL mail_insert(vBuyerEmail, 'noreply@verdnatura.es', vSubject, vMailBody); END LOOP; diff --git a/db/routines/vn/triggers/travel_beforeInsert.sql b/db/routines/vn/triggers/travel_beforeInsert.sql index 50331ba6a..5356ed537 100644 --- a/db/routines/vn/triggers/travel_beforeInsert.sql +++ b/db/routines/vn/triggers/travel_beforeInsert.sql @@ -9,6 +9,10 @@ BEGIN CALL travel_checkWarehouseIsFeedStock(NEW.warehouseInFk); + IF NEW.isRaid IS NOT NULL OR NEW.daysInForward IS NOT NULL THEN + CALL travel_checkRaid(NEW.isRaid, NEW.daysInForward); + END IF; + IF NEW.awbFk IS NOT NULL THEN CALL travel_throwAwb(NEW.id); END IF; diff --git a/db/routines/vn/triggers/travel_beforeUpdate.sql b/db/routines/vn/triggers/travel_beforeUpdate.sql index 256dd35f8..5a27b43b4 100644 --- a/db/routines/vn/triggers/travel_beforeUpdate.sql +++ b/db/routines/vn/triggers/travel_beforeUpdate.sql @@ -20,6 +20,10 @@ BEGIN CALL travel_checkWarehouseIsFeedStock(NEW.warehouseInFk); END IF; + IF NOT (NEW.isRaid <=> OLD.isRaid) OR NOT (NEW.daysInForward <=> OLD.daysInForward) THEN + CALL travel_checkRaid(NEW.isRaid, NEW.daysInForward); + END IF; + IF NOT (NEW.awbFk <=> OLD.awbFk)THEN SELECT COUNT(*) INTO vHasAnyInvoiceBooked FROM travel t From 202ed47963dad41ed96efce4197225113feb2c43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Andr=C3=A9s?= Date: Fri, 29 Nov 2024 17:20:14 +0100 Subject: [PATCH 04/12] fix: refs #8087 refs#8087 errores travel_moveRaids --- db/routines/vn/procedures/travel_moveRaids.sql | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/db/routines/vn/procedures/travel_moveRaids.sql b/db/routines/vn/procedures/travel_moveRaids.sql index 7f2593a3b..17d7ecc4c 100644 --- a/db/routines/vn/procedures/travel_moveRaids.sql +++ b/db/routines/vn/procedures/travel_moveRaids.sql @@ -35,7 +35,10 @@ BEGIN FROM vn.travel WHERE isRaid AND daysInForward - )SELECT t.*, + )SELECT t.id, + t.travelLink, + t.newLanded, + t.newShipped, CONCAT(u.name, '@verdnatura.es') buyerEmail FROM travels t STRAIGHT_JOIN vn.entry e ON e.travelFk = t.id From f6ac55d9d7c197b7325948392cf85b7bf301520a Mon Sep 17 00:00:00 2001 From: carlossa Date: Tue, 10 Dec 2024 11:01:52 +0100 Subject: [PATCH 05/12] fix: fix back --- .../ticket/back/methods/ticket-request/filter.js | 14 +++++++++++++- modules/worker/back/models/worker-irpf.json | 10 ++++++---- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/modules/ticket/back/methods/ticket-request/filter.js b/modules/ticket/back/methods/ticket-request/filter.js index 53f90b98f..c2edcae81 100644 --- a/modules/ticket/back/methods/ticket-request/filter.js +++ b/modules/ticket/back/methods/ticket-request/filter.js @@ -64,6 +64,11 @@ module.exports = Self => { arg: 'myTeam', type: 'boolean', description: `Team partners` + }, + { + arg: 'daysOnward', + type: 'number', + description: 'The days onward' } ], returns: { @@ -104,6 +109,9 @@ module.exports = Self => { teamMembersId.push(userId); } + const today = Date.vnNew(); + const future = Date.vnNew(); + let where = buildFilter(ctx.args, (param, value) => { switch (param) { case 'search': @@ -140,9 +148,13 @@ module.exports = Self => { return {'tr.requesterFk': {inq: teamMembersId}}; else return {'tr.requesterFk': {nin: teamMembersId}}; + case 'daysOnward': + today.setHours(0, 0, 0, 0); + future.setDate(today.getDate() + value); + future.setHours(23, 59, 59, 999); + return {'t.shipped': {between: [today, future]}}; } }); - if (!where) where = {}; where['tw.ticketFk'] = null; diff --git a/modules/worker/back/models/worker-irpf.json b/modules/worker/back/models/worker-irpf.json index 65f72a1fd..eafda0596 100644 --- a/modules/worker/back/models/worker-irpf.json +++ b/modules/worker/back/models/worker-irpf.json @@ -23,7 +23,7 @@ "type" : "number" }, "isDependend": { - "type" : "number" + "type" : "boolean" }, "familySituation": { "type" : "number" @@ -35,15 +35,17 @@ "type" : "number" }, "hasHousingPaymentBefore": { - "type" : "number" + "type" : "boolean" }, "hasHousingPaymentAfter": { - "type" : "number" + "type" : "boolean" }, "updated": { "type" : "date" + }, + "hasExtendedWorking": { + "type" : "boolean" } - }, "relations": { "disabilityGrade": { From 10558853a2b2304c8732cfe1854e2bcb7ccbd211 Mon Sep 17 00:00:00 2001 From: Jbreso Date: Tue, 10 Dec 2024 13:41:45 +0100 Subject: [PATCH 06/12] feat: refs #8174 create table simsupplier --- .../11327-maroonOak/00-firstScript.sql | 159 ++++++++++++++++++ 1 file changed, 159 insertions(+) diff --git a/db/versions/11327-maroonOak/00-firstScript.sql b/db/versions/11327-maroonOak/00-firstScript.sql index 973050fba..2ad44f700 100644 --- a/db/versions/11327-maroonOak/00-firstScript.sql +++ b/db/versions/11327-maroonOak/00-firstScript.sql @@ -17,3 +17,162 @@ MODIFY `simSerialNumber` VARCHAR(25); ALTER TABLE vn.deviceProductionUser ADD CONSTRAINT deviceProductionUser_simSupplier_FK FOREIGN KEY (simSerialNumber) REFERENCES vn.simSupplier(sim); +INSERT IGNORE INTO `vn`.`simSupplier` (`line`, `ext`, `pin`, `sim`, `puk`, `statusWeb`) +VALUES +(621188151, 2209, 1486, 3456985220092508,14213470, 'OK'), +(621188152, 2210, 8765, 3456985220092509,99473093, 'OK'), +(621188153, 2211, 3064, 3456985220092510,52967210, 'OK'), +(621188759, 2081, 3700, 3456985220123637,56600999, 'OK'), +(621188760, 2082, 3259, 345698522023638,87492404, 'OK'), +(621188761, 2083, 2790, 3456985220123639,94009456, 'OK'), +(621188762, 2084, 2480, 3456985220123644,1484999, 'OK'), +(621188763, 2085, 6876, 3456985220123641,36577064, 'OK'), +(621188766, 2086, 7775, 3456985220123642,80761698, 'OK'), +(621188769, 2088, 4027, 3456985220123643,37921712, 'OK'), +(621188771, 2089, 8797, 3456985220123640,63092540, 'OK'), +(621188772, 2090, 8404, 3456985220123645,21014997, 'OK'), +(621188773, 2091, 5481, 3456985220123646,16317277, 'OK'), +(621188774, 2092, 9632, 3456985220123647,22235994, 'OK'), +(621188775, 2093, 4654, 3456985220123648,28506486, 'OK'), +(621188838, 2094, 1392, 3456985220123649,29498627, 'OK'), +(621188839, 2095, 7774, 3456985220123650,46263490, 'OK'), +(621188840, 2096, 7304, 3456985220123658,8212044, 'OK'), +(621188841, 2097, 5569, 3456985220123652,81597658, 'OK'), +(621188842, 2098, 4944, 3456985220123653,24961501, 'OK'), +(621188843, 2099, 5142, 3456985220123654,17035634, 'OK'), +(621188844, 2111, 7245, 3456985220123655,90231951, 'OK'), +(621188846, 2110, 6590, 3456985220123656,72201537, 'OK'), +(667680207, 2564, 4042, 34569832200759166,48401979, 'OK'), +(667680315, 2565, 7143, 34569832200759372,32143252, 'OK'), +(667680318, 2566, 6342, 34569832200759364,39597112, 'OK'), +(667680413, 2567, 5580, 34569832200759356,32786992, 'OK'), +(667680463, 2568, 0171, 34569832200759349,34240853, 'OK'), +(667688217, 2569, 2500, 34569832200759331,5687589, 'OK'), +(633603945, 2212, 7129, 34569832200759323,51554019, 'OK'), +(622130186, 2213, 4826, 34569832200759307,19623551, 'OK'), +(633973424, 2214, 8535, 34569832200759299,94619307, 'OK'), +(633703828, 2215, 8628, 34569832200759281,22468012, 'OK'), +(622025110, 2216, 2399, 34569832200759273,34602918, 'OK'), +(622924867, 2217, 5665, 34569832200759265,26920216, 'OK'), +(722409630, 2218, 5211, 34569832200759240,93750137, 'OK'), +(623590529, 2219, 0493, 34569832200759208,47077088, 'OK'), +(633243462, 2220, 6902, 34569832200759174,6421962, 'OK'), +(633047286, 2221, 5592, 34569832200759182,32069439, 'OK'), +(744716801, 2112, 9184, 34569832200759190,57049814, 'OK'), +(655995021, 2131, 8896, 34569852202049093,19497356, 'OK'), +(685522718, 2132, 1955, 34569852202049101,28519879, 'OK'), +(674587213, 2994, 2006, 34569332200223743,62360135, 'OK'), +(674587227, 2993, 9271, 34569332200223750,81628192, 'OK'), +(674587229, 2993, 0900, 34569332200223768,91119071, 'OK'), +(674587231, 2992, 5007, 34569332200223776,45826232, 'OK'), +(674587234, 2991, 1378, 34569332200223784,91245744, 'OK'), +(674587240, 2990, 0905, 34569332200223792,13083224, 'OK'), +(674587245, 2989, 9059, 34569332200223800,15291807, 'OK'), +(674587250, 2988, 8188, 34569332200223818,83017918, 'OK'), +(674587254, 2987, 2962, 34569332200223826,92809271, 'OK'), +(674587256, 2986, 0358, 34569332200223834,81067040, 'OK'), +(674592713, 2570, 2537, 34569332200230672,82325850, 'OK'), +(697832478, 2579, 0936, 34568732200494825,49658372, 'OK'), +(697832176, 2571, 5944, 34568732200494742,19039461, 'OK'), +(697832477, 2572, 5138, 34568732200494759,25712504, 'OK'), +(697832178, 2573, 4597, 34568732200494767,66241760, 'OK'), +(697832182, 2574, 9241, 34568732200494775,07342562, 'OK'), +(697832196, 2575, 2995, 34568732200494783,53929026, 'OK'), +(697832214, 2576, 7434, 34568732200494791,49698432, 'OK'), +(697832230, 2577, 7004, 34568732200494809,21578612, 'OK'), +(697832235, 2578, 9674, 34568732200494817,93090700, 'OK'), +(673420375, 2599, 5430, 34562052300117259,35911412, 'OK'), +(673420367, 2598, 8402, 34562052300117242,924654, 'OK'), +(673420361, 2597, 5125, 34562052300117234,12027970, 'OK'), +(673420355, 2596, 5069, 34562052300117226,34978149, 'OK'), +(673420348, 2595, 8911, 34562052300117218,4228121, 'OK'), +(673420346, 2594, 2461, 34562052300117200,67670772, 'OK'), +(673420345, 2593, 2226, 34562052300117192,90586404, 'OK'), +(673420306, 2592, 3355, 34562052300117184,97850017, 'OK'), +(673420257, 2591, 9395, 34562052300117176,50713786, 'OK'), +(673420231, 2590, 1378, 34562052300117168,50151763, 'OK'), +(673420223, 2589, 9580, 34562052300117150,99534550, 'OK'), +(673420216, 2588, 4955, 34562052300117143,317554, 'OK'), +(673420203, 2587, 6742, 34562052300117135,69321531, 'OK'), +(673420201, 2586, 1659, 34562052300117127,54720480, 'OK'), +(673420199, 2585, 7823, 34562052300117119,22923796, 'OK'), +(673420198, 2584, 1787, 34562052300117101,54414630, 'OK'), +(673420168, 2583, 6334, 34562052300117093,50694894, 'OK'), +(673420147, 2582, 8951, 34562052300117085,1402535, 'OK'), +(673420125, 2581, 3068, 34562052300117077,86216200, 'OK'), +(673420124, 2580, 9517, 34562052300117069,42504099, 'OK'), +(600294609, 2715, 7474, 34569832304894588,55923317, 'OK'), +(600084713, 2703, 8342, 34569832304894570,8392636, 'OK'), +(600084732, 2704, 1625, 34569832304894513,75477452, 'OK'), +(600084850, 2705, 9896, 34569832304894653,28589813, 'OK'), +(600084951, 2706, 5520, 34569832304894661,75353012, 'OK'), +(600084978, 2707, 2698, 34569832304894679,9005523, 'OK'), +(600085403, 2708, 0837, 34569832304894646,77051152, 'OK'), +(600085513, 2709, 3106, 34569832304894687,41571002, 'OK'), +(600293916, 2712, 8990, 34569832304894620,95188676, 'OK'), +(600294160, 2714, 6376, 34569832304894703,79879896, 'OK'), +(671919529, 2975, 9184, 34569832304806236,7535392, 'OK'), +(671919942, 2981, 0328, 34569832304806269,31052894, 'OK'), +(671919530, 2976, 0344, 34569832304806251,89860304, 'OK'), +(671919533, 2977, 0668, 34569832304806244,42921771, 'OK'), +(671919535, 2978, 0105, 34569832304806277,31009417, 'OK'), +(671919537, 2979, 0881, 34569832304806285,33479769, 'OK'), +(671919540, 2980, 9874, 34569832304806293,14103929, 'OK'), +(671919525, 2972, 2089, 34569832304806301,45903729, 'OK'), +(671919527, 2973, 8206, 34569832304806368,1586035, 'OK'), +(671919528, 2974, 2532, 34569832304806327,62310124, 'OK'), +(673668717, 2836, 7973, 34562032301044223,15635496, 'OK'), +(673668734, 2837, 4457, 34562032301044231,18313118, 'OK'), +(673668738, 2824, 2911, 34562032301044249,30875583, 'OK'), +(673668745, 2838, 7253, 34562032301044256,62754222, 'OK'), +(673668796, 2839, 0068, 34562032301044264,15556829, 'OK'), +(673668803, 2840, 2386, 34562032301044272,17572287, 'OK'), +(673669591, 2850, 3833, 34562032301044280,34828896, 'OK'), +(673668808, 2841, 3584, 34562032301044298,16234497, 'OK'), +(673670102, 2851, 3554, 34562032301044306,23652625, 'OK'), +(673670131, 2852, 4412, 34562032301044314,88611709, 'OK'), +(673670135, 2827, 6058, 34562032301044322,53918579, 'OK'), +(673670201, 2828, 8066, 34562032301044330,92369343, 'OK'), +(673670225, 2829, 4592, 34562032301044348,24126635, 'OK'), +(673670236, 2830, 2974, 34562032301044355,88608465, 'OK'), +(673671485, 2849, 0349, 34562032301044363,44944874, 'OK'), +(673461977, 2871, 1728, 34562032400157090,46975780, 'OK'), +(673461975, 2870, 4734, 34562032400157082,69628432, 'OK'), +(673461972, 2867, 6276, 34562032400157058,53338365, 'OK'), +(673461979, 2872, 6043, 34562032400157108,36525197, 'OK'), +(673461958, 2859, 3164, 34562032400156977,58947831, 'OK'), +(673461957, 2857, 8685, 34562032400156969,15826386, 'OK'), +(673461944, 2853, 1073, 34562032400156910,20452195, 'OK'), +(673461974, 2869, 7121, 34562032400157074,32044645, 'OK'), +(673461973, 2868, 8022, 34562032400157066,29282044, 'OK'), +(673461971, 2866, 3089, 34562032400157041,66149978, 'OK'), +(673461969, 2865, 7555, 34562032400157033,78391293, 'OK'), +(673461960, 2860, 5203, 34562032400156985,37138232, 'OK'), +(673461952, 2855, 6915, 34562032400156936,62724661, 'OK'), +(673461949, 2854, 8706, 34562032400156928,5594345, 'OK'), +(673461966, 2863, 2496, 34562032400157017,93450666, 'OK'), +(673461968, 2864, 3703, 34562032400157025,23208841, 'OK'), +(673461963, 2862, 9364, 34562032400157009,29712130, 'OK'), +(673462719, 2873, 9387, 34562032400156951,50434348, 'OK'), +(673461962, 2861, 8441, 34562032400156993,39686909, 'OK'), +(673461956, 2826, 5392, 34562032400156944,5496107, 'OK'), +(673465284, 2694, 1523, 34562032400171349,14554994, 'OK'), +(673465282, 2692, 4645, 34562032400171323,24871187, 'OK'), +(673465283, 2693, 5253, 34562032400171331,28303238, 'OK'), +(673465841, 2696, 0849, 34562032400171257,21673222, 'OK'), +(673465258, 2679, 4140, 34562032400171174,39793881, 'OK'), +(673465263, 2680, 6922, 34562032400171182,12253261, 'OK'), +(673465265, 2681, 9112, 34562032400171190,93894366, 'OK'), +(673465267, 2682, 3259, 34562032400171208,2342189, 'OK'), +(673465268, 2683, 8540, 34562032400171216,63886925, 'OK'), +(673465285, 2695, 4167, 34562032400171356,79227618, 'OK'), +(673465270, 2684, 4292, 34562032400171224,19216349, 'OK'), +(673465272, 2685, 4007, 34562032400171232,14396903, 'OK'), +(673465273, 2686, 6894, 34562032400171240,13569394, 'OK'), +(673465274, 2687, 5268, 34562032400171265,59453667, 'OK'), +(673465275, 2688, 0232, 34562032400171273,62324713, 'OK'), +(673465276, 2689, 2720, 34562032400171281,65977200, 'OK'), +(673465843, 2698, 4773, 34562032400171364,78387158, 'OK'), +(673465842, 2697, 3729, 34562032400171315,94201789, 'OK'), +(673465280, 2691, 0503, 34562032400171307,12298533, 'OK'), +(673465279, 2690, 8239, 34562032400171299,76183877, 'OK'); \ No newline at end of file From 87976351012fa275b41a4c46e2a31299ebe77f9f Mon Sep 17 00:00:00 2001 From: Jbreso Date: Tue, 10 Dec 2024 13:46:03 +0100 Subject: [PATCH 07/12] feat: refs #8174 fix --- db/versions/11327-maroonOak/00-firstScript.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/versions/11327-maroonOak/00-firstScript.sql b/db/versions/11327-maroonOak/00-firstScript.sql index 2ad44f700..eda1f5e97 100644 --- a/db/versions/11327-maroonOak/00-firstScript.sql +++ b/db/versions/11327-maroonOak/00-firstScript.sql @@ -11,7 +11,7 @@ CREATE TABLE IF NOT EXISTS `vn`.`simSupplier` ( ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; -ALTER TABLE `deviceProductionUser` +ALTER TABLE `vn`.`deviceProductionUser` MODIFY `simSerialNumber` VARCHAR(25); ALTER TABLE vn.deviceProductionUser ADD CONSTRAINT deviceProductionUser_simSupplier_FK From 28ab6b2266620feace9b03ffb66c83f7a5cd167e Mon Sep 17 00:00:00 2001 From: Jbreso Date: Wed, 11 Dec 2024 11:20:15 +0100 Subject: [PATCH 08/12] feat: refs #8174 fix --- .../11327-maroonOak/00-firstScript.sql | 327 +++++++++--------- 1 file changed, 163 insertions(+), 164 deletions(-) diff --git a/db/versions/11327-maroonOak/00-firstScript.sql b/db/versions/11327-maroonOak/00-firstScript.sql index eda1f5e97..250a2fc8b 100644 --- a/db/versions/11327-maroonOak/00-firstScript.sql +++ b/db/versions/11327-maroonOak/00-firstScript.sql @@ -1,11 +1,10 @@ CREATE TABLE IF NOT EXISTS `vn`.`simSupplier` ( - `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, - `line` int(9) unsigned DEFAULT NULL, - `ext` int(10) unsigned DEFAULT NULL, - `pin` int(4) unsigned DEFAULT NULL, + `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, + `line` INT(9) unsigned NOT NULL, + `ext` CHAR(4) NOT NULL CHECK (ext REGEXP '^[0-9]{4}$'), + `pin` CHAR(4) NOT NULL CHECK (pin REGEXP '^[0-9]{4}$'), `sim` VARCHAR(25), - `puk` int(10) unsigned DEFAULT NULL, - `statusWeb` varchar(50) DEFAULT NULL, + `puk` INT(10) unsigned NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `sim_UNIQUE` (`sim`) ) ENGINE=InnoDB AUTO_INCREMENT=1 @@ -17,162 +16,162 @@ MODIFY `simSerialNumber` VARCHAR(25); ALTER TABLE vn.deviceProductionUser ADD CONSTRAINT deviceProductionUser_simSupplier_FK FOREIGN KEY (simSerialNumber) REFERENCES vn.simSupplier(sim); -INSERT IGNORE INTO `vn`.`simSupplier` (`line`, `ext`, `pin`, `sim`, `puk`, `statusWeb`) +INSERT IGNORE INTO `vn`.`simSupplier` (`line`, `ext`, `pin`, `sim`, `puk`) VALUES -(621188151, 2209, 1486, 3456985220092508,14213470, 'OK'), -(621188152, 2210, 8765, 3456985220092509,99473093, 'OK'), -(621188153, 2211, 3064, 3456985220092510,52967210, 'OK'), -(621188759, 2081, 3700, 3456985220123637,56600999, 'OK'), -(621188760, 2082, 3259, 345698522023638,87492404, 'OK'), -(621188761, 2083, 2790, 3456985220123639,94009456, 'OK'), -(621188762, 2084, 2480, 3456985220123644,1484999, 'OK'), -(621188763, 2085, 6876, 3456985220123641,36577064, 'OK'), -(621188766, 2086, 7775, 3456985220123642,80761698, 'OK'), -(621188769, 2088, 4027, 3456985220123643,37921712, 'OK'), -(621188771, 2089, 8797, 3456985220123640,63092540, 'OK'), -(621188772, 2090, 8404, 3456985220123645,21014997, 'OK'), -(621188773, 2091, 5481, 3456985220123646,16317277, 'OK'), -(621188774, 2092, 9632, 3456985220123647,22235994, 'OK'), -(621188775, 2093, 4654, 3456985220123648,28506486, 'OK'), -(621188838, 2094, 1392, 3456985220123649,29498627, 'OK'), -(621188839, 2095, 7774, 3456985220123650,46263490, 'OK'), -(621188840, 2096, 7304, 3456985220123658,8212044, 'OK'), -(621188841, 2097, 5569, 3456985220123652,81597658, 'OK'), -(621188842, 2098, 4944, 3456985220123653,24961501, 'OK'), -(621188843, 2099, 5142, 3456985220123654,17035634, 'OK'), -(621188844, 2111, 7245, 3456985220123655,90231951, 'OK'), -(621188846, 2110, 6590, 3456985220123656,72201537, 'OK'), -(667680207, 2564, 4042, 34569832200759166,48401979, 'OK'), -(667680315, 2565, 7143, 34569832200759372,32143252, 'OK'), -(667680318, 2566, 6342, 34569832200759364,39597112, 'OK'), -(667680413, 2567, 5580, 34569832200759356,32786992, 'OK'), -(667680463, 2568, 0171, 34569832200759349,34240853, 'OK'), -(667688217, 2569, 2500, 34569832200759331,5687589, 'OK'), -(633603945, 2212, 7129, 34569832200759323,51554019, 'OK'), -(622130186, 2213, 4826, 34569832200759307,19623551, 'OK'), -(633973424, 2214, 8535, 34569832200759299,94619307, 'OK'), -(633703828, 2215, 8628, 34569832200759281,22468012, 'OK'), -(622025110, 2216, 2399, 34569832200759273,34602918, 'OK'), -(622924867, 2217, 5665, 34569832200759265,26920216, 'OK'), -(722409630, 2218, 5211, 34569832200759240,93750137, 'OK'), -(623590529, 2219, 0493, 34569832200759208,47077088, 'OK'), -(633243462, 2220, 6902, 34569832200759174,6421962, 'OK'), -(633047286, 2221, 5592, 34569832200759182,32069439, 'OK'), -(744716801, 2112, 9184, 34569832200759190,57049814, 'OK'), -(655995021, 2131, 8896, 34569852202049093,19497356, 'OK'), -(685522718, 2132, 1955, 34569852202049101,28519879, 'OK'), -(674587213, 2994, 2006, 34569332200223743,62360135, 'OK'), -(674587227, 2993, 9271, 34569332200223750,81628192, 'OK'), -(674587229, 2993, 0900, 34569332200223768,91119071, 'OK'), -(674587231, 2992, 5007, 34569332200223776,45826232, 'OK'), -(674587234, 2991, 1378, 34569332200223784,91245744, 'OK'), -(674587240, 2990, 0905, 34569332200223792,13083224, 'OK'), -(674587245, 2989, 9059, 34569332200223800,15291807, 'OK'), -(674587250, 2988, 8188, 34569332200223818,83017918, 'OK'), -(674587254, 2987, 2962, 34569332200223826,92809271, 'OK'), -(674587256, 2986, 0358, 34569332200223834,81067040, 'OK'), -(674592713, 2570, 2537, 34569332200230672,82325850, 'OK'), -(697832478, 2579, 0936, 34568732200494825,49658372, 'OK'), -(697832176, 2571, 5944, 34568732200494742,19039461, 'OK'), -(697832477, 2572, 5138, 34568732200494759,25712504, 'OK'), -(697832178, 2573, 4597, 34568732200494767,66241760, 'OK'), -(697832182, 2574, 9241, 34568732200494775,07342562, 'OK'), -(697832196, 2575, 2995, 34568732200494783,53929026, 'OK'), -(697832214, 2576, 7434, 34568732200494791,49698432, 'OK'), -(697832230, 2577, 7004, 34568732200494809,21578612, 'OK'), -(697832235, 2578, 9674, 34568732200494817,93090700, 'OK'), -(673420375, 2599, 5430, 34562052300117259,35911412, 'OK'), -(673420367, 2598, 8402, 34562052300117242,924654, 'OK'), -(673420361, 2597, 5125, 34562052300117234,12027970, 'OK'), -(673420355, 2596, 5069, 34562052300117226,34978149, 'OK'), -(673420348, 2595, 8911, 34562052300117218,4228121, 'OK'), -(673420346, 2594, 2461, 34562052300117200,67670772, 'OK'), -(673420345, 2593, 2226, 34562052300117192,90586404, 'OK'), -(673420306, 2592, 3355, 34562052300117184,97850017, 'OK'), -(673420257, 2591, 9395, 34562052300117176,50713786, 'OK'), -(673420231, 2590, 1378, 34562052300117168,50151763, 'OK'), -(673420223, 2589, 9580, 34562052300117150,99534550, 'OK'), -(673420216, 2588, 4955, 34562052300117143,317554, 'OK'), -(673420203, 2587, 6742, 34562052300117135,69321531, 'OK'), -(673420201, 2586, 1659, 34562052300117127,54720480, 'OK'), -(673420199, 2585, 7823, 34562052300117119,22923796, 'OK'), -(673420198, 2584, 1787, 34562052300117101,54414630, 'OK'), -(673420168, 2583, 6334, 34562052300117093,50694894, 'OK'), -(673420147, 2582, 8951, 34562052300117085,1402535, 'OK'), -(673420125, 2581, 3068, 34562052300117077,86216200, 'OK'), -(673420124, 2580, 9517, 34562052300117069,42504099, 'OK'), -(600294609, 2715, 7474, 34569832304894588,55923317, 'OK'), -(600084713, 2703, 8342, 34569832304894570,8392636, 'OK'), -(600084732, 2704, 1625, 34569832304894513,75477452, 'OK'), -(600084850, 2705, 9896, 34569832304894653,28589813, 'OK'), -(600084951, 2706, 5520, 34569832304894661,75353012, 'OK'), -(600084978, 2707, 2698, 34569832304894679,9005523, 'OK'), -(600085403, 2708, 0837, 34569832304894646,77051152, 'OK'), -(600085513, 2709, 3106, 34569832304894687,41571002, 'OK'), -(600293916, 2712, 8990, 34569832304894620,95188676, 'OK'), -(600294160, 2714, 6376, 34569832304894703,79879896, 'OK'), -(671919529, 2975, 9184, 34569832304806236,7535392, 'OK'), -(671919942, 2981, 0328, 34569832304806269,31052894, 'OK'), -(671919530, 2976, 0344, 34569832304806251,89860304, 'OK'), -(671919533, 2977, 0668, 34569832304806244,42921771, 'OK'), -(671919535, 2978, 0105, 34569832304806277,31009417, 'OK'), -(671919537, 2979, 0881, 34569832304806285,33479769, 'OK'), -(671919540, 2980, 9874, 34569832304806293,14103929, 'OK'), -(671919525, 2972, 2089, 34569832304806301,45903729, 'OK'), -(671919527, 2973, 8206, 34569832304806368,1586035, 'OK'), -(671919528, 2974, 2532, 34569832304806327,62310124, 'OK'), -(673668717, 2836, 7973, 34562032301044223,15635496, 'OK'), -(673668734, 2837, 4457, 34562032301044231,18313118, 'OK'), -(673668738, 2824, 2911, 34562032301044249,30875583, 'OK'), -(673668745, 2838, 7253, 34562032301044256,62754222, 'OK'), -(673668796, 2839, 0068, 34562032301044264,15556829, 'OK'), -(673668803, 2840, 2386, 34562032301044272,17572287, 'OK'), -(673669591, 2850, 3833, 34562032301044280,34828896, 'OK'), -(673668808, 2841, 3584, 34562032301044298,16234497, 'OK'), -(673670102, 2851, 3554, 34562032301044306,23652625, 'OK'), -(673670131, 2852, 4412, 34562032301044314,88611709, 'OK'), -(673670135, 2827, 6058, 34562032301044322,53918579, 'OK'), -(673670201, 2828, 8066, 34562032301044330,92369343, 'OK'), -(673670225, 2829, 4592, 34562032301044348,24126635, 'OK'), -(673670236, 2830, 2974, 34562032301044355,88608465, 'OK'), -(673671485, 2849, 0349, 34562032301044363,44944874, 'OK'), -(673461977, 2871, 1728, 34562032400157090,46975780, 'OK'), -(673461975, 2870, 4734, 34562032400157082,69628432, 'OK'), -(673461972, 2867, 6276, 34562032400157058,53338365, 'OK'), -(673461979, 2872, 6043, 34562032400157108,36525197, 'OK'), -(673461958, 2859, 3164, 34562032400156977,58947831, 'OK'), -(673461957, 2857, 8685, 34562032400156969,15826386, 'OK'), -(673461944, 2853, 1073, 34562032400156910,20452195, 'OK'), -(673461974, 2869, 7121, 34562032400157074,32044645, 'OK'), -(673461973, 2868, 8022, 34562032400157066,29282044, 'OK'), -(673461971, 2866, 3089, 34562032400157041,66149978, 'OK'), -(673461969, 2865, 7555, 34562032400157033,78391293, 'OK'), -(673461960, 2860, 5203, 34562032400156985,37138232, 'OK'), -(673461952, 2855, 6915, 34562032400156936,62724661, 'OK'), -(673461949, 2854, 8706, 34562032400156928,5594345, 'OK'), -(673461966, 2863, 2496, 34562032400157017,93450666, 'OK'), -(673461968, 2864, 3703, 34562032400157025,23208841, 'OK'), -(673461963, 2862, 9364, 34562032400157009,29712130, 'OK'), -(673462719, 2873, 9387, 34562032400156951,50434348, 'OK'), -(673461962, 2861, 8441, 34562032400156993,39686909, 'OK'), -(673461956, 2826, 5392, 34562032400156944,5496107, 'OK'), -(673465284, 2694, 1523, 34562032400171349,14554994, 'OK'), -(673465282, 2692, 4645, 34562032400171323,24871187, 'OK'), -(673465283, 2693, 5253, 34562032400171331,28303238, 'OK'), -(673465841, 2696, 0849, 34562032400171257,21673222, 'OK'), -(673465258, 2679, 4140, 34562032400171174,39793881, 'OK'), -(673465263, 2680, 6922, 34562032400171182,12253261, 'OK'), -(673465265, 2681, 9112, 34562032400171190,93894366, 'OK'), -(673465267, 2682, 3259, 34562032400171208,2342189, 'OK'), -(673465268, 2683, 8540, 34562032400171216,63886925, 'OK'), -(673465285, 2695, 4167, 34562032400171356,79227618, 'OK'), -(673465270, 2684, 4292, 34562032400171224,19216349, 'OK'), -(673465272, 2685, 4007, 34562032400171232,14396903, 'OK'), -(673465273, 2686, 6894, 34562032400171240,13569394, 'OK'), -(673465274, 2687, 5268, 34562032400171265,59453667, 'OK'), -(673465275, 2688, 0232, 34562032400171273,62324713, 'OK'), -(673465276, 2689, 2720, 34562032400171281,65977200, 'OK'), -(673465843, 2698, 4773, 34562032400171364,78387158, 'OK'), -(673465842, 2697, 3729, 34562032400171315,94201789, 'OK'), -(673465280, 2691, 0503, 34562032400171307,12298533, 'OK'), -(673465279, 2690, 8239, 34562032400171299,76183877, 'OK'); \ No newline at end of file +(621188151, '2209', '1486', 3456985220092508,14213470), +(621188152, '2210', '8765', 3456985220092509,99473093), +(621188153, '2211', '3064', 3456985220092510,52967210), +(621188759, '2081', '3700', 3456985220123637,56600999), +(621188760, '2082', '3259', 345698522023638,87492404), +(621188761, '2083', '2790', 3456985220123639,94009456), +(621188762, '2084', '2480', 3456985220123644,1484999), +(621188763, '2085', '6876', 3456985220123641,36577064), +(621188766, '2086', '7775', 3456985220123642,80761698), +(621188769, '2088', '4027', 3456985220123643,37921712), +(621188771, '2089', '8797', 3456985220123640,63092540), +(621188772, '2090', '8404', 3456985220123645,21014997), +(621188773, '2091', '5481', 3456985220123646,16317277), +(621188774, '2092', '9632', 3456985220123647,22235994), +(621188775, '2093', '4654', 3456985220123648,28506486), +(621188838, '2094', '1392', 3456985220123649,29498627), +(621188839, '2095', '7774', 3456985220123650,46263490), +(621188840, '2096', '7304', 3456985220123658,8212044), +(621188841, '2097', '5569', 3456985220123652,81597658), +(621188842, '2098', '4944', 3456985220123653,24961501), +(621188843, '2099', '5142', 3456985220123654,17035634), +(621188844, '2111', '7245', 3456985220123655,90231951), +(621188846, '2110', '6590', 3456985220123656,72201537), +(667680207, '2564', '4042', 34569832200759166,48401979), +(667680315, '2565', '7143', 34569832200759372,32143252), +(667680318, '2566', '6342', 34569832200759364,39597112), +(667680413, '2567', '5580', 34569832200759356,32786992), +(667680463, '2568', '0171', 34569832200759349,34240853), +(667688217, '2569', '2500', 34569832200759331,5687589), +(633603945, '2212', '7129', 34569832200759323,51554019), +(622130186, '2213', '4826', 34569832200759307,19623551), +(633973424, '2214', '8535', 34569832200759299,94619307), +(633703828, '2215', '8628', 34569832200759281,22468012), +(622025110, '2216', '2399', 34569832200759273,34602918), +(622924867, '2217', '5665', 34569832200759265,26920216), +(722409630, '2218', '5211', 34569832200759240,93750137), +(623590529, '2219', '0493', 34569832200759208,47077088), +(633243462, '2220', '6902', 34569832200759174,6421962), +(633047286, '2221', '5592', 34569832200759182,32069439), +(744716801, '2112', '9184', 34569832200759190,57049814), +(655995021, '2131', '8896', 34569852202049093,19497356), +(685522718, '2132', '1955', 34569852202049101,28519879), +(674587213, '2994', '2006', 34569332200223743,62360135), +(674587227, '2993', '9271', 34569332200223750,81628192), +(674587229, '2993', '0900', 34569332200223768,91119071), +(674587231, '2992', '5007', 34569332200223776,45826232), +(674587234, '2991', '1378', 34569332200223784,91245744), +(674587240, '2990', '0905', 34569332200223792,13083224), +(674587245, '2989', '9059', 34569332200223800,15291807), +(674587250, '2988', '8188', 34569332200223818,83017918), +(674587254, '2987', '2962', 34569332200223826,92809271), +(674587256, '2986', '0358', 34569332200223834,81067040), +(674592713, '2570', '2537', 34569332200230672,82325850), +(697832478, '2579', '0936', 34568732200494825,49658372), +(697832176, '2571', '5944', 34568732200494742,19039461), +(697832477, '2572', '5138', 34568732200494759,25712504), +(697832178, '2573', '4597', 34568732200494767,66241760), +(697832182, '2574', '9241', 34568732200494775,07342562), +(697832196, '2575', '2995', 34568732200494783,53929026), +(697832214, '2576', '7434', 34568732200494791,49698432), +(697832230, '2577', '7004', 34568732200494809,21578612), +(697832235, '2578', '9674', 34568732200494817,93090700), +(673420375, '2599', '5430', 34562052300117259,35911412), +(673420367, '2598', '8402', 34562052300117242,924654), +(673420361, '2597', '5125', 34562052300117234,12027970), +(673420355, '2596', '5069', 34562052300117226,34978149), +(673420348, '2595', '8911', 34562052300117218,4228121), +(673420346, '2594', '2461', 34562052300117200,67670772), +(673420345, '2593', '2226', 34562052300117192,90586404), +(673420306, '2592', '3355', 34562052300117184,97850017), +(673420257, '2591', '9395', 34562052300117176,50713786), +(673420231, '2590', '1378', 34562052300117168,50151763), +(673420223, '2589', '9580', 34562052300117150,99534550), +(673420216, '2588', '4955', 34562052300117143,317554), +(673420203, '2587', '6742', 34562052300117135,69321531), +(673420201, '2586', '1659', 34562052300117127,54720480), +(673420199, '2585', '7823', 34562052300117119,22923796), +(673420198, '2584', '1787', 34562052300117101,54414630), +(673420168, '2583', '6334', 34562052300117093,50694894), +(673420147, '2582', '8951', 34562052300117085,1402535), +(673420125, '2581', '3068', 34562052300117077,86216200), +(673420124, '2580', '9517', 34562052300117069,42504099), +(600294609, '2715', '7474', 34569832304894588,55923317), +(600084713, '2703', '8342', 34569832304894570,8392636), +(600084732, '2704', '1625', 34569832304894513,75477452), +(600084850, '2705', '9896', 34569832304894653,28589813), +(600084951, '2706', '5520', 34569832304894661,75353012), +(600084978, '2707', '2698', 34569832304894679,9005523), +(600085403, '2708', '0837', 34569832304894646,77051152), +(600085513, '2709', '3106', 34569832304894687,41571002), +(600293916, '2712', '8990', 34569832304894620,95188676), +(600294160, '2714', '6376', 34569832304894703,79879896), +(671919529, '2975', '9184', 34569832304806236,7535392), +(671919942, '2981', '0328', 34569832304806269,31052894), +(671919530, '2976', '0344', 34569832304806251,89860304), +(671919533, '2977', '0668', 34569832304806244,42921771), +(671919535, '2978', '0105', 34569832304806277,31009417), +(671919537, '2979', '0881', 34569832304806285,33479769), +(671919540, '2980', '9874', 34569832304806293,14103929), +(671919525, '2972', '2089', 34569832304806301,45903729), +(671919527, '2973', '8206', 34569832304806368,1586035), +(671919528, '2974', '2532', 34569832304806327,62310124), +(673668717, '2836', '7973', 34562032301044223,15635496), +(673668734, '2837', '4457', 34562032301044231,18313118), +(673668738, '2824', '2911', 34562032301044249,30875583), +(673668745, '2838', '7253', 34562032301044256,62754222), +(673668796, '2839', '0068', 34562032301044264,15556829), +(673668803, '2840', '2386', 34562032301044272,17572287), +(673669591, '2850', '3833', 34562032301044280,34828896), +(673668808, '2841', '3584', 34562032301044298,16234497), +(673670102, '2851', '3554', 34562032301044306,23652625), +(673670131, '2852', '4412', 34562032301044314,88611709), +(673670135, '2827', '6058', 34562032301044322,53918579), +(673670201, '2828', '8066', 34562032301044330,92369343), +(673670225, '2829', '4592', 34562032301044348,24126635), +(673670236, '2830', '2974', 34562032301044355,88608465), +(673671485, '2849', '0349', 34562032301044363,44944874), +(673461977, '2871', '1728', 34562032400157090,46975780), +(673461975, '2870', '4734', 34562032400157082,69628432), +(673461972, '2867', '6276', 34562032400157058,53338365), +(673461979, '2872', '6043', 34562032400157108,36525197), +(673461958, '2859', '3164', 34562032400156977,58947831), +(673461957, '2857', '8685', 34562032400156969,15826386), +(673461944, '2853', '1073', 34562032400156910,20452195), +(673461974, '2869', '7121', 34562032400157074,32044645), +(673461973, '2868', '8022', 34562032400157066,29282044), +(673461971, '2866', '3089', 34562032400157041,66149978), +(673461969, '2865', '7555', 34562032400157033,78391293), +(673461960, '2860', '5203', 34562032400156985,37138232), +(673461952, '2855', '6915', 34562032400156936,62724661), +(673461949, '2854', '8706', 34562032400156928,5594345), +(673461966, '2863', '2496', 34562032400157017,93450666), +(673461968, '2864', '3703', 34562032400157025,23208841), +(673461963, '2862', '9364', 34562032400157009,29712130), +(673462719, '2873', '9387', 34562032400156951,50434348), +(673461962, '2861', '8441', 34562032400156993,39686909), +(673461956, '2826', '5392', 34562032400156944,5496107), +(673465284, '2694', '1523', 34562032400171349,14554994), +(673465282, '2692', '4645', 34562032400171323,24871187), +(673465283, '2693', '5253', 34562032400171331,28303238), +(673465841, '2696', '0849', 34562032400171257,21673222), +(673465258, '2679', '4140', 34562032400171174,39793881), +(673465263, '2680', '6922', 34562032400171182,12253261), +(673465265, '2681', '9112', 34562032400171190,93894366), +(673465267, '2682', '3259', 34562032400171208,2342189), +(673465268, '2683', '8540', 34562032400171216,63886925), +(673465285, '2695', '4167', 34562032400171356,79227618), +(673465270, '2684', '4292', 34562032400171224,19216349), +(673465272, '2685', '4007', 34562032400171232,14396903), +(673465273, '2686', '6894', 34562032400171240,13569394), +(673465274, '2687', '5268', 34562032400171265,59453667), +(673465275, '2688', '0232', 34562032400171273,62324713), +(673465276, '2689', '2720', 34562032400171281,65977200), +(673465843, '2698', '4773', 34562032400171364,78387158), +(673465842, '2697', '3729', 34562032400171315,94201789), +(673465280, '2691', '0503', 34562032400171307,12298533), +(673465279, '2690', '8239', 34562032400171299,76183877); \ No newline at end of file From fbd6178c06826c62e08387beb319050cdd8cac51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Andr=C3=A9s?= Date: Wed, 11 Dec 2024 13:16:39 +0100 Subject: [PATCH 09/12] fix: refs #8149 taxableBase invoiceIn --- db/routines/sage/procedures/invoiceIn_add.sql | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/db/routines/sage/procedures/invoiceIn_add.sql b/db/routines/sage/procedures/invoiceIn_add.sql index 1d411cfd0..76618ce50 100644 --- a/db/routines/sage/procedures/invoiceIn_add.sql +++ b/db/routines/sage/procedures/invoiceIn_add.sql @@ -25,7 +25,7 @@ BEGIN DECLARE vIsInformativeExportation BOOL DEFAULT FALSE; DECLARE vCursor CURSOR FOR - SELECT it.taxableBase, + SELECT SUM(it.taxableBase), CAST(SUM((( it.taxableBase / 100) * t.PorcentajeIva)) AS DECIMAL (10,2)), t.PorcentajeIva, it.transactionTypeSageFk, @@ -204,17 +204,17 @@ BEGIN FROM vn.invoiceInCorrection WHERE correctingFk = vInvoiceInFk; - IF vInvoiceInOriginalFk THEN + IF vInvoiceInOriginalFk THEN UPDATE movContaIVA mci JOIN vn.invoiceInRefund iir ON iir.invoiceInRefundFk = vInvoiceInFk JOIN (SELECT issued, - SUM(sub.taxableBase) taxableBase, + SUM(sub.taxableBase) taxableBase, SUM(ROUND((sub.taxableBase * sub.PorcentajeIva) / 100 , 2)) vat FROM(SELECT issued, - SUM(iit.taxableBase) taxableBase, + SUM(iit.taxableBase) taxableBase, ti.PorcentajeIva - FROM vn.invoiceIn i + FROM vn.invoiceIn i JOIN vn.invoiceInTax iit ON iit.invoiceInFk = i.id JOIN sage.TiposIva ti ON ti.CodigoIva = iit.taxTypeSageFk WHERE i.id = vInvoiceInOriginalFk @@ -222,7 +222,7 @@ BEGIN )invoiceInOriginal JOIN ClavesOperacion co ON co.Descripcion = 'Factura rectificativa' SET mci.TipoRectificativa = iir.refundCategoryFk, - mci.ClaseAbonoRectificativas = iir.refundType, + mci.ClaseAbonoRectificativas = iir.refundType, mci.FechaFacturaOriginal = invoiceInOriginal.issued, mci.FechaOperacion = invoiceInOriginal.issued, mci.BaseImponibleOriginal = invoiceInOriginal.taxableBase, @@ -232,4 +232,4 @@ BEGIN END IF; END$$ -DELIMITER ; \ No newline at end of file +DELIMITER ; From 3e92aca6ff0ad18c521e7b7fa31d9754fe15e51c Mon Sep 17 00:00:00 2001 From: robert Date: Wed, 11 Dec 2024 14:32:08 +0100 Subject: [PATCH 10/12] feat: refs #249272 message updateQuantity --- modules/ticket/back/methods/sale/updateQuantity.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ticket/back/methods/sale/updateQuantity.js b/modules/ticket/back/methods/sale/updateQuantity.js index 36d75ffed..4de1bcbd6 100644 --- a/modules/ticket/back/methods/sale/updateQuantity.js +++ b/modules/ticket/back/methods/sale/updateQuantity.js @@ -82,7 +82,7 @@ module.exports = Self => { const message = $t('Changed sale quantity', { ticketId: sale.ticket().id, - changes: change, + changes: JSON.stringify(change), ticketUrl: `${url}ticket/${sale.ticket().id}/sale`, }); From 452ec3d7319491df73c9416ea671341a80f2a695 Mon Sep 17 00:00:00 2001 From: guillermo Date: Fri, 13 Dec 2024 08:29:14 +0100 Subject: [PATCH 11/12] fix: refs #247552 ticket 247552 claimRatio_add --- db/routines/vn/procedures/claimRatio_add.sql | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/db/routines/vn/procedures/claimRatio_add.sql b/db/routines/vn/procedures/claimRatio_add.sql index 8c3213644..5e2e66a8e 100644 --- a/db/routines/vn/procedures/claimRatio_add.sql +++ b/db/routines/vn/procedures/claimRatio_add.sql @@ -46,7 +46,7 @@ BEGIN JOIN claimDestination cd ON cd.id = ce.claimDestinationFk JOIN claim c ON c.id = ce.claimFk JOIN claimState cs ON cs.id = c.claimStateFk - WHERE cd.description NOT IN ('Bueno', 'Corregido') + WHERE cd.code NOT IN ('good', 'corrected', 'supplierClaim') AND NOT ce.isGreuge AND cs.code = 'resolved'; @@ -71,7 +71,7 @@ BEGIN JOIN claimDestination cd ON cd.id = ce.claimDestinationFk JOIN claim c ON c.id = ce.claimFk JOIN claimState cs ON cs.id = c.claimStateFk - WHERE cd.description NOT IN ('Bueno', 'Corregido') + WHERE cd.code NOT IN ('good', 'corrected', 'supplierClaim') AND NOT ce.isGreuge AND cs.code = 'resolved' AND c.isChargedToMana; @@ -82,7 +82,7 @@ BEGIN JOIN claim c ON c.id = ce.claimFk JOIN claimState cs ON cs.id = c.claimStateFk SET ce.isGreuge = TRUE - WHERE cd.description NOT IN ('Bueno', 'Corregido') + WHERE cd.code NOT IN ('good', 'corrected', 'supplierClaim') AND NOT ce.isGreuge AND cs.code = 'resolved'; @@ -161,7 +161,7 @@ BEGIN JOIN claimDestination cd ON cd.id = ce.claimDestinationFk JOIN claim c ON c.id = ce.claimFk JOIN claimState cs ON cs.id = c.claimStateFk - WHERE cd.description NOT IN ('Bueno', 'Corregido') + WHERE cd.code NOT IN ('good', 'corrected', 'supplierClaim') AND cs.code = 'resolved' AND c.ticketCreated >= util.VN_CURDATE() - INTERVAL 1 YEAR GROUP BY c.clientFk From ec2b6dd0c2fbf3605cd594e7a00375ff43cdf5ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Andr=C3=A9s?= Date: Fri, 13 Dec 2024 14:55:03 +0000 Subject: [PATCH 12/12] Actualizar db/versions/11327-maroonOak/00-firstScript.sql --- db/versions/11327-maroonOak/00-firstScript.sql | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/db/versions/11327-maroonOak/00-firstScript.sql b/db/versions/11327-maroonOak/00-firstScript.sql index 250a2fc8b..35ec989e7 100644 --- a/db/versions/11327-maroonOak/00-firstScript.sql +++ b/db/versions/11327-maroonOak/00-firstScript.sql @@ -13,9 +13,6 @@ CREATE TABLE IF NOT EXISTS `vn`.`simSupplier` ( ALTER TABLE `vn`.`deviceProductionUser` MODIFY `simSerialNumber` VARCHAR(25); -ALTER TABLE vn.deviceProductionUser ADD CONSTRAINT deviceProductionUser_simSupplier_FK - FOREIGN KEY (simSerialNumber) REFERENCES vn.simSupplier(sim); - INSERT IGNORE INTO `vn`.`simSupplier` (`line`, `ext`, `pin`, `sim`, `puk`) VALUES (621188151, '2209', '1486', 3456985220092508,14213470), @@ -174,4 +171,7 @@ VALUES (673465843, '2698', '4773', 34562032400171364,78387158), (673465842, '2697', '3729', 34562032400171315,94201789), (673465280, '2691', '0503', 34562032400171307,12298533), -(673465279, '2690', '8239', 34562032400171299,76183877); \ No newline at end of file +(673465279, '2690', '8239', 34562032400171299,76183877); + +ALTER TABLE vn.deviceProductionUser ADD CONSTRAINT deviceProductionUser_simSupplier_FK + FOREIGN KEY (simSerialNumber) REFERENCES vn.simSupplier(sim) ON DELETE CASCADE ON UPDATE CASCADE; \ No newline at end of file