diff --git a/public/assets/icon/check-circle-solid.svg b/public/assets/icon/check-circle-solid.svg new file mode 100644 index 00000000..ff35c5be --- /dev/null +++ b/public/assets/icon/check-circle-solid.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/icon/paper-plane-solid.svg b/public/assets/icon/paper-plane-solid.svg new file mode 100644 index 00000000..770923eb --- /dev/null +++ b/public/assets/icon/paper-plane-solid.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/resources/assets/js/plugins/en.js b/resources/assets/js/plugins/en.js index 6be999aa..8b41dd29 100644 --- a/resources/assets/js/plugins/en.js +++ b/resources/assets/js/plugins/en.js @@ -303,7 +303,9 @@ export default { send_invoice: 'Send Invoice', invoice_template: 'Invoice Template', template: 'Template', - mark_as_sent: 'Mark as Sent', + mark_as_sent: 'Mark as sent', + invoice_mark_as_sent: 'This invoice will be marked as sent', + confirm_send: 'This invoice will be sent via email to the customer', invoice_date: 'Invoice Date', record_payment: 'Record Payment', add_new_invoice: 'Add New Invoice', diff --git a/resources/assets/js/plugins/es.js b/resources/assets/js/plugins/es.js index 04c67339..1ad301e9 100644 --- a/resources/assets/js/plugins/es.js +++ b/resources/assets/js/plugins/es.js @@ -308,6 +308,8 @@ export default { invoice_template: 'Plantilla de factura', template: 'Modelo', mark_as_sent: 'Marcar como enviado', + invoice_mark_as_sent: 'Esta factura se marcará como enviada', + confirm_send: 'Estas facturas se enviarán por correo electrónico al cliente.', invoice_date: 'Fecha de la factura', record_payment: 'Registro de pago', add_new_invoice: 'Añadir nueva factura', diff --git a/resources/assets/js/plugins/fr.js b/resources/assets/js/plugins/fr.js index 597d1c23..50a3f720 100644 --- a/resources/assets/js/plugins/fr.js +++ b/resources/assets/js/plugins/fr.js @@ -308,6 +308,8 @@ export default { invoice_template: 'Modèle de facture', template: 'Modèle', mark_as_sent: 'Marquer comme envoyé', + invoice_mark_as_sent: 'Cette facture sera marquée comme envoyé', + confirm_send: 'Cette facture sera envoyée par courrier électronique au client.', invoice_date: 'Date de facturation', record_payment: 'Record de paiement', add_new_invoice: 'Ajouter une nouvelle facture', diff --git a/resources/assets/js/views/invoices/Index.vue b/resources/assets/js/views/invoices/Index.vue index 4e1c5218..24c508b1 100644 --- a/resources/assets/js/views/invoices/Index.vue +++ b/resources/assets/js/views/invoices/Index.vue @@ -247,13 +247,13 @@ {{ $t('invoices.view') }} - + {{ $t('invoices.send_invoice') }} - + {{ $t('invoices.mark_as_sent') }} @@ -384,24 +384,44 @@ export default { 'fetchCustomers' ]), async sendInvoice (id) { - const data = { - id: id - } - let response = await this.sendEmail(data) - this.refreshTable() - if (response.data) { - window.toastr['success'](this.$tc('invoices.send_invoice')) - } + swal({ + title: this.$t('general.are_you_sure'), + text: this.$t('invoices.confirm_send'), + icon: '/assets/icon/paper-plane-solid.svg', + buttons: true, + dangerMode: true + }).then(async (Send_Invoice) => { + if (Send_Invoice) { + const data = { + id: id + } + let response = await this.sendEmail(data) + this.refreshTable() + if (response.data) { + window.toastr['success'](this.$tc('invoices.send_invoice')) + } + } + }) }, async sentInvoice (id) { - const data = { - id: id - } - let response = await this.markAsSent(data) - this.refreshTable() - if (response.data) { - window.toastr['success'](this.$tc('invoices.mark_as_sent')) - } + swal({ + title: this.$t('general.are_you_sure'), + text: this.$t('invoices.invoice_mark_as_sent'), + icon: '/assets/icon/check-circle-solid.svg', + buttons: true, + dangerMode: true + }).then(async (MarkAsSend_Invoice) => { + if (MarkAsSend_Invoice) { + const data = { + id: id + } + let response = await this.markAsSent(data) + this.refreshTable() + if (response.data) { + window.toastr['success'](this.$tc('invoices.mark_as_sent')) + } + } + }) }, getStatus (val) { this.filters.status = { diff --git a/resources/assets/sass/base.scss b/resources/assets/sass/base.scss index dd3012c1..8e5013f5 100644 --- a/resources/assets/sass/base.scss +++ b/resources/assets/sass/base.scss @@ -111,3 +111,7 @@ code, .code { justify-content: center; align-items: center; } + +.swal-icon--custom { + height: 50px !important; +} \ No newline at end of file