From 90b36bf1abb1be5c28ded97d618196a1f37ab3d3 Mon Sep 17 00:00:00 2001 From: Pau Navarro Date: Tue, 20 Dec 2022 14:21:01 +0100 Subject: [PATCH 1/5] Fix missing report for the invoice electronic notification --- modules/ticket/front/descriptor-menu/index.js | 9 +++++++- .../invoice-electronic.html | 13 ++++++++++++ .../invoice-electronic/invoice-electronic.js | 21 +++++++++++++++++++ .../email/invoice-electronic/locale/en.yml | 4 ++++ .../email/invoice-electronic/locale/es.yml | 4 ++++ 5 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 print/templates/email/invoice-electronic/invoice-electronic.html create mode 100644 print/templates/email/invoice-electronic/invoice-electronic.js create mode 100644 print/templates/email/invoice-electronic/locale/en.yml create mode 100644 print/templates/email/invoice-electronic/locale/es.yml diff --git a/modules/ticket/front/descriptor-menu/index.js b/modules/ticket/front/descriptor-menu/index.js index f10e059ad..477eab9a3 100644 --- a/modules/ticket/front/descriptor-menu/index.js +++ b/modules/ticket/front/descriptor-menu/index.js @@ -254,8 +254,15 @@ class Controller extends Section { if (client.hasElectronicInvoice) { this.$http.post(`NotificationQueues`, { - notificationFk: 'invoiceElectronic', + notificationFk: 'invoice-electronic', authorFk: client.id, + params: JSON.stringify( + { + 'name': client.name, + 'email': client.email, + 'ticketId': this.id, + 'url': window.location.href + }) }).then(a => { this.vnApp.showSuccess(this.$t('Invoice sent')); }); diff --git a/print/templates/email/invoice-electronic/invoice-electronic.html b/print/templates/email/invoice-electronic/invoice-electronic.html new file mode 100644 index 000000000..fc96e0970 --- /dev/null +++ b/print/templates/email/invoice-electronic/invoice-electronic.html @@ -0,0 +1,13 @@ + + + + + + {{ $t('subject') }} + + +

{{ $t('title') }} {{name}}

+

{{ $t('clientMail') }} {{email}}

+

{{ $t('ticketId') }} {{ticketId}} + + diff --git a/print/templates/email/invoice-electronic/invoice-electronic.js b/print/templates/email/invoice-electronic/invoice-electronic.js new file mode 100644 index 000000000..2e1e739ac --- /dev/null +++ b/print/templates/email/invoice-electronic/invoice-electronic.js @@ -0,0 +1,21 @@ +module.exports = { + name: 'invoice-electronic', + props: { + name: { + type: [String], + required: true + }, + email: { + type: [String], + required: true + }, + ticketId: { + type: [Number], + required: true + }, + url: { + type: [String], + required: true + } + }, +}; diff --git a/print/templates/email/invoice-electronic/locale/en.yml b/print/templates/email/invoice-electronic/locale/en.yml new file mode 100644 index 000000000..5523a2fa3 --- /dev/null +++ b/print/templates/email/invoice-electronic/locale/en.yml @@ -0,0 +1,4 @@ +subject: A electronic invoice has been created +title: A new electronic invoice has been created for the client +clientMail: The client's email is +ticketId: The invoice's ticket is \ No newline at end of file diff --git a/print/templates/email/invoice-electronic/locale/es.yml b/print/templates/email/invoice-electronic/locale/es.yml new file mode 100644 index 000000000..2cbcfbb36 --- /dev/null +++ b/print/templates/email/invoice-electronic/locale/es.yml @@ -0,0 +1,4 @@ +subject: Se ha creado una factura electrónica +title: Se ha creado una nueva factura electrónica para el cliente +clientMail: El correo del cliente es +ticketId: El ticket de la factura es \ No newline at end of file From 05f4db7924d85b753d8e33ae3d56b922a06b9544 Mon Sep 17 00:00:00 2001 From: Pau Navarro Date: Thu, 22 Dec 2022 07:16:22 +0100 Subject: [PATCH 2/5] Add requested changes to the fixtures --- db/changes/224903/00-insert_notification_invoiceE.sql | 1 - db/changes/225001/.gitkeep | 0 db/changes/225001/00-insert_notification_invoiceE.sql | 1 + 3 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 db/changes/224903/00-insert_notification_invoiceE.sql delete mode 100644 db/changes/225001/.gitkeep create mode 100644 db/changes/225001/00-insert_notification_invoiceE.sql diff --git a/db/changes/224903/00-insert_notification_invoiceE.sql b/db/changes/224903/00-insert_notification_invoiceE.sql deleted file mode 100644 index 1d416c196..000000000 --- a/db/changes/224903/00-insert_notification_invoiceE.sql +++ /dev/null @@ -1 +0,0 @@ -insert into `util`.`notification` (`id`, `name`,`description`) values (2, 'invoiceElectronic', 'A electronic invoice has been generated'); \ No newline at end of file diff --git a/db/changes/225001/.gitkeep b/db/changes/225001/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/db/changes/225001/00-insert_notification_invoiceE.sql b/db/changes/225001/00-insert_notification_invoiceE.sql new file mode 100644 index 000000000..bbce9dd01 --- /dev/null +++ b/db/changes/225001/00-insert_notification_invoiceE.sql @@ -0,0 +1 @@ +insert into `util`.`notification` (`id`, `name`,`description`) values (2, 'invoice-electronic', 'A electronic invoice has been generated'); \ No newline at end of file From fce035298685d4388648f9cdf9e8cc3f5c3dcd67 Mon Sep 17 00:00:00 2001 From: Pau Navarro Date: Thu, 22 Dec 2022 10:41:07 +0100 Subject: [PATCH 3/5] add fixtures --- db/dump/fixtures.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql index 92b84be43..2fd4174ea 100644 --- a/db/dump/fixtures.sql +++ b/db/dump/fixtures.sql @@ -2685,6 +2685,7 @@ INSERT INTO `util`.`notificationConfig` INSERT INTO `util`.`notification` (`id`, `name`, `description`) VALUES (1, 'print-email', 'notification fixture one'); + (2, 'invoice-electronic', 'A electronic invoice has been generated') INSERT INTO `util`.`notificationAcl` (`notificationFk`, `roleFk`) VALUES From 8696d554d66a9f989c9ea79034ebc3bfda1fdfb2 Mon Sep 17 00:00:00 2001 From: Pau Navarro Date: Mon, 26 Dec 2022 07:22:59 +0100 Subject: [PATCH 4/5] Change SQL folder --- db/changes/{225001 => 225002}/00-insert_notification_invoiceE.sql | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename db/changes/{225001 => 225002}/00-insert_notification_invoiceE.sql (100%) diff --git a/db/changes/225001/00-insert_notification_invoiceE.sql b/db/changes/225002/00-insert_notification_invoiceE.sql similarity index 100% rename from db/changes/225001/00-insert_notification_invoiceE.sql rename to db/changes/225002/00-insert_notification_invoiceE.sql From 7aeeddcf1813a65eca3b0cfc21e324bd1e923e4f Mon Sep 17 00:00:00 2001 From: Pau Navarro Date: Tue, 27 Dec 2022 07:23:15 +0100 Subject: [PATCH 5/5] removed the sql --- db/changes/225002/00-insert_notification_invoiceE.sql | 1 - 1 file changed, 1 deletion(-) delete mode 100644 db/changes/225002/00-insert_notification_invoiceE.sql diff --git a/db/changes/225002/00-insert_notification_invoiceE.sql b/db/changes/225002/00-insert_notification_invoiceE.sql deleted file mode 100644 index bbce9dd01..000000000 --- a/db/changes/225002/00-insert_notification_invoiceE.sql +++ /dev/null @@ -1 +0,0 @@ -insert into `util`.`notification` (`id`, `name`,`description`) values (2, 'invoice-electronic', 'A electronic invoice has been generated'); \ No newline at end of file