From edb024a1f9b95b67d36fbe458c3282a8fe4a22a8 Mon Sep 17 00:00:00 2001 From: sergiodt Date: Tue, 14 May 2024 10:14:53 +0200 Subject: [PATCH 1/5] refs #6106 hotFix: getTickets --- modules/route/back/methods/route/getTickets.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/modules/route/back/methods/route/getTickets.js b/modules/route/back/methods/route/getTickets.js index 0e7c9fe20..c0b952b70 100644 --- a/modules/route/back/methods/route/getTickets.js +++ b/modules/route/back/methods/route/getTickets.js @@ -87,10 +87,6 @@ module.exports = Self => { const where = filter.where; where['r.id'] = filter.id; - where.and = [{or: [ - {'t.packages': {gt: 0}}, - {and: [{'ot.code': 'delivery'}, {'tob.observationTypeFk': {neq: null}}]} - ]}]; stmt.merge(conn.makeWhere(filter.where)); stmt.merge(conn.makeGroupBy('t.id')); -- 2.40.1 From eadf13b66325c53f36e6bacbb04baf3392e56b20 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Tue, 14 May 2024 12:20:39 +0200 Subject: [PATCH 2/5] fix: Jenkinsfile display BRANCH_NAME --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 9d5954f86..8a079d35b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -24,7 +24,6 @@ node { FROM_GIT = env.JOB_NAME.startsWith('gitea/') RUN_TESTS = !PROTECTED_BRANCH && FROM_GIT RUN_BUILD = PROTECTED_BRANCH && FROM_GIT - // env.DEBUG = 'strong-remoting:shared-method' // https://www.jenkins.io/doc/book/pipeline/jenkinsfile/#using-environment-variables echo "NODE_NAME: ${env.NODE_NAME}" echo "WORKSPACE: ${env.WORKSPACE}" @@ -162,6 +161,7 @@ pipeline { def packageJson = readJSON file: 'package.json' env.VERSION = packageJson.version } + echo "BRANCH_NAME: ${env.BRANCH_NAME}" sh 'gulp build' sh 'docker-compose build front' } -- 2.40.1 From b6f788a8db3fe6355a2b1aa8f84ff2f0d80f351c Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Tue, 14 May 2024 14:21:16 +0200 Subject: [PATCH 3/5] fix: refs #7389 pbx.sipConfig: rename incomingLimit to call-limit --- db/routines/pbx/views/sipConf.sql | 2 +- db/versions/11051-blueAralia/00-sipConfig_callLimit.sql | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 db/versions/11051-blueAralia/00-sipConfig_callLimit.sql diff --git a/db/routines/pbx/views/sipConf.sql b/db/routines/pbx/views/sipConf.sql index 443cf7bee..0765264bc 100644 --- a/db/routines/pbx/views/sipConf.sql +++ b/db/routines/pbx/views/sipConf.sql @@ -12,7 +12,7 @@ AS SELECT `s`.`user_id` AS `id`, `c`.`permit` AS `permit`, `c`.`type` AS `type`, `c`.`context` AS `context`, - `c`.`incomingLimit` AS `incominglimit`, + `c`.`call-limit` AS `call-limit`, `c`.`pickupGroup` AS `pickupgroup`, `c`.`directMedia` AS `directmedia`, `c`.`insecure` AS `insecure`, diff --git a/db/versions/11051-blueAralia/00-sipConfig_callLimit.sql b/db/versions/11051-blueAralia/00-sipConfig_callLimit.sql new file mode 100644 index 000000000..9fbb7bb90 --- /dev/null +++ b/db/versions/11051-blueAralia/00-sipConfig_callLimit.sql @@ -0,0 +1,3 @@ +ALTER TABLE pbx.sipConfig + CHANGE incomingLimit `call-limit` varchar(10) + CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL; -- 2.40.1 From d0d710f023107a1c35c9f48009d1eb5d91ef2797 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Andr=C3=A9s?= Date: Tue, 14 May 2024 15:36:09 +0200 Subject: [PATCH 4/5] refs #6974 refactorLoop --- db/routines/bs/procedures/sale_add.sql | 94 ++++++++++++-------------- 1 file changed, 42 insertions(+), 52 deletions(-) diff --git a/db/routines/bs/procedures/sale_add.sql b/db/routines/bs/procedures/sale_add.sql index 64beb4776..823ece079 100644 --- a/db/routines/bs/procedures/sale_add.sql +++ b/db/routines/bs/procedures/sale_add.sql @@ -1,7 +1,8 @@ DELIMITER $$ CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `bs`.`sale_add`( IN vStarted DATE, - IN vEnded DATE) + IN vEnded DATE +) BEGIN /** * AƱade las ventas que se realizaron entre 2 fechas a la tabla bs.sale @@ -10,63 +11,52 @@ BEGIN * @param vEnded Fecha de fin * */ - DECLARE vLoopDate DATE; - DECLARE vLoopDateTime DATETIME; - IF vStarted < (util.VN_CURDATE() - INTERVAL 5 YEAR) OR vStarted > vEnded THEN CALL util.throw('Wrong date'); END IF; - SET vLoopDate = vStarted; - DELETE FROM sale WHERE dated BETWEEN vStarted AND vEnded; - WHILE vLoopDate <= vEnded DO - SET vLoopDateTime = util.dayEnd(vLoopDate); - - REPLACE sale( - saleFk, - amount, - surcharge, - dated, - typeFk, - clientFk, - companyFk, - margin - )WITH calculatedSales AS( - SELECT s.id saleFk, - SUM(IF(ct.isBase, s.quantity * sc.value, 0)) amount, - SUM(IF(ct.isBase, 0, s.quantity * sc.value)) surcharge, - s.total pvp, - DATE(t.shipped) dated, - i.typeFk, - t.clientFk, - t.companyFk, - SUM(IF(ct.isMargin, s.quantity * sc.value, 0 )) marginComponents - FROM vn.ticket t - STRAIGHT_JOIN vn.sale s ON s.ticketFk = t.id - JOIN vn.item i ON i.id = s.itemFk - JOIN vn.itemType it ON it.id = i.typeFk - JOIN vn.itemCategory ic ON ic.id = it.categoryFk - JOIN vn.saleComponent sc ON sc.saleFk = s.id - JOIN vn.component c ON c.id = sc.componentFk - JOIN vn.componentType ct ON ct.id = c.typeFk - WHERE t.shipped BETWEEN vLoopDate AND vLoopDateTime - AND s.quantity <> 0 - AND ic.merchandise - GROUP BY s.id - )SELECT saleFk, - amount, - surcharge, - dated, - typeFk, - clientFk, - companyFk, - marginComponents + amount + surcharge - pvp - FROM calculatedSales; - - SET vLoopDate = vLoopDate + INTERVAL 1 DAY; - END WHILE; + REPLACE sale( + saleFk, + amount, + surcharge, + dated, + typeFk, + clientFk, + companyFk, + margin + )WITH calculatedSales AS( + SELECT s.id saleFk, + CAST(SUM(IF(ct.isBase, s.quantity * sc.value, 0)) AS DECIMAL(10, 3)) amount, + CAST(SUM(IF(ct.isBase, 0, s.quantity * sc.value)) AS DECIMAL(10, 3)) surcharge, + s.total, + DATE(t.shipped) dated, + i.typeFk, + t.clientFk, + t.companyFk, + CAST(SUM(IF(ct.isMargin, s.quantity * sc.value, 0 )) AS DECIMAL(10, 3)) marginComponents + FROM vn.ticket t + STRAIGHT_JOIN vn.sale s ON s.ticketFk = t.id + JOIN vn.item i ON i.id = s.itemFk + JOIN vn.itemType it ON it.id = i.typeFk + JOIN vn.itemCategory ic ON ic.id = it.categoryFk + JOIN vn.saleComponent sc ON sc.saleFk = s.id + JOIN vn.component c ON c.id = sc.componentFk + JOIN vn.componentType ct ON ct.id = c.typeFk + WHERE t.shipped BETWEEN vStarted AND vEnded + AND s.quantity <> 0 + AND ic.merchandise + GROUP BY s.id + )SELECT saleFk, + amount, + surcharge, + dated, + typeFk, + clientFk, + companyFk, + IF (marginComponents IS NULL, 0, CAST(marginComponents + amount + surcharge - total AS DECIMAL(10, 3))) + FROM calculatedSales; END$$ DELIMITER ; -- 2.40.1 From adaba6ecfb6eb4c3c7a6d47b15ad10cfda33140d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Andr=C3=A9s?= Date: Tue, 14 May 2024 15:39:28 +0200 Subject: [PATCH 5/5] refs #6974 refactor: optimize sale_add --- db/routines/bs/procedures/sale_add.sql | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/db/routines/bs/procedures/sale_add.sql b/db/routines/bs/procedures/sale_add.sql index 823ece079..c50d27b81 100644 --- a/db/routines/bs/procedures/sale_add.sql +++ b/db/routines/bs/procedures/sale_add.sql @@ -56,7 +56,9 @@ BEGIN typeFk, clientFk, companyFk, - IF (marginComponents IS NULL, 0, CAST(marginComponents + amount + surcharge - total AS DECIMAL(10, 3))) + IF (marginComponents IS NULL, + 0, + CAST(marginComponents + amount + surcharge - total AS DECIMAL(10, 3))) FROM calculatedSales; END$$ DELIMITER ; -- 2.40.1