From 35f4f161ab6cd4ef8f6cc6b179bae88012d4220c Mon Sep 17 00:00:00 2001 From: Pako Date: Mon, 11 Nov 2024 09:02:04 +0100 Subject: [PATCH 1/3] fix(collection_new): remove agency condition for suitable tickets Refs: #0000 --- db/routines/vn/procedures/collection_new.sql | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/db/routines/vn/procedures/collection_new.sql b/db/routines/vn/procedures/collection_new.sql index f04d5241e..36e837869 100644 --- a/db/routines/vn/procedures/collection_new.sql +++ b/db/routines/vn/procedures/collection_new.sql @@ -173,8 +173,6 @@ BEGIN DELETE pb.* FROM tmp.productionBuffer pb JOIN state s ON s.id = pb.state - JOIN agencyMode am ON am.id = pb.agencyModeFk - JOIN agency a ON a.id = am.agencyFk LEFT JOIN ( SELECT pb.ticketFk, MAX(i.`size`) maxSize FROM tmp.productionBuffer pb @@ -185,7 +183,7 @@ BEGIN ) sub ON sub.ticketFk = pb.ticketFk JOIN productionConfig pc WHERE pb.shipped <> util.VN_CURDATE() - OR (pb.ubicacion IS NULL AND a.isOwn) + OR pb.ubicacion IS NULL OR (NOT s.isPreparable AND NOT s.isPrintable) OR pb.collectionH IS NOT NULL OR pb.collectionV IS NOT NULL From f7a29cd9c79bfe605e9c938da41ad5780c4a40b6 Mon Sep 17 00:00:00 2001 From: alexm Date: Mon, 11 Nov 2024 10:32:17 +0100 Subject: [PATCH 2/3] feat(Supplier): refs #6828 add companySize --- db/dump/fixtures.before.sql | 3 ++- db/versions/11331-bronzeBirch/00-firstScript.sql | 2 ++ modules/supplier/back/methods/supplier/getSummary.js | 3 ++- modules/supplier/back/models/supplier.json | 3 +++ 4 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 db/versions/11331-bronzeBirch/00-firstScript.sql diff --git a/db/dump/fixtures.before.sql b/db/dump/fixtures.before.sql index f25a4aab4..c9b6a2206 100644 --- a/db/dump/fixtures.before.sql +++ b/db/dump/fixtures.before.sql @@ -2476,7 +2476,8 @@ INSERT INTO `vn`.`dmsType` (20, 'ReclamaciĆ³n', 1, 1, 'claim'), (21, 'Entrada', 1, 1, 'entry'), (22, 'Proveedor', 1, 1, 'supplier'), - (23, 'Termografos', 35, 35, 'thermograph'); + (23, 'Termografos', 35, 35, 'thermograph'), + (24, 'Sello de calidad', 1, 1, 'qualitySeal'); INSERT INTO `vn`.`dms`(`id`, `dmsTypeFk`, `file`, `contentType`, `workerFk`, `warehouseFk`, `companyFk`, `hardCopyNumber`, `hasFile`, `reference`, `description`, `created`) VALUES diff --git a/db/versions/11331-bronzeBirch/00-firstScript.sql b/db/versions/11331-bronzeBirch/00-firstScript.sql new file mode 100644 index 000000000..ada374182 --- /dev/null +++ b/db/versions/11331-bronzeBirch/00-firstScript.sql @@ -0,0 +1,2 @@ +ALTER TABLE vn.supplier ADD companySize ENUM('small', 'medium', 'big') NULL; + diff --git a/modules/supplier/back/methods/supplier/getSummary.js b/modules/supplier/back/methods/supplier/getSummary.js index 67767e7b4..8fcaaa53f 100644 --- a/modules/supplier/back/methods/supplier/getSummary.js +++ b/modules/supplier/back/methods/supplier/getSummary.js @@ -43,7 +43,8 @@ module.exports = Self => { 'sageWithholdingFk', 'workerFk', 'supplierActivityFk', - 'healthRegister' + 'healthRegister', + 'companySize' ], include: [ { diff --git a/modules/supplier/back/models/supplier.json b/modules/supplier/back/models/supplier.json index 90b266ba9..b79a6b80d 100644 --- a/modules/supplier/back/models/supplier.json +++ b/modules/supplier/back/models/supplier.json @@ -113,6 +113,9 @@ }, "isVies": { "type": "boolean" + }, + "companySize": { + "type": "string" } }, "relations": { From eaad989b3afaec94f31815516ad3dcfe8d4488e7 Mon Sep 17 00:00:00 2001 From: jgallego Date: Mon, 11 Nov 2024 13:57:49 +0100 Subject: [PATCH 3/3] fix: clean deletes also zoneEvent range records --- db/routines/vn/procedures/clean.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/routines/vn/procedures/clean.sql b/db/routines/vn/procedures/clean.sql index d3fed0242..fcee33c97 100644 --- a/db/routines/vn/procedures/clean.sql +++ b/db/routines/vn/procedures/clean.sql @@ -56,7 +56,7 @@ BEGIN AND ts.id IS NULL; DELETE FROM claim WHERE ticketCreated < v4Years; -- Robert ubicacion anterior de travelLog comentario para debug - DELETE FROM zoneEvent WHERE `type` = 'day' AND dated < v3Months; + DELETE FROM zoneEvent WHERE dated < v2Months OR ended < v2Months; DELETE b FROM buy b JOIN entryConfig e ON e.defaultEntry = b.entryFk WHERE b.created < v2Months;