diff --git a/front/core/services/email.js b/front/core/services/email.js index 23eae0202..633b13a26 100644 --- a/front/core/services/email.js +++ b/front/core/services/email.js @@ -26,7 +26,7 @@ class Email { * @param {Object} params The email parameters * @return {Promise} Promise resolved when it's sent */ - sendCSV(template, params) { + sendCsv(template, params) { return this.$http.get(`csv/${template}/send`, {params}) .then(() => this.vnApp.showMessage(this.$t('Notification sent!'))); } diff --git a/front/core/services/report.js b/front/core/services/report.js index 12d33789f..c58a0ee0e 100644 --- a/front/core/services/report.js +++ b/front/core/services/report.js @@ -28,7 +28,7 @@ class Report { * @param {String} report The report name * @param {Object} params The report parameters */ - showCSV(report, params) { + showCsv(report, params) { params = Object.assign({ authorization: this.vnToken.token }, params); diff --git a/modules/invoiceOut/front/descriptor/index.html b/modules/invoiceOut/front/descriptor/index.html index 584983379..1210a69e5 100644 --- a/modules/invoiceOut/front/descriptor/index.html +++ b/modules/invoiceOut/front/descriptor/index.html @@ -18,7 +18,7 @@ Show as PDF Show as CSV @@ -34,12 +34,12 @@ Send PDF Send CSV @@ -136,15 +136,32 @@ message="You are going to regenerate the invoice PDF document"> - - + + Are you sure you want to send it? + ng-model="sendPdfConfirmation.data.email"> + + + + + + + + + + + + Are you sure you want to send it? + diff --git a/modules/invoiceOut/front/descriptor/index.js b/modules/invoiceOut/front/descriptor/index.js index 69fb3e503..399fd1ba7 100644 --- a/modules/invoiceOut/front/descriptor/index.js +++ b/modules/invoiceOut/front/descriptor/index.js @@ -22,7 +22,7 @@ class Controller extends Descriptor { .then(() => this.vnApp.showSuccess(this.$t('InvoiceOut booked'))); } - createInvoicePdf() { + createPdfInvoice() { const invoiceId = this.invoiceOut.id; return this.$http.post(`InvoiceOuts/${invoiceId}/createPdf`) .then(() => { @@ -60,14 +60,14 @@ class Controller extends Descriptor { .then(res => this.entity = res.data); } - showInvoiceCSV() { - this.vnReport.showCSV('invoice', { + showCsvInvoice() { + this.vnReport.showCsv('invoice', { recipientId: this.invoiceOut.client.id, invoiceId: this.id, }); } - sendInvoice($data) { + sendPdfInvoice($data) { return this.vnEmail.send('invoice', { recipientId: this.invoiceOut.client.id, recipient: $data.email, @@ -75,11 +75,11 @@ class Controller extends Descriptor { }); } - sendDeliveryNoteCSV($data) { - return this.vnEmail.sendCSV('delivery-note', { - recipientId: this.ticket.client.id, + sendCsvInvoice($data) { + return this.vnEmail.sendCsv('invoice', { + recipientId: this.invoiceOut.client.id, recipient: $data.email, - ticketId: this.id + invoiceId: this.id }); } } diff --git a/modules/invoiceOut/front/descriptor/locale/es.yml b/modules/invoiceOut/front/descriptor/locale/es.yml index 68ce7af84..3aff4840f 100644 --- a/modules/invoiceOut/front/descriptor/locale/es.yml +++ b/modules/invoiceOut/front/descriptor/locale/es.yml @@ -4,8 +4,8 @@ Client card: Ficha del cliente Invoice ticket list: Listado de tickets de la factura Show invoice...: Ver factura... Send invoice...: Enviar factura... -Send invoice PDF: Enviar factura en PDF -Send invoice CSV: Enviar factura en CSV +Send PDF invoice: Enviar factura en PDF +Send CSV invoice: Enviar factura en CSV Delete Invoice: Eliminar factura Clone Invoice: Clonar factura InvoiceOut deleted: Factura eliminada diff --git a/modules/ticket/front/descriptor-menu/index.html b/modules/ticket/front/descriptor-menu/index.html index b26246b3c..8b683b862 100644 --- a/modules/ticket/front/descriptor-menu/index.html +++ b/modules/ticket/front/descriptor-menu/index.html @@ -16,16 +16,16 @@ - Show Delivery Note + Show Delivery Note... Show as PDF Show as CSV @@ -35,17 +35,17 @@ - Send Delivery Note + Send Delivery Note... Send PDF Send CSV @@ -109,7 +109,7 @@ Make invoice - - - + + vn-id="sendPdfConfirmation" + on-accept="$ctrl.sendPdfDeliveryNote($data)" + message="Send PDF Delivery Note"> Are you sure you want to send it? + ng-model="sendPdfConfirmation.data.email"> @@ -189,15 +182,15 @@ - + + vn-id="sendCsvConfirmation" + on-accept="$ctrl.sendCsvDeliveryNote($data)" + message="Send CSV Delivery Note"> Are you sure you want to send it? + ng-model="sendCsvConfirmation.data.email"> @@ -271,8 +264,8 @@ diff --git a/modules/ticket/front/descriptor-menu/index.js b/modules/ticket/front/descriptor-menu/index.js index 8ef79f195..ca701f606 100644 --- a/modules/ticket/front/descriptor-menu/index.js +++ b/modules/ticket/front/descriptor-menu/index.js @@ -111,21 +111,21 @@ class Controller extends Section { }); } - showDeliveryNote() { + showPdfDeliveryNote() { this.vnReport.show('delivery-note', { recipientId: this.ticket.client.id, ticketId: this.id, }); } - showDeliveryNoteCSV() { - this.vnReport.showCSV('delivery-note', { + showCsvDeliveryNote() { + this.vnReport.showCsv('delivery-note', { recipientId: this.ticket.client.id, ticketId: this.id, }); } - sendDeliveryNote($data) { + sendPdfDeliveryNote($data) { return this.vnEmail.send('delivery-note', { recipientId: this.ticket.client.id, recipient: $data.email, @@ -133,8 +133,8 @@ class Controller extends Section { }); } - sendDeliveryNoteCSV($data) { - return this.vnEmail.sendCSV('delivery-note', { + sendCsvDeliveryNote($data) { + return this.vnEmail.sendCsv('delivery-note', { recipientId: this.ticket.client.id, recipient: $data.email, ticketId: this.id diff --git a/modules/ticket/front/descriptor-menu/locale/es.yml b/modules/ticket/front/descriptor-menu/locale/es.yml index aa6551808..1f4ee710c 100644 --- a/modules/ticket/front/descriptor-menu/locale/es.yml +++ b/modules/ticket/front/descriptor-menu/locale/es.yml @@ -1,8 +1,8 @@ -Show Delivery Note: Ver albarán -Send Delivery Note: Enviar albarán +Show Delivery Note...: Ver albarán... +Send Delivery Note...: Enviar albarán... Show as PDF: Ver como PDF Show as CSV: Ver como CSV Send PDF: Enviar PDF Send CSV: Enviar CSV -Send Delivery Note CSV: Enviar albarán en CSV -Send Delivery Note PDF: Enviar albarán en PDF \ No newline at end of file +Send CSV Delivery Note: Enviar albarán en CSV +Send PDF Delivery Note: Enviar albarán en PDF \ No newline at end of file