From 56e6a7e6aa794b2ce7c6ddf58b789622abee4ded Mon Sep 17 00:00:00 2001 From: jgallego Date: Wed, 11 Sep 2024 08:10:21 +0200 Subject: [PATCH 01/24] feat: refs #7956 parametro daysInForward --- db/routines/vn/procedures/item_getSimilar.sql | 186 ++++++++++-------- 1 file changed, 102 insertions(+), 84 deletions(-) diff --git a/db/routines/vn/procedures/item_getSimilar.sql b/db/routines/vn/procedures/item_getSimilar.sql index 823625b97..5c1cfe0e3 100644 --- a/db/routines/vn/procedures/item_getSimilar.sql +++ b/db/routines/vn/procedures/item_getSimilar.sql @@ -1,99 +1,117 @@ DELIMITER $$ -CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`item_getSimilar`( - vSelf INT, - vWarehouseFk INT, - vDated DATE, - vShowType BOOL +CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`item_getSimilar`( + vSelf INT, + vWarehouseFk INT, + vDated DATE, + vShowType BOOL, + vDaysInForward INT ) BEGIN /** -* Propone articulos disponibles ordenados, con la cantidad +* Propone articulos ordenados, con la cantidad * de veces usado y segun sus caracteristicas. * * @param vSelf Id de artículo * @param vWarehouseFk Id de almacen * @param vDated Fecha * @param vShowType Mostrar tipos +* @param vDaysInForward Días de alcance para las ventas */ - DECLARE vAvailableCalcFk INT; - DECLARE vVisibleCalcFk INT; - DECLARE vTypeFk INT; - DECLARE vPriority INT DEFAULT 1; + DECLARE vAvailableCalcFk INT; + DECLARE vPriority INT DEFAULT 1; - CALL cache.available_refresh(vAvailableCalcFk, FALSE, vWarehouseFk, vDated); - CALL cache.visible_refresh(vVisibleCalcFk, FALSE, vWarehouseFk); + 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 - 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 - ) - SELECT i.id itemFk, - i.longName, - i.subName, - i.tag5, - i.value5, - (i.value5 <=> its.value5) match5, - i.tag6, - i.value6, - (i.value6 <=> its.value6) match6, - i.tag7, - i.value7, - (i.value7 <=> its.value7) match7, - i.tag8, - i.value8, - (i.value8 <=> its.value8) match8, - a.available, - IFNULL(ip.counter, 0) `counter`, - CASE - WHEN b.groupingMode = 'grouping' THEN b.grouping - WHEN b.groupingMode = 'packing' THEN b.packing - ELSE 1 - END minQuantity, - v.visible located, - b.price2 - FROM vn.item i - JOIN cache.available a ON a.item_id = i.id - AND a.calc_id = vAvailableCalcFk - LEFT JOIN cache.visible v ON v.item_id = i.id - AND v.calc_id = vVisibleCalcFk - LEFT JOIN cache.last_buy lb ON lb.item_id = i.id - AND lb.warehouse_id = vWarehouseFk - LEFT JOIN vn.itemProposal ip ON ip.mateFk = i.id - AND ip.itemFk = vSelf - LEFT JOIN vn.itemTag it ON it.itemFk = i.id - AND it.priority = vPriority - LEFT JOIN vn.tag t ON t.id = it.tagFk - LEFT JOIN vn.buy b ON b.id = lb.buy_id - JOIN itemTags its - WHERE a.available > 0 - AND (i.typeFk = its.typeFk OR NOT vShowType) - AND i.id <> vSelf - ORDER BY `counter` DESC, - (t.name = its.name) DESC, - (it.value = its.value) DESC, - (i.tag5 = its.tag5) DESC, - match5 DESC, - (i.tag6 = its.tag6) DESC, - match6 DESC, - (i.tag7 = its.tag7) DESC, - match7 DESC, - (i.tag8 = its.tag8) DESC, - match8 DESC - LIMIT 100; + 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 + FROM vn.itemShelvingStock + WHERE warehouseFk = vWarehouseFk + GROUP BY itemFk + ), + sold AS ( + SELECT SUM(s.quantity) AS 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 + AND iss.saleFk IS NULL + AND t.warehouseFk = vWarehouseFk + GROUP BY s.itemFk + ) + SELECT i.id itemFk, + CAST(sd.quantity AS INT) advanceable, + i.longName, + i.subName, + i.tag5, + i.value5, + (i.value5 <=> its.value5) match5, + i.tag6, + i.value6, + (i.value6 <=> its.value6) match6, + i.tag7, + i.value7, + (i.value7 <=> its.value7) match7, + i.tag8, + i.value8, + (i.value8 <=> its.value8) match8, + a.available, + IFNULL(ip.counter, 0) `counter`, + CASE + WHEN b.groupingMode = 'grouping' THEN b.grouping + WHEN b.groupingMode = 'packing' THEN b.packing + ELSE 1 + END minQuantity, + sk.stock located, + b.price2 + FROM vn.item i + LEFT JOIN sold sd ON sd.itemFk = i.id + JOIN cache.available a ON a.item_id = i.id + AND a.calc_id = vAvailableCalcFk + LEFT JOIN stock sk ON sk.itemFk = i.id + LEFT JOIN cache.last_buy lb ON lb.item_id = i.id + AND lb.warehouse_id = vWarehouseFk + LEFT JOIN vn.itemProposal ip ON ip.mateFk = i.id + AND ip.itemFk = vSelf + LEFT JOIN vn.itemTag it ON it.itemFk = i.id + AND it.priority = vPriority + LEFT JOIN vn.tag t ON t.id = it.tagFk + LEFT JOIN vn.buy b ON b.id = lb.buy_id + JOIN itemTags its + WHERE (a.available > 0 OR sd.quantity < sk.stock) + AND (i.typeFk = its.typeFk OR NOT vShowType) + AND i.id <> vSelf + ORDER BY (a.available > 0) DESC, + `counter` DESC, + (t.name = its.name) DESC, + (it.value = its.value) DESC, + (i.tag5 = its.tag5) DESC, + match5 DESC, + (i.tag6 = its.tag6) DESC, + match6 DESC, + (i.tag7 = its.tag7) DESC, + match7 DESC, + (i.tag8 = its.tag8) DESC, + match8 DESC + LIMIT 100; END$$ DELIMITER ; From 6ae15a8e649fbcfbec4c04b98e10dabc0db6847f Mon Sep 17 00:00:00 2001 From: jgallego Date: Wed, 11 Sep 2024 08:13:28 +0200 Subject: [PATCH 02/24] feat: refs #7956 definer --- db/routines/vn/procedures/item_getSimilar.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/routines/vn/procedures/item_getSimilar.sql b/db/routines/vn/procedures/item_getSimilar.sql index 5c1cfe0e3..bc7c6fa87 100644 --- a/db/routines/vn/procedures/item_getSimilar.sql +++ b/db/routines/vn/procedures/item_getSimilar.sql @@ -1,5 +1,5 @@ DELIMITER $$ -CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`item_getSimilar`( +CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`item_getSimilar`( vSelf INT, vWarehouseFk INT, vDated DATE, From ed8cf628a5ee758af4e4d70bcc193eb8805f462e Mon Sep 17 00:00:00 2001 From: jgallego Date: Wed, 11 Sep 2024 08:15:32 +0200 Subject: [PATCH 03/24] feat: refs #7956 tabulaciones --- db/routines/vn/procedures/item_getSimilar.sql | 141 +++++++++--------- 1 file changed, 70 insertions(+), 71 deletions(-) diff --git a/db/routines/vn/procedures/item_getSimilar.sql b/db/routines/vn/procedures/item_getSimilar.sql index bc7c6fa87..77a21eb83 100644 --- a/db/routines/vn/procedures/item_getSimilar.sql +++ b/db/routines/vn/procedures/item_getSimilar.sql @@ -35,83 +35,82 @@ BEGIN 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 + 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 - FROM vn.itemShelvingStock - WHERE warehouseFk = vWarehouseFk - GROUP BY itemFk + FROM vn.itemShelvingStock + WHERE warehouseFk = vWarehouseFk + GROUP BY itemFk ), sold AS ( - SELECT SUM(s.quantity) AS 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 - AND iss.saleFk IS NULL - AND t.warehouseFk = vWarehouseFk - GROUP BY s.itemFk + SELECT SUM(s.quantity) AS 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 + AND iss.saleFk IS NULL + AND t.warehouseFk = vWarehouseFk + GROUP BY s.itemFk ) SELECT i.id itemFk, - CAST(sd.quantity AS INT) advanceable, - i.longName, - i.subName, - i.tag5, - i.value5, - (i.value5 <=> its.value5) match5, - i.tag6, - i.value6, - (i.value6 <=> its.value6) match6, - i.tag7, - i.value7, - (i.value7 <=> its.value7) match7, - i.tag8, - i.value8, - (i.value8 <=> its.value8) match8, - a.available, - IFNULL(ip.counter, 0) `counter`, - CASE - WHEN b.groupingMode = 'grouping' THEN b.grouping - WHEN b.groupingMode = 'packing' THEN b.packing - ELSE 1 - END minQuantity, - sk.stock located, - b.price2 - FROM vn.item i - LEFT JOIN sold sd ON sd.itemFk = i.id - JOIN cache.available a ON a.item_id = i.id - AND a.calc_id = vAvailableCalcFk - LEFT JOIN stock sk ON sk.itemFk = i.id - LEFT JOIN cache.last_buy lb ON lb.item_id = i.id - AND lb.warehouse_id = vWarehouseFk - LEFT JOIN vn.itemProposal ip ON ip.mateFk = i.id - AND ip.itemFk = vSelf - LEFT JOIN vn.itemTag it ON it.itemFk = i.id - AND it.priority = vPriority - LEFT JOIN vn.tag t ON t.id = it.tagFk - LEFT JOIN vn.buy b ON b.id = lb.buy_id - JOIN itemTags its - WHERE (a.available > 0 OR sd.quantity < sk.stock) - AND (i.typeFk = its.typeFk OR NOT vShowType) - AND i.id <> vSelf - ORDER BY (a.available > 0) DESC, - `counter` DESC, - (t.name = its.name) DESC, - (it.value = its.value) DESC, - (i.tag5 = its.tag5) DESC, - match5 DESC, - (i.tag6 = its.tag6) DESC, - match6 DESC, - (i.tag7 = its.tag7) DESC, - match7 DESC, - (i.tag8 = its.tag8) DESC, - match8 DESC - LIMIT 100; + CAST(sd.quantity AS INT) advanceable, + i.longName, + i.subName, + i.tag5, + i.value5, + (i.value5 <=> its.value5) match5, + i.tag6, + i.value6, + (i.value6 <=> its.value6) match6, + i.tag7, + i.value7, + (i.value7 <=> its.value7) match7, + i.tag8, + i.value8, + (i.value8 <=> its.value8) match8, + a.available, + IFNULL(ip.counter, 0) `counter`, + CASE + WHEN b.groupingMode = 'grouping' THEN b.grouping + WHEN b.groupingMode = 'packing' THEN b.packing + ELSE 1 + END minQuantity, + sk.stock located, + b.price2 + FROM vn.item i + LEFT JOIN sold sd ON sd.itemFk = i.id + JOIN cache.available a ON a.item_id = i.id + AND a.calc_id = vAvailableCalcFk + LEFT JOIN stock sk ON sk.itemFk = i.id + LEFT JOIN cache.last_buy lb ON lb.item_id = i.id + AND lb.warehouse_id = vWarehouseFk + LEFT JOIN vn.itemProposal ip ON ip.mateFk = i.id + AND ip.itemFk = vSelf + LEFT JOIN vn.itemTag it ON it.itemFk = i.id + AND it.priority = vPriority + LEFT JOIN vn.tag t ON t.id = it.tagFk + LEFT JOIN vn.buy b ON b.id = lb.buy_id + JOIN itemTags its + WHERE (a.available > 0 OR sd.quantity < sk.stock) + AND (i.typeFk = its.typeFk OR NOT vShowType) + AND i.id <> vSelf + ORDER BY (a.available > 0) DESC, + `counter` DESC, + (t.name = its.name) DESC, + (it.value = its.value) DESC, + (i.tag5 = its.tag5) DESC, + match5 DESC, + (i.tag6 = its.tag6) DESC, + match6 DESC, + (i.tag7 = its.tag7) DESC, + match7 DESC, + (i.tag8 = its.tag8) DESC, + match8 DESC + LIMIT 100; END$$ DELIMITER ; From 10f75835871dd02b999baa1fa4b1265fa66a2a94 Mon Sep 17 00:00:00 2001 From: jgallego Date: Wed, 11 Sep 2024 11:22:22 +0200 Subject: [PATCH 04/24] feat: refs #7956 sin AS --- db/routines/vn/procedures/item_getSimilar.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/routines/vn/procedures/item_getSimilar.sql b/db/routines/vn/procedures/item_getSimilar.sql index 77a21eb83..b524e30a7 100644 --- a/db/routines/vn/procedures/item_getSimilar.sql +++ b/db/routines/vn/procedures/item_getSimilar.sql @@ -48,7 +48,7 @@ BEGIN GROUP BY itemFk ), sold AS ( - SELECT SUM(s.quantity) AS quantity, s.itemFk + 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 From f1f10d1367b79c62709ca7ee1ec3d9d521f7f6e2 Mon Sep 17 00:00:00 2001 From: jorgep Date: Thu, 12 Sep 2024 09:15:07 +0200 Subject: [PATCH 05/24] refactor: refs #7828 wip --- .../11227-maroonEucalyptus/00-firstScript.sql | 3 ++ .../worker-time-control-mail/getWeeklyMail.js | 34 +++++++++++++++++++ .../back/models/worker-time-control-mail.js | 1 + .../back/models/worker-time-control-mail.json | 18 +++++----- 4 files changed, 47 insertions(+), 9 deletions(-) create mode 100644 db/versions/11227-maroonEucalyptus/00-firstScript.sql create mode 100644 modules/worker/back/methods/worker-time-control-mail/getWeeklyMail.js diff --git a/db/versions/11227-maroonEucalyptus/00-firstScript.sql b/db/versions/11227-maroonEucalyptus/00-firstScript.sql new file mode 100644 index 000000000..bd4a0b681 --- /dev/null +++ b/db/versions/11227-maroonEucalyptus/00-firstScript.sql @@ -0,0 +1,3 @@ +-- Place your SQL code here +INSERT INTO salix.ACL (model, property, accessType, permission, principalType, principalId) + VALUES ('WorkerTimeControlMail', 'getWeeklyMail', 'READ', 'ALLOW', 'ROLE', '$owner'); diff --git a/modules/worker/back/methods/worker-time-control-mail/getWeeklyMail.js b/modules/worker/back/methods/worker-time-control-mail/getWeeklyMail.js new file mode 100644 index 000000000..e2253889f --- /dev/null +++ b/modules/worker/back/methods/worker-time-control-mail/getWeeklyMail.js @@ -0,0 +1,34 @@ +module.exports = Self => { + Self.remoteMethod('getWeeklyMail', { + description: 'Check an email inbox and process it', + accessType: 'READ', + accepts: [{ + arg: 'id', + type: 'number', + description: 'workerFk', + required: true, + http: {source: 'path'} + }, { + arg: 'week', + type: 'number', + required: true + }, { + arg: 'year', + type: 'number', + required: true + }], + returns: + { + type: 'Object', + root: true + }, + http: { + path: `/:id/getWeeklyMail`, + verb: 'GET' + } + }); + + Self.getWeeklyMail = async(workerFk, week, year) => { + return Self.findOne({where: {workerFk, week, year}}); + }; +}; diff --git a/modules/worker/back/models/worker-time-control-mail.js b/modules/worker/back/models/worker-time-control-mail.js index 36f3851b6..e0d385fd0 100644 --- a/modules/worker/back/models/worker-time-control-mail.js +++ b/modules/worker/back/models/worker-time-control-mail.js @@ -1,3 +1,4 @@ module.exports = Self => { require('../methods/worker-time-control-mail/checkInbox')(Self); + require('../methods/worker-time-control-mail/getWeeklyMail')(Self); }; diff --git a/modules/worker/back/models/worker-time-control-mail.json b/modules/worker/back/models/worker-time-control-mail.json index 87eae9217..285c0a7e5 100644 --- a/modules/worker/back/models/worker-time-control-mail.json +++ b/modules/worker/back/models/worker-time-control-mail.json @@ -33,12 +33,12 @@ "type": "number" } }, - "acls": [ - { - "accessType": "READ", - "principalType": "ROLE", - "principalId": "employee", - "permission": "ALLOW" - } - ] -} + "relations": { + "user": { + "type": "belongsTo", + "model": "VnUser", + "foreignKey": "workerFk" + } + }, + "acls": [] +} \ No newline at end of file From 74fafdf330af4ef25e5db58008a528841160f251 Mon Sep 17 00:00:00 2001 From: jorgep Date: Thu, 12 Sep 2024 10:27:18 +0200 Subject: [PATCH 06/24] fix: refs #7828 filter mail access --- .../00-addWorkerTimeControlMailAcl.sql | 4 + .../11227-maroonEucalyptus/00-firstScript.sql | 3 - .../worker-time-control-mail/getWeeklyMail.js | 34 --------- .../back/models/worker-time-control-mail.js | 1 - .../back/models/worker-time-control-mail.json | 10 +-- modules/worker/back/models/worker.json | 73 ++++--------------- 6 files changed, 18 insertions(+), 107 deletions(-) create mode 100644 db/versions/11227-maroonEucalyptus/00-addWorkerTimeControlMailAcl.sql delete mode 100644 db/versions/11227-maroonEucalyptus/00-firstScript.sql delete mode 100644 modules/worker/back/methods/worker-time-control-mail/getWeeklyMail.js diff --git a/db/versions/11227-maroonEucalyptus/00-addWorkerTimeControlMailAcl.sql b/db/versions/11227-maroonEucalyptus/00-addWorkerTimeControlMailAcl.sql new file mode 100644 index 000000000..330dcb839 --- /dev/null +++ b/db/versions/11227-maroonEucalyptus/00-addWorkerTimeControlMailAcl.sql @@ -0,0 +1,4 @@ +-- Place your SQL code here +INSERT INTO salix.ACL (model, property, accessType, permission, principalType, principalId) + VALUES ('WorkerTimeControlMail', 'count', 'READ', 'ALLOW', 'ROLE', 'employee'), + ('Worker', '__get__mail', 'READ', 'ALLOW', 'ROLE', 'hr'); diff --git a/db/versions/11227-maroonEucalyptus/00-firstScript.sql b/db/versions/11227-maroonEucalyptus/00-firstScript.sql deleted file mode 100644 index bd4a0b681..000000000 --- a/db/versions/11227-maroonEucalyptus/00-firstScript.sql +++ /dev/null @@ -1,3 +0,0 @@ --- Place your SQL code here -INSERT INTO salix.ACL (model, property, accessType, permission, principalType, principalId) - VALUES ('WorkerTimeControlMail', 'getWeeklyMail', 'READ', 'ALLOW', 'ROLE', '$owner'); diff --git a/modules/worker/back/methods/worker-time-control-mail/getWeeklyMail.js b/modules/worker/back/methods/worker-time-control-mail/getWeeklyMail.js deleted file mode 100644 index e2253889f..000000000 --- a/modules/worker/back/methods/worker-time-control-mail/getWeeklyMail.js +++ /dev/null @@ -1,34 +0,0 @@ -module.exports = Self => { - Self.remoteMethod('getWeeklyMail', { - description: 'Check an email inbox and process it', - accessType: 'READ', - accepts: [{ - arg: 'id', - type: 'number', - description: 'workerFk', - required: true, - http: {source: 'path'} - }, { - arg: 'week', - type: 'number', - required: true - }, { - arg: 'year', - type: 'number', - required: true - }], - returns: - { - type: 'Object', - root: true - }, - http: { - path: `/:id/getWeeklyMail`, - verb: 'GET' - } - }); - - Self.getWeeklyMail = async(workerFk, week, year) => { - return Self.findOne({where: {workerFk, week, year}}); - }; -}; diff --git a/modules/worker/back/models/worker-time-control-mail.js b/modules/worker/back/models/worker-time-control-mail.js index e0d385fd0..36f3851b6 100644 --- a/modules/worker/back/models/worker-time-control-mail.js +++ b/modules/worker/back/models/worker-time-control-mail.js @@ -1,4 +1,3 @@ module.exports = Self => { require('../methods/worker-time-control-mail/checkInbox')(Self); - require('../methods/worker-time-control-mail/getWeeklyMail')(Self); }; diff --git a/modules/worker/back/models/worker-time-control-mail.json b/modules/worker/back/models/worker-time-control-mail.json index 285c0a7e5..192178c2d 100644 --- a/modules/worker/back/models/worker-time-control-mail.json +++ b/modules/worker/back/models/worker-time-control-mail.json @@ -32,13 +32,5 @@ "sendedCounter": { "type": "number" } - }, - "relations": { - "user": { - "type": "belongsTo", - "model": "VnUser", - "foreignKey": "workerFk" - } - }, - "acls": [] + } } \ No newline at end of file diff --git a/modules/worker/back/models/worker.json b/modules/worker/back/models/worker.json index 82cd1cc2d..502c192c6 100644 --- a/modules/worker/back/models/worker.json +++ b/modules/worker/back/models/worker.json @@ -116,11 +116,6 @@ "model": "Locker", "foreignKey": "workerFk" }, - "medicalReview": { - "type": "hasMany", - "model": "MedicalReview", - "foreignKey": "workerFk" - }, "incomes": { "type": "hasMany", "model": "WorkerIncome", @@ -130,6 +125,11 @@ "type": "hasMany", "model": "TrainingCourse", "foreignKey": "workerFk" + }, + "mail": { + "type": "hasMany", + "model": "WorkerTimeControlMail", + "foreignKey": "workerFk" } }, "acls": [ @@ -139,60 +139,13 @@ "permission": "ALLOW", "principalType": "ROLE", "principalId": "$owner" + }, + { + "property": "__get__mail", + "accessType": "READ", + "permission": "ALLOW", + "principalType": "ROLE", + "principalId": "$owner" } - ], - "scopes": { - "descriptor": { - "fields": [ - "id", - "phone" - ], - "include": [ - { - "relation": "user", - "scope": { - "fields": [ - "name", - "nickname" - ], - "include": { - "relation": "emailUser", - "scope": { - "fields": [ - "email" - ] - } - } - } - }, - { - "relation": "department", - "scope": { - "fields": [ - "departmentFk" - ], - "include": [ - { - "relation": "department", - "scope": { - "fields": [ - "id", - "name" - ] - } - } - ] - } - }, - { - "relation": "sip", - "scope": { - "fields": [ - "extension" - ] - } - } - ] - } - } + ] } \ No newline at end of file From b2bc095caa10a288896e60b4838c51a54723ce14 Mon Sep 17 00:00:00 2001 From: jorgep Date: Thu, 12 Sep 2024 10:28:29 +0200 Subject: [PATCH 07/24] fix: refs #7828 rollback --- modules/worker/back/models/worker.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/worker/back/models/worker.json b/modules/worker/back/models/worker.json index 502c192c6..67eb5cab8 100644 --- a/modules/worker/back/models/worker.json +++ b/modules/worker/back/models/worker.json @@ -116,6 +116,11 @@ "model": "Locker", "foreignKey": "workerFk" }, + "medicalReview": { + "type": "hasMany", + "model": "MedicalReview", + "foreignKey": "workerFk" + }, "incomes": { "type": "hasMany", "model": "WorkerIncome", From edccd95fa1121ee9ffd264d3599e3514040e264d Mon Sep 17 00:00:00 2001 From: jorgep Date: Thu, 12 Sep 2024 10:29:03 +0200 Subject: [PATCH 08/24] fix: refs #7828 rollback --- modules/worker/back/models/worker.json | 56 +++++++++++++++++++++++++- 1 file changed, 55 insertions(+), 1 deletion(-) diff --git a/modules/worker/back/models/worker.json b/modules/worker/back/models/worker.json index 67eb5cab8..21c5bd10f 100644 --- a/modules/worker/back/models/worker.json +++ b/modules/worker/back/models/worker.json @@ -152,5 +152,59 @@ "principalType": "ROLE", "principalId": "$owner" } - ] + ], + "scopes": { + "descriptor": { + "fields": [ + "id", + "phone" + ], + "include": [ + { + "relation": "user", + "scope": { + "fields": [ + "name", + "nickname" + ], + "include": { + "relation": "emailUser", + "scope": { + "fields": [ + "email" + ] + } + } + } + }, + { + "relation": "department", + "scope": { + "fields": [ + "departmentFk" + ], + "include": [ + { + "relation": "department", + "scope": { + "fields": [ + "id", + "name" + ] + } + } + ] + } + }, + { + "relation": "sip", + "scope": { + "fields": [ + "extension" + ] + } + } + ] + } + } } \ No newline at end of file From f1f0f5920cdd39318e8ca13d93a81729b1401c8c Mon Sep 17 00:00:00 2001 From: Jon Date: Fri, 13 Sep 2024 11:29:05 +0200 Subject: [PATCH 09/24] fix: refs #6346 fixed SQL --- db/versions/11088-bronzeAspidistra/00-firstScript.sql | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/db/versions/11088-bronzeAspidistra/00-firstScript.sql b/db/versions/11088-bronzeAspidistra/00-firstScript.sql index 751bbf7e3..5c56993fd 100644 --- a/db/versions/11088-bronzeAspidistra/00-firstScript.sql +++ b/db/versions/11088-bronzeAspidistra/00-firstScript.sql @@ -1,10 +1,10 @@ ALTER TABLE vn.collectionWagonTicket DROP FOREIGN KEY IF EXISTS collectionWagonTicket_tray; ALTER TABLE vn.wagonConfig DROP FOREIGN KEY IF EXISTS wagonConfig_wagonTypeColor_FK; CREATE OR REPLACE TABLE vn.wagonTypeTray ( - id INT(11) UNSIGNED, - wagonTypeFk INT(11) unsigned NULL, + id INT(11) UNSIGNED auto_increment, + wagonTypeFk INT(11) UNSIGNED NULL, height INT(11) UNSIGNED NULL, - wagonTypeColorFk int(11) unsigned NULL, + wagonTypeColorFk int(11) UNSIGNED NULL, CONSTRAINT wagonTypeTray_pk PRIMARY KEY (id), CONSTRAINT wagonTypeTray_wagonType_FK FOREIGN KEY (wagonTypeFk) REFERENCES vn.wagonType(id) ON DELETE CASCADE ON UPDATE RESTRICT, CONSTRAINT wagonTypeTray_wagonTypeColor_FK FOREIGN KEY (wagonTypeColorFk) REFERENCES vn.wagonTypeColor(id) @@ -14,6 +14,6 @@ DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; ALTER TABLE vn.wagonConfig ADD IF NOT EXISTS defaultHeight INT UNSIGNED DEFAULT 0 NULL COMMENT 'Default height in cm for a base tray'; -ALTER TABLE vn.wagonConfig ADD IF NOT EXISTS defaultTrayColorFk int(11) unsigned NULL COMMENT 'Default color for a base tray'; +ALTER TABLE vn.wagonConfig ADD IF NOT EXISTS defaultTrayColorFk int(11) UNSIGNED NULL COMMENT 'Default color for a base tray'; ALTER TABLE vn.wagonConfig ADD CONSTRAINT wagonConfig_wagonTypeColor_FK FOREIGN KEY (defaultTrayColorFk) REFERENCES vn.wagonTypeColor(id); ALTER TABLE vn.collectionWagonTicket ADD CONSTRAINT collectionWagonTicket_tray FOREIGN KEY (trayFk) REFERENCES vn.wagonTypeTray(id); From 6cbf25dee597f2c9b765bedb086a286cae55564f Mon Sep 17 00:00:00 2001 From: Pako Date: Mon, 16 Sep 2024 08:10:58 +0200 Subject: [PATCH 10/24] fix: refs #7969 fix on collectionNew --- db/routines/vn/procedures/collection_new.sql | 3 ++- .../vn/procedures/productionControl.sql | 23 +++++++++++++++---- .../11229-salmonAsparagus/00-firstScript.sql | 2 ++ 3 files changed, 22 insertions(+), 6 deletions(-) create mode 100644 db/versions/11229-salmonAsparagus/00-firstScript.sql diff --git a/db/routines/vn/procedures/collection_new.sql b/db/routines/vn/procedures/collection_new.sql index 6e112634e..940540afb 100644 --- a/db/routines/vn/procedures/collection_new.sql +++ b/db/routines/vn/procedures/collection_new.sql @@ -196,7 +196,8 @@ BEGIN OR LENGTH(pb.problem) > 0 OR pb.lines > vLinesLimit OR pb.m3 > vVolumeLimit - OR sub.maxSize > vSizeLimit; + OR sub.maxSize > vSizeLimit + OR pb.hasPlantTray; END IF; -- Es importante que el primer ticket se coja en todos los casos diff --git a/db/routines/vn/procedures/productionControl.sql b/db/routines/vn/procedures/productionControl.sql index 84717a19a..842a306b4 100644 --- a/db/routines/vn/procedures/productionControl.sql +++ b/db/routines/vn/procedures/productionControl.sql @@ -1,5 +1,5 @@ DELIMITER $$ -CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`productionControl`( +CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`productionControl`( vWarehouseFk INT, vScopeDays INT ) @@ -211,8 +211,6 @@ proc: BEGIN salesInParkingCount INT DEFAULT 0) ENGINE = MEMORY; - -- Insertamos todos los tickets que tienen productos parkineados - -- en sectores de previa, segun el sector CREATE OR REPLACE TEMPORARY TABLE tItemShelvingStock (PRIMARY KEY(itemFk, sectorFk)) ENGINE = MEMORY @@ -245,7 +243,6 @@ proc: BEGIN AND s.quantity > 0 GROUP BY pb.ticketFk; - -- Se calcula la cantidad de productos que estan ya preparados porque su saleGroup está aparcado UPDATE tmp.ticketWithPrevia twp JOIN ( SELECT pb.ticketFk, COUNT(DISTINCT s.id) salesInParkingCount @@ -259,12 +256,28 @@ proc: BEGIN ) sub ON twp.ticketFk = sub.ticketFk SET twp.salesInParkingCount = sub.salesInParkingCount; - -- Marcamos como pendientes aquellos que no coinciden las cantidades UPDATE tmp.productionBuffer pb JOIN tmp.ticketWithPrevia twp ON twp.ticketFk = pb.ticketFk SET pb.previousWithoutParking = TRUE WHERE twp.salesCount > twp.salesInParkingCount; + -- hasPlantTray + ALTER TABLE tmp.productionBuffer + ADD hasPlantTray BOOL DEFAULT FALSE; + + UPDATE tmp.productionBuffer pb + JOIN sale s ON s.ticketFk = pb.ticketFk + JOIN item i ON i.id = s.itemFk + JOIN itemType it ON it.id = i.typeFk + JOIN itemCategory ic ON ic.id = it.categoryFk + JOIN cache.last_buy lb ON lb.warehouse_id = vWarehouseFk AND lb.item_id = s.itemFk + JOIN buy b ON b.id = lb.buy_id + JOIN packaging p ON p.id = b.packagingFk + JOIN productionConfig pc + SET hasPlantTray = TRUE + WHERE ic.code = 'plant' + AND p.`depth` >= pc.minPlantTrayLength; + DROP TEMPORARY TABLE tmp.productionTicket, tmp.ticket, diff --git a/db/versions/11229-salmonAsparagus/00-firstScript.sql b/db/versions/11229-salmonAsparagus/00-firstScript.sql new file mode 100644 index 000000000..e51fe0933 --- /dev/null +++ b/db/versions/11229-salmonAsparagus/00-firstScript.sql @@ -0,0 +1,2 @@ +ALTER TABLE vn.productionConfig ADD IF NOT EXISTS minPlantTrayLength INT DEFAULT 53 NOT NULL +COMMENT 'minimum length for plant tray restriction. Avoid to make collection of the ticket with this kind of item'; \ No newline at end of file From 390b8271c2964df4654222f38dd1e62f97c99415 Mon Sep 17 00:00:00 2001 From: Pako Date: Mon, 16 Sep 2024 08:20:17 +0200 Subject: [PATCH 11/24] fix: root instead of vn --- db/routines/vn/procedures/productionControl.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/routines/vn/procedures/productionControl.sql b/db/routines/vn/procedures/productionControl.sql index 842a306b4..76d24c7dd 100644 --- a/db/routines/vn/procedures/productionControl.sql +++ b/db/routines/vn/procedures/productionControl.sql @@ -1,5 +1,5 @@ DELIMITER $$ -CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`productionControl`( +CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`productionControl`( vWarehouseFk INT, vScopeDays INT ) From 6983a2fbd918fd3057a0a8cf26e636f03fbac5e4 Mon Sep 17 00:00:00 2001 From: Pako Date: Mon, 16 Sep 2024 08:38:06 +0200 Subject: [PATCH 12/24] fix: refs #7969 no agency restriction removed --- db/routines/vn/procedures/productionControl.sql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/db/routines/vn/procedures/productionControl.sql b/db/routines/vn/procedures/productionControl.sql index 76d24c7dd..e6e14e2db 100644 --- a/db/routines/vn/procedures/productionControl.sql +++ b/db/routines/vn/procedures/productionControl.sql @@ -276,7 +276,8 @@ proc: BEGIN JOIN productionConfig pc SET hasPlantTray = TRUE WHERE ic.code = 'plant' - AND p.`depth` >= pc.minPlantTrayLength; + AND p.`depth` >= pc.minPlantTrayLength + AND pb.isOwn; DROP TEMPORARY TABLE tmp.productionTicket, From 51cabd06a4486b619498250b136e89b0f1950fd1 Mon Sep 17 00:00:00 2001 From: guillermo Date: Mon, 16 Sep 2024 10:44:04 +0200 Subject: [PATCH 13/24] refactor: refs #7562 Deleted deprecated objects --- db/versions/11234-yellowRuscus/00-firstScript.sql | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 db/versions/11234-yellowRuscus/00-firstScript.sql diff --git a/db/versions/11234-yellowRuscus/00-firstScript.sql b/db/versions/11234-yellowRuscus/00-firstScript.sql new file mode 100644 index 000000000..2cbac598b --- /dev/null +++ b/db/versions/11234-yellowRuscus/00-firstScript.sql @@ -0,0 +1,13 @@ +ALTER TABLE `vn`.`payrollWorkCenter` DROP PRIMARY KEY; +ALTER TABLE `vn`.`payrollWorkCenter` DROP COLUMN `empresa_id__`; +ALTER TABLE `vn`.`payrollWorkCenter` DROP COLUMN `Centro__`; +ALTER TABLE `vn`.`payrollWorkCenter` DROP COLUMN `nss_cotizacion__`; +ALTER TABLE `vn`.`payrollWorkCenter` DROP COLUMN `domicilio__`; +ALTER TABLE `vn`.`payrollWorkCenter` DROP COLUMN `poblacion__`; +ALTER TABLE `vn`.`payrollWorkCenter` DROP COLUMN `cp__`; +ALTER TABLE `vn`.`payrollWorker` DROP COLUMN `nss__`; +ALTER TABLE `vn`.`payrollWorker` DROP COLUMN `codpuesto__`; +ALTER TABLE `vn`.`payrollWorker` DROP COLUMN `codcontrato__`; +ALTER TABLE `vn`.`payrollWorker` DROP COLUMN `FAntiguedad__`; +ALTER TABLE `vn`.`payrollWorker` DROP COLUMN `codcategoria__`; +ALTER TABLE `vn`.`payrollWorker` DROP COLUMN `ContratoTemporal__`; From 5c7a537275e47e8382c803602c7c3648dbc132b7 Mon Sep 17 00:00:00 2001 From: guillermo Date: Mon, 16 Sep 2024 12:32:52 +0200 Subject: [PATCH 14/24] feat: refs #7912 Added new waste types --- db/dump/fixtures.before.sql | 32 +++++++++---------- db/routines/bs/procedures/waste_addSales.sql | 32 ++++++++++++++----- .../11236-blackMedeola/00-firstScript.sql | 19 +++++++++++ .../11236-blackMedeola/01-firstScript.sql | 6 ++++ .../item/back/methods/item/getWasteByItem.js | 8 ++++- .../back/methods/item/getWasteByWorker.js | 16 ++++++++-- .../buyer-week-waste/sql/wasteWeekly.sql | 10 ++++-- 7 files changed, 94 insertions(+), 29 deletions(-) create mode 100644 db/versions/11236-blackMedeola/00-firstScript.sql create mode 100644 db/versions/11236-blackMedeola/01-firstScript.sql diff --git a/db/dump/fixtures.before.sql b/db/dump/fixtures.before.sql index fdd6d6d65..6fbd34274 100644 --- a/db/dump/fixtures.before.sql +++ b/db/dump/fixtures.before.sql @@ -1521,23 +1521,23 @@ INSERT INTO `vn`.`entry`(`id`, `supplierFk`, `created`, `travelFk`, `isConfirmed INSERT INTO `vn`.`entryConfig` (`defaultEntry`, `inventorySupplierFk`, `defaultSupplierFk`) VALUES (2, 4, 1); -INSERT INTO `bs`.`waste`(`buyerFk`, `year`, `week`, `itemFk`, `itemTypeFk`, `saleTotal`, `saleWasteQuantity`, `saleInternalWaste`, `saleExternalWaste`) +INSERT INTO `bs`.`waste`(`buyerFk`, `year`, `week`, `itemFk`, `itemTypeFk`, `saleTotal`, `saleWasteQuantity`, `saleExternalWaste`, `saleFaultWaste`, `saleContainerWaste`, `saleBreakWaste`, `saleOtherWaste`) VALUES - ('35', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 1, 1, '1062', '51', '56.20', '56.20'), - ('35', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 2, 1, '35074', '687', '53.12', '89.69'), - ('35', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 3, 1, '1777', '13', '12.02', '53.12'), - ('35', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 4, 1, '3182', '59', '51', '56.20'), - ('35', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 5, 1, '1747', '13', '53.12', '53.12'), - ('35', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 6, 1, '7182', '59', '51', '53.12'), - ('35', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 7, 1, '1777', '13', '89.69', '89.69'), - ('35', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 8, 1, '4181', '59', '53.12', '53.12'), - ('35', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 9, 1, '7268', '59', '12.02', '56.20'), - ('103', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 2, 1, '-74', '0', '51', '89.69'), - ('103', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 3, 1, '-7', '0', '12.02', '53.12'), - ('103', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 4, 1, '1100', '0', '51', '56.20'), - ('103', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 5, 1, '848', '-187', '12.02', '89.69'), - ('103', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 6, 1, '186', '0', '51', '53.12'), - ('103', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 7, 1, '277', '0', '53.12', '56.20'); + ('35', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 1, 1, '1062', '51', '56.20', '56.20', '56.20', '56.20', '56.20'), + ('35', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 2, 1, '35074', '687', '53.12', '89.69', '56.20', '56.20', '56.20'), + ('35', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 3, 1, '1777', '13', '12.02', '53.12', '56.20', '56.20', '56.20'), + ('35', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 4, 1, '3182', '59', '51', '56.20', '56.20', '56.20', '56.20'), + ('35', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 5, 1, '1747', '13', '53.12', '53.12', '56.20', '56.20', '56.20'), + ('35', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 6, 1, '7182', '59', '51', '53.12', '56.20', '56.20', '56.20'), + ('35', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 7, 1, '1777', '13', '89.69', '89.69', '56.20', '56.20', '56.20'), + ('35', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 8, 1, '4181', '59', '53.12', '53.12', '56.20', '56.20', '56.20'), + ('35', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 9, 1, '7268', '59', '12.02', '56.20', '56.20', '56.20', '56.20'), + ('103', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 2, 1, '-74', '0', '51', '89.69', '56.20', '56.20', '56.20'), + ('103', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 3, 1, '-7', '0', '12.02', '53.12', '56.20', '56.20', '56.20'), + ('103', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 4, 1, '1100', '0', '51', '56.20', '56.20', '56.20', '56.20'), + ('103', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 5, 1, '848', '-187', '12.02', '89.69', '56.20', '56.20', '56.20'), + ('103', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 6, 1, '186', '0', '51', '53.12', '56.20', '56.20', '56.20'), + ('103', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 7, 1, '277', '0', '53.12', '56.20', '56.20', '56.20', '56.20'); INSERT INTO `vn`.`buy`(`id`,`entryFk`,`itemFk`,`buyingValue`,`quantity`,`packagingFk`,`stickers`,`freightValue`,`packageValue`,`comissionValue`,`packing`,`grouping`,`groupingMode`,`location`,`price1`,`price2`,`price3`, `printedStickers`,`isChecked`,`isIgnored`,`weight`, `created`) VALUES diff --git a/db/routines/bs/procedures/waste_addSales.sql b/db/routines/bs/procedures/waste_addSales.sql index 20eee5d49..f23c1b360 100644 --- a/db/routines/bs/procedures/waste_addSales.sql +++ b/db/routines/bs/procedures/waste_addSales.sql @@ -1,7 +1,7 @@ DELIMITER $$ CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `bs`.`waste_addSales`() BEGIN - DECLARE vDateFrom DATE DEFAULT util.VN_CURDATE() - INTERVAL WEEKDAY(util.VN_CURDATE()) DAY; + DECLARE vDateFrom DATE DEFAULT util.VN_CURDATE() - INTERVAL WEEKDAY(util.VN_CURDATE()) DAY; DECLARE vDateTo DATE DEFAULT vDateFrom + INTERVAL 6 DAY; CALL cache.last_buy_refresh(FALSE); @@ -14,16 +14,32 @@ BEGIN s.itemFk, SUM((b.buyingValue + b.freightValue + b.comissionValue + b.packageValue) * s.quantity), SUM(IF(aw.`type`, s.quantity, 0)), - SUM( - IF( - aw.`type` = 'internal', + SUM(IF( + aw.`type` = 'external', (b.buyingValue + b.freightValue + b.comissionValue + b.packageValue) * s.quantity, 0 ) - ), - SUM( - IF( - aw.`type` = 'external', + ), + SUM(IF( + aw.`type` = 'fault', + (b.buyingValue + b.freightValue + b.comissionValue + b.packageValue) * s.quantity, + 0 + ) + ), + SUM(IF( + aw.`type` = 'container', + (b.buyingValue + b.freightValue + b.comissionValue + b.packageValue) * s.quantity, + 0 + ) + ), + SUM(IF( + aw.`type` = 'break', + (b.buyingValue + b.freightValue + b.comissionValue + b.packageValue) * s.quantity, + 0 + ) + ), + SUM(IF( + aw.`type` = 'other', (b.buyingValue + b.freightValue + b.comissionValue + b.packageValue) * s.quantity, 0 ) diff --git a/db/versions/11236-blackMedeola/00-firstScript.sql b/db/versions/11236-blackMedeola/00-firstScript.sql new file mode 100644 index 000000000..8729e40e1 --- /dev/null +++ b/db/versions/11236-blackMedeola/00-firstScript.sql @@ -0,0 +1,19 @@ +ALTER TABLE vn.addressWaste + MODIFY COLUMN `type` enum('external', 'fault', 'container', 'break', 'other') + CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL; + +UPDATE vn.addressWaste + SET `type`='container' + WHERE addressFk=77; + +UPDATE vn.addressWaste + SET `type`='fault' + WHERE addressFk=317; + +UPDATE vn.addressWaste + SET `type`='break' + WHERE addressFk=57702; + +UPDATE vn.addressWaste + SET `type`='other' + WHERE addressFk=43432; diff --git a/db/versions/11236-blackMedeola/01-firstScript.sql b/db/versions/11236-blackMedeola/01-firstScript.sql new file mode 100644 index 000000000..87262115b --- /dev/null +++ b/db/versions/11236-blackMedeola/01-firstScript.sql @@ -0,0 +1,6 @@ +ALTER TABLE bs.waste + DROP COLUMN saleInternalWaste, + ADD saleFaultWaste decimal(10,2) DEFAULT NULL NULL, + ADD saleContainerWaste decimal(10,2) DEFAULT NULL NULL, + ADD saleBreakWaste decimal(10,2) DEFAULT NULL NULL, + ADD saleOtherWaste decimal(10,2) DEFAULT NULL NULL; diff --git a/modules/item/back/methods/item/getWasteByItem.js b/modules/item/back/methods/item/getWasteByItem.js index 548f28008..b4cc566ae 100644 --- a/modules/item/back/methods/item/getWasteByItem.js +++ b/modules/item/back/methods/item/getWasteByItem.js @@ -52,7 +52,13 @@ module.exports = Self => { it.name family, w.itemFk, SUM(w.saleTotal) total, - SUM(w.saleInternalWaste + w.saleExternalWaste) dwindle + SUM( + w.saleExternalWaste + + w.saleFaultWaste + + w.saleContainerWaste + + w.saleBreakWaste + + w.saleOtherWaste + ) dwindle FROM bs.waste w JOIN account.user u ON u.id = w.buyerFk JOIN vn.itemType it ON it.id = w.itemTypeFk diff --git a/modules/item/back/methods/item/getWasteByWorker.js b/modules/item/back/methods/item/getWasteByWorker.js index 9af49478f..d2c2f7f59 100644 --- a/modules/item/back/methods/item/getWasteByWorker.js +++ b/modules/item/back/methods/item/getWasteByWorker.js @@ -28,7 +28,13 @@ module.exports = Self => { it.name family, w.itemFk, SUM(w.saleTotal) total, - SUM(w.saleInternalWaste + w.saleExternalWaste) dwindle + SUM( + w.saleExternalWaste + + w.saleFaultWaste + + w.saleContainerWaste + + w.saleBreakWaste + + w.saleOtherWaste + ) dwindle FROM bs.waste w JOIN account.user u ON u.id = w.buyerFk JOIN vn.itemType it ON it.id = w.itemTypeFk @@ -44,7 +50,13 @@ module.exports = Self => { FROM ( SELECT u.name buyer, SUM(w.saleTotal) total, - SUM(w.saleInternalWaste + w.saleExternalWaste) dwindle + SUM( + w.saleExternalWaste + + w.saleFaultWaste + + w.saleContainerWaste + + w.saleBreakWaste + + w.saleOtherWaste + ) dwindle FROM bs.waste w JOIN account.user u ON u.id = w.buyerFk WHERE w.year = YEAR(TIMESTAMPADD(WEEK, -1, ?)) diff --git a/print/templates/email/buyer-week-waste/sql/wasteWeekly.sql b/print/templates/email/buyer-week-waste/sql/wasteWeekly.sql index 1b486a004..e5dbdfcb6 100644 --- a/print/templates/email/buyer-week-waste/sql/wasteWeekly.sql +++ b/print/templates/email/buyer-week-waste/sql/wasteWeekly.sql @@ -1,8 +1,14 @@ SELECT *, 100 * dwindle / total `percentage` FROM ( SELECT u.name buyer, - SUM(saleTotal) total, - SUM(w.saleInternalWaste + w.saleExternalWaste) dwindle + SUM(w.saleTotal) total, + SUM( + w.saleExternalWaste + + w.saleFaultWaste + + w.saleContainerWaste + + w.saleBreakWaste + + w.saleOtherWaste + ) dwindle FROM bs.waste w JOIN account.user u ON u.id = w.buyerFk JOIN vn.itemType it ON it.id = w.itemTypeFk From 9aff118b6eba56abe3540119f1b1c92315b99f18 Mon Sep 17 00:00:00 2001 From: Jon Date: Mon, 16 Sep 2024 13:00:11 +0200 Subject: [PATCH 15/24] feat: refs #6346 added script for wagons --- db/versions/11235-purpleCordyline/00-firstScript.sql | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 db/versions/11235-purpleCordyline/00-firstScript.sql diff --git a/db/versions/11235-purpleCordyline/00-firstScript.sql b/db/versions/11235-purpleCordyline/00-firstScript.sql new file mode 100644 index 000000000..f3bb6ddab --- /dev/null +++ b/db/versions/11235-purpleCordyline/00-firstScript.sql @@ -0,0 +1,12 @@ +ALTER TABLE vn.collectionWagon DROP FOREIGN KEY IF EXISTS collectionWagon_FK_1; +ALTER TABLE vn.collectionWagonTicket DROP FOREIGN KEY IF EXISTS collectionWagonTicket_FK_1; +ALTER TABLE vn.wagonVolumetry DROP FOREIGN KEY IF EXISTS wagonVolumetry_FK_1; + +ALTER TABLE vn.wagon MODIFY COLUMN id int(11) unsigned auto_increment NOT NULL COMMENT '26 letras de alfabeto inglés'; +ALTER TABLE vn.collectionWagon MODIFY COLUMN wagonFk int(11) unsigned NOT NULL; +ALTER TABLE vn.collectionWagonTicket MODIFY COLUMN wagonFk int(11) unsigned NOT NULL; +ALTER TABLE vn.wagonVolumetry MODIFY COLUMN wagonFk int(11) unsigned NOT NULL; + +ALTER TABLE vn.collectionWagon ADD CONSTRAINT collectionWagon_FK_1 FOREIGN KEY (wagonFk) REFERENCES vn.wagon(id) ON DELETE RESTRICT ON UPDATE CASCADE; +ALTER TABLE vn.collectionWagonTicket ADD CONSTRAINT collectionWagonTicket_FK_1 FOREIGN KEY (wagonFk) REFERENCES vn.wagon(id) ON DELETE RESTRICT ON UPDATE CASCADE; +ALTER TABLE vn.wagonVolumetry ADD CONSTRAINT wagonVolumetry_FK_1 FOREIGN KEY (wagonFk) REFERENCES vn.wagon(id) ON DELETE RESTRICT ON UPDATE CASCADE; From c33740e36e1943fabfac9c081340a56e3474a252 Mon Sep 17 00:00:00 2001 From: sergiodt Date: Mon, 16 Sep 2024 13:00:20 +0200 Subject: [PATCH 16/24] fix: refs #6861 itemShelvingSale debug --- db/routines/vn/procedures/itemShelvingSale_addBySale.sql | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/db/routines/vn/procedures/itemShelvingSale_addBySale.sql b/db/routines/vn/procedures/itemShelvingSale_addBySale.sql index 454ea877f..df1a12806 100644 --- a/db/routines/vn/procedures/itemShelvingSale_addBySale.sql +++ b/db/routines/vn/procedures/itemShelvingSale_addBySale.sql @@ -75,6 +75,9 @@ proc: BEGIN WHERE saleFk = vSaleFk; IF vTotalReservedQuantity <> vSaleQuantity THEN + CALL util.debugAdd('itemShelvingSale_addBySale', + CONCAT(vSaleFk, ' - ', vSaleQuantity,' - ', vTotalReservedQuantity,'-', vOutStanding,'-', account.myUser_getId())); + UPDATE sale SET quantity = vTotalReservedQuantity WHERE id = vSaleFk; @@ -93,7 +96,8 @@ proc: BEGIN SET vOutStanding = vOutStanding - vReservedQuantity; IF vReservedQuantity > 0 THEN - + CALL util.debugAdd('itemShelvingSale_addBySale_reservedQuantity', + CONCAT(vSaleFk, ' - ', vReservedQuantity, ' - ', vOutStanding, account.myUser_getId())); INSERT INTO itemShelvingSale( itemShelvingFk, saleFk, From e7343b7e257d33ee45aeb39746a85690f5278bad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Andr=C3=A9s?= Date: Mon, 16 Sep 2024 14:16:48 +0200 Subject: [PATCH 17/24] fix: refs #7760 tmp.ticketIPT --- .../vn/procedures/ticket_splitItemPackingType.sql | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/db/routines/vn/procedures/ticket_splitItemPackingType.sql b/db/routines/vn/procedures/ticket_splitItemPackingType.sql index b5b77d2ef..789ffc68b 100644 --- a/db/routines/vn/procedures/ticket_splitItemPackingType.sql +++ b/db/routines/vn/procedures/ticket_splitItemPackingType.sql @@ -10,6 +10,7 @@ BEGIN * * @param vSelf Id ticket * @param vOriginalItemPackingTypeFk Tipo empaquetado al que se mantiene el ticket original + * @return table tmp.ticketIPT(ticketFk, itemPackingTypeFk) */ DECLARE vDone INT DEFAULT FALSE; DECLARE vHasItemPackingType BOOL; @@ -73,5 +74,14 @@ BEGIN WHERE stm.ticketFk; DROP TEMPORARY TABLE tSalesToMove; + + CREATE OR REPLACE TEMPORARY TABLE tmp.ticketIPT( + ticketFk INT, + itemPackingTypeFk VARCHAR(1) + ) ENGINE=MEMORY; + SELECT ticketFk, itemPackingTypeFk + FROM tSalesToMove + GROUP BY ticketFk; + END$$ DELIMITER ; \ No newline at end of file From 33540063f4722a70970778390e05d66687f191a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Andr=C3=A9s?= Date: Mon, 16 Sep 2024 14:17:51 +0200 Subject: [PATCH 18/24] fix: refs #7760 tmp.ticketIPT --- db/routines/vn/procedures/ticket_splitItemPackingType.sql | 1 - 1 file changed, 1 deletion(-) diff --git a/db/routines/vn/procedures/ticket_splitItemPackingType.sql b/db/routines/vn/procedures/ticket_splitItemPackingType.sql index 789ffc68b..d06ed5b2f 100644 --- a/db/routines/vn/procedures/ticket_splitItemPackingType.sql +++ b/db/routines/vn/procedures/ticket_splitItemPackingType.sql @@ -82,6 +82,5 @@ BEGIN SELECT ticketFk, itemPackingTypeFk FROM tSalesToMove GROUP BY ticketFk; - END$$ DELIMITER ; \ No newline at end of file From 2e03fe8193f06ae44f310cd1a7c642f75e657807 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Andr=C3=A9s?= Date: Mon, 16 Sep 2024 14:41:29 +0200 Subject: [PATCH 19/24] fix: refs #7760 tmp.ticketIPT --- .../vn/procedures/ticket_splitItemPackingType.sql | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/db/routines/vn/procedures/ticket_splitItemPackingType.sql b/db/routines/vn/procedures/ticket_splitItemPackingType.sql index d06ed5b2f..6a974ea39 100644 --- a/db/routines/vn/procedures/ticket_splitItemPackingType.sql +++ b/db/routines/vn/procedures/ticket_splitItemPackingType.sql @@ -73,14 +73,14 @@ BEGIN SET s.ticketFk = stm.ticketFk WHERE stm.ticketFk; - DROP TEMPORARY TABLE tSalesToMove; - - CREATE OR REPLACE TEMPORARY TABLE tmp.ticketIPT( - ticketFk INT, + CREATE OR REPLACE TEMPORARY TABLE tmp.ticketIPT( + ticketFk INT, itemPackingTypeFk VARCHAR(1) - ) ENGINE=MEMORY; + ) ENGINE=MEMORY SELECT ticketFk, itemPackingTypeFk FROM tSalesToMove GROUP BY ticketFk; + + DROP TEMPORARY TABLE tSalesToMove; END$$ DELIMITER ; \ No newline at end of file From 1d42f58c39b9ecaea22067585a1dc8da3404d827 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Andr=C3=A9s?= Date: Mon, 16 Sep 2024 15:09:34 +0200 Subject: [PATCH 20/24] fix: refs #7760 tmp.ticketIPT --- db/routines/vn/procedures/ticket_splitItemPackingType.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/db/routines/vn/procedures/ticket_splitItemPackingType.sql b/db/routines/vn/procedures/ticket_splitItemPackingType.sql index 6a974ea39..dd03ef692 100644 --- a/db/routines/vn/procedures/ticket_splitItemPackingType.sql +++ b/db/routines/vn/procedures/ticket_splitItemPackingType.sql @@ -80,6 +80,8 @@ BEGIN SELECT ticketFk, itemPackingTypeFk FROM tSalesToMove GROUP BY ticketFk; + UNION + SELECT vSelf, vOriginalItemPackingTypeFk; DROP TEMPORARY TABLE tSalesToMove; END$$ From faf963ba524a8f0d49fa9b68d993a513057c30b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Andr=C3=A9s?= Date: Mon, 16 Sep 2024 15:11:51 +0200 Subject: [PATCH 21/24] fix: refs #7760 tmp.ticketIPT --- db/routines/vn/procedures/ticket_splitItemPackingType.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/routines/vn/procedures/ticket_splitItemPackingType.sql b/db/routines/vn/procedures/ticket_splitItemPackingType.sql index dd03ef692..407b8cdde 100644 --- a/db/routines/vn/procedures/ticket_splitItemPackingType.sql +++ b/db/routines/vn/procedures/ticket_splitItemPackingType.sql @@ -79,7 +79,7 @@ BEGIN ) ENGINE=MEMORY SELECT ticketFk, itemPackingTypeFk FROM tSalesToMove - GROUP BY ticketFk; + GROUP BY ticketFk UNION SELECT vSelf, vOriginalItemPackingTypeFk; From d46be3978602468c5808f3bd2018828268681daf Mon Sep 17 00:00:00 2001 From: alexm Date: Mon, 16 Sep 2024 15:19:21 +0200 Subject: [PATCH 22/24] chore: refs #7983 changelog --- CHANGELOG.md | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 74109c7c4..57848aa7f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,89 @@ +# Version 24.38 - 2024-09-17 + +### Added 🆕 + +- chore: refs #7323 filter data by:jorgep +- chore: refs #7323 fix test by:jorgep +- chore: refs #7323 worker changes by:jorgep +- chore: refs #7323 worker changes wip by:jorgep +- chore: refs #7524 add select limit by:jorgep +- feat(AccessToken&ACL): refs #7547 upgrade security by:alexm +- feat: deleted code and redirect to Lilium by:Jon +- feat: refs #4515 New throw buy_checkItem by:guillermo +- feat: refs #6650 Added saleGroupLog by:guillermo +- feat: refs #6650 new itemShelvingLog by:guillermo +- feat: refs #6760 refs #actualiza campo nickname by:jgallego +- feat: refs #7277 fdescribe by:jgallego +- feat: refs #7277 fit by:jgallego +- feat: refs #7277 refundInvoices by:jgallego +- feat: refs #7277 test with warehouse by:jgallego +- feat: refs #7277 traducciones by:jgallego +- feat: refs #7277 transfer addressFk by:jgallego +- feat: refs #7532 Requested changes by:guillermo +- feat: refs #7564 Added proc by:guillermo +- feat: refs #7564 Added ticket_setVolumeItemCost by:guillermo +- feat: refs #7564 Added volume column by:guillermo +- feat: refs #7564 Fix version by:guillermo +- feat: refs #7564 Requested changes by:guillermo +- feat: refs #7615 setDeleted by:robert +- feat: refs #7650 Added no transfer lines to inventory entry and fixtures by:guillermo +- feat: refs #7650 Fix tests by:guillermo +- feat: refs #7747 Delete buyUltimate and buyUltimateFromInterval by:ivanm +- feat: refs #7759 Changed defined only of vn objects by:guillermo +- feat: refs #7759 Changed definer root to vn-admin by:guillermo +- feat: refs #7759 Changed name by:guillermo +- feat: refs #7759 Deleted version 11163-maroonEucalyptus by:guillermo +- feat: refs #7759 Revoke routine grants vn by:guillermo +- feat: refs #7811 Added comment by:guillermo +- feat: refs #7811 Added new params in datasources.json by:guillermo +- feat: refs #7898 Add column "floor" in vn.parking by:ivanm +- feat: refs #7898 Modify default by:ivanm +- feat: refs #7905 Added new method getBuysCsv by:guillermo +- feat: refs #7905 Added param toCsv by:guillermo +- feat: refs #7938 remove unnecessary insert in clientLog by:alexm +- feat: refs #7953 pullinfo (7953-devToTest_2438) by:alexm +- feat(salix): #7671 define isDestiny field in model by:Javier Segarra +- feat(salix): refs #7896 update version and changelog (origin/7896_down_devToTest_2436) by:Javier Segarra +- feat(salix): refs #7905 #7905 use getBuys toCSV flattened by:Javier Segarra +- feat(ssalix): refs #7671 #7671 checkDates by:Javier Segarra +- feat(ssalix): refs #7671 #7671 checkDates to present by:Javier Segarra +- feat: ticket 215005 Changed acl show transferClient by:guillermo + +### Changed 📦 + +- perf: refs #7671 improve showBadDates by:Javier Segarra +- perf(salix): refs #7671 #7671 imrpove and revert where changes by:Javier Segarra +- refactor: deleted e2e & added back descriptor and summary by:Jon + +### Fixed 🛠️ + +- chore: refs #7323 fix test by:jorgep +- feat: refs #7650 Added no transfer lines to inventory entry and fixtures by:guillermo +- fix by:guillermo +- fixes: refs #7760 collection problems by:Carlos Andrés +- fix merge dev (7407-workerMedical) by:alexm +- fix: refs #6727 No delete log tables data in clean procedures by:guillermo +- fix: refs #6897 back and tests by:carlossa +- fix: refs #6897 back by:carlossa +- fix: refs #6897 fix filter by:carlossa +- fix: refs #6897 fix json by:carlossa +- fix: refs #6897 travel filter by:carlossa +- fix: refs #6897 error test by:jgallego +- fix: refs #7323 fetch from right source by:jorgep +- fix: refs #7564 Deleted query by:guillermo +- fix: refs #7759 Added user 'vn'@'localhost' & grants by:guillermo +- fix: refs #7760 collection problems by:Carlos Andrés +- fix: refs #7760 tmp.ticketIPT by:Carlos Andrés +- fix: refs #7905 added comments to flatten.js by:guillermo +- fix: refs ##7905 Handle error by:guillermo +- fix(salix): refs #7905 #7905 use right fn to flatten data by:Javier Segarra +- perf(salix): refs #7671 #7671 imrpove and revert where changes by:Javier Segarra +- refs #6898 fix supplier remove by:carlossa +- refs #7407 fix acls fixtures by:carlossa +- test: fix connections e2e (7547-accessToken-security) by:alexm +- test: refs #7277 fix test proposal by:Javier Segarra +- test(salix): refs #7671 #7671 improve and revert where changes by:Javier Segarra + # Version 24.36 - 2024-09-03 ### Added 🆕 From 3011421526f3238c2e58d2046de6724bce235434 Mon Sep 17 00:00:00 2001 From: alexm Date: Mon, 16 Sep 2024 15:19:46 +0200 Subject: [PATCH 23/24] fix: refs #7983 correct version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index bbb83c4b0..2e351c86f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "salix-back", - "version": "24.36.0", + "version": "24.38.0", "author": "Verdnatura Levante SL", "description": "Salix backend", "license": "GPL-3.0", From 2980b2da51b387c1d25e8f259a15294db5e55f81 Mon Sep 17 00:00:00 2001 From: guillermo Date: Tue, 17 Sep 2024 08:41:52 +0200 Subject: [PATCH 24/24] fix: refs #7759 Added more grants for vn user --- db/dump/dump.after.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/db/dump/dump.after.sql b/db/dump/dump.after.sql index 7508a36a7..962d8e3f2 100644 --- a/db/dump/dump.after.sql +++ b/db/dump/dump.after.sql @@ -4,7 +4,9 @@ GRANT SELECT, INSERT, UPDATE, DELETE, + DROP, CREATE TEMPORARY TABLES, EXECUTE, + EVENT, TRIGGER ON *.* TO 'vn'@'localhost';