1341 invoiceOut.descriptor asentar factura
gitea/salix/dev This commit looks good
Details
gitea/salix/dev This commit looks good
Details
This commit is contained in:
parent
c8bf9d0d7b
commit
c68015fb88
|
@ -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();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -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();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue