From ed25bd93d6164ebc58f1c3dda7578ba06e734468 Mon Sep 17 00:00:00 2001 From: jgallego Date: Mon, 4 Sep 2023 11:13:29 +0200 Subject: [PATCH] fixes #6173 lastItemBuy muestra articulos sin podu --- modules/entry/back/methods/entry/lastItemBuys.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/modules/entry/back/methods/entry/lastItemBuys.js b/modules/entry/back/methods/entry/lastItemBuys.js index 514052e4b..525e24fdc 100644 --- a/modules/entry/back/methods/entry/lastItemBuys.js +++ b/modules/entry/back/methods/entry/lastItemBuys.js @@ -55,7 +55,6 @@ module.exports = Self => { travel.landed ]); stmts.push(stmt); - stmts.push('DROP TEMPORARY TABLE IF EXISTS tmp.item'); stmt = new ParameterizedSQL( `CREATE TEMPORARY TABLE tmp.item @@ -65,13 +64,12 @@ module.exports = Self => { p.name AS producerName, nk.name AS inkName FROM item i - JOIN producer p ON p.id = i.producerFk - JOIN ink nk ON nk.id = i.inkFk - JOIN tmp.buyUltimate bu ON i.id = bu.itemFk + LEFT JOIN producer p ON p.id = i.producerFk + LEFT JOIN ink nk ON nk.id = i.inkFk + LEFT JOIN tmp.buyUltimate bu ON i.id = bu.itemFk AND bu.warehouseFk = ? `, [travel.warehouseInFk]); stmts.push(stmt); - stmt = new ParameterizedSQL('SELECT * FROM tmp.item'); stmt.merge(conn.makeSuffix(filter));