refactor: movido codigo que imprime pdf dentro del try
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
b801ac676c
commit
f7ee6c18ca
|
@ -121,6 +121,17 @@ module.exports = Self => {
|
||||||
invoiceId = newInvoice.id;
|
invoiceId = newInvoice.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (invoiceId && !invoiceOut.client().isToBeMailed) {
|
||||||
|
const query = `CALL vn.report_print(
|
||||||
|
'invoice',
|
||||||
|
?,
|
||||||
|
account.myUser_getId(),
|
||||||
|
JSON_OBJECT('refFk', ?),
|
||||||
|
'normal'
|
||||||
|
);`;
|
||||||
|
await models.InvoiceOut.rawSql(query, [1 /* vPrinterFk */, invoiceOut.ref], myOptions);
|
||||||
|
}
|
||||||
|
|
||||||
if (tx) await tx.commit();
|
if (tx) await tx.commit();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (tx) await tx.rollback();
|
if (tx) await tx.rollback();
|
||||||
|
@ -136,17 +147,6 @@ module.exports = Self => {
|
||||||
await models.InvoiceOut.invoiceEmail(ctx, invoiceOut.ref);
|
await models.InvoiceOut.invoiceEmail(ctx, invoiceOut.ref);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (invoiceId && !invoiceOut.client().isToBeMailed) {
|
|
||||||
const query = `CALL vn.report_print(
|
|
||||||
'invoice',
|
|
||||||
?,
|
|
||||||
account.myUser_getId(),
|
|
||||||
JSON_OBJECT('refFk', ?),
|
|
||||||
'normal'
|
|
||||||
);`;
|
|
||||||
await models.InvoiceOut.rawSql(query, [1 /* vPrinterFk */, invoiceOut.ref], myOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
return invoiceId;
|
return invoiceId;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue