From 6a8e7873faef49d8744465d003f334ff1226cf03 Mon Sep 17 00:00:00 2001 From: vicent Date: Thu, 12 Jan 2023 15:07:48 +0100 Subject: [PATCH 1/3] =?UTF-8?q?fix:=20s=C3=B3lo=20cierra=20caus=20que=20el?= =?UTF-8?q?=20=C3=BAltimo=20mensaje=20sea=20una=20respuesta.=20Cierra=20ca?= =?UTF-8?q?us=20con=20el=20estado=20'Abierto'=20y=20'En=20espera'=C2=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- back/methods/osticket/closeTicket.js | 17 +++++++++++------ db/changes/225203/00-mdbApp.sql | 5 +++++ db/dump/fixtures.sql | 2 +- 3 files changed, 17 insertions(+), 7 deletions(-) create mode 100644 db/changes/225203/00-mdbApp.sql diff --git a/back/methods/osticket/closeTicket.js b/back/methods/osticket/closeTicket.js index 178b09601..b0ec78c95 100644 --- a/back/methods/osticket/closeTicket.js +++ b/back/methods/osticket/closeTicket.js @@ -36,14 +36,19 @@ module.exports = Self => { JOIN osticket.ost_ticket_status ots ON ots.id = ot.status_id JOIN osticket.ost_thread ot2 ON ot2.object_id = ot.ticket_id AND ot2.object_type = 'T' JOIN ( - SELECT ote.thread_id, MAX(ote.created) created, MAX(ote.updated) updated - FROM osticket.ost_thread_entry ote - WHERE ote.staff_id AND ote.type = 'R' - GROUP BY ote.thread_id + SELECT sub2.thread_id, sub2.type, sub2.updated, sub2.created + FROM ( + SELECT ote.thread_id, ote.created, ote.updated, ote.type + FROM osticket.ost_thread_entry ote + WHERE ote.staff_id + ORDER BY ote.id DESC + LIMIT 10000000000000000000) sub2 + GROUP BY sub2.thread_id ) sub ON sub.thread_id = ot2.id WHERE ot.isanswered - AND ots.state = ? - AND IF(sub.updated > sub.created, sub.updated, sub.created) < DATE_SUB(CURDATE(), INTERVAL ? DAY)`; + AND ots.id IN (?) + AND sub.type = 'R' + AND IF(sub.updated > sub.created, sub.updated, sub.created) < DATE_SUB(CURDATE(), INTERVAL ? DAY);`; const ticketsId = []; con.connect(err => { diff --git a/db/changes/225203/00-mdbApp.sql b/db/changes/225203/00-mdbApp.sql new file mode 100644 index 000000000..32a21eb6b --- /dev/null +++ b/db/changes/225203/00-mdbApp.sql @@ -0,0 +1,5 @@ +UPDATE `vn`.`osTicketConfig` +SET oldStatus='1,6' +WHERE id=0; + + diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql index 2ed8ba2ef..3bf9b57ad 100644 --- a/db/dump/fixtures.sql +++ b/db/dump/fixtures.sql @@ -2745,7 +2745,7 @@ INSERT INTO `vn`.`ticketLog` (`originFk`, userFk, `action`, changedModel, oldIns INSERT INTO `vn`.`osTicketConfig` (`id`, `host`, `user`, `password`, `oldStatus`, `newStatusId`, `day`, `comment`, `hostDb`, `userDb`, `passwordDb`, `portDb`, `responseType`, `fromEmailId`, `replyTo`) VALUES - (0, 'http://localhost:56596/scp', 'ostadmin', 'Admin1', 'open', 3, 60, 'Este CAU se ha cerrado automáticamente. Si el problema persiste responda a este mensaje.', 'localhost', 'osticket', 'osticket', 40003, 'reply', 1, 'all'); + (0, 'http://localhost:56596/scp', 'ostadmin', 'Admin1', '1,6', 3, 60, 'Este CAU se ha cerrado automáticamente. Si el problema persiste responda a este mensaje.', 'localhost', 'osticket', 'osticket', 40003, 'reply', 1, 'all'); INSERT INTO `vn`.`mdbApp` (`app`, `baselineBranchFk`, `userFk`, `locked`) VALUES From 1c532d81e85d18b535b47ad8cc6c375243939191 Mon Sep 17 00:00:00 2001 From: vicent Date: Fri, 13 Jan 2023 08:38:03 +0100 Subject: [PATCH 2/3] fix: permite cerrar varios estados --- back/methods/osticket/closeTicket.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/back/methods/osticket/closeTicket.js b/back/methods/osticket/closeTicket.js index b0ec78c95..32b369c8d 100644 --- a/back/methods/osticket/closeTicket.js +++ b/back/methods/osticket/closeTicket.js @@ -51,9 +51,11 @@ module.exports = Self => { AND IF(sub.updated > sub.created, sub.updated, sub.created) < DATE_SUB(CURDATE(), INTERVAL ? DAY);`; const ticketsId = []; + const statusIdToClose = config.oldStatus.split(','); + con.connect(err => { if (err) throw err; - con.query(sql, [config.oldStatus, config.day], + con.query(sql, [statusIdToClose, config.day], (err, results) => { if (err) throw err; for (const result of results) From d7e8c4fafd05910bf5a2986ce5b1da5148e3e837 Mon Sep 17 00:00:00 2001 From: alexm Date: Fri, 13 Jan 2023 09:28:44 +0100 Subject: [PATCH 3/3] fix(print_invoiceIn): translation invoice to receipt --- modules/invoiceIn/front/descriptor/index.html | 4 ++-- modules/invoiceIn/front/locale/es.yml | 6 +++--- print/templates/email/invoiceIn/locale/en.yml | 4 ++-- print/templates/email/invoiceIn/locale/es.yml | 4 ++-- print/templates/email/invoiceIn/locale/fr.yml | 4 ++-- print/templates/email/invoiceIn/locale/pt.yml | 4 ++-- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/modules/invoiceIn/front/descriptor/index.html b/modules/invoiceIn/front/descriptor/index.html index 40f7dec18..223914c9c 100644 --- a/modules/invoiceIn/front/descriptor/index.html +++ b/modules/invoiceIn/front/descriptor/index.html @@ -36,13 +36,13 @@ ng-if="$ctrl.isAgricultural()" ng-click="$ctrl.showPdfInvoice()" translate> - Show agricultural invoice as PDF + Show agricultural receipt as PDF - Send agricultural invoice as PDF + Send agricultural receipt as PDF diff --git a/modules/invoiceIn/front/locale/es.yml b/modules/invoiceIn/front/locale/es.yml index d8400dd67..35b43f9f6 100644 --- a/modules/invoiceIn/front/locale/es.yml +++ b/modules/invoiceIn/front/locale/es.yml @@ -19,6 +19,6 @@ To book: Contabilizar Total amount: Total importe Total net: Total neto Total stems: Total tallos -Show agricultural invoice as PDF: Ver factura agrícola como PDF -Send agricultural invoice as PDF: Enviar factura agrícola como PDF -New InvoiceIn: Nueva Factura \ No newline at end of file +Show agricultural receipt as PDF: Ver recibo agrícola como PDF +Send agricultural receipt as PDF: Enviar recibo agrícola como PDF +New InvoiceIn: Nueva Factura diff --git a/print/templates/email/invoiceIn/locale/en.yml b/print/templates/email/invoiceIn/locale/en.yml index 47ebc3966..e238ecf61 100644 --- a/print/templates/email/invoiceIn/locale/en.yml +++ b/print/templates/email/invoiceIn/locale/en.yml @@ -1,5 +1,5 @@ -subject: Your agricultural invoice -title: Your agricultural invoice +subject: Your agricultural receipt +title: Your agricultural receipt dear: Dear supplier description: Attached you can find agricultural receipt generated from your last deliveries. Please return a signed and stamped copy to our administration department. conclusion: Thanks for your attention! diff --git a/print/templates/email/invoiceIn/locale/es.yml b/print/templates/email/invoiceIn/locale/es.yml index 2698763cf..456122c75 100644 --- a/print/templates/email/invoiceIn/locale/es.yml +++ b/print/templates/email/invoiceIn/locale/es.yml @@ -1,5 +1,5 @@ -subject: Tu factura agrícola -title: Tu factura agrícola +subject: Tu recibo agrícola +title: Tu recibo agrícola dear: Estimado proveedor description: Adjunto puede encontrar recibo agrícola generado de sus últimas entregas. Por favor, devuelva una copia firmada y sellada a nuestro de departamento de administración. conclusion: ¡Gracias por tu atención! diff --git a/print/templates/email/invoiceIn/locale/fr.yml b/print/templates/email/invoiceIn/locale/fr.yml index 1c38f3c25..dd35631e5 100644 --- a/print/templates/email/invoiceIn/locale/fr.yml +++ b/print/templates/email/invoiceIn/locale/fr.yml @@ -1,5 +1,5 @@ -subject: Votre facture agricole -title: Votre facture agricole +subject: Votre reçu agricole +title: Votre reçu agricole dear: Cher Fournisseur description: Vous trouverez en pièce jointe le reçu agricole généré à partir de vos dernières livraisons. Veuillez retourner une copie signée et tamponnée à notre service administratif. conclusion: Merci pour votre attention! diff --git a/print/templates/email/invoiceIn/locale/pt.yml b/print/templates/email/invoiceIn/locale/pt.yml index a43e3a79d..5dffc7acf 100644 --- a/print/templates/email/invoiceIn/locale/pt.yml +++ b/print/templates/email/invoiceIn/locale/pt.yml @@ -1,5 +1,5 @@ -subject: A sua fatura agrícola -title: A sua fatura agrícola +subject: A sua recibo agrícola +title: A sua recibo agrícola dear: Caro Fornecedor description: Em anexo encontra-se o recibo agrícola gerado a partir das suas últimas entregas. Por favor, devolva uma cópia assinada e carimbada ao nosso departamento de administração. conclusion: Obrigado pela atenção.