diff --git a/modules/invoiceOut/back/methods/invoiceOut/negativeBases.js b/modules/invoiceOut/back/methods/invoiceOut/negativeBases.js index 993ac2c0e..66440616c 100644 --- a/modules/invoiceOut/back/methods/invoiceOut/negativeBases.js +++ b/modules/invoiceOut/back/methods/invoiceOut/negativeBases.js @@ -87,7 +87,7 @@ module.exports = Self => { WHERE t.shipped BETWEEN ? AND util.dayEnd(?) AND t.refFk IS NULL AND c.typeFk IN ('normal','trust') - GROUP BY t.clientFk, t.totalWithoutVat + GROUP BY t.clientFk, negativeBase.taxableBase HAVING amount < 0`, [args.from, args.to])); stmt = new ParameterizedSQL(`SELECT * FROM tmp.filter`);