From 65fd5e2c8f22ac2114ef61a10c202da9620f32a1 Mon Sep 17 00:00:00 2001 From: Pau Navarro Date: Fri, 18 Nov 2022 08:51:17 +0100 Subject: [PATCH 01/36] Possible change? --- modules/route/back/methods/route/getTickets.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/route/back/methods/route/getTickets.js b/modules/route/back/methods/route/getTickets.js index 18e5abaf2..72df91158 100644 --- a/modules/route/back/methods/route/getTickets.js +++ b/modules/route/back/methods/route/getTickets.js @@ -32,7 +32,7 @@ module.exports = Self => { Object.assign(myOptions, options); const stmt = new ParameterizedSQL( - `SELECT + `SELECT DISTINCT t.id, t.packages, t.warehouseFk, From 0f17c082a317bb66341d4194966ee0a19f592ef5 Mon Sep 17 00:00:00 2001 From: Pau Navarro Date: Fri, 18 Nov 2022 12:07:33 +0100 Subject: [PATCH 02/36] refs #4557 @1h left join note only delivery --- modules/route/back/methods/route/getTickets.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/route/back/methods/route/getTickets.js b/modules/route/back/methods/route/getTickets.js index 72df91158..81b4c5781 100644 --- a/modules/route/back/methods/route/getTickets.js +++ b/modules/route/back/methods/route/getTickets.js @@ -32,7 +32,7 @@ module.exports = Self => { Object.assign(myOptions, options); const stmt = new ParameterizedSQL( - `SELECT DISTINCT + `SELECT t.id, t.packages, t.warehouseFk, @@ -56,7 +56,7 @@ module.exports = Self => { LEFT JOIN ticketState ts ON ts.ticketFk = t.id LEFT JOIN state st ON st.id = ts.stateFk LEFT JOIN warehouse wh ON wh.id = t.warehouseFk - LEFT JOIN ticketObservation tob ON tob.ticketFk = t.id + LEFT JOIN ticketObservation tob ON tob.ticketFk = t.id AND tob.observationTypeFk = 3 LEFT JOIN observationType ot ON tob.observationTypeFk = ot.id AND ot.code = 'delivery' LEFT JOIN address a ON a.id = t.addressFk From e854fd248e4ccf9432243b0650a671f44142b4ab Mon Sep 17 00:00:00 2001 From: vicent Date: Wed, 23 Nov 2022 10:08:58 +0100 Subject: [PATCH 03/36] feat: add checkInBox --- .../worker-time-control-mail/checkInbox.js | 181 ++++++++++++++++++ .../back/models/worker-time-control-mail.js | 3 + 2 files changed, 184 insertions(+) create mode 100644 modules/worker/back/methods/worker-time-control-mail/checkInbox.js create mode 100644 modules/worker/back/models/worker-time-control-mail.js diff --git a/modules/worker/back/methods/worker-time-control-mail/checkInbox.js b/modules/worker/back/methods/worker-time-control-mail/checkInbox.js new file mode 100644 index 000000000..7825f38b8 --- /dev/null +++ b/modules/worker/back/methods/worker-time-control-mail/checkInbox.js @@ -0,0 +1,181 @@ +const Imap = require('imap'); +module.exports = Self => { + Self.remoteMethod('checkInbox', { + description: 'Check an email inbox and process it', + accessType: 'READ', + returns: + { + arg: 'body', + type: 'file', + root: true + }, + http: { + path: `/checkInbox`, + verb: 'POST' + } + }); + + Self.checkInbox = async() => { + let imapConfig = await Self.app.models.WorkerTimeControlParams.findOne(); + let imap = new Imap({ + user: imapConfig.mailUser, + password: imapConfig.mailPass, + host: imapConfig.mailHost, + port: 993, + tls: true + }); + let isEmailOk; + let uid; + let emailBody; + + function openInbox(cb) { + imap.openBox('INBOX', true, cb); + } + + imap.once('ready', function() { + openInbox(function(err, box) { + if (err) throw err; + const totalMessages = box.messages.total; + if (totalMessages == 0) + imap.end(); + + let f = imap.seq.fetch('1:*', { + bodies: ['HEADER.FIELDS (FROM SUBJECT)', '1'], + struct: true + }); + f.on('message', function(msg, seqno) { + isEmailOk = false; + msg.on('body', function(stream, info) { + let buffer = ''; + let bufferCopy = ''; + stream.on('data', function(chunk) { + buffer = chunk.toString('utf8'); + if (info.which === '1' && bufferCopy.length == 0) + bufferCopy = buffer.replace(/\s/g, ' '); + }); + stream.on('end', function() { + if (bufferCopy.length > 0) { + emailBody = bufferCopy.toUpperCase().trim(); + + const bodyPositionOK = emailBody.match(/\bOK\b/i); + if (bodyPositionOK != null && (bodyPositionOK.index == 0 || bodyPositionOK.index == 122)) + isEmailOk = true; + else + isEmailOk = false; + } + }); + msg.once('attributes', function(attrs) { + uid = attrs.uid; + }); + msg.once('end', function() { + if (info.which === 'HEADER.FIELDS (FROM SUBJECT)') { + if (isEmailOk) { + imap.move(uid, 'exito', function(err) { + }); + emailConfirm(buffer); + } else { + imap.move(uid, 'error', function(err) { + }); + emailReply(buffer, emailBody); + } + } + }); + }); + }); + f.once('end', function() { + imap.end(); + }); + }); + }); + + imap.connect(); + return 'Leer emails de gestion horaria'; + }; + + async function emailConfirm(buffer) { + const now = new Date(); + const from = JSON.stringify(Imap.parseHeader(buffer).from); + const subject = JSON.stringify(Imap.parseHeader(buffer).subject); + + const timeControlDate = await getEmailDate(subject); + const week = timeControlDate[0]; + const year = timeControlDate[1]; + const user = await getUser(from); + let workerMail; + + if (user.id != null) { + workerMail = await Self.app.models.WorkerTimeControlMail.findOne({ + where: { + week: week, + year: year, + workerFk: user.id + } + }); + } + if (workerMail != null) { + await workerMail.updateAttributes({ + updated: now, + state: 'CONFIRMED' + }); + } + } + + async function emailReply(buffer, emailBody) { + const now = new Date(); + const from = JSON.stringify(Imap.parseHeader(buffer).from); + const subject = JSON.stringify(Imap.parseHeader(buffer).subject); + + const timeControlDate = await getEmailDate(subject); + const week = timeControlDate[0]; + const year = timeControlDate[1]; + const user = await getUser(from); + let workerMail; + + if (user.id != null) { + workerMail = await Self.app.models.WorkerTimeControlMail.findOne({ + where: { + week: week, + year: year, + workerFk: user.id + } + }); + + if (workerMail != null) { + await workerMail.updateAttributes({ + updated: now, + state: 'REVISE', + reason: emailBody + }); + } else + await sendMail(user, subject, emailBody); + } + } + + async function getUser(workerEmail) { + const userEmail = workerEmail.match(/(?<=<)(.*?)(?=>)/); + + let [user] = await Self.rawSql(`SELECT u.id,u.name FROM account.user u + LEFT JOIN account.mailForward m on m.account = u.id + WHERE forwardTo =? OR + CONCAT(u.name,'@verdnatura.es') = ?`, + [userEmail[0], userEmail[0]]); + + return user; + } + + async function getEmailDate(subject) { + const date = subject.match(/\d+/g); + return date; + } + + async function sendMail(user, subject, emailBody) { + const sendTo = 'rrhh@verdnatura.es'; + const emailSubject = subject + ' ' + user.name; + + await Self.app.models.Mail.create({ + receiver: sendTo, + subject: emailSubject, + body: emailBody + }); + } +}; diff --git a/modules/worker/back/models/worker-time-control-mail.js b/modules/worker/back/models/worker-time-control-mail.js new file mode 100644 index 000000000..36f3851b6 --- /dev/null +++ b/modules/worker/back/models/worker-time-control-mail.js @@ -0,0 +1,3 @@ +module.exports = Self => { + require('../methods/worker-time-control-mail/checkInbox')(Self); +}; From bf782c378273c97314763d8d0c48e31f763b52b4 Mon Sep 17 00:00:00 2001 From: vicent Date: Wed, 23 Nov 2022 10:09:09 +0100 Subject: [PATCH 04/36] =?UTF-8?q?fix:=20a=C3=B1adido=20esquema=20account?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/worker/back/methods/worker-time-control/sendMail.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/worker/back/methods/worker-time-control/sendMail.js b/modules/worker/back/methods/worker-time-control/sendMail.js index 2f9559b3a..cd9cacbd7 100644 --- a/modules/worker/back/methods/worker-time-control/sendMail.js +++ b/modules/worker/back/methods/worker-time-control/sendMail.js @@ -133,7 +133,7 @@ module.exports = Self => { tb.permissionRate, d.isTeleworking FROM tmp.timeBusinessCalculate tb - JOIN user u ON u.id = tb.userFk + JOIN account.user u ON u.id = tb.userFk JOIN department d ON d.id = tb.departmentFk JOIN business b ON b.id = tb.businessFk LEFT JOIN tmp.timeControlCalculate tc ON tc.userFk = tb.userFk AND tc.dated = tb.dated @@ -143,7 +143,7 @@ module.exports = Self => { IF(tc.timeWorkDecimal > 0, FALSE, IF(tb.timeWorkDecimal > 0, TRUE, FALSE)), TRUE))isTeleworkingWeek FROM tmp.timeBusinessCalculate tb - LEFT JOIN tmp.timeControlCalculate tc ON tc.userFk = tb.userFk + LEFT JOIN tmp.timeControlCalculate tc ON tc.userFk = tb.userFk AND tc.dated = tb.dated GROUP BY tb.userFk HAVING isTeleworkingWeek > 0 From 37a7a12f8759bf03cd23d3524dbc737eb803f39c Mon Sep 17 00:00:00 2001 From: Pau Navarro Date: Thu, 24 Nov 2022 11:47:32 +0100 Subject: [PATCH 05/36] requested change --- .../route/back/methods/route/getTickets.js | 61 ++++++++++--------- 1 file changed, 31 insertions(+), 30 deletions(-) diff --git a/modules/route/back/methods/route/getTickets.js b/modules/route/back/methods/route/getTickets.js index 81b4c5781..a72868120 100644 --- a/modules/route/back/methods/route/getTickets.js +++ b/modules/route/back/methods/route/getTickets.js @@ -33,36 +33,37 @@ module.exports = Self => { const stmt = new ParameterizedSQL( `SELECT - t.id, - t.packages, - t.warehouseFk, - t.nickname, - t.clientFk, - t.priority, - t.addressFk, - st.code AS ticketStateCode, - st.name AS ticketStateName, - wh.name AS warehouseName, - tob.description AS ticketObservation, - a.street, - a.postalCode, - a.city, - am.name AS agencyModeName, - u.nickname AS userNickname, - vn.ticketTotalVolume(t.id) AS volume, - tob.description - FROM route r - JOIN ticket t ON t.routeFk = r.id - LEFT JOIN ticketState ts ON ts.ticketFk = t.id - LEFT JOIN state st ON st.id = ts.stateFk - LEFT JOIN warehouse wh ON wh.id = t.warehouseFk - LEFT JOIN ticketObservation tob ON tob.ticketFk = t.id AND tob.observationTypeFk = 3 - LEFT JOIN observationType ot ON tob.observationTypeFk = ot.id - AND ot.code = 'delivery' - LEFT JOIN address a ON a.id = t.addressFk - LEFT JOIN agencyMode am ON am.id = t.agencyModeFk - LEFT JOIN account.user u ON u.id = r.workerFk - LEFT JOIN vehicle v ON v.id = r.vehicleFk` + t.id, + t.packages, + t.warehouseFk, + t.nickname, + t.clientFk, + t.priority, + t.addressFk, + st.code AS ticketStateCode, + st.name AS ticketStateName, + wh.name AS warehouseName, + tob.description AS ticketObservation, + a.street, + a.postalCode, + a.city, + am.name AS agencyModeName, + u.nickname AS userNickname, + vn.ticketTotalVolume(t.id) AS volume, + tob.description + FROM vn.route r + JOIN ticket t ON t.routeFk = r.id + LEFT JOIN ticketState ts ON ts.ticketFk = t.id + LEFT JOIN state st ON st.id = ts.stateFk + LEFT JOIN warehouse wh ON wh.id = t.warehouseFk + LEFT JOIN ticketObservation tob ON tob.ticketFk = t.id + AND tob.observationTypeFk = (SELECT ot2.id from vn.observationType ot2 WHERE ot2.code = 'delivery') + LEFT JOIN observationType ot ON tob.observationTypeFk = ot.id + AND ot.code = 'delivery' + LEFT JOIN address a ON a.id = t.addressFk + LEFT JOIN agencyMode am ON am.id = t.agencyModeFk + LEFT JOIN account.user u ON u.id = r.workerFk + LEFT JOIN vehicle v ON v.id = r.vehicleFk` ); if (!filter.where) filter.where = {}; From 001c3ec2ace757f911ec495cfbbe6412ed29e9a1 Mon Sep 17 00:00:00 2001 From: Pau Navarro Date: Thu, 24 Nov 2022 12:06:13 +0100 Subject: [PATCH 06/36] requested changes --- modules/route/back/methods/route/getTickets.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/route/back/methods/route/getTickets.js b/modules/route/back/methods/route/getTickets.js index a72868120..708644c1a 100644 --- a/modules/route/back/methods/route/getTickets.js +++ b/modules/route/back/methods/route/getTickets.js @@ -56,10 +56,9 @@ module.exports = Self => { LEFT JOIN ticketState ts ON ts.ticketFk = t.id LEFT JOIN state st ON st.id = ts.stateFk LEFT JOIN warehouse wh ON wh.id = t.warehouseFk + LEFT JOIN observationType ot ON ot.code = 'delivery' LEFT JOIN ticketObservation tob ON tob.ticketFk = t.id - AND tob.observationTypeFk = (SELECT ot2.id from vn.observationType ot2 WHERE ot2.code = 'delivery') - LEFT JOIN observationType ot ON tob.observationTypeFk = ot.id - AND ot.code = 'delivery' + AND tob.observationTypeFk = ot.id LEFT JOIN address a ON a.id = t.addressFk LEFT JOIN agencyMode am ON am.id = t.agencyModeFk LEFT JOIN account.user u ON u.id = r.workerFk From d58e56729583c9fe21af64d36b4be722c6ac7530 Mon Sep 17 00:00:00 2001 From: vicent Date: Mon, 28 Nov 2022 08:51:04 +0100 Subject: [PATCH 07/36] fix: maneja si el dms no tiene file. Simplemente borra el registro --- back/methods/dms/deleteTrashFiles.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/back/methods/dms/deleteTrashFiles.js b/back/methods/dms/deleteTrashFiles.js index 63d7021c5..f14e65e9f 100644 --- a/back/methods/dms/deleteTrashFiles.js +++ b/back/methods/dms/deleteTrashFiles.js @@ -51,7 +51,7 @@ module.exports = Self => { const dstFile = path.join(dmsContainer.client.root, pathHash, dms.file); await fs.unlink(dstFile); } catch (err) { - if (err.code != 'ENOENT') + if (err.code != 'ENOENT' && dms.file) throw err; } From 0d6e424a3e8bce45439e2b590e5d615d81bef649 Mon Sep 17 00:00:00 2001 From: Pau Navarro Date: Mon, 28 Nov 2022 10:21:01 +0100 Subject: [PATCH 08/36] allow client search by socialname --- modules/client/back/methods/client/filter.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/client/back/methods/client/filter.js b/modules/client/back/methods/client/filter.js index 3e1ea43bb..6a545b594 100644 --- a/modules/client/back/methods/client/filter.js +++ b/modules/client/back/methods/client/filter.js @@ -91,7 +91,10 @@ module.exports = Self => { case 'search': return /^\d+$/.test(value) ? {'c.id': {inq: value}} - : {'c.name': {like: `%${value}%`}}; + : {or: [ + {'c.name': {like: `%${value}%`}}, + {'c.socialName': {like: `%${value}%`}}, + ]}; case 'name': case 'salesPersonFk': case 'fi': From c3d06ca5dbec264bac18adbaa6af1534aa9adbf9 Mon Sep 17 00:00:00 2001 From: vicent Date: Mon, 28 Nov 2022 14:47:23 +0100 Subject: [PATCH 10/36] fix: crashea cuando el log no tiene changedModel --- front/salix/components/log/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/front/salix/components/log/index.js b/front/salix/components/log/index.js index 2796931a0..fda465ae4 100644 --- a/front/salix/components/log/index.js +++ b/front/salix/components/log/index.js @@ -34,10 +34,11 @@ export default class Controller extends Section { set logs(value) { this._logs = value; if (!value) return; - + console.log(value); const validations = window.validations; value.forEach(log => { - const locale = validations[log.changedModel].locale ? validations[log.changedModel].locale : {}; + console.log(log.changedModel); + const locale = validations[log.changedModel] && validations[log.changedModel].locale ? validations[log.changedModel].locale : {}; log.oldProperties = this.getInstance(log.oldInstance, locale); log.newProperties = this.getInstance(log.newInstance, locale); From a0f5cf14499cca2c81510ddd7cc033160d3e5f4c Mon Sep 17 00:00:00 2001 From: vicent Date: Mon, 28 Nov 2022 14:48:37 +0100 Subject: [PATCH 11/36] refactor: borrados saltos de linea --- front/salix/components/log/index.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/front/salix/components/log/index.js b/front/salix/components/log/index.js index fda465ae4..f30878b9f 100644 --- a/front/salix/components/log/index.js +++ b/front/salix/components/log/index.js @@ -34,10 +34,9 @@ export default class Controller extends Section { set logs(value) { this._logs = value; if (!value) return; - console.log(value); + const validations = window.validations; value.forEach(log => { - console.log(log.changedModel); const locale = validations[log.changedModel] && validations[log.changedModel].locale ? validations[log.changedModel].locale : {}; log.oldProperties = this.getInstance(log.oldInstance, locale); From 8a0c810a8437ea5317ab4b50cf02e25bde14cb03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Andr=C3=A9s?= Date: Mon, 28 Nov 2022 17:45:19 +0100 Subject: [PATCH 12/36] refs #4613 --- db/dump/fixtures.sql | 4 ---- 1 file changed, 4 deletions(-) diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql index f0cbf880e..92b84be43 100644 --- a/db/dump/fixtures.sql +++ b/db/dump/fixtures.sql @@ -2564,10 +2564,6 @@ UPDATE `vn`.`route` UPDATE `vn`.`route` SET `invoiceInFk`=2 WHERE `id`=2; -INSERT INTO `bs`.`salesPerson` (`workerFk`, `year`, `month`) - VALUES - (18, YEAR(util.VN_CURDATE()), MONTH(util.VN_CURDATE())), - (19, YEAR(util.VN_CURDATE()), MONTH(util.VN_CURDATE())); INSERT INTO `bs`.`sale` (`saleFk`, `amount`, `dated`, `typeFk`, `clientFk`) VALUES From b262b29627cd0b481b4c8529d6242928f4473589 Mon Sep 17 00:00:00 2001 From: guillermo Date: Tue, 29 Nov 2022 08:22:32 +0100 Subject: [PATCH 13/36] refs #4550 collection-label fixes --- .../collection-label/assets/css/style.css | 3 +- .../collection-label/collection-label.html | 67 +++++++++---------- .../collection-label/collection-label.js | 2 +- .../reports/collection-label/options.json | 4 +- .../collection-label/sql/labelsData.sql | 6 +- 5 files changed, 40 insertions(+), 42 deletions(-) diff --git a/print/templates/reports/collection-label/assets/css/style.css b/print/templates/reports/collection-label/assets/css/style.css index fe1975445..ad80af5bf 100644 --- a/print/templates/reports/collection-label/assets/css/style.css +++ b/print/templates/reports/collection-label/assets/css/style.css @@ -1,6 +1,6 @@ html { font-family: "Roboto"; - margin-top: -7px; + margin-top: -6px; } * { box-sizing: border-box; @@ -18,6 +18,7 @@ html { } #nickname { font-size: 22px; + max-width: 50px; } #agencyDescripton { font-size: 32px; diff --git a/print/templates/reports/collection-label/collection-label.html b/print/templates/reports/collection-label/collection-label.html index eeb82ac4a..8d7cc3655 100644 --- a/print/templates/reports/collection-label/collection-label.html +++ b/print/templates/reports/collection-label/collection-label.html @@ -1,35 +1,32 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{{labelData.levelV}}{{labelData.ticketFk}} ⬸ {{labelData.clientFk}}{{labelData.shipped}}
{{labelData.workerCode}}
{{labelData.labelCount}}
{{labelData.size}}
{{labelData.agencyDescription}}
{{labelData.lineCount}}
{{labelData.nickName}}{{labelData.agencyHour}}
- -
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{{labelData.levelV}}{{labelData.ticketFk}} / {{labelData.clientFk}}{{labelData.shipped}}
{{labelData.workerCode}}
{{labelData.labelCount}}
{{labelData.value}}
{{labelData.agencyDescription}}
{{labelData.lineCount}}
{{labelData.nickName}}{{labelData.agencyHour}}
+ + \ No newline at end of file diff --git a/print/templates/reports/collection-label/collection-label.js b/print/templates/reports/collection-label/collection-label.js index 7bc25ad79..d2d5f6417 100644 --- a/print/templates/reports/collection-label/collection-label.js +++ b/print/templates/reports/collection-label/collection-label.js @@ -40,7 +40,7 @@ module.exports = { format: 'code128', displayValue: false, width: 3.8, - height: 110, + height: 115, }); return xmlSerializer.serializeToString(svgNode); }, diff --git a/print/templates/reports/collection-label/options.json b/print/templates/reports/collection-label/options.json index 175b3c1db..f6e68a5ea 100644 --- a/print/templates/reports/collection-label/options.json +++ b/print/templates/reports/collection-label/options.json @@ -2,8 +2,8 @@ "width": "10.4cm", "height": "4.8cm", "margin": { - "top": "0cm", - "right": "0.5cm", + "top": "0.2cm", + "right": "0.6cm", "bottom": "0cm", "left": "0cm" }, diff --git a/print/templates/reports/collection-label/sql/labelsData.sql b/print/templates/reports/collection-label/sql/labelsData.sql index 6f5b47a54..1a2977f74 100644 --- a/print/templates/reports/collection-label/sql/labelsData.sql +++ b/print/templates/reports/collection-label/sql/labelsData.sql @@ -1,18 +1,18 @@ SELECT c.itemPackingTypeFk, CONCAT(tc.collectionFk, ' ', LEFT(cc.code, 4)) color, - CONCAT(tc.collectionFk, ' ', SUBSTRING('ABCDEFGH',tc.wagon, 1), '-', tc.`level`) levelV, + CONCAT(tc.collectionFk, ' ', SUBSTRING('ABCDEFGH', tc.wagon, 1), '-', tc.`level`) levelV, tc.ticketFk, LEFT(COALESCE(et.description, zo.name, am.name),12) agencyDescription, am.name, t.clientFk, CONCAT(CAST(SUM(sv.volume) AS DECIMAL(5, 2)), 'm³') m3 , - CAST(IF(ic.code = 'plant', CONCAT(MAX(i.`size`),' cm'), COUNT(*)) AS CHAR) size, + IF(ic.code = 'plant', CONCAT(MAX(i.`size`),' cm'), CONCAT(CAST(SUM(sv.volume) AS DECIMAL(5, 2)), 'm³')) `value`, w.code workerCode, tt.labelCount, IF(HOUR(t.shipped), TIME_FORMAT(t.shipped, '%H:%i'), TIME_FORMAT(zo.`hour`, '%H:%i')) agencyHour, DATE_FORMAT(t.shipped, '%d/%m/%y') shipped, COUNT(*) lineCount, - t.nickName + LEFT(t.nickName, 29) nickName FROM vn.ticket t JOIN vn.ticketCollection tc ON tc.ticketFk = t.id JOIN vn.collection c ON c.id = tc.collectionFk From 2faacb169ae9ca5add85a6737a2d8b3af2cfad2a Mon Sep 17 00:00:00 2001 From: guillermo Date: Tue, 29 Nov 2022 11:56:05 +0100 Subject: [PATCH 14/36] refs #4550 collection-label more fixes --- print/common/css/misc.css | 6 ++++ .../collection-label/assets/css/style.css | 2 +- .../collection-label/collection-label.html | 24 ++++++++------ .../reports/collection-label/options.json | 2 +- .../collection-label/sql/labelsData.sql | 32 ++++++++++--------- 5 files changed, 39 insertions(+), 27 deletions(-) diff --git a/print/common/css/misc.css b/print/common/css/misc.css index df8bf571a..ce6c641a0 100644 --- a/print/common/css/misc.css +++ b/print/common/css/misc.css @@ -49,4 +49,10 @@ .page-break-after { page-break-after: always; +} + +.ellipsize { + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden; } \ No newline at end of file diff --git a/print/templates/reports/collection-label/assets/css/style.css b/print/templates/reports/collection-label/assets/css/style.css index ad80af5bf..597921c92 100644 --- a/print/templates/reports/collection-label/assets/css/style.css +++ b/print/templates/reports/collection-label/assets/css/style.css @@ -9,7 +9,7 @@ html { } #vertical { writing-mode: vertical-rl; - height: 226px; + height: 240px; margin-left: -13px; } .outline { diff --git a/print/templates/reports/collection-label/collection-label.html b/print/templates/reports/collection-label/collection-label.html index 8d7cc3655..6716d1fe5 100644 --- a/print/templates/reports/collection-label/collection-label.html +++ b/print/templates/reports/collection-label/collection-label.html @@ -4,27 +4,31 @@ - - - + + + - + - + - + - - + + - - + +
{{labelData.levelV}}{{labelData.ticketFk}} / {{labelData.clientFk}}{{labelData.shipped}} + {{labelData.collectionFk ? `${labelData.collectionFk} ~ ${labelData.wagon}-${labelData.level}` : '-'.repeat(23)}} + + {{labelData.clientFk ? `${labelData.ticketFk} « ${labelData.clientFk}` : labelData.ticketFk}} + {{labelData.shipped ? labelData.shipped : '---'}}
{{labelData.workerCode}}{{labelData.workerCode ? labelData.workerCode : '---'}}
{{labelData.labelCount}}{{labelData.labelCount ? labelData.labelCount : 0}}
{{labelData.value}}{{labelData.code == 'plant' ? labelData.size + 'cm' : labelData.volume + 'm³'}}
{{labelData.agencyDescription}}
{{labelData.lineCount}}
{{labelData.agencyDescription}}
{{labelData.lineCount ? labelData.lineCount : 0}}
{{labelData.nickName}}{{labelData.agencyHour}}{{labelData.nickName ? labelData.nickName : '---'}}{{labelData.shipped ? labelData.shippedHour : labelData.zoneHour}}
diff --git a/print/templates/reports/collection-label/options.json b/print/templates/reports/collection-label/options.json index f6e68a5ea..ae88e6c0c 100644 --- a/print/templates/reports/collection-label/options.json +++ b/print/templates/reports/collection-label/options.json @@ -2,7 +2,7 @@ "width": "10.4cm", "height": "4.8cm", "margin": { - "top": "0.2cm", + "top": "0.3cm", "right": "0.6cm", "bottom": "0cm", "left": "0cm" diff --git a/print/templates/reports/collection-label/sql/labelsData.sql b/print/templates/reports/collection-label/sql/labelsData.sql index 1a2977f74..b799b289b 100644 --- a/print/templates/reports/collection-label/sql/labelsData.sql +++ b/print/templates/reports/collection-label/sql/labelsData.sql @@ -1,21 +1,23 @@ -SELECT c.itemPackingTypeFk, - CONCAT(tc.collectionFk, ' ', LEFT(cc.code, 4)) color, - CONCAT(tc.collectionFk, ' ', SUBSTRING('ABCDEFGH', tc.wagon, 1), '-', tc.`level`) levelV, - tc.ticketFk, - LEFT(COALESCE(et.description, zo.name, am.name),12) agencyDescription, +SELECT tc.collectionFk, + SUBSTRING('ABCDEFGH', tc.wagon, 1) wagon, + tc.`level`, + t.id ticketFk, + COALESCE(et.description, zo.name, am.name) agencyDescription, am.name, t.clientFk, - CONCAT(CAST(SUM(sv.volume) AS DECIMAL(5, 2)), 'm³') m3 , - IF(ic.code = 'plant', CONCAT(MAX(i.`size`),' cm'), CONCAT(CAST(SUM(sv.volume) AS DECIMAL(5, 2)), 'm³')) `value`, + CAST(SUM(sv.volume) AS DECIMAL(5, 2)) volume, + MAX(i.`size`) `size`, + ic.code, w.code workerCode, - tt.labelCount, - IF(HOUR(t.shipped), TIME_FORMAT(t.shipped, '%H:%i'), TIME_FORMAT(zo.`hour`, '%H:%i')) agencyHour, + TIME_FORMAT(t.shipped, '%H:%i') shippedHour, + TIME_FORMAT(zo.`hour`, '%H:%i') zoneHour, DATE_FORMAT(t.shipped, '%d/%m/%y') shipped, - COUNT(*) lineCount, - LEFT(t.nickName, 29) nickName + t.nickName, + tt.labelCount, + COUNT(*) lineCount FROM vn.ticket t - JOIN vn.ticketCollection tc ON tc.ticketFk = t.id - JOIN vn.collection c ON c.id = tc.collectionFk + LEFT JOIN vn.ticketCollection tc ON tc.ticketFk = t.id + LEFT JOIN vn.collection c ON c.id = tc.collectionFk LEFT JOIN vn.collectionColors cc ON cc.shelve = tc.`level` AND cc.wagon = tc.wagon AND cc.trainFk = c.trainFk @@ -24,12 +26,12 @@ SELECT c.itemPackingTypeFk, 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.worker w ON w.id = c.workerFk + LEFT JOIN vn.worker w ON w.id = c.workerFk JOIN vn.agencyMode am ON am.id = t.agencyModeFk LEFT JOIN vn.ticketTrolley tt ON tt.ticket = t.id LEFT JOIN vn.`zone` zo ON t.zoneFk = zo.id LEFT JOIN vn.routesMonitor rm ON rm.routeFk = t.routeFk LEFT JOIN vn.expeditionTruck et ON et.id = rm.expeditionTruckFk - WHERE tc.ticketFk IN (?) + WHERE t.id IN (?) GROUP BY t.id ORDER BY cc.`code`; \ No newline at end of file From b7fa4dca4c450b47a65c886c2797e50963fa8797 Mon Sep 17 00:00:00 2001 From: guillermo Date: Tue, 29 Nov 2022 14:16:44 +0100 Subject: [PATCH 15/36] refs #4550 changed font-family of collection-label --- .../templates/reports/collection-label/assets/css/style.css | 3 ++- .../reports/collection-label/collection-label.html | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/print/templates/reports/collection-label/assets/css/style.css b/print/templates/reports/collection-label/assets/css/style.css index 597921c92..f62d35c97 100644 --- a/print/templates/reports/collection-label/assets/css/style.css +++ b/print/templates/reports/collection-label/assets/css/style.css @@ -1,5 +1,5 @@ html { - font-family: "Roboto"; + font-family: Arial, Helvetica, sans-serif; margin-top: -6px; } * { @@ -15,6 +15,7 @@ html { .outline { border: 1px solid black; padding: 5px; + height: 37px; } #nickname { font-size: 22px; diff --git a/print/templates/reports/collection-label/collection-label.html b/print/templates/reports/collection-label/collection-label.html index 6716d1fe5..c64c12aed 100644 --- a/print/templates/reports/collection-label/collection-label.html +++ b/print/templates/reports/collection-label/collection-label.html @@ -5,7 +5,7 @@ - {{labelData.collectionFk ? `${labelData.collectionFk} ~ ${labelData.wagon}-${labelData.level}` : '-'.repeat(23)}} + {{labelData.collectionFk ? `${labelData.collectionFk} ~ ${labelData.wagon}-${labelData.level}` : '-'.repeat(19)}} {{labelData.clientFk ? `${labelData.ticketFk} « ${labelData.clientFk}` : labelData.ticketFk}} @@ -23,11 +23,11 @@ {{labelData.code == 'plant' ? labelData.size + 'cm' : labelData.volume + 'm³'}} -
{{labelData.agencyDescription}}
+
{{labelData.agencyDescription.toUpperCase()}}
{{labelData.lineCount ? labelData.lineCount : 0}} - {{labelData.nickName ? labelData.nickName : '---'}} + {{labelData.nickName ? labelData.nickName.toUpperCase() : '---'}} {{labelData.shipped ? labelData.shippedHour : labelData.zoneHour}} From d0acd3e4c0eee2c8a55d50908fd14af3a6bb4cbd Mon Sep 17 00:00:00 2001 From: guillermo Date: Wed, 30 Nov 2022 08:18:37 +0100 Subject: [PATCH 16/36] refs #4550 collection-label changes --- .../collection-label/assets/css/style.css | 7 ++++--- .../collection-label/collection-label.html | 16 ++++++++-------- .../reports/collection-label/collection-label.js | 9 ++++++++- .../reports/collection-label/sql/labelsData.sql | 16 ++++++++-------- 4 files changed, 28 insertions(+), 20 deletions(-) diff --git a/print/templates/reports/collection-label/assets/css/style.css b/print/templates/reports/collection-label/assets/css/style.css index f62d35c97..f9ead378a 100644 --- a/print/templates/reports/collection-label/assets/css/style.css +++ b/print/templates/reports/collection-label/assets/css/style.css @@ -9,7 +9,8 @@ html { } #vertical { writing-mode: vertical-rl; - height: 240px; + height: 235px; + font-size: 30px; margin-left: -13px; } .outline { @@ -34,6 +35,6 @@ html { #shipped { font-weight: bold; } -#ticketFk, #vertical { - font-size: 34px; +#ticketFk { + font-size: 32px; } \ No newline at end of file diff --git a/print/templates/reports/collection-label/collection-label.html b/print/templates/reports/collection-label/collection-label.html index c64c12aed..de9e5fcc3 100644 --- a/print/templates/reports/collection-label/collection-label.html +++ b/print/templates/reports/collection-label/collection-label.html @@ -5,30 +5,30 @@ - {{labelData.collectionFk ? `${labelData.collectionFk} ~ ${labelData.wagon}-${labelData.level}` : '-'.repeat(19)}} + {{labelData.collectionFk ? `${labelData.collectionFk} ~ ${getVertical(labelData.code, labelData.wagon, labelData.level, labelData.color)}` : '-'.repeat(19)}} {{labelData.clientFk ? `${labelData.ticketFk} « ${labelData.clientFk}` : labelData.ticketFk}} - {{labelData.shipped ? labelData.shipped : '---'}} + {{labelData.shipped || '---'}}
- {{labelData.workerCode ? labelData.workerCode : '---'}} + {{labelData.workerCode || '---'}} - {{labelData.labelCount ? labelData.labelCount : 0}} + {{labelData.labelCount || 0}} - {{labelData.code == 'plant' ? labelData.size + 'cm' : labelData.volume + 'm³'}} + {{labelData.code == 'V' ? (labelData.size || 0) + 'cm' : (labelData.volume || 0) + 'm³'}} -
{{labelData.agencyDescription.toUpperCase()}}
- {{labelData.lineCount ? labelData.lineCount : 0}} +
{{labelData.agencyDescription ? labelData.agencyDescription.toUpperCase() : '---'}}
+ {{labelData.lineCount || 0}} {{labelData.nickName ? labelData.nickName.toUpperCase() : '---'}} - {{labelData.shipped ? labelData.shippedHour : labelData.zoneHour}} + {{labelData.shippedHour || labelData.zoneHour}} diff --git a/print/templates/reports/collection-label/collection-label.js b/print/templates/reports/collection-label/collection-label.js index d2d5f6417..93c13e49b 100644 --- a/print/templates/reports/collection-label/collection-label.js +++ b/print/templates/reports/collection-label/collection-label.js @@ -25,7 +25,6 @@ module.exports = { ticketIds = [this.id]; this.labelsData = await this.rawSqlFromDef('labelsData', [ticketIds]); - if (!this.labelsData.length) throw new UserError('Empty data source'); }, @@ -44,6 +43,14 @@ module.exports = { }); return xmlSerializer.serializeToString(svgNode); }, + getVertical(code, wagon, level, color) { + let value; + if (code == 'V') + value = `${wagon}-${level}`; + else + value = `${color.substring(0, 4)}`; + return value; + }, }, components: { 'report-body': reportBody.build() diff --git a/print/templates/reports/collection-label/sql/labelsData.sql b/print/templates/reports/collection-label/sql/labelsData.sql index b799b289b..d2dafea1d 100644 --- a/print/templates/reports/collection-label/sql/labelsData.sql +++ b/print/templates/reports/collection-label/sql/labelsData.sql @@ -1,13 +1,13 @@ -SELECT tc.collectionFk, +SELECT c.itemPackingTypeFk code, + tc.collectionFk, SUBSTRING('ABCDEFGH', tc.wagon, 1) wagon, tc.`level`, t.id ticketFk, COALESCE(et.description, zo.name, am.name) agencyDescription, - am.name, + cc.code color, t.clientFk, CAST(SUM(sv.volume) AS DECIMAL(5, 2)) volume, MAX(i.`size`) `size`, - ic.code, w.code workerCode, TIME_FORMAT(t.shipped, '%H:%i') shippedHour, TIME_FORMAT(zo.`hour`, '%H:%i') zoneHour, @@ -21,13 +21,13 @@ SELECT tc.collectionFk, LEFT JOIN vn.collectionColors cc ON cc.shelve = tc.`level` AND cc.wagon = tc.wagon AND cc.trainFk = c.trainFk - JOIN vn.sale s ON s.ticketFk = t.id + LEFT JOIN vn.sale s ON s.ticketFk = t.id LEFT JOIN vn.saleVolume sv ON sv.saleFk = s.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 + LEFT JOIN vn.item i ON i.id = s.itemFk + LEFT JOIN vn.itemType it ON it.id = i.typeFk + LEFT JOIN vn.itemCategory ic ON ic.id = it.categoryFk LEFT JOIN vn.worker w ON w.id = c.workerFk - JOIN vn.agencyMode am ON am.id = t.agencyModeFk + LEFT JOIN vn.agencyMode am ON am.id = t.agencyModeFk LEFT JOIN vn.ticketTrolley tt ON tt.ticket = t.id LEFT JOIN vn.`zone` zo ON t.zoneFk = zo.id LEFT JOIN vn.routesMonitor rm ON rm.routeFk = t.routeFk From 27078595ce1828356b5f34d50426212d84346722 Mon Sep 17 00:00:00 2001 From: alexandre Date: Wed, 30 Nov 2022 08:39:04 +0100 Subject: [PATCH 17/36] fix balances --- modules/client/back/methods/receipt/filter.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/client/back/methods/receipt/filter.js b/modules/client/back/methods/receipt/filter.js index 9549fb001..c4ebc6fcf 100644 --- a/modules/client/back/methods/receipt/filter.js +++ b/modules/client/back/methods/receipt/filter.js @@ -57,14 +57,16 @@ module.exports = Self => { r.clientFk, FALSE hasPdf, FALSE isInvoice, - CASE WHEN at2.code LIKE 'compensation' THEN True ELSE False END as isCompensation + at2.id IS NOT NULL as isCompensation FROM vn.receipt r LEFT JOIN vn.worker w ON w.id = r.workerFk LEFT JOIN account.user u ON u.id = w.userFk JOIN vn.company c ON c.id = r.companyFk - JOIN vn.accounting a ON a.id = r.bankFk - JOIN vn.accountingType at2 ON at2.id = a.accountingTypeFk - WHERE r.clientFk = ? AND r.companyFk = ? + LEFT JOIN vn.accounting a ON a.id = r.bankFk + LEFT JOIN vn.accountingType at2 ON at2.id = a.accountingTypeFk AND at2.code = 'compensation' + WHERE + r.clientFk = ? + AND r.companyFk = ? UNION ALL SELECT i.id, @@ -81,11 +83,9 @@ module.exports = Self => { i.clientFk, i.hasPdf, TRUE isInvoice, - CASE WHEN at2.code LIKE 'compensation' THEN True ELSE False END as isCompensation + NULL FROM vn.invoiceOut i JOIN vn.company c ON c.id = i.companyFk - JOIN vn.accounting a ON a.id = i.bankFk - JOIN vn.accountingType at2 ON at2.id = a.accountingTypeFk WHERE i.clientFk = ? AND i.companyFk = ? ORDER BY payed DESC, created DESC ) t ORDER BY payed DESC, created DESC`, From bef1071316e0f01327e0c28a4057bda7ab160373 Mon Sep 17 00:00:00 2001 From: Pau Navarro Date: Wed, 30 Nov 2022 09:22:03 +0100 Subject: [PATCH 18/36] refs #4914 @1h --- modules/client/back/methods/client/filter.js | 22 +++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/modules/client/back/methods/client/filter.js b/modules/client/back/methods/client/filter.js index 3e1ea43bb..1ae569fd3 100644 --- a/modules/client/back/methods/client/filter.js +++ b/modules/client/back/methods/client/filter.js @@ -91,7 +91,18 @@ module.exports = Self => { case 'search': return /^\d+$/.test(value) ? {'c.id': {inq: value}} - : {'c.name': {like: `%${value}%`}}; + : {or: [ + {'c.name': {like: `%${value}%`}}, + {'c.socialName': {like: `%${value}%`}}, + ]}; + case 'phone': + return {or: [ + {'c.phone': {like: `%${value}%`}}, + {'c.mobile': {like: `%${value}%`}}, + ]}; + case 'zoneFk': + param = 'a.postalCode'; + return {[param]: {inq: postalCode}}; case 'name': case 'salesPersonFk': case 'fi': @@ -100,12 +111,8 @@ module.exports = Self => { case 'postcode': case 'provinceFk': case 'email': - case 'phone': param = `c.${param}`; - return {[param]: value}; - case 'zoneFk': - param = 'a.postalCode'; - return {[param]: {inq: postalCode}}; + return {[param]: {like: `%${value}%`}}; } }); @@ -119,6 +126,7 @@ module.exports = Self => { c.fi, c.socialName, c.phone, + c.mobile, c.city, c.postcode, c.email, @@ -132,7 +140,7 @@ module.exports = Self => { LEFT JOIN account.user u ON u.id = c.salesPersonFk LEFT JOIN province p ON p.id = c.provinceFk JOIN vn.address a ON a.clientFk = c.id - ` + ` ); stmt.merge(conn.makeWhere(filter.where)); From 492b852be8597ca297dd205349515b290b937ab6 Mon Sep 17 00:00:00 2001 From: alexandre Date: Wed, 30 Nov 2022 09:22:53 +0100 Subject: [PATCH 19/36] delete orderBy --- modules/client/back/methods/receipt/filter.js | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/client/back/methods/receipt/filter.js b/modules/client/back/methods/receipt/filter.js index c4ebc6fcf..6df5e73f8 100644 --- a/modules/client/back/methods/receipt/filter.js +++ b/modules/client/back/methods/receipt/filter.js @@ -87,7 +87,6 @@ module.exports = Self => { FROM vn.invoiceOut i JOIN vn.company c ON c.id = i.companyFk WHERE i.clientFk = ? AND i.companyFk = ? - ORDER BY payed DESC, created DESC ) t ORDER BY payed DESC, created DESC`, [ clientId, From 497e3e54a2a171068543c3e91caadaf5db832fbc Mon Sep 17 00:00:00 2001 From: guillermo Date: Wed, 30 Nov 2022 10:52:52 +0100 Subject: [PATCH 20/36] refs #4550 changes --- .../collection-label/collection-label.html | 4 +--- .../reports/collection-label/collection-label.js | 15 ++++++++++----- .../reports/collection-label/sql/labelsData.sql | 16 ++++++++-------- 3 files changed, 19 insertions(+), 16 deletions(-) diff --git a/print/templates/reports/collection-label/collection-label.html b/print/templates/reports/collection-label/collection-label.html index de9e5fcc3..b7f783a88 100644 --- a/print/templates/reports/collection-label/collection-label.html +++ b/print/templates/reports/collection-label/collection-label.html @@ -4,9 +4,7 @@ - + diff --git a/print/templates/reports/collection-label/collection-label.js b/print/templates/reports/collection-label/collection-label.js index 93c13e49b..fd412791b 100644 --- a/print/templates/reports/collection-label/collection-label.js +++ b/print/templates/reports/collection-label/collection-label.js @@ -43,12 +43,17 @@ module.exports = { }); return xmlSerializer.serializeToString(svgNode); }, - getVertical(code, wagon, level, color) { + getVertical(labelData) { let value; - if (code == 'V') - value = `${wagon}-${level}`; - else - value = `${color.substring(0, 4)}`; + if (labelData.collectionFk) { + value = `${labelData.collectionFk} ~ `; + if (labelData.code == 'V') + value = value + `${labelData.wagon}-${labelData.level}`; + else + value = value + `${labelData.color.substring(0, 4)}`; + } else + value = '-'.repeat(19); + return value; }, }, diff --git a/print/templates/reports/collection-label/sql/labelsData.sql b/print/templates/reports/collection-label/sql/labelsData.sql index d2dafea1d..9afac79d0 100644 --- a/print/templates/reports/collection-label/sql/labelsData.sql +++ b/print/templates/reports/collection-label/sql/labelsData.sql @@ -16,18 +16,18 @@ SELECT c.itemPackingTypeFk code, tt.labelCount, COUNT(*) lineCount FROM vn.ticket t - LEFT JOIN vn.ticketCollection tc ON tc.ticketFk = t.id - LEFT JOIN vn.collection c ON c.id = tc.collectionFk + JOIN vn.ticketCollection tc ON tc.ticketFk = t.id + JOIN vn.collection c ON c.id = tc.collectionFk LEFT JOIN vn.collectionColors cc ON cc.shelve = tc.`level` AND cc.wagon = tc.wagon AND cc.trainFk = c.trainFk - LEFT JOIN vn.sale s ON s.ticketFk = t.id + JOIN vn.sale s ON s.ticketFk = t.id LEFT JOIN vn.saleVolume sv ON sv.saleFk = s.id - LEFT JOIN vn.item i ON i.id = s.itemFk - LEFT JOIN vn.itemType it ON it.id = i.typeFk - LEFT JOIN vn.itemCategory ic ON ic.id = it.categoryFk - LEFT JOIN vn.worker w ON w.id = c.workerFk - LEFT JOIN vn.agencyMode am ON am.id = t.agencyModeFk + 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.worker w ON w.id = c.workerFk + JOIN vn.agencyMode am ON am.id = t.agencyModeFk LEFT JOIN vn.ticketTrolley tt ON tt.ticket = t.id LEFT JOIN vn.`zone` zo ON t.zoneFk = zo.id LEFT JOIN vn.routesMonitor rm ON rm.routeFk = t.routeFk From 23f429d94a1c960d15ccac4d98eb1db06eea4046 Mon Sep 17 00:00:00 2001 From: guillermo Date: Wed, 30 Nov 2022 12:44:33 +0100 Subject: [PATCH 21/36] refs #4550 fixed no ellipsize in agencyDescription --- .../reports/collection-label/assets/css/style.css | 10 +++++++--- print/templates/reports/collection-label/options.json | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/print/templates/reports/collection-label/assets/css/style.css b/print/templates/reports/collection-label/assets/css/style.css index f9ead378a..f92d5bf1e 100644 --- a/print/templates/reports/collection-label/assets/css/style.css +++ b/print/templates/reports/collection-label/assets/css/style.css @@ -9,14 +9,15 @@ html { } #vertical { writing-mode: vertical-rl; - height: 235px; - font-size: 30px; + height: 230px; + font-size: 29px; margin-left: -13px; } .outline { border: 1px solid black; padding: 5px; height: 37px; + width: 100px; } #nickname { font-size: 22px; @@ -24,16 +25,19 @@ html { } #agencyDescripton { font-size: 32px; + width: 375px; font-weight: bold; } #bold { font-weight: bold; } #barcode{ - width: 390px; + width: 370px; } #shipped { font-weight: bold; + width: 50px; + max-width: 100px; } #ticketFk { font-size: 32px; diff --git a/print/templates/reports/collection-label/options.json b/print/templates/reports/collection-label/options.json index ae88e6c0c..a555c5723 100644 --- a/print/templates/reports/collection-label/options.json +++ b/print/templates/reports/collection-label/options.json @@ -1,6 +1,6 @@ { "width": "10.4cm", - "height": "4.8cm", + "height": "4.9cm", "margin": { "top": "0.3cm", "right": "0.6cm", From b769845a287f25e4c67b8c268e1a20eca429b2b2 Mon Sep 17 00:00:00 2001 From: alexm Date: Wed, 30 Nov 2022 14:29:44 +0100 Subject: [PATCH 22/36] hotFix: not transfer all sales if all sales is negatives --- modules/ticket/back/methods/ticket/componentUpdate.js | 4 +++- modules/ticket/front/basic-data/step-two/index.js | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/ticket/back/methods/ticket/componentUpdate.js b/modules/ticket/back/methods/ticket/componentUpdate.js index baa6a0b41..e33428bf0 100644 --- a/modules/ticket/back/methods/ticket/componentUpdate.js +++ b/modules/ticket/back/methods/ticket/componentUpdate.js @@ -137,9 +137,11 @@ module.exports = Self => { const params = [args.id, args.shipped, args.warehouseFk]; const [salesMovable] = await Self.rawSql(query, params, myOptions); + const sales = await models.Sale.find({ticketFk: args.id}, myOptions); const salesNewTicket = salesMovable.filter(sale => (sale.movable ? sale.movable : 0) >= sale.quantity); - if (salesNewTicket.length) { + const salesNewTicketLength = salesNewTicket.length; + if (salesNewTicketLength && sales.length != salesNewTicketLength) { const newTicket = await models.Ticket.transferSales(ctx, args.id, null, salesNewTicket, myOptions); args.id = newTicket.id; } diff --git a/modules/ticket/front/basic-data/step-two/index.js b/modules/ticket/front/basic-data/step-two/index.js index 32d6b2cd6..4ac9f292e 100644 --- a/modules/ticket/front/basic-data/step-two/index.js +++ b/modules/ticket/front/basic-data/step-two/index.js @@ -67,6 +67,7 @@ class Controller extends Component { ticketHaveNegatives() { let haveNegatives = false; let haveNotNegatives = false; + this.ticket.withoutNegatives = false; const haveDifferences = this.ticket.sale.haveDifferences; this.ticket.sale.items.forEach(item => { @@ -76,8 +77,9 @@ class Controller extends Component { haveNotNegatives = true; }); - this.ticket.withoutNegatives = true; this.haveNegatives = (haveNegatives && haveNotNegatives && haveDifferences); + if (this.haveNegatives) + this.ticket.withoutNegatives = true; } onSubmit() { From 67384b724d39f7c62c5b7e9c61a041a607bdafd3 Mon Sep 17 00:00:00 2001 From: Pau Navarro Date: Wed, 30 Nov 2022 14:41:03 +0100 Subject: [PATCH 23/36] refs #4875 skipped failing test --- .../invoiceOut/back/methods/invoiceOut/specs/createPdf.spec.js | 3 ++- .../back/methods/invoiceOut/specs/downloadZip.spec.js | 3 ++- .../invoiceOut/back/methods/invoiceOut/specs/filter.spec.js | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/invoiceOut/back/methods/invoiceOut/specs/createPdf.spec.js b/modules/invoiceOut/back/methods/invoiceOut/specs/createPdf.spec.js index 803338ef3..6c48c7c5f 100644 --- a/modules/invoiceOut/back/methods/invoiceOut/specs/createPdf.spec.js +++ b/modules/invoiceOut/back/methods/invoiceOut/specs/createPdf.spec.js @@ -10,7 +10,8 @@ describe('InvoiceOut createPdf()', () => { }; const ctx = {req: activeCtx}; - it('should create a new PDF file and set true the hasPdf property', async() => { + // https://redmine.verdnatura.es/issues/4875 + xit('should create a new PDF file and set true the hasPdf property', async() => { const invoiceId = 1; spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({ active: activeCtx diff --git a/modules/invoiceOut/back/methods/invoiceOut/specs/downloadZip.spec.js b/modules/invoiceOut/back/methods/invoiceOut/specs/downloadZip.spec.js index 08f049783..4518528d1 100644 --- a/modules/invoiceOut/back/methods/invoiceOut/specs/downloadZip.spec.js +++ b/modules/invoiceOut/back/methods/invoiceOut/specs/downloadZip.spec.js @@ -29,7 +29,8 @@ describe('InvoiceOut downloadZip()', () => { } }); - it('should return an error if the size of the files is too large', async() => { + // https://redmine.verdnatura.es/issues/4875 + xit('should return an error if the size of the files is too large', async() => { const tx = await models.InvoiceOut.beginTransaction({}); let error; diff --git a/modules/invoiceOut/back/methods/invoiceOut/specs/filter.spec.js b/modules/invoiceOut/back/methods/invoiceOut/specs/filter.spec.js index 02f982011..6f1b510ab 100644 --- a/modules/invoiceOut/back/methods/invoiceOut/specs/filter.spec.js +++ b/modules/invoiceOut/back/methods/invoiceOut/specs/filter.spec.js @@ -50,7 +50,8 @@ describe('InvoiceOut filter()', () => { } }); - it('should return the invoice out matching hasPdf', async() => { + // https://redmine.verdnatura.es/issues/4875 + xit('should return the invoice out matching hasPdf', async() => { const tx = await models.InvoiceOut.beginTransaction({}); const options = {transaction: tx}; From 79f8e30ded9af8ef7c2ffc2a32454df18b50bc5a Mon Sep 17 00:00:00 2001 From: Pau Navarro Date: Wed, 30 Nov 2022 14:49:00 +0100 Subject: [PATCH 24/36] add pending to the tests --- .../back/methods/invoiceOut/specs/createPdf.spec.js | 4 ++-- .../back/methods/invoiceOut/specs/downloadZip.spec.js | 4 ++-- .../invoiceOut/back/methods/invoiceOut/specs/filter.spec.js | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/invoiceOut/back/methods/invoiceOut/specs/createPdf.spec.js b/modules/invoiceOut/back/methods/invoiceOut/specs/createPdf.spec.js index 6c48c7c5f..ee3310368 100644 --- a/modules/invoiceOut/back/methods/invoiceOut/specs/createPdf.spec.js +++ b/modules/invoiceOut/back/methods/invoiceOut/specs/createPdf.spec.js @@ -10,8 +10,8 @@ describe('InvoiceOut createPdf()', () => { }; const ctx = {req: activeCtx}; - // https://redmine.verdnatura.es/issues/4875 - xit('should create a new PDF file and set true the hasPdf property', async() => { + it('should create a new PDF file and set true the hasPdf property', async() => { + pending('https://redmine.verdnatura.es/issues/4875'); const invoiceId = 1; spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({ active: activeCtx diff --git a/modules/invoiceOut/back/methods/invoiceOut/specs/downloadZip.spec.js b/modules/invoiceOut/back/methods/invoiceOut/specs/downloadZip.spec.js index 4518528d1..536fa07a0 100644 --- a/modules/invoiceOut/back/methods/invoiceOut/specs/downloadZip.spec.js +++ b/modules/invoiceOut/back/methods/invoiceOut/specs/downloadZip.spec.js @@ -29,8 +29,8 @@ describe('InvoiceOut downloadZip()', () => { } }); - // https://redmine.verdnatura.es/issues/4875 - xit('should return an error if the size of the files is too large', async() => { + it('should return an error if the size of the files is too large', async() => { + pending('https://redmine.verdnatura.es/issues/4875'); const tx = await models.InvoiceOut.beginTransaction({}); let error; diff --git a/modules/invoiceOut/back/methods/invoiceOut/specs/filter.spec.js b/modules/invoiceOut/back/methods/invoiceOut/specs/filter.spec.js index 6f1b510ab..7b5886236 100644 --- a/modules/invoiceOut/back/methods/invoiceOut/specs/filter.spec.js +++ b/modules/invoiceOut/back/methods/invoiceOut/specs/filter.spec.js @@ -50,8 +50,8 @@ describe('InvoiceOut filter()', () => { } }); - // https://redmine.verdnatura.es/issues/4875 - xit('should return the invoice out matching hasPdf', async() => { + it('should return the invoice out matching hasPdf', async() => { + pending('https://redmine.verdnatura.es/issues/4875'); const tx = await models.InvoiceOut.beginTransaction({}); const options = {transaction: tx}; From 2bb6c1c1da55b90f5c16244e290101b6d6703378 Mon Sep 17 00:00:00 2001 From: vicent Date: Thu, 1 Dec 2022 07:54:32 +0100 Subject: [PATCH 25/36] fix: borra registros aunq no tengan file adjunto --- back/methods/dms/deleteTrashFiles.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/back/methods/dms/deleteTrashFiles.js b/back/methods/dms/deleteTrashFiles.js index 63d7021c5..f14e65e9f 100644 --- a/back/methods/dms/deleteTrashFiles.js +++ b/back/methods/dms/deleteTrashFiles.js @@ -51,7 +51,7 @@ module.exports = Self => { const dstFile = path.join(dmsContainer.client.root, pathHash, dms.file); await fs.unlink(dstFile); } catch (err) { - if (err.code != 'ENOENT') + if (err.code != 'ENOENT' && dms.file) throw err; } From e815292d6b4a0f85d62c42edced6026ef20b1ae5 Mon Sep 17 00:00:00 2001 From: joan Date: Thu, 1 Dec 2022 09:24:56 +0100 Subject: [PATCH 26/36] fix(componentUpdate): updated filter where sintax --- modules/ticket/back/methods/ticket/componentUpdate.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ticket/back/methods/ticket/componentUpdate.js b/modules/ticket/back/methods/ticket/componentUpdate.js index e33428bf0..f4a4bb98d 100644 --- a/modules/ticket/back/methods/ticket/componentUpdate.js +++ b/modules/ticket/back/methods/ticket/componentUpdate.js @@ -137,7 +137,7 @@ module.exports = Self => { const params = [args.id, args.shipped, args.warehouseFk]; const [salesMovable] = await Self.rawSql(query, params, myOptions); - const sales = await models.Sale.find({ticketFk: args.id}, myOptions); + const sales = await models.Sale.find({where: {ticketFk: args.id}}, myOptions); const salesNewTicket = salesMovable.filter(sale => (sale.movable ? sale.movable : 0) >= sale.quantity); const salesNewTicketLength = salesNewTicket.length; From e7173fe15604ae68afdd9328065b857947715e9d Mon Sep 17 00:00:00 2001 From: vicent Date: Thu, 1 Dec 2022 11:59:30 +0100 Subject: [PATCH 27/36] fix: backTest --- back/methods/chat/spec/notifyIssue.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/back/methods/chat/spec/notifyIssue.spec.js b/back/methods/chat/spec/notifyIssue.spec.js index e20d43142..1aab51793 100644 --- a/back/methods/chat/spec/notifyIssue.spec.js +++ b/back/methods/chat/spec/notifyIssue.spec.js @@ -27,7 +27,7 @@ describe('Chat notifyIssue()', () => { subject: 'Issue title'} ]); // eslint-disable-next-line max-len - const expectedMessage = `@all ➔ There's a new urgent ticket:\r\n[ID: *00001* - Issue title (@batman)](https://cau.verdnatura.es/scp/tickets.php?id=1)`; + const expectedMessage = `@all ➔ There's a new urgent ticket:\r\n[ID: 00001 - Issue title @batman](https://cau.verdnatura.es/scp/tickets.php?id=1)`; const department = await app.models.Department.findById(departmentId); let orgChatName = department.chatName; From 12cfa0569682c4e45b944d8b0c9a2e6a5944235b Mon Sep 17 00:00:00 2001 From: joan Date: Fri, 2 Dec 2022 08:33:56 +0100 Subject: [PATCH 28/36] fix(invoicePdf): invoice correction --- .../templates/reports/invoice/sql/rectified.sql | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/print/templates/reports/invoice/sql/rectified.sql b/print/templates/reports/invoice/sql/rectified.sql index ea814a05a..49db8f68b 100644 --- a/print/templates/reports/invoice/sql/rectified.sql +++ b/print/templates/reports/invoice/sql/rectified.sql @@ -1,10 +1,10 @@ -SELECT - io.amount, - io.ref, - io.issued, +SELECT + io.amount, + io.ref, + io.issued, ict.description -FROM vn.invoiceCorrection ic - JOIN vn.invoiceOut io ON io.id = ic.correctedFk - JOIN vn.invoiceCorrectionType ict ON ict.id = ic.invoiceCorrectionTypeFk +FROM invoiceOut io + JOIN invoiceCorrection ic ON ic.correctingFk = io.id + JOIN invoiceCorrectionType ict ON ict.id = ic.invoiceCorrectionTypeFk LEFT JOIN ticket t ON t.refFk = io.ref -WHERE t.refFk = ? \ No newline at end of file +WHERE io.ref = ? \ No newline at end of file From 48a76354496827c71982d66db8d0140eb09b199a Mon Sep 17 00:00:00 2001 From: alexandre Date: Fri, 2 Dec 2022 09:18:52 +0100 Subject: [PATCH 29/36] refs #4893 regex changed --- modules/client/back/models/client.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/client/back/models/client.js b/modules/client/back/models/client.js index e66cdb83f..e07993f79 100644 --- a/modules/client/back/models/client.js +++ b/modules/client/back/models/client.js @@ -27,7 +27,7 @@ module.exports = Self => { message: 'Invalid email', allowNull: true, allowBlank: true, - with: /^[\w|.|-]+@[\w|-]+(\.[\w|-]+)*(,[\w|.|-]+@[\w|-]+(\.[\w|-]+)*)*$/ + with: /^[\W]*([\w+\-.%]+@[\w\-.]+\.[A-Za-z]{1,61}[\W]*,{1}[\W]*)*([\w+\-.%]+@[\w\-.]+\.[A-Za-z]{1,61})[\W]*$/ }); Self.validatesLengthOf('postcode', { From 6562b683412972d7070eaf6cad33079e24b003bd Mon Sep 17 00:00:00 2001 From: joan Date: Fri, 2 Dec 2022 11:16:49 +0100 Subject: [PATCH 30/36] fix(agencyTerm): permitir decimales en m3 minimos --- modules/supplier/front/agency-term/create/index.html | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/supplier/front/agency-term/create/index.html b/modules/supplier/front/agency-term/create/index.html index e43f6396a..3c987cc13 100644 --- a/modules/supplier/front/agency-term/create/index.html +++ b/modules/supplier/front/agency-term/create/index.html @@ -46,6 +46,7 @@ type="number" label="M3 Price" ng-model="$ctrl.supplierAgencyTerm.m3Price" + step="0.1" rule> From 0c4ab815fd817c76e33b85a8d5c6f664b446a83c Mon Sep 17 00:00:00 2001 From: joan Date: Fri, 2 Dec 2022 11:24:08 +0100 Subject: [PATCH 31/36] decimal --- modules/supplier/front/agency-term/create/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/supplier/front/agency-term/create/index.html b/modules/supplier/front/agency-term/create/index.html index 3c987cc13..fff94695d 100644 --- a/modules/supplier/front/agency-term/create/index.html +++ b/modules/supplier/front/agency-term/create/index.html @@ -46,7 +46,7 @@ type="number" label="M3 Price" ng-model="$ctrl.supplierAgencyTerm.m3Price" - step="0.1" + step="0.01" rule> From 6128414685fcf5d62938e45608377a3afdb52a9f Mon Sep 17 00:00:00 2001 From: joan Date: Fri, 2 Dec 2022 11:26:21 +0100 Subject: [PATCH 32/36] m3 decimal --- modules/supplier/front/agency-term/create/index.html | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/supplier/front/agency-term/create/index.html b/modules/supplier/front/agency-term/create/index.html index fff94695d..29d7b9b6a 100644 --- a/modules/supplier/front/agency-term/create/index.html +++ b/modules/supplier/front/agency-term/create/index.html @@ -26,6 +26,7 @@ type="number" label="Minimum M3" ng-model="$ctrl.supplierAgencyTerm.minimumM3" + step="0.01" rule> From 14a3a815da11e780009fce9e635aece4a0413221 Mon Sep 17 00:00:00 2001 From: vicent Date: Fri, 2 Dec 2022 12:05:25 +0100 Subject: [PATCH 33/36] =?UTF-8?q?fix(invoiceOut):=20pdf=20adjunto=20correc?= =?UTF-8?q?to.=20Corregido=20valor=20NaN=20en=20intrastat.=20S=C3=B3lo=20m?= =?UTF-8?q?uestra=20intrstar=20en=20fact=20CEE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../back/methods/invoiceOut/invoiceClient.js | 2 +- print/templates/reports/invoice/invoice.js | 2 +- .../reports/invoice/sql/intrastat.sql | 71 ++++++++++--------- 3 files changed, 41 insertions(+), 34 deletions(-) diff --git a/modules/invoiceOut/back/methods/invoiceOut/invoiceClient.js b/modules/invoiceOut/back/methods/invoiceOut/invoiceClient.js index b04747d16..95c51a96d 100644 --- a/modules/invoiceOut/back/methods/invoiceOut/invoiceClient.js +++ b/modules/invoiceOut/back/methods/invoiceOut/invoiceClient.js @@ -138,7 +138,7 @@ module.exports = Self => { recipient: invoiceOut.client().email }; try { - await models.InvoiceOut.invoiceEmail(ctx); + await models.InvoiceOut.invoiceEmail(ctx, invoiceOut.ref); } catch (err) {} return invoiceId; diff --git a/print/templates/reports/invoice/invoice.js b/print/templates/reports/invoice/invoice.js index eebbde8ef..48848c079 100755 --- a/print/templates/reports/invoice/invoice.js +++ b/print/templates/reports/invoice/invoice.js @@ -82,7 +82,7 @@ module.exports = { return this.rawSqlFromDef(`taxes`, [reference]); }, fetchIntrastat(reference) { - return this.rawSqlFromDef(`intrastat`, [reference, reference, reference, reference]); + return this.rawSqlFromDef(`intrastat`, [reference, reference, reference, reference, reference]); }, fetchRectified(reference) { return this.rawSqlFromDef(`rectified`, [reference]); diff --git a/print/templates/reports/invoice/sql/intrastat.sql b/print/templates/reports/invoice/sql/intrastat.sql index 5cc3ebd7f..7f5fbdf39 100644 --- a/print/templates/reports/invoice/sql/intrastat.sql +++ b/print/templates/reports/invoice/sql/intrastat.sql @@ -1,32 +1,39 @@ -(SELECT - ir.id code, - ir.description description, - CAST(SUM(IFNULL(i.stems, 1) * s.quantity) AS DECIMAL(10,2)) stems, - CAST(SUM(CAST(IFNULL(i.stems, 1) * s.quantity * IF(ic.grams, ic.grams, i.density * ic.cm3delivery / 1000) / 1000 AS DECIMAL(10,2)) * - IF(sub.weight, sub.weight / vn.invoiceOut_getWeight(?), 1)) AS DECIMAL(10,2)) netKg, - CAST(SUM((s.quantity * s.price * (100 - s.discount) / 100 )) AS DECIMAL(10,2)) subtotal - FROM vn.ticket t - JOIN vn.sale s ON s.ticketFk = t.id - JOIN vn.item i ON i.id = s.itemFk - JOIN vn.itemCost ic ON ic.itemFk = i.id AND ic.warehouseFk = t.warehouseFk - JOIN vn.intrastat ir ON ir.id = i.intrastatFk - LEFT JOIN ( - SELECT t2.weight - FROM vn.ticket t2 - WHERE refFk = ? AND weight - LIMIT 1 - ) sub ON TRUE - WHERE t.refFk = ? - AND i.intrastatFk - GROUP BY i.intrastatFk - ORDER BY i.intrastatFk) -UNION ALL -(SELECT - NULL AS code, - NULL AS description, - 0 AS stems, - 0 AS netKg, - CAST(SUM((ts.quantity * ts.price)) AS DECIMAL(10,2)) AS subtotal - FROM vn.ticketService ts - JOIN vn.ticket t ON ts.ticketFk = t.id - WHERE t.refFk = ?); \ No newline at end of file +SELECT * + FROM invoiceOut io + JOIN invoiceOutSerial ios ON io.serial = ios.code + JOIN + (SELECT + t.refFk, + ir.id code, + ir.description description, + CAST(SUM(IFNULL(i.stems, 1) * s.quantity) AS DECIMAL(10,2)) stems, + CAST(SUM(CAST(IFNULL(i.stems, 1) * s.quantity * IF(ic.grams, ic.grams, i.density * ic.cm3delivery / 1000) / 1000 AS DECIMAL(10,2)) * + IF(sub.weight, sub.weight / vn.invoiceOut_getWeight(?), 1)) AS DECIMAL(10,2)) netKg, + CAST(SUM((s.quantity * s.price * (100 - s.discount) / 100 )) AS DECIMAL(10,2)) subtotal + FROM vn.ticket t + JOIN vn.sale s ON s.ticketFk = t.id + JOIN vn.item i ON i.id = s.itemFk + JOIN vn.itemCost ic ON ic.itemFk = i.id AND ic.warehouseFk = t.warehouseFk + JOIN vn.intrastat ir ON ir.id = i.intrastatFk + LEFT JOIN ( + SELECT t2.weight + FROM vn.ticket t2 + WHERE refFk = ? AND weight + LIMIT 1 + ) sub ON TRUE + WHERE t.refFk = ? + AND i.intrastatFk + GROUP BY i.intrastatFk + UNION ALL + SELECT + NULL AS refFk, + NULL AS code, + NULL AS description, + 0 AS stems, + 0 AS netKg, + IF(CAST(SUM((ts.quantity * ts.price)) AS DECIMAL(10,2)), CAST(SUM((ts.quantity * ts.price)) AS DECIMAL(10,2)), 0) AS subtotal + FROM vn.ticketService ts + JOIN vn.ticket t ON ts.ticketFk = t.id + WHERE t.refFk = ?) sub + WHERE io.`ref` = ? AND ios.isCEE + ORDER BY sub.code; From ac447d4981695aeceab34cdc30c48cfe26f559b0 Mon Sep 17 00:00:00 2001 From: joan Date: Fri, 2 Dec 2022 12:48:12 +0100 Subject: [PATCH 34/36] Updated SQL version nomenclature --- db/changes/10470-family/00-accountingType.sql | 3 - db/changes/10470-family/00-aclItemType.sql | 4 - db/changes/10470-family/00-aclMdb.sql | 14 -- db/changes/10470-family/00-chat.sql | 13 -- .../10470-family/00-creditInsurance.sql | 8 -- .../10470-family/00-defaultViewConfig.sql | 3 - .../10470-family/00-ticket_doRefund.sql | 127 ------------------ .../01-creditInsuranceTriggers.sql | 11 -- db/changes/10470-family/01-tableConfig.sql | 1 - db/changes/10470-family/02-fileConfig.sql | 22 --- db/changes/10471-family/00-chat.sql | 3 - .../10472-family/00-creditInsurance.sql | 3 - db/changes/10480-june/00-ACL.sql | 21 --- db/changes/10480-june/00-aclShelvingLog.sql | 3 - .../10480-june/00-aclZoneExclusionGeos.sql | 4 - db/changes/10480-june/00-albaran_gestdoc.sql | 2 - db/changes/10480-june/00-client.sql | 3 - db/changes/10480-june/00-deprecations.sql | 13 -- db/changes/10480-june/00-item.sql | 1 - db/changes/10480-june/00-route.sql | 10 -- db/changes/10480-june/00-sample.sql | 2 - db/changes/10480-june/00-shelving.sql | 18 --- .../00-ticketRefund_beforeUpsert.sql | 21 --- db/changes/10480-june/01-claimObservation.sql | 13 -- .../10480-june/02-claimTextMigration.sql | 2 - db/changes/10480-june/04-aclParking.sql | 2 - db/changes/10480-june/04-aclShelving.sql | 2 - db/changes/10481-june/00-aclOsTicket.sql | 3 - .../10481-june/00-aclOsTicketConfig.sql | 3 - db/changes/10481-june/00-osTicketConfig.sql | 16 --- .../{10490-august => 224701}/00-ACL.sql | 0 .../00-acl_receiptPdf.sql | 0 .../00-clientConsumptionQueue.sql | 0 .../00-invoiceOutQueue.sql | 0 .../00-itemConfig.sql | 0 .../00-printConfig.sql | 0 .../00-sale_afterUpdate.sql | 0 .../{10490-august => 224701}/00-sample.sql | 0 .../00-user_hasGrant.sql | 0 .../00-ACL_workerDisableExcluded.sql | 0 .../00-aclBusiness.sql | 0 .../00-aclUsesMana.sql | 0 .../00-defaultPayDem_sameAs_production.sql | 0 .../00-invoiceInPdf.sql | 0 .../00-newSupplier_ACL.sql | 0 .../00-notificationProc.sql | 0 .../00-notificationTables.sql | 0 .../00-payMethodFk_Allow_Null.sql | 0 .../00-supplierActivityFk_Allow_Null.sql | 0 .../00-ticket_closeByTicket.sql | 0 .../{10491-august => 224702}/00-zipConfig.sql | 0 .../{10500-november => 224801}/00-ACL.sql | 0 .../{10500-november => 224801}/00-claim.sql | 0 .../00-claimRma.sql | 0 .../00-aclNotification.sql | 0 .../00-packingSiteConfig.sql | 0 .../00-packingSiteUpdate.sql | 0 .../00-salix_url.sql | 0 .../00-aclUserPassword.sql | 0 .../00-deletePickupContact.sql | 0 .../00-itemShelvingACL.sql | 0 ...00-itemShelvingPlacementSupplyStockACL.sql | 0 .../00-workerTimeControlMail.sql | 0 .../00-zone_getPostalCode.sql | 0 .../00-ACL_notification_InvoiceE.sql | 0 .../00-aclInvoiceOut.sql | 0 .../00-alter_expedition_itemFk.sql | 0 .../00-clientHasInvoiceElectronic.sql | 0 .../00-collection_missingTrash.sql | 0 .../00-deleteInvoiceOutQueue.sql | 0 .../00-editTrackedACL.sql | 0 .../{10503-november => 224903}/00-greuge.sql | 0 .../00-insert_notification_invoiceE.sql | 0 .../00-isCompensationACL.sql | 0 .../00-osTicketConfig.sql | 0 .../00-ticket_canMerge.sql | 0 .../00-ticket_canbePostponed.sql | 0 .../00-timeBusiness_calculate.sql | 0 .../01-updateClientHasInvoiceElectronic.sql | 0 .../deleteMe.keep => 225001/.gitkeep} | 0 db/dump/dumpedFixtures.sql | 2 +- db/import-changes.sh | 4 +- 82 files changed, 3 insertions(+), 354 deletions(-) delete mode 100644 db/changes/10470-family/00-accountingType.sql delete mode 100644 db/changes/10470-family/00-aclItemType.sql delete mode 100644 db/changes/10470-family/00-aclMdb.sql delete mode 100644 db/changes/10470-family/00-chat.sql delete mode 100644 db/changes/10470-family/00-creditInsurance.sql delete mode 100644 db/changes/10470-family/00-defaultViewConfig.sql delete mode 100644 db/changes/10470-family/00-ticket_doRefund.sql delete mode 100644 db/changes/10470-family/01-creditInsuranceTriggers.sql delete mode 100644 db/changes/10470-family/01-tableConfig.sql delete mode 100644 db/changes/10470-family/02-fileConfig.sql delete mode 100644 db/changes/10471-family/00-chat.sql delete mode 100644 db/changes/10472-family/00-creditInsurance.sql delete mode 100644 db/changes/10480-june/00-ACL.sql delete mode 100644 db/changes/10480-june/00-aclShelvingLog.sql delete mode 100644 db/changes/10480-june/00-aclZoneExclusionGeos.sql delete mode 100644 db/changes/10480-june/00-albaran_gestdoc.sql delete mode 100644 db/changes/10480-june/00-client.sql delete mode 100644 db/changes/10480-june/00-deprecations.sql delete mode 100644 db/changes/10480-june/00-item.sql delete mode 100644 db/changes/10480-june/00-route.sql delete mode 100644 db/changes/10480-june/00-sample.sql delete mode 100644 db/changes/10480-june/00-shelving.sql delete mode 100644 db/changes/10480-june/00-ticketRefund_beforeUpsert.sql delete mode 100644 db/changes/10480-june/01-claimObservation.sql delete mode 100644 db/changes/10480-june/02-claimTextMigration.sql delete mode 100644 db/changes/10480-june/04-aclParking.sql delete mode 100644 db/changes/10480-june/04-aclShelving.sql delete mode 100644 db/changes/10481-june/00-aclOsTicket.sql delete mode 100644 db/changes/10481-june/00-aclOsTicketConfig.sql delete mode 100644 db/changes/10481-june/00-osTicketConfig.sql rename db/changes/{10490-august => 224701}/00-ACL.sql (100%) rename db/changes/{10490-august => 224701}/00-acl_receiptPdf.sql (100%) rename db/changes/{10490-august => 224701}/00-clientConsumptionQueue.sql (100%) rename db/changes/{10490-august => 224701}/00-invoiceOutQueue.sql (100%) rename db/changes/{10490-august => 224701}/00-itemConfig.sql (100%) rename db/changes/{10490-august => 224701}/00-printConfig.sql (100%) rename db/changes/{10490-august => 224701}/00-sale_afterUpdate.sql (100%) rename db/changes/{10490-august => 224701}/00-sample.sql (100%) rename db/changes/{10490-august => 224701}/00-user_hasGrant.sql (100%) rename db/changes/{10491-august => 224702}/00-ACL_workerDisableExcluded.sql (100%) rename db/changes/{10491-august => 224702}/00-aclBusiness.sql (100%) rename db/changes/{10491-august => 224702}/00-aclUsesMana.sql (100%) rename db/changes/{10491-august => 224702}/00-defaultPayDem_sameAs_production.sql (100%) rename db/changes/{10491-august => 224702}/00-invoiceInPdf.sql (100%) rename db/changes/{10491-august => 224702}/00-newSupplier_ACL.sql (100%) rename db/changes/{10491-august => 224702}/00-notificationProc.sql (100%) rename db/changes/{10491-august => 224702}/00-notificationTables.sql (100%) rename db/changes/{10491-august => 224702}/00-payMethodFk_Allow_Null.sql (100%) rename db/changes/{10491-august => 224702}/00-supplierActivityFk_Allow_Null.sql (100%) rename db/changes/{10491-august => 224702}/00-ticket_closeByTicket.sql (100%) rename db/changes/{10491-august => 224702}/00-zipConfig.sql (100%) rename db/changes/{10500-november => 224801}/00-ACL.sql (100%) rename db/changes/{10500-november => 224801}/00-claim.sql (100%) rename db/changes/{10500-november => 224801}/00-claimRma.sql (100%) rename db/changes/{10501-november => 224901}/00-aclNotification.sql (100%) rename db/changes/{10501-november => 224901}/00-packingSiteConfig.sql (100%) rename db/changes/{10501-november => 224901}/00-packingSiteUpdate.sql (100%) rename db/changes/{10501-november => 224901}/00-salix_url.sql (100%) rename db/changes/{10502-november => 224902}/00-aclUserPassword.sql (100%) rename db/changes/{10502-november => 224902}/00-deletePickupContact.sql (100%) rename db/changes/{10502-november => 224902}/00-itemShelvingACL.sql (100%) rename db/changes/{10502-november => 224902}/00-itemShelvingPlacementSupplyStockACL.sql (100%) rename db/changes/{10502-november => 224902}/00-workerTimeControlMail.sql (100%) rename db/changes/{10502-november => 224902}/00-zone_getPostalCode.sql (100%) rename db/changes/{10503-november => 224903}/00-ACL_notification_InvoiceE.sql (100%) rename db/changes/{10503-november => 224903}/00-aclInvoiceOut.sql (100%) rename db/changes/{10503-november => 224903}/00-alter_expedition_itemFk.sql (100%) rename db/changes/{10503-november => 224903}/00-clientHasInvoiceElectronic.sql (100%) rename db/changes/{10503-november => 224903}/00-collection_missingTrash.sql (100%) rename db/changes/{10503-november => 224903}/00-deleteInvoiceOutQueue.sql (100%) rename db/changes/{10503-november => 224903}/00-editTrackedACL.sql (100%) rename db/changes/{10503-november => 224903}/00-greuge.sql (100%) rename db/changes/{10503-november => 224903}/00-insert_notification_invoiceE.sql (100%) rename db/changes/{10503-november => 224903}/00-isCompensationACL.sql (100%) rename db/changes/{10503-november => 224903}/00-osTicketConfig.sql (100%) rename db/changes/{10503-november => 224903}/00-ticket_canMerge.sql (100%) rename db/changes/{10503-november => 224903}/00-ticket_canbePostponed.sql (100%) rename db/changes/{10503-november => 224903}/00-timeBusiness_calculate.sql (100%) rename db/changes/{10503-november => 224903}/01-updateClientHasInvoiceElectronic.sql (100%) rename db/changes/{10510-december/deleteMe.keep => 225001/.gitkeep} (100%) diff --git a/db/changes/10470-family/00-accountingType.sql b/db/changes/10470-family/00-accountingType.sql deleted file mode 100644 index 964027e3a..000000000 --- a/db/changes/10470-family/00-accountingType.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE `vn`.`accountingType` ADD daysInFuture INT NULL; -ALTER TABLE `vn`.`accountingType` MODIFY COLUMN daysInFuture int(11) DEFAULT 0 NULL; -UPDATE `vn`.`accountingType` SET daysInFuture=1 WHERE id=8; \ No newline at end of file diff --git a/db/changes/10470-family/00-aclItemType.sql b/db/changes/10470-family/00-aclItemType.sql deleted file mode 100644 index 836a69dfd..000000000 --- a/db/changes/10470-family/00-aclItemType.sql +++ /dev/null @@ -1,4 +0,0 @@ -INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) - VALUES - ('ItemType', '*', 'READ', 'ALLOW', 'ROLE', 'employee'), - ('ItemType', '*', 'WRITE', 'ALLOW', 'ROLE', 'buyer'); \ No newline at end of file diff --git a/db/changes/10470-family/00-aclMdb.sql b/db/changes/10470-family/00-aclMdb.sql deleted file mode 100644 index b02ddc451..000000000 --- a/db/changes/10470-family/00-aclMdb.sql +++ /dev/null @@ -1,14 +0,0 @@ -CREATE TABLE IF NOT EXISTS `vn`.`mdbBranch` ( - `name` VARCHAR(255), - PRIMARY KEY(`name`) -); - -CREATE TABLE IF NOT EXISTS `vn`.`mdbVersion` ( - `app` VARCHAR(255) NOT NULL, - `branchFk` VARCHAR(255) NOT NULL, - `version` INT, - CONSTRAINT `mdbVersion_branchFk` FOREIGN KEY (`branchFk`) REFERENCES `vn`.`mdbBranch` (`name`) ON DELETE CASCADE ON UPDATE CASCADE -); - -INSERT IGNORE INTO `salix`.`ACL` (`id`, `model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) - VALUES(318, 'MdbVersion', '*', '*', 'ALLOW', 'ROLE', 'developer'); diff --git a/db/changes/10470-family/00-chat.sql b/db/changes/10470-family/00-chat.sql deleted file mode 100644 index d4a8f068a..000000000 --- a/db/changes/10470-family/00-chat.sql +++ /dev/null @@ -1,13 +0,0 @@ -CREATE TABLE `vn`.`chat` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `senderFk` int(10) unsigned DEFAULT NULL, - `recipient` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, - `dated` date DEFAULT NULL, - `checkUserStatus` tinyint(1) DEFAULT NULL, - `message` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL, - `status` tinyint(1) DEFAULT NULL, - `attempts` int(1) DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `chat_FK` (`senderFk`), - CONSTRAINT `chat_FK` FOREIGN KEY (`senderFk`) REFERENCES `account`.`user` (`id`) ON UPDATE CASCADE -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; \ No newline at end of file diff --git a/db/changes/10470-family/00-creditInsurance.sql b/db/changes/10470-family/00-creditInsurance.sql deleted file mode 100644 index 9d4db470b..000000000 --- a/db/changes/10470-family/00-creditInsurance.sql +++ /dev/null @@ -1,8 +0,0 @@ -ALTER TABLE `vn`.`creditInsurance` ADD creditClassificationFk int(11) NULL; - -UPDATE `vn`.`creditInsurance` AS `destiny` - SET `destiny`.`creditClassificationFk`= (SELECT creditClassification FROM `vn`.`creditInsurance` AS `origin` WHERE `origin`.id = `destiny`.id); - -ALTER TABLE `vn`.`creditInsurance` - ADD CONSTRAINT `creditInsurance_creditClassificationFk` FOREIGN KEY (`creditClassificationFk`) - REFERENCES `vn`.`creditClassification` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; \ No newline at end of file diff --git a/db/changes/10470-family/00-defaultViewConfig.sql b/db/changes/10470-family/00-defaultViewConfig.sql deleted file mode 100644 index d423599b1..000000000 --- a/db/changes/10470-family/00-defaultViewConfig.sql +++ /dev/null @@ -1,3 +0,0 @@ -INSERT INTO `salix`.`defaultViewConfig` (tableCode, columns) -VALUES ('clientsDetail', '{"id":true,"phone":true,"city":true,"socialName":true,"salesPersonFk":true,"email":true,"name":false,"fi":false,"credit":false,"creditInsurance":false,"mobile":false,"street":false,"countryFk":false,"provinceFk":false,"postcode":false,"created":false,"businessTypeFk":false,"payMethodFk":false,"sageTaxTypeFk":false,"sageTransactionTypeFk":false,"isActive":false,"isVies":false,"isTaxDataChecked":false,"isEqualizated":false,"isFreezed":false,"hasToInvoice":false,"hasToInvoiceByAddress":false,"isToBeMailed":false,"hasLcr":false,"hasCoreVnl":false,"hasSepaVnl":false}'); - diff --git a/db/changes/10470-family/00-ticket_doRefund.sql b/db/changes/10470-family/00-ticket_doRefund.sql deleted file mode 100644 index f4ecf29d7..000000000 --- a/db/changes/10470-family/00-ticket_doRefund.sql +++ /dev/null @@ -1,127 +0,0 @@ -DROP PROCEDURE IF EXISTS `vn`.`ticket_doRefund`; - -DELIMITER $$ -$$ -CREATE DEFINER=`root`@`localhost` PROCEDURE `vn`.`ticket_doRefund`(OUT vNewTicket INT) -BEGIN -/** - * Crea un ticket de abono a partir de tmp.sale y/o tmp.ticketService - * - * @return vNewTicket - */ - DECLARE vDone BIT DEFAULT 0; - DECLARE vClientFk MEDIUMINT; - DECLARE vWarehouse TINYINT; - DECLARE vCompany MEDIUMINT; - DECLARE vAddress MEDIUMINT; - DECLARE vRefundAgencyMode INT; - DECLARE vItemFk INT; - DECLARE vQuantity DECIMAL (10,2); - DECLARE vConcept VARCHAR(50); - DECLARE vPrice DECIMAL (10,2); - DECLARE vDiscount TINYINT; - DECLARE vSaleNew INT; - DECLARE vSaleMain INT; - DECLARE vZoneFk INT; - DECLARE vDescription VARCHAR(50); - DECLARE vTaxClassFk INT; - DECLARE vTicketServiceTypeFk INT; - DECLARE vOriginTicket INT; - - DECLARE cSales CURSOR FOR - SELECT s.id, s.itemFk, - s.quantity, s.concept, s.price, s.discount - FROM tmp.sale s; - - DECLARE cTicketServices CURSOR FOR - SELECT ts.description, - ts.quantity, ts.price, ts.taxClassFk, ts.ticketServiceTypeFk - FROM tmp.ticketService ts; - - DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE; - - SELECT sub.ticketFk INTO vOriginTicket - FROM ( - SELECT s.ticketFk - FROM tmp.sale s - UNION ALL - SELECT ts.ticketFk - FROM tmp.ticketService ts - ) sub - LIMIT 1; - - SELECT id INTO vRefundAgencyMode - FROM agencyMode WHERE `name` = 'ABONO'; - - SELECT clientFk, warehouseFk, companyFk, addressFk - INTO vClientFk, vWarehouse, vCompany, vAddress - FROM ticket - WHERE id = vOriginTicket; - - SELECT id INTO vZoneFk - FROM zone WHERE agencyModeFk = vRefundAgencyMode - LIMIT 1; - - INSERT INTO vn.ticket ( - clientFk, - shipped, - addressFk, - agencyModeFk, - nickname, - warehouseFk, - companyFk, - landed, - zoneFk - ) - SELECT - vClientFk, - CURDATE(), - vAddress, - vRefundAgencyMode, - a.nickname, - vWarehouse, - vCompany, - CURDATE(), - vZoneFk - FROM address a - WHERE a.id = vAddress; - - SET vNewTicket = LAST_INSERT_ID(); - - SET vDone := FALSE; - OPEN cSales; - FETCH cSales INTO vSaleMain, vItemFk, vQuantity, vConcept, vPrice, vDiscount; - - WHILE NOT vDone DO - - INSERT INTO vn.sale(ticketFk, itemFk, quantity, concept, price, discount) - VALUES( vNewTicket, vItemFk, vQuantity, vConcept, vPrice, vDiscount ); - - SET vSaleNew = LAST_INSERT_ID(); - - INSERT INTO vn.saleComponent(saleFk,componentFk,`value`) - SELECT vSaleNew,componentFk,`value` - FROM vn.saleComponent - WHERE saleFk = vSaleMain; - - FETCH cSales INTO vSaleMain, vItemFk, vQuantity, vConcept, vPrice, vDiscount; - - END WHILE; - CLOSE cSales; - - SET vDone := FALSE; - OPEN cTicketServices; - FETCH cTicketServices INTO vDescription, vQuantity, vPrice, vTaxClassFk, vTicketServiceTypeFk; - - WHILE NOT vDone DO - - INSERT INTO vn.ticketService(description, quantity, price, taxClassFk, ticketFk, ticketServiceTypeFk) - VALUES(vDescription, vQuantity, vPrice, vTaxClassFk, vNewTicket, vTicketServiceTypeFk); - - FETCH cTicketServices INTO vDescription, vQuantity, vPrice, vTaxClassFk, vTicketServiceTypeFk; - - END WHILE; - CLOSE cTicketServices; - - INSERT INTO vn.ticketRefund(refundTicketFk, originalTicketFk) - VALUES(vNewTicket, vOriginTicket); -END$$ -DELIMITER ; diff --git a/db/changes/10470-family/01-creditInsuranceTriggers.sql b/db/changes/10470-family/01-creditInsuranceTriggers.sql deleted file mode 100644 index 53ba3ba11..000000000 --- a/db/changes/10470-family/01-creditInsuranceTriggers.sql +++ /dev/null @@ -1,11 +0,0 @@ -DELIMITER $$ -$$ -CREATE DEFINER=`root`@`localhost` TRIGGER `vn`.`creditInsurance_beforeInsert` - BEFORE INSERT ON `creditInsurance` - FOR EACH ROW -BEGIN - IF NEW.creditClassificationFk THEN - SET NEW.creditClassification = NEW.creditClassificationFk; - END IF; -END$$ -DELIMITER ; \ No newline at end of file diff --git a/db/changes/10470-family/01-tableConfig.sql b/db/changes/10470-family/01-tableConfig.sql deleted file mode 100644 index 685981d90..000000000 --- a/db/changes/10470-family/01-tableConfig.sql +++ /dev/null @@ -1 +0,0 @@ -RENAME TABLE `edi`.`fileConfig` to `edi`.`tableConfig`; \ No newline at end of file diff --git a/db/changes/10470-family/02-fileConfig.sql b/db/changes/10470-family/02-fileConfig.sql deleted file mode 100644 index 3109a4616..000000000 --- a/db/changes/10470-family/02-fileConfig.sql +++ /dev/null @@ -1,22 +0,0 @@ -CREATE TABLE `edi`.`fileConfig` -( - name varchar(25) NOT NULL, - checksum text NULL, - keyValue tinyint(1) default true NOT NULL, - constraint fileConfig_pk - primary key (name) -); - -create unique index fileConfig_name_uindex - on `edi`.`fileConfig` (name); - - -INSERT INTO `edi`.`fileConfig` (name, checksum, keyValue) -VALUES ('FEC010104', null, 0); - -INSERT INTO `edi`.`fileConfig` (name, checksum, keyValue) -VALUES ('VBN020101', null, 1); - -INSERT INTO `edi`.`fileConfig` (name, checksum, keyValue) -VALUES ('florecompc2', null, 1); - diff --git a/db/changes/10471-family/00-chat.sql b/db/changes/10471-family/00-chat.sql deleted file mode 100644 index 6f3c9d437..000000000 --- a/db/changes/10471-family/00-chat.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE `vn`.`chat` MODIFY COLUMN message TEXT CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL NULL; -ALTER TABLE `vn`.`chat` MODIFY COLUMN dated DATETIME DEFAULT NULL NULL; -ALTER TABLE `vn`.`chat` ADD error TEXT NULL; diff --git a/db/changes/10472-family/00-creditInsurance.sql b/db/changes/10472-family/00-creditInsurance.sql deleted file mode 100644 index 4731cfb2a..000000000 --- a/db/changes/10472-family/00-creditInsurance.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE `vn`.`creditInsurance` - ADD CONSTRAINT `creditInsurance_creditClassificationFk` FOREIGN KEY (`creditClassificationFk`) - REFERENCES `vn`.`creditClassification` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; \ No newline at end of file diff --git a/db/changes/10480-june/00-ACL.sql b/db/changes/10480-june/00-ACL.sql deleted file mode 100644 index b13e56e21..000000000 --- a/db/changes/10480-june/00-ACL.sql +++ /dev/null @@ -1,21 +0,0 @@ -INSERT INTO `salix`.`ACL` (model,property,accessType,permission,principalType,principalId) - VALUES - ('InvoiceOut','refund','WRITE','ALLOW','ROLE','invoicing'), - ('InvoiceOut','refund','WRITE','ALLOW','ROLE','salesAssistant'), - ('InvoiceOut','refund','WRITE','ALLOW','ROLE','claimManager'), - ('Ticket','refund','WRITE','ALLOW','ROLE','invoicing'), - ('Ticket','refund','WRITE','ALLOW','ROLE','salesAssistant'), - ('Ticket','refund','WRITE','ALLOW','ROLE','claimManager'), - ('Sale','refund','WRITE','ALLOW','ROLE','salesAssistant'), - ('Sale','refund','WRITE','ALLOW','ROLE','claimManager'), - ('TicketRefund','*','WRITE','ALLOW','ROLE','invoicing'), - ('ClaimObservation','*','WRITE','ALLOW','ROLE','salesPerson'), - ('ClaimObservation','*','READ','ALLOW','ROLE','salesPerson'), - ('Client','setPassword','WRITE','ALLOW','ROLE','salesPerson'), - ('Client','updateUser','WRITE','ALLOW','ROLE','salesPerson'); - -DELETE FROM `salix`.`ACL` WHERE id=313; - -UPDATE `salix`.`ACL` - SET principalId='invoicing' - WHERE id=297; \ No newline at end of file diff --git a/db/changes/10480-june/00-aclShelvingLog.sql b/db/changes/10480-june/00-aclShelvingLog.sql deleted file mode 100644 index dc75142d1..000000000 --- a/db/changes/10480-june/00-aclShelvingLog.sql +++ /dev/null @@ -1,3 +0,0 @@ -INSERT INTO `salix`.`ACL` (model,property,accessType,permission,principalType,principalId) - VALUES - ('ShelvingLog','*','READ','ALLOW','ROLE','employee'); \ No newline at end of file diff --git a/db/changes/10480-june/00-aclZoneExclusionGeos.sql b/db/changes/10480-june/00-aclZoneExclusionGeos.sql deleted file mode 100644 index 4c0f6c991..000000000 --- a/db/changes/10480-june/00-aclZoneExclusionGeos.sql +++ /dev/null @@ -1,4 +0,0 @@ -INSERT INTO `salix`.`ACL`(`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) - VALUES - ('ZoneExclusionGeo', '*', 'READ', 'ALLOW', 'ROLE', 'employee'), - ('ZoneExclusionGeo', '*', 'WRITE', 'ALLOW', 'ROLE', 'deliveryBoss'); \ No newline at end of file diff --git a/db/changes/10480-june/00-albaran_gestdoc.sql b/db/changes/10480-june/00-albaran_gestdoc.sql deleted file mode 100644 index a0ba93bd3..000000000 --- a/db/changes/10480-june/00-albaran_gestdoc.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE `vn2008`.`albaran_gestdoc` DROP FOREIGN KEY fk_albaran_gestdoc_gestdoc1; -ALTER TABLE `vn2008`.`albaran_gestdoc` ADD CONSTRAINT albaran_gestdoc_FK FOREIGN KEY (gestdoc_id) REFERENCES `vn`.`dms`(id) ON DELETE CASCADE ON UPDATE CASCADE; \ No newline at end of file diff --git a/db/changes/10480-june/00-client.sql b/db/changes/10480-june/00-client.sql deleted file mode 100644 index 4a39bbdf9..000000000 --- a/db/changes/10480-june/00-client.sql +++ /dev/null @@ -1,3 +0,0 @@ -alter table `vn`.`client` - add hasIncoterms tinyint(1) default 0 not null comment 'Received incoterms authorization from client'; - diff --git a/db/changes/10480-june/00-deprecations.sql b/db/changes/10480-june/00-deprecations.sql deleted file mode 100644 index 68becd13e..000000000 --- a/db/changes/10480-june/00-deprecations.sql +++ /dev/null @@ -1,13 +0,0 @@ -DROP FUNCTION `account`.`userGetId`; -DROP FUNCTION `account`.`myUserGetName`; -DROP FUNCTION `account`.`myUserGetId`; -DROP FUNCTION `account`.`myUserHasRole`; -DROP FUNCTION `account`.`myUserHasRoleId`; -DROP FUNCTION `account`.`userGetName`; -DROP FUNCTION `account`.`userHasRole`; -DROP FUNCTION `account`.`userHasRoleId`; -DROP PROCEDURE `account`.`myUserLogout`; -DROP PROCEDURE `account`.`userLogin`; -DROP PROCEDURE `account`.`userLoginWithKey`; -DROP PROCEDURE `account`.`userLoginWithName`; -DROP PROCEDURE `account`.`userSetPassword`; \ No newline at end of file diff --git a/db/changes/10480-june/00-item.sql b/db/changes/10480-june/00-item.sql deleted file mode 100644 index a08d3f4c1..000000000 --- a/db/changes/10480-june/00-item.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE `vn`.`item` MODIFY COLUMN description TEXT CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL NULL; diff --git a/db/changes/10480-june/00-route.sql b/db/changes/10480-june/00-route.sql deleted file mode 100644 index beb7d5e41..000000000 --- a/db/changes/10480-june/00-route.sql +++ /dev/null @@ -1,10 +0,0 @@ -UPDATE `vn`.`route` r - JOIN(SELECT r.id, wl.workcenterFk - FROM `vn`.`route` r - JOIN `vn`.`routeLog` rl ON rl.originFk = r.id - JOIN `vn`.`workerLabour` wl ON wl.workerFk = rl.userFk - AND r.created BETWEEN wl.started AND IFNULL(wl.ended, r.created) - WHERE r.created BETWEEN '2021-12-01' AND CURDATE() - AND rl.action = 'insert' - )sub ON sub.id = r.id - SET r.commissionWorkCenterFk = sub.workcenterFk; \ No newline at end of file diff --git a/db/changes/10480-june/00-sample.sql b/db/changes/10480-june/00-sample.sql deleted file mode 100644 index 18beb736d..000000000 --- a/db/changes/10480-june/00-sample.sql +++ /dev/null @@ -1,2 +0,0 @@ -INSERT INTO `vn`.`sample` (code, description, isVisible, hasCompany, hasPreview, datepickerEnabled) -VALUES ('incoterms-authorization', 'Autorización de incoterms', 1, 1, 1, 0); \ No newline at end of file diff --git a/db/changes/10480-june/00-shelving.sql b/db/changes/10480-june/00-shelving.sql deleted file mode 100644 index c66d164c4..000000000 --- a/db/changes/10480-june/00-shelving.sql +++ /dev/null @@ -1,18 +0,0 @@ -ALTER TABLE `vn`.`itemShelving` DROP FOREIGN KEY itemShelving_fk2; -ALTER TABLE `vn`.`shelvingLog` DROP FOREIGN KEY shelvingLog_FK_ibfk_1; -ALTER TABLE `vn`.`smartTag` DROP FOREIGN KEY smartTag_shelving_fk; -ALTER TABLE `vn`.`workerShelving` DROP FOREIGN KEY workerShelving_shelving_fk; - -ALTER TABLE `vn`.`shelving` DROP PRIMARY KEY; -ALTER TABLE `vn`.`shelving` ADD id INT auto_increment PRIMARY KEY NULL; -ALTER TABLE `vn`.`shelving` CHANGE id id int(11) auto_increment NOT NULL FIRST; -ALTER TABLE `vn`.`shelving` ADD CONSTRAINT shelving_UN UNIQUE KEY (code); - -ALTER TABLE `vn`.`itemShelving` ADD CONSTRAINT itemShelving_fk2 FOREIGN KEY (shelvingFk) REFERENCES `vn`.`shelving`(code) ON DELETE CASCADE ON UPDATE CASCADE; -ALTER TABLE `vn`.`shelvingLog` ADD CONSTRAINT shelvingLog_FK_ibfk_1 FOREIGN KEY (originFk) REFERENCES `vn`.`shelving`(code) ON DELETE CASCADE ON UPDATE CASCADE; -ALTER TABLE `vn`.`smartTag` ADD CONSTRAINT smartTag_FK FOREIGN KEY (shelvingFk) REFERENCES `vn`.`shelving`(code) ON DELETE RESTRICT ON UPDATE CASCADE; -ALTER TABLE `vn`.`workerShelving` ADD CONSTRAINT workerShelving_FK_1 FOREIGN KEY (shelvingFk) REFERENCES `vn`.`shelving`(code) ON DELETE RESTRICT ON UPDATE CASCADE; - -ALTER TABLE vn.shelvingLog DROP FOREIGN KEY shelvingLog_FK_ibfk_1; -ALTER TABLE vn.shelvingLog MODIFY COLUMN originFk INT NOT NULL; -ALTER TABLE vn.shelvingLog ADD CONSTRAINT shelvingLog_FK FOREIGN KEY (originFk) REFERENCES vn.shelving(id) ON DELETE CASCADE ON UPDATE CASCADE; \ No newline at end of file diff --git a/db/changes/10480-june/00-ticketRefund_beforeUpsert.sql b/db/changes/10480-june/00-ticketRefund_beforeUpsert.sql deleted file mode 100644 index e6506c5d7..000000000 --- a/db/changes/10480-june/00-ticketRefund_beforeUpsert.sql +++ /dev/null @@ -1,21 +0,0 @@ -DROP PROCEDURE IF EXISTS `vn`.`ticketRefund_beforeUpsert`; - -DELIMITER $$ -$$ -CREATE DEFINER=`root`@`localhost` PROCEDURE `vn`.`ticketRefund_beforeUpsert`(vRefundTicketFk INT, vOriginalTicketFk INT) -BEGIN - DECLARE vAlreadyExists BOOLEAN DEFAULT FALSE; - - IF vRefundTicketFk = vOriginalTicketFk THEN - CALL util.throw('Original ticket and refund ticket has same id'); - END IF; - - SELECT COUNT(*) INTO vAlreadyExists - FROM ticketRefund - WHERE originalTicketFk = vOriginalTicketFk; - - IF vAlreadyExists > 0 THEN - CALL util.throw('This ticket is already a refund'); - END IF; -END$$ -DELIMITER ; diff --git a/db/changes/10480-june/01-claimObservation.sql b/db/changes/10480-june/01-claimObservation.sql deleted file mode 100644 index 8dc126a9e..000000000 --- a/db/changes/10480-june/01-claimObservation.sql +++ /dev/null @@ -1,13 +0,0 @@ -CREATE TABLE `vn`.`claimObservation` ( - `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, - `claimFk` int(10) unsigned NOT NULL, - `workerFk` int(10) unsigned DEFAULT NULL, - `text` text COLLATE utf8_unicode_ci NOT NULL, - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY (`id`), - KEY `worker_key` (`workerFk`), - KEY `claim_key` (`claimFk`), - KEY `claimObservation_created_IDX` (`created`) USING BTREE, - CONSTRAINT `claimObservation_ibfk_1` FOREIGN KEY (`claimFk`) REFERENCES `vn`.`claim` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `claimObservation_ibfk_2` FOREIGN KEY (`workerFk`) REFERENCES `vn`.`worker` (`id`) ON UPDATE CASCADE -) COMMENT='Todas las observaciones referentes a una reclamación' \ No newline at end of file diff --git a/db/changes/10480-june/02-claimTextMigration.sql b/db/changes/10480-june/02-claimTextMigration.sql deleted file mode 100644 index fa5f6fe83..000000000 --- a/db/changes/10480-june/02-claimTextMigration.sql +++ /dev/null @@ -1,2 +0,0 @@ -INSERT INTO `vn`.`claimObservation` (`claimFk`, `text`, `created`) -SELECT `id`, `observation`, `created` FROM `vn`.`claim` \ No newline at end of file diff --git a/db/changes/10480-june/04-aclParking.sql b/db/changes/10480-june/04-aclParking.sql deleted file mode 100644 index 05acd68b1..000000000 --- a/db/changes/10480-june/04-aclParking.sql +++ /dev/null @@ -1,2 +0,0 @@ -INSERT INTO `salix`.`ACL` (model,property,accessType,permission,principalType,principalId) - VALUES ('Parking','*','*','ALLOW','ROLE','employee') \ No newline at end of file diff --git a/db/changes/10480-june/04-aclShelving.sql b/db/changes/10480-june/04-aclShelving.sql deleted file mode 100644 index b237dfe0d..000000000 --- a/db/changes/10480-june/04-aclShelving.sql +++ /dev/null @@ -1,2 +0,0 @@ -INSERT INTO `salix`.`ACL` (model,property,accessType,permission,principalType,principalId) - VALUES ('Shelving','*','*','ALLOW','ROLE','employee') \ No newline at end of file diff --git a/db/changes/10481-june/00-aclOsTicket.sql b/db/changes/10481-june/00-aclOsTicket.sql deleted file mode 100644 index ae2a121f5..000000000 --- a/db/changes/10481-june/00-aclOsTicket.sql +++ /dev/null @@ -1,3 +0,0 @@ -INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) - VALUES - ('OsTicket', '*', '*', 'ALLOW', 'ROLE', 'employee'); \ No newline at end of file diff --git a/db/changes/10481-june/00-aclOsTicketConfig.sql b/db/changes/10481-june/00-aclOsTicketConfig.sql deleted file mode 100644 index ad53ea6ae..000000000 --- a/db/changes/10481-june/00-aclOsTicketConfig.sql +++ /dev/null @@ -1,3 +0,0 @@ -INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) - VALUES - ('OsTicketConfig', '*', '*', 'ALLOW', 'ROLE', 'it'); \ No newline at end of file diff --git a/db/changes/10481-june/00-osTicketConfig.sql b/db/changes/10481-june/00-osTicketConfig.sql deleted file mode 100644 index 8727c816d..000000000 --- a/db/changes/10481-june/00-osTicketConfig.sql +++ /dev/null @@ -1,16 +0,0 @@ -CREATE TABLE `vn`.`osTicketConfig` ( - `id` int(11) NOT NULL, - `host` varchar(100) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `user` varchar(100) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `password` varchar(100) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `oldStatus` varchar(100) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `newStatusId` int(11) DEFAULT NULL, - `action` varchar(100) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `day` int(11) DEFAULT NULL, - `comment` varchar(100) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `hostDb` varchar(100) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `userDb` varchar(100) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `passwordDb` varchar(100) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `portDb` int(11) DEFAULT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; \ No newline at end of file diff --git a/db/changes/10490-august/00-ACL.sql b/db/changes/224701/00-ACL.sql similarity index 100% rename from db/changes/10490-august/00-ACL.sql rename to db/changes/224701/00-ACL.sql diff --git a/db/changes/10490-august/00-acl_receiptPdf.sql b/db/changes/224701/00-acl_receiptPdf.sql similarity index 100% rename from db/changes/10490-august/00-acl_receiptPdf.sql rename to db/changes/224701/00-acl_receiptPdf.sql diff --git a/db/changes/10490-august/00-clientConsumptionQueue.sql b/db/changes/224701/00-clientConsumptionQueue.sql similarity index 100% rename from db/changes/10490-august/00-clientConsumptionQueue.sql rename to db/changes/224701/00-clientConsumptionQueue.sql diff --git a/db/changes/10490-august/00-invoiceOutQueue.sql b/db/changes/224701/00-invoiceOutQueue.sql similarity index 100% rename from db/changes/10490-august/00-invoiceOutQueue.sql rename to db/changes/224701/00-invoiceOutQueue.sql diff --git a/db/changes/10490-august/00-itemConfig.sql b/db/changes/224701/00-itemConfig.sql similarity index 100% rename from db/changes/10490-august/00-itemConfig.sql rename to db/changes/224701/00-itemConfig.sql diff --git a/db/changes/10490-august/00-printConfig.sql b/db/changes/224701/00-printConfig.sql similarity index 100% rename from db/changes/10490-august/00-printConfig.sql rename to db/changes/224701/00-printConfig.sql diff --git a/db/changes/10490-august/00-sale_afterUpdate.sql b/db/changes/224701/00-sale_afterUpdate.sql similarity index 100% rename from db/changes/10490-august/00-sale_afterUpdate.sql rename to db/changes/224701/00-sale_afterUpdate.sql diff --git a/db/changes/10490-august/00-sample.sql b/db/changes/224701/00-sample.sql similarity index 100% rename from db/changes/10490-august/00-sample.sql rename to db/changes/224701/00-sample.sql diff --git a/db/changes/10490-august/00-user_hasGrant.sql b/db/changes/224701/00-user_hasGrant.sql similarity index 100% rename from db/changes/10490-august/00-user_hasGrant.sql rename to db/changes/224701/00-user_hasGrant.sql diff --git a/db/changes/10491-august/00-ACL_workerDisableExcluded.sql b/db/changes/224702/00-ACL_workerDisableExcluded.sql similarity index 100% rename from db/changes/10491-august/00-ACL_workerDisableExcluded.sql rename to db/changes/224702/00-ACL_workerDisableExcluded.sql diff --git a/db/changes/10491-august/00-aclBusiness.sql b/db/changes/224702/00-aclBusiness.sql similarity index 100% rename from db/changes/10491-august/00-aclBusiness.sql rename to db/changes/224702/00-aclBusiness.sql diff --git a/db/changes/10491-august/00-aclUsesMana.sql b/db/changes/224702/00-aclUsesMana.sql similarity index 100% rename from db/changes/10491-august/00-aclUsesMana.sql rename to db/changes/224702/00-aclUsesMana.sql diff --git a/db/changes/10491-august/00-defaultPayDem_sameAs_production.sql b/db/changes/224702/00-defaultPayDem_sameAs_production.sql similarity index 100% rename from db/changes/10491-august/00-defaultPayDem_sameAs_production.sql rename to db/changes/224702/00-defaultPayDem_sameAs_production.sql diff --git a/db/changes/10491-august/00-invoiceInPdf.sql b/db/changes/224702/00-invoiceInPdf.sql similarity index 100% rename from db/changes/10491-august/00-invoiceInPdf.sql rename to db/changes/224702/00-invoiceInPdf.sql diff --git a/db/changes/10491-august/00-newSupplier_ACL.sql b/db/changes/224702/00-newSupplier_ACL.sql similarity index 100% rename from db/changes/10491-august/00-newSupplier_ACL.sql rename to db/changes/224702/00-newSupplier_ACL.sql diff --git a/db/changes/10491-august/00-notificationProc.sql b/db/changes/224702/00-notificationProc.sql similarity index 100% rename from db/changes/10491-august/00-notificationProc.sql rename to db/changes/224702/00-notificationProc.sql diff --git a/db/changes/10491-august/00-notificationTables.sql b/db/changes/224702/00-notificationTables.sql similarity index 100% rename from db/changes/10491-august/00-notificationTables.sql rename to db/changes/224702/00-notificationTables.sql diff --git a/db/changes/10491-august/00-payMethodFk_Allow_Null.sql b/db/changes/224702/00-payMethodFk_Allow_Null.sql similarity index 100% rename from db/changes/10491-august/00-payMethodFk_Allow_Null.sql rename to db/changes/224702/00-payMethodFk_Allow_Null.sql diff --git a/db/changes/10491-august/00-supplierActivityFk_Allow_Null.sql b/db/changes/224702/00-supplierActivityFk_Allow_Null.sql similarity index 100% rename from db/changes/10491-august/00-supplierActivityFk_Allow_Null.sql rename to db/changes/224702/00-supplierActivityFk_Allow_Null.sql diff --git a/db/changes/10491-august/00-ticket_closeByTicket.sql b/db/changes/224702/00-ticket_closeByTicket.sql similarity index 100% rename from db/changes/10491-august/00-ticket_closeByTicket.sql rename to db/changes/224702/00-ticket_closeByTicket.sql diff --git a/db/changes/10491-august/00-zipConfig.sql b/db/changes/224702/00-zipConfig.sql similarity index 100% rename from db/changes/10491-august/00-zipConfig.sql rename to db/changes/224702/00-zipConfig.sql diff --git a/db/changes/10500-november/00-ACL.sql b/db/changes/224801/00-ACL.sql similarity index 100% rename from db/changes/10500-november/00-ACL.sql rename to db/changes/224801/00-ACL.sql diff --git a/db/changes/10500-november/00-claim.sql b/db/changes/224801/00-claim.sql similarity index 100% rename from db/changes/10500-november/00-claim.sql rename to db/changes/224801/00-claim.sql diff --git a/db/changes/10500-november/00-claimRma.sql b/db/changes/224801/00-claimRma.sql similarity index 100% rename from db/changes/10500-november/00-claimRma.sql rename to db/changes/224801/00-claimRma.sql diff --git a/db/changes/10501-november/00-aclNotification.sql b/db/changes/224901/00-aclNotification.sql similarity index 100% rename from db/changes/10501-november/00-aclNotification.sql rename to db/changes/224901/00-aclNotification.sql diff --git a/db/changes/10501-november/00-packingSiteConfig.sql b/db/changes/224901/00-packingSiteConfig.sql similarity index 100% rename from db/changes/10501-november/00-packingSiteConfig.sql rename to db/changes/224901/00-packingSiteConfig.sql diff --git a/db/changes/10501-november/00-packingSiteUpdate.sql b/db/changes/224901/00-packingSiteUpdate.sql similarity index 100% rename from db/changes/10501-november/00-packingSiteUpdate.sql rename to db/changes/224901/00-packingSiteUpdate.sql diff --git a/db/changes/10501-november/00-salix_url.sql b/db/changes/224901/00-salix_url.sql similarity index 100% rename from db/changes/10501-november/00-salix_url.sql rename to db/changes/224901/00-salix_url.sql diff --git a/db/changes/10502-november/00-aclUserPassword.sql b/db/changes/224902/00-aclUserPassword.sql similarity index 100% rename from db/changes/10502-november/00-aclUserPassword.sql rename to db/changes/224902/00-aclUserPassword.sql diff --git a/db/changes/10502-november/00-deletePickupContact.sql b/db/changes/224902/00-deletePickupContact.sql similarity index 100% rename from db/changes/10502-november/00-deletePickupContact.sql rename to db/changes/224902/00-deletePickupContact.sql diff --git a/db/changes/10502-november/00-itemShelvingACL.sql b/db/changes/224902/00-itemShelvingACL.sql similarity index 100% rename from db/changes/10502-november/00-itemShelvingACL.sql rename to db/changes/224902/00-itemShelvingACL.sql diff --git a/db/changes/10502-november/00-itemShelvingPlacementSupplyStockACL.sql b/db/changes/224902/00-itemShelvingPlacementSupplyStockACL.sql similarity index 100% rename from db/changes/10502-november/00-itemShelvingPlacementSupplyStockACL.sql rename to db/changes/224902/00-itemShelvingPlacementSupplyStockACL.sql diff --git a/db/changes/10502-november/00-workerTimeControlMail.sql b/db/changes/224902/00-workerTimeControlMail.sql similarity index 100% rename from db/changes/10502-november/00-workerTimeControlMail.sql rename to db/changes/224902/00-workerTimeControlMail.sql diff --git a/db/changes/10502-november/00-zone_getPostalCode.sql b/db/changes/224902/00-zone_getPostalCode.sql similarity index 100% rename from db/changes/10502-november/00-zone_getPostalCode.sql rename to db/changes/224902/00-zone_getPostalCode.sql diff --git a/db/changes/10503-november/00-ACL_notification_InvoiceE.sql b/db/changes/224903/00-ACL_notification_InvoiceE.sql similarity index 100% rename from db/changes/10503-november/00-ACL_notification_InvoiceE.sql rename to db/changes/224903/00-ACL_notification_InvoiceE.sql diff --git a/db/changes/10503-november/00-aclInvoiceOut.sql b/db/changes/224903/00-aclInvoiceOut.sql similarity index 100% rename from db/changes/10503-november/00-aclInvoiceOut.sql rename to db/changes/224903/00-aclInvoiceOut.sql diff --git a/db/changes/10503-november/00-alter_expedition_itemFk.sql b/db/changes/224903/00-alter_expedition_itemFk.sql similarity index 100% rename from db/changes/10503-november/00-alter_expedition_itemFk.sql rename to db/changes/224903/00-alter_expedition_itemFk.sql diff --git a/db/changes/10503-november/00-clientHasInvoiceElectronic.sql b/db/changes/224903/00-clientHasInvoiceElectronic.sql similarity index 100% rename from db/changes/10503-november/00-clientHasInvoiceElectronic.sql rename to db/changes/224903/00-clientHasInvoiceElectronic.sql diff --git a/db/changes/10503-november/00-collection_missingTrash.sql b/db/changes/224903/00-collection_missingTrash.sql similarity index 100% rename from db/changes/10503-november/00-collection_missingTrash.sql rename to db/changes/224903/00-collection_missingTrash.sql diff --git a/db/changes/10503-november/00-deleteInvoiceOutQueue.sql b/db/changes/224903/00-deleteInvoiceOutQueue.sql similarity index 100% rename from db/changes/10503-november/00-deleteInvoiceOutQueue.sql rename to db/changes/224903/00-deleteInvoiceOutQueue.sql diff --git a/db/changes/10503-november/00-editTrackedACL.sql b/db/changes/224903/00-editTrackedACL.sql similarity index 100% rename from db/changes/10503-november/00-editTrackedACL.sql rename to db/changes/224903/00-editTrackedACL.sql diff --git a/db/changes/10503-november/00-greuge.sql b/db/changes/224903/00-greuge.sql similarity index 100% rename from db/changes/10503-november/00-greuge.sql rename to db/changes/224903/00-greuge.sql diff --git a/db/changes/10503-november/00-insert_notification_invoiceE.sql b/db/changes/224903/00-insert_notification_invoiceE.sql similarity index 100% rename from db/changes/10503-november/00-insert_notification_invoiceE.sql rename to db/changes/224903/00-insert_notification_invoiceE.sql diff --git a/db/changes/10503-november/00-isCompensationACL.sql b/db/changes/224903/00-isCompensationACL.sql similarity index 100% rename from db/changes/10503-november/00-isCompensationACL.sql rename to db/changes/224903/00-isCompensationACL.sql diff --git a/db/changes/10503-november/00-osTicketConfig.sql b/db/changes/224903/00-osTicketConfig.sql similarity index 100% rename from db/changes/10503-november/00-osTicketConfig.sql rename to db/changes/224903/00-osTicketConfig.sql diff --git a/db/changes/10503-november/00-ticket_canMerge.sql b/db/changes/224903/00-ticket_canMerge.sql similarity index 100% rename from db/changes/10503-november/00-ticket_canMerge.sql rename to db/changes/224903/00-ticket_canMerge.sql diff --git a/db/changes/10503-november/00-ticket_canbePostponed.sql b/db/changes/224903/00-ticket_canbePostponed.sql similarity index 100% rename from db/changes/10503-november/00-ticket_canbePostponed.sql rename to db/changes/224903/00-ticket_canbePostponed.sql diff --git a/db/changes/10503-november/00-timeBusiness_calculate.sql b/db/changes/224903/00-timeBusiness_calculate.sql similarity index 100% rename from db/changes/10503-november/00-timeBusiness_calculate.sql rename to db/changes/224903/00-timeBusiness_calculate.sql diff --git a/db/changes/10503-november/01-updateClientHasInvoiceElectronic.sql b/db/changes/224903/01-updateClientHasInvoiceElectronic.sql similarity index 100% rename from db/changes/10503-november/01-updateClientHasInvoiceElectronic.sql rename to db/changes/224903/01-updateClientHasInvoiceElectronic.sql diff --git a/db/changes/10510-december/deleteMe.keep b/db/changes/225001/.gitkeep similarity index 100% rename from db/changes/10510-december/deleteMe.keep rename to db/changes/225001/.gitkeep diff --git a/db/dump/dumpedFixtures.sql b/db/dump/dumpedFixtures.sql index c9c265ae7..a4870e2df 100644 --- a/db/dump/dumpedFixtures.sql +++ b/db/dump/dumpedFixtures.sql @@ -22,7 +22,7 @@ USE `util`; LOCK TABLES `config` WRITE; /*!40000 ALTER TABLE `config` DISABLE KEYS */; -INSERT INTO `config` VALUES (1,'10480',0,'production',NULL); +INSERT INTO `config` VALUES (1,'224602',0,'production',NULL); /*!40000 ALTER TABLE `config` ENABLE KEYS */; UNLOCK TABLES; diff --git a/db/import-changes.sh b/db/import-changes.sh index 2b80654d3..5461f003b 100755 --- a/db/import-changes.sh +++ b/db/import-changes.sh @@ -81,9 +81,9 @@ N_CHANGES=0 for DIR_PATH in "$DIR/changes/"*; do DIR_NAME=$(basename $DIR_PATH) - DIR_VERSION=${DIR_NAME:0:5} + DIR_VERSION=${DIR_NAME:0:6} - if [[ ! "$DIR_NAME" =~ ^[0-9]{5}(-[a-zA-Z0-9]+)?$ ]]; then + if [[ ! "$DIR_NAME" =~ ^[0-9]{6}$ ]]; then echo "[WARN] Ignoring wrong directory name: $DIR_NAME" continue fi From e000103ca4b8c748f7dda3f40556c6431cbeaccb Mon Sep 17 00:00:00 2001 From: joan Date: Mon, 12 Dec 2022 14:22:32 +0100 Subject: [PATCH 35/36] Deleted version --- db/changes/225001/.gitkeep | 1 - 1 file changed, 1 deletion(-) delete mode 100644 db/changes/225001/.gitkeep diff --git a/db/changes/225001/.gitkeep b/db/changes/225001/.gitkeep deleted file mode 100644 index 7a4187c02..000000000 --- a/db/changes/225001/.gitkeep +++ /dev/null @@ -1 +0,0 @@ -Delete this file From dc777ea69f511e633717fa387a295d9f570b1e83 Mon Sep 17 00:00:00 2001 From: joan Date: Mon, 12 Dec 2022 14:23:40 +0100 Subject: [PATCH 36/36] Added version after merging to test --- db/changes/225001/.gitkeep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 db/changes/225001/.gitkeep diff --git a/db/changes/225001/.gitkeep b/db/changes/225001/.gitkeep new file mode 100644 index 000000000..e69de29bb
- {{labelData.collectionFk ? `${labelData.collectionFk} ~ ${getVertical(labelData.code, labelData.wagon, labelData.level, labelData.color)}` : '-'.repeat(19)}} - {{getVertical(labelData)}} {{labelData.clientFk ? `${labelData.ticketFk} « ${labelData.clientFk}` : labelData.ticketFk}}