From 91c26ee5a5e78236b9cd8ba059518770197a8b83 Mon Sep 17 00:00:00 2001 From: joan Date: Thu, 1 Apr 2021 13:55:01 +0200 Subject: [PATCH] Removed filter import --- modules/entry/back/methods/entry/filter.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/modules/entry/back/methods/entry/filter.js b/modules/entry/back/methods/entry/filter.js index 82578c397..42dbe3078 100644 --- a/modules/entry/back/methods/entry/filter.js +++ b/modules/entry/back/methods/entry/filter.js @@ -148,24 +148,19 @@ module.exports = Self => { s.name AS supplierName, s.nickname AS supplierAlias, co.code AS companyCode, - cu.code AS currencyCode, - IF(b.buyingValue, SUM(b.quantity * b.buyingValue), 0) AS totalEntry + cu.code AS currencyCode FROM vn.entry e JOIN vn.supplier s ON s.id = e.supplierFk JOIN vn.travel t ON t.id = e.travelFk JOIN vn.company co ON co.id = e.companyFk - JOIN vn.currency cu ON cu.id = e.currencyFk - LEFT JOIN vn.buy b ON b.entryFk = e.id` + JOIN vn.currency cu ON cu.id = e.currencyFk` ); - stmt.merge(conn.makeWhere(filter.where)); - stmt.merge(conn.makeGroupBy('b.entryFk')); - stmt.merge(conn.makeLimit(filter)); + stmt.merge(conn.makeSuffix(filter)); let itemsIndex = stmts.push(stmt) - 1; let sql = ParameterizedSQL.join(stmts, ';'); let result = await conn.executeStmt(sql); - return itemsIndex === 0 ? result : result[itemsIndex]; }; };