diff --git a/modules/invoiceOut/back/methods/invoiceOut/specs/delete.spec.js b/modules/invoiceOut/back/methods/invoiceOut/specs/delete.spec.js index 560837a68..1fba84cbd 100644 --- a/modules/invoiceOut/back/methods/invoiceOut/specs/delete.spec.js +++ b/modules/invoiceOut/back/methods/invoiceOut/specs/delete.spec.js @@ -2,15 +2,15 @@ const app = require('vn-loopback/server/server'); describe('invoiceOut delete()', () => { const invoiceOutId = 2; - let OriginalInvoice; + let OriginalInvoiceOut; let OriginalTickets; afterAll(async done => { - const newInvoice = await app.models.InvoiceOut.create(OriginalInvoice); - await newInvoice.updateAttribute('ref', OriginalInvoice.ref); + const newInvoiceOut = await app.models.InvoiceOut.create(OriginalInvoiceOut); + await newInvoiceOut.updateAttribute('ref', OriginalInvoiceOut.ref); const promises = []; OriginalTickets.forEach(ticket => { - promises.push(ticket.updateAttribute('refFk', newInvoice.ref)); + promises.push(ticket.updateAttribute('refFk', newInvoiceOut.ref)); }); Promise.all(promises); @@ -26,13 +26,13 @@ describe('invoiceOut delete()', () => { }); it(`should check the two tickets from the invoice id 2 that are not invoiced`, async() => { - OriginalInvoice = await app.models.InvoiceOut.findById(invoiceOutId); + OriginalInvoiceOut = await app.models.InvoiceOut.findById(invoiceOutId); await app.models.InvoiceOut.delete(invoiceOutId); OriginalTickets = await app.models.Ticket.find({where: {id: {inq: [2, 3]}}}); - const invoice = await app.models.InvoiceOut.findById(invoiceOutId); + const invoiceOut = await app.models.InvoiceOut.findById(invoiceOutId); expect(OriginalTickets[0].refFk).toBeNull(); expect(OriginalTickets[1].refFk).toBeNull(); - expect(invoice).toBeNull(); + expect(invoiceOut).toBeNull(); }); }); diff --git a/modules/invoiceOut/front/descriptor/index.js b/modules/invoiceOut/front/descriptor/index.js index 036d0b261..bd9891193 100644 --- a/modules/invoiceOut/front/descriptor/index.js +++ b/modules/invoiceOut/front/descriptor/index.js @@ -10,8 +10,8 @@ class Controller { this.$http = $http; this.aclService = aclService; this.moreOptions = [ - {callback: this.showInvoiceOutPdf, name: 'Show invoice out PDF'}, - {callback: this.showDeleteInvoiceOutDialog, name: 'Delete InvoiceOut', acl: 'invoicing'}, + {callback: this.showInvoiceOutPdf, name: 'Show invoice PDF'}, + {callback: this.showDeleteInvoiceOutDialog, name: 'Delete Invoice', acl: 'invoicing'}, {callback: this.showBookInvoiceOutDialog, name: 'Book invoice', acl: 'invoicing'} ]; } @@ -80,7 +80,7 @@ class Controller { const query = `/invoiceOut/api/InvoiceOuts/${this.invoiceOut.ref}/book`; this.$http.post(query).then(() => { this.vnApp.showSuccess(this.$translate.instant('InvoiceOut booked')); - this.$state.go('invoiceOut.index'); + this.$state.reload(); }); } } diff --git a/modules/invoiceOut/front/descriptor/locale/es.yml b/modules/invoiceOut/front/descriptor/locale/es.yml index cedd0e94e..4f6abcea3 100644 --- a/modules/invoiceOut/front/descriptor/locale/es.yml +++ b/modules/invoiceOut/front/descriptor/locale/es.yml @@ -2,8 +2,8 @@ Volume exceded: Volumen excedido Volume: Volumen Client card: Ficha del cliente Invoice ticket list: Listado de tickets de la factura -Show invoice out PDF: Ver factura emitida en PDF -Delete InvoiceOut: Borrar factura +Show invoice PDF: Ver factura en PDF +Delete Invoice: Borrar factura InvoiceOut deleted: Factura eliminada Are you sure you want to delete this invoice?: Estas seguro de eliminar esta factura? Book invoice: Asentar factura