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' } diff --git a/db/routines/bs/procedures/sale_add.sql b/db/routines/bs/procedures/sale_add.sql index 64beb4776..c50d27b81 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,54 @@ 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 ; 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; 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'));