From 02bf78d00a2bab69a1e2fd5b42315d1a36fd7ca5 Mon Sep 17 00:00:00 2001 From: robert Date: Fri, 9 Feb 2024 09:22:24 +0100 Subject: [PATCH 1/8] feat: refs #6830 item_getLack origin --- db/routines/vn/procedures/item_getLack.sql | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/db/routines/vn/procedures/item_getLack.sql b/db/routines/vn/procedures/item_getLack.sql index b2e3e425c..e0531e2ac 100644 --- a/db/routines/vn/procedures/item_getLack.sql +++ b/db/routines/vn/procedures/item_getLack.sql @@ -23,7 +23,8 @@ BEGIN SUM(IFNULL(sub.amount,0)) lack, i.inkFk, IFNULL(im.timed, util.midnight()) timed, - IFNULL(izc.timed, util.midnight()) minTimed + IFNULL(izc.timed, util.midnight()) minTimed, + o.name originFk FROM (SELECT item_id, warehouse_id, amount @@ -42,6 +43,7 @@ BEGIN JOIN itemCategory ic ON ic.id = it.categoryFk LEFT JOIN tmp.itemMinETD im ON im.itemFk = i.id LEFT JOIN tmp.itemZoneClosure izc ON izc.itemFk = i.id + JOIN origin o ON o.id = i.originFk WHERE w.isForTicket AND ic.display AND it.code != 'GEN' From 41db1c924f3c3875c27f08f3993c66ff4c79235d Mon Sep 17 00:00:00 2001 From: guillermo Date: Tue, 13 Feb 2024 09:20:21 +0100 Subject: [PATCH 2/8] refactor: refs #6781 Deleted timeControlDevice --- db/versions/10884-maroonGerbera/00-firstScript.sql | 1 + 1 file changed, 1 insertion(+) create mode 100644 db/versions/10884-maroonGerbera/00-firstScript.sql diff --git a/db/versions/10884-maroonGerbera/00-firstScript.sql b/db/versions/10884-maroonGerbera/00-firstScript.sql new file mode 100644 index 000000000..704342a7c --- /dev/null +++ b/db/versions/10884-maroonGerbera/00-firstScript.sql @@ -0,0 +1 @@ +DROP TABLE vn.timeControlDevice; From 6116ada156dd68e2b5e1e94fef8c8811c8fc9e7b Mon Sep 17 00:00:00 2001 From: jorgep Date: Tue, 13 Feb 2024 09:35:39 +0100 Subject: [PATCH 3/8] fix: refs #6813 remove inserts --- db/routines/vn2008/procedures/recobro_credito.sql | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/db/routines/vn2008/procedures/recobro_credito.sql b/db/routines/vn2008/procedures/recobro_credito.sql index ca5304b6c..0db9d6e70 100644 --- a/db/routines/vn2008/procedures/recobro_credito.sql +++ b/db/routines/vn2008/procedures/recobro_credito.sql @@ -8,16 +8,10 @@ BEGIN END; START TRANSACTION; - INSERT INTO vn.clientCredit(clientFk, amount) - SELECT c.id, 0 - FROM vn.`client` c - JOIN vn.payMethod pm ON pm.id = c.payMethodFk - WHERE c.credit <> 0 AND pm.`code` = 'card'; - UPDATE vn.`client` c - JOIN vn.payMethod pm ON pm.id = c.payMethodFk + JOIN vn.payMethod pm ON pm.id = c.payMethodFk SET credit = 0 - WHERE pm.`code` = 'card'; + WHERE pm.`code` = 'card'; DROP TEMPORARY TABLE IF EXISTS clientes_credit; CREATE TEMPORARY TABLE clientes_credit @@ -44,10 +38,6 @@ BEGIN UPDATE Clientes JOIN clientes_credit USING(Id_Cliente) SET Clientes.Credito = newCredit; - - INSERT INTO credit(Id_Cliente, amount, Id_Trabajador) - SELECT Id_Cliente, newCredit, NULL - FROM clientes_credit; DROP TEMPORARY TABLE clientes_credit; COMMIT; From db2919b48208cd634ab8cea4d7d9f567fca32354 Mon Sep 17 00:00:00 2001 From: jorgep Date: Tue, 13 Feb 2024 11:05:21 +0100 Subject: [PATCH 4/8] fix: refs #6813 procedure --- db/routines/vn2008/procedures/recobro_credito.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/db/routines/vn2008/procedures/recobro_credito.sql b/db/routines/vn2008/procedures/recobro_credito.sql index 0db9d6e70..3c8b6fbfe 100644 --- a/db/routines/vn2008/procedures/recobro_credito.sql +++ b/db/routines/vn2008/procedures/recobro_credito.sql @@ -8,10 +8,10 @@ BEGIN END; START TRANSACTION; - UPDATE vn.`client` c + UPDATE vn.client c JOIN vn.payMethod pm ON pm.id = c.payMethodFk SET credit = 0 - WHERE pm.`code` = 'card'; + WHERE pm.code = 'card'; DROP TEMPORARY TABLE IF EXISTS clientes_credit; CREATE TEMPORARY TABLE clientes_credit From 579f2abe5bd48bd05f5d25b7a9b66daf45038278 Mon Sep 17 00:00:00 2001 From: jorgep Date: Tue, 13 Feb 2024 11:16:00 +0100 Subject: [PATCH 5/8] fix: refs #6813 remove quotation marks --- db/routines/vn2008/procedures/recobro_credito.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/db/routines/vn2008/procedures/recobro_credito.sql b/db/routines/vn2008/procedures/recobro_credito.sql index 3c8b6fbfe..0db9d6e70 100644 --- a/db/routines/vn2008/procedures/recobro_credito.sql +++ b/db/routines/vn2008/procedures/recobro_credito.sql @@ -8,10 +8,10 @@ BEGIN END; START TRANSACTION; - UPDATE vn.client c + UPDATE vn.`client` c JOIN vn.payMethod pm ON pm.id = c.payMethodFk SET credit = 0 - WHERE pm.code = 'card'; + WHERE pm.`code` = 'card'; DROP TEMPORARY TABLE IF EXISTS clientes_credit; CREATE TEMPORARY TABLE clientes_credit From 999d9a0f9c3599436039772f64ca747b9bcadbb2 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Tue, 13 Feb 2024 16:21:01 +0100 Subject: [PATCH 6/8] fix: refs#6706 E2E show parameter fix --- e2e/{helpers => }/tests.js | 7 ++++--- package.json | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) rename e2e/{helpers => }/tests.js (94%) diff --git a/e2e/helpers/tests.js b/e2e/tests.js similarity index 94% rename from e2e/helpers/tests.js rename to e2e/tests.js index 7dd299e0b..829056f4c 100644 --- a/e2e/helpers/tests.js +++ b/e2e/tests.js @@ -10,7 +10,7 @@ const Myt = require('@verdnatura/myt/myt'); const Run = require('@verdnatura/myt/myt-run'); const axios = require('axios'); -const e2eConfig = require('./config.js'); +const e2eConfig = require('./helpers/config.js'); const log = require('fancy-log'); process.on('warning', warning => { @@ -23,11 +23,12 @@ async function test() { const opts = getopts(process.argv.slice(2), { boolean: ['show'] }); - process.env.E2E_SHOW = opts.show; + if (opts.show) + process.env.E2E_SHOW = true; console.log('Building and running DB container.'); const myt = new Myt(); - await myt.init({workspace: path.join(__dirname, '../..')}); + await myt.init({workspace: path.join(__dirname, '..')}); await myt.run(Run); await myt.deinit(); diff --git a/package.json b/package.json index 9ae8b276b..a9a355cf6 100644 --- a/package.json +++ b/package.json @@ -108,7 +108,7 @@ "dbtest": "nodemon -q db/tests.js -w db/tests", "test:back": "nodemon -q back/tests.js --config back/nodemonConfig.json", "test:back:ci": "node back/tests.js --ci --junit --network jenkins", - "test:e2e": "node e2e/helpers/tests.js", + "test:e2e": "node e2e/tests.js", "test:front": "jest --watch", "back": "nodemon --inspect -w modules ./node_modules/gulp/bin/gulp.js back", "lint": "eslint ./ --cache --ignore-pattern .gitignore", From 27d7a114e6e9596232d84ab8774e4d30e3033ba8 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Tue, 13 Feb 2024 17:16:10 +0100 Subject: [PATCH 7/8] fix: refs#6706 package.json dbtest script removed --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index a9a355cf6..dc2e25166 100644 --- a/package.json +++ b/package.json @@ -105,7 +105,6 @@ "yaml-loader": "^0.5.0" }, "scripts": { - "dbtest": "nodemon -q db/tests.js -w db/tests", "test:back": "nodemon -q back/tests.js --config back/nodemonConfig.json", "test:back:ci": "node back/tests.js --ci --junit --network jenkins", "test:e2e": "node e2e/tests.js", From 19bbb4a4bf06db9c52dcae984719dd1707be86c4 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Tue, 13 Feb 2024 17:20:04 +0100 Subject: [PATCH 8/8] fix: refs#6706 package.json deprecated scripts removed --- Jenkinsfile | 2 +- package.json | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 2c04bcf16..d508da8bf 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -103,7 +103,7 @@ pipeline { NODE_ENV = '' } steps { - sh 'npm run test:back:ci' + sh 'node back/tests.js --ci --junit --network jenkins' } post { always { diff --git a/package.json b/package.json index dc2e25166..5970e68fb 100644 --- a/package.json +++ b/package.json @@ -106,12 +106,10 @@ }, "scripts": { "test:back": "nodemon -q back/tests.js --config back/nodemonConfig.json", - "test:back:ci": "node back/tests.js --ci --junit --network jenkins", "test:e2e": "node e2e/tests.js", "test:front": "jest --watch", "back": "nodemon --inspect -w modules ./node_modules/gulp/bin/gulp.js back", - "lint": "eslint ./ --cache --ignore-pattern .gitignore", - "docker": "docker build --progress=plain -t salix-db ./db" + "lint": "eslint ./ --cache --ignore-pattern .gitignore" }, "jest": { "projects": [