feat: send mail with the invoice pdf
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
9bcfebcae6
commit
dbd0e77e12
|
@ -109,9 +109,6 @@ module.exports = Self => {
|
|||
if (newInvoice.id) {
|
||||
await Self.rawSql('CALL invoiceOutBooking(?)', [newInvoice.id], myOptions);
|
||||
|
||||
query = `INSERT IGNORE INTO invoiceOutQueue(invoiceFk) VALUES(?)`;
|
||||
await Self.rawSql(query, [newInvoice.id], myOptions);
|
||||
|
||||
invoiceId = newInvoice.id;
|
||||
}
|
||||
} catch (e) {
|
||||
|
@ -128,6 +125,21 @@ module.exports = Self => {
|
|||
throw e;
|
||||
}
|
||||
|
||||
const invoiceOut = await models.InvoiceOut.findById(invoiceId, {
|
||||
include: {
|
||||
relation: 'client'
|
||||
}
|
||||
});
|
||||
|
||||
try {
|
||||
ctx.args = {
|
||||
reference: invoiceOut.ref,
|
||||
recipientId: invoiceOut.clientFk,
|
||||
recipient: invoiceOut.client().email
|
||||
};
|
||||
await models.InvoiceOut.invoiceEmail(ctx);
|
||||
} catch (err) {}
|
||||
|
||||
return invoiceId;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue