diff --git a/modules/invoiceOut/back/methods/invoiceOut/createManualInvoice.js b/modules/invoiceOut/back/methods/invoiceOut/createManualInvoice.js index 854c1e2f96..561f559fd7 100644 --- a/modules/invoiceOut/back/methods/invoiceOut/createManualInvoice.js +++ b/modules/invoiceOut/back/methods/invoiceOut/createManualInvoice.js @@ -138,11 +138,12 @@ module.exports = Self => { } const [newInvoice] = await Self.rawSql(`SELECT @newInvoiceId id`, null, myOptions); - if (newInvoice.id) - await Self.createPdf(ctx, newInvoice.id, myOptions); if (tx) await tx.commit(); + if (newInvoice.id) + await Self.createPdf(ctx, newInvoice.id); + return newInvoice; } catch (e) { if (tx) await tx.rollback();