From 3e57bf2b341527d7cb047dfa0f7301009e209a5c Mon Sep 17 00:00:00 2001 From: carlossa Date: Fri, 9 Feb 2024 11:49:29 +0100 Subject: [PATCH] refs #6791 remake negativeBases --- modules/invoiceOut/back/methods/invoiceOut/negativeBases.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/invoiceOut/back/methods/invoiceOut/negativeBases.js b/modules/invoiceOut/back/methods/invoiceOut/negativeBases.js index 96c789316..46ec1cfa6 100644 --- a/modules/invoiceOut/back/methods/invoiceOut/negativeBases.js +++ b/modules/invoiceOut/back/methods/invoiceOut/negativeBases.js @@ -66,6 +66,7 @@ module.exports = Self => { cou.country, c.id clientId, c.socialName clientSocialName, + u.nickname workerSocialName, SUM(s.quantity * s.price * ( 100 - s.discount ) / 100) amount, negativeBase.taxableBase, negativeBase.ticketFk, @@ -78,8 +79,10 @@ module.exports = Self => { JOIN vn.company co ON co.id = t.companyFk JOIN vn.sale s ON s.ticketFk = t.id JOIN vn.client c ON c.id = t.clientFk + JOIN vn.country cou ON cou.id = c.countryFk LEFT JOIN vn.worker w ON w.id = c.salesPersonFk + JOIN account.user u ON u.id = w.id LEFT JOIN ( SELECT ticketFk, taxableBase FROM tmp.ticketAmount