@@ -81,4 +89,12 @@
-
\ No newline at end of file
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/invoiceOut/front/descriptor/index.js b/modules/invoiceOut/front/descriptor/index.js
index cb4b131ac7..3e859478d0 100644
--- a/modules/invoiceOut/front/descriptor/index.js
+++ b/modules/invoiceOut/front/descriptor/index.js
@@ -22,6 +22,16 @@ class Controller extends Descriptor {
.then(() => this.vnApp.showSuccess(this.$t('InvoiceOut booked')));
}
+ createInvoicePdf() {
+ const invoiceId = this.invoiceOut.id;
+ return this.$http.post(`InvoiceOuts/${invoiceId}/createPdf`)
+ .then(() => {
+ const snackbarMessage = this.$t(
+ `The invoice PDF document has been regenerated`);
+ this.vnApp.showSuccess(snackbarMessage);
+ });
+ }
+
get filter() {
if (this.invoiceOut)
return JSON.stringify({refFk: this.invoiceOut.ref});
diff --git a/modules/invoiceOut/front/descriptor/locale/es.yml b/modules/invoiceOut/front/descriptor/locale/es.yml
index e85be96bfa..dd67660ee4 100644
--- a/modules/invoiceOut/front/descriptor/locale/es.yml
+++ b/modules/invoiceOut/front/descriptor/locale/es.yml
@@ -8,4 +8,6 @@ InvoiceOut deleted: Factura eliminada
Are you sure you want to delete this invoice?: Estas seguro de eliminar esta factura?
Book invoice: Asentar factura
InvoiceOut booked: Factura asentada
-Are you sure you want to book this invoice?: Estas seguro de querer asentar esta factura?
\ No newline at end of file
+Are you sure you want to book this invoice?: Estas seguro de querer asentar esta factura?
+Regenerate invoice PDF: Regenerar PDF factura
+The invoice PDF document has been regenerated: El documento PDF de la factura ha sido regenerado
\ No newline at end of file
diff --git a/modules/ticket/back/methods/ticket/makeInvoice.js b/modules/ticket/back/methods/ticket/makeInvoice.js
index 9500ab2a28..a44c41e169 100644
--- a/modules/ticket/back/methods/ticket/makeInvoice.js
+++ b/modules/ticket/back/methods/ticket/makeInvoice.js
@@ -67,7 +67,7 @@ module.exports = function(Self) {
if (serial != 'R' && invoiceId) {
await Self.rawSql('CALL invoiceOutBooking(?)', [invoiceId], options);
- await models.InvoiceOut.createPdf(ctx, invoiceId);
+ await models.InvoiceOut.createPdf(ctx, invoiceId, options);
}
await tx.commit();
diff --git a/modules/ticket/front/descriptor-menu/index.html b/modules/ticket/front/descriptor-menu/index.html
index 80ad71d5fe..390d9daf7c 100644
--- a/modules/ticket/front/descriptor-menu/index.html
+++ b/modules/ticket/front/descriptor-menu/index.html
@@ -80,13 +80,13 @@
Make invoice
- Regenerate invoice
+ Regenerate invoice PDF
-
+
+ vn-id="createInvoicePdfConfirmation"
+ on-accept="$ctrl.createInvoicePdf()"
+ question="Are you sure you want to regenerate the invoice PDF document?"
+ message="You are going to regenerate the invoice PDF document">
diff --git a/modules/ticket/front/descriptor-menu/index.js b/modules/ticket/front/descriptor-menu/index.js
index d2dea6c0ab..09783ec20e 100644
--- a/modules/ticket/front/descriptor-menu/index.js
+++ b/modules/ticket/front/descriptor-menu/index.js
@@ -219,12 +219,12 @@ class Controller extends Section {
.then(() => this.vnApp.showSuccess(this.$t('Ticket invoiced')));
}
- regenerateInvoice() {
+ createInvoicePdf() {
const invoiceId = this.ticket.invoiceOut.id;
- return this.$http.post(`InvoiceOuts/${invoiceId}/regenerate`)
+ return this.$http.post(`InvoiceOuts/${invoiceId}/createPdf`)
.then(() => {
const snackbarMessage = this.$t(
- `Invoice sent for a regeneration, will be available in a few minutes`);
+ `The invoice PDF document has been regenerated`);
this.vnApp.showSuccess(snackbarMessage);
});
}
diff --git a/modules/ticket/front/descriptor/locale/es.yml b/modules/ticket/front/descriptor/locale/es.yml
index 6524df353c..c2b181c97e 100644
--- a/modules/ticket/front/descriptor/locale/es.yml
+++ b/modules/ticket/front/descriptor/locale/es.yml
@@ -17,12 +17,12 @@ Make a payment: "Verdnatura le comunica:\rSu pedido está pendiente de pago.\rPo
Minimum is needed: "Verdnatura le recuerda:\rEs necesario un importe mínimo de 50€ (Sin IVA) en su pedido {{ticketId}} del día {{created | date: 'dd/MM/yyyy'}} para recibirlo sin portes adicionales."
Ticket invoiced: Ticket facturado
Make invoice: Crear factura
-Regenerate invoice: Regenerar factura
+Regenerate invoice PDF: Regenerar PDF factura
+The invoice PDF document has been regenerated: El documento PDF de la factura ha sido regenerado
You are going to invoice this ticket: Vas a facturar este ticket
Are you sure you want to invoice this ticket?: ¿Seguro que quieres facturar este ticket?
-You are going to regenerate the invoice: Vas a regenerar la factura
-Are you sure you want to regenerate the invoice?: ¿Seguro que quieres regenerar la factura?
-Invoice sent for a regeneration, will be available in a few minutes: La factura ha sido enviada para ser regenerada, estará disponible en unos minutos
+You are going to regenerate the invoice PDF document: Vas a regenerar el documento PDF de la factura
+Are you sure you want to regenerate the invoice PDF document?: ¿Seguro que quieres regenerar el documento PDF de la factura?
Shipped hour updated: Hora de envio modificada
Deleted ticket: Ticket eliminado
Recalculate components: Recalcular componentes