From 2ab475791c03a7b53bb187ac36fcc2e44eb3fc05 Mon Sep 17 00:00:00 2001 From: vicent Date: Wed, 9 Nov 2022 09:16:58 +0100 Subject: [PATCH] refactor code --- .../back/methods/invoiceOut/invoiceClient.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/modules/invoiceOut/back/methods/invoiceOut/invoiceClient.js b/modules/invoiceOut/back/methods/invoiceOut/invoiceClient.js index c3ad9508a2..7c8742caae 100644 --- a/modules/invoiceOut/back/methods/invoiceOut/invoiceClient.js +++ b/modules/invoiceOut/back/methods/invoiceOut/invoiceClient.js @@ -130,13 +130,12 @@ module.exports = Self => { relation: 'client' } }); - + ctx.args = { + reference: invoiceOut.ref, + recipientId: invoiceOut.clientFk, + recipient: invoiceOut.client().email + }; try { - ctx.args = { - reference: invoiceOut.ref, - recipientId: invoiceOut.clientFk, - recipient: invoiceOut.client().email - }; await models.InvoiceOut.invoiceEmail(ctx); } catch (err) {}