refs #6174 test: fix test bug
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Javier Segarra 2024-01-26 09:55:21 +01:00
parent f1cbb6aab3
commit 0afc9ab109
2 changed files with 3 additions and 6 deletions

View File

@ -17,6 +17,7 @@ describe('InvoiceOut transferInvoice()', () => {
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
active: activeCtx
});
spyOn(models.InvoiceOut, 'makePdfAndNotify');
});
it('should return the id of the created issued invoice', async() => {

View File

@ -28,11 +28,7 @@ module.exports = function(Self) {
});
Self.invoiceTicketsAndPdf = async(ctx, ticketsIds, invoiceCorrection, options) => {
let invoiceIds = null;
invoiceIds = await Self.invoiceTickets(ctx, ticketsIds, invoiceCorrection, options);
if (!invoiceIds) return [];
if (!options.transaction)
const invoiceIds = await Self.invoiceTickets(ctx, ticketsIds, invoiceCorrection, options);
await Self.app.models.InvoiceOut.makePdfList(ctx, invoiceIds, null, options);
return invoiceIds;
};