2983 - Invoice tickets from ticket index #685
|
@ -87,7 +87,7 @@ describe('ticket makeInvoice()', () => {
|
||||||
await tx.rollback();
|
await tx.rollback();
|
||||||
}
|
}
|
||||||
|
|
||||||
expect(error.message).toEqual(`One or more tickets are not billable`);
|
expect(error.message).toEqual(`Some of the selected tickets are not billable`);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should success to invoice a ticket', async() => {
|
it('should success to invoice a ticket', async() => {
|
||||||
|
|
|
@ -217,7 +217,8 @@ class Controller extends Section {
|
||||||
}
|
}
|
||||||
|
|
||||||
makeInvoice() {
|
makeInvoice() {
|
||||||
return this.$http.post(`Tickets/${this.id}/makeInvoice`)
|
const params = {ticketsIds: [this.id]};
|
||||||
|
return this.$http.post(`Tickets/makeInvoice`, params)
|
||||||
.then(() => this.reload())
|
.then(() => this.reload())
|
||||||
.then(() => this.vnApp.showSuccess(this.$t('Ticket invoiced')));
|
.then(() => this.vnApp.showSuccess(this.$t('Ticket invoiced')));
|
||||||
}
|
}
|
||||||
|
|
|
@ -139,7 +139,8 @@ describe('Ticket Component vnTicketDescriptorMenu', () => {
|
||||||
jest.spyOn(controller, 'reload').mockReturnThis();
|
jest.spyOn(controller, 'reload').mockReturnThis();
|
||||||
jest.spyOn(controller.vnApp, 'showSuccess');
|
jest.spyOn(controller.vnApp, 'showSuccess');
|
||||||
|
|
||||||
$httpBackend.expectPOST(`Tickets/${ticket.id}/makeInvoice`).respond();
|
const expectedParams = {ticketsIds: [ticket.id]};
|
||||||
|
$httpBackend.expectPOST(`Tickets/makeInvoice`, expectedParams).respond();
|
||||||
controller.makeInvoice();
|
controller.makeInvoice();
|
||||||
$httpBackend.flush();
|
$httpBackend.flush();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue