Removed PDF generation from transaction
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Joan Sanchez 2021-08-11 08:47:05 +02:00
parent 6ed0dcc4c5
commit de2bda5284
1 changed files with 3 additions and 2 deletions

View File

@ -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();