fixes #6173 lastItemBuy muestra articulos sin podu
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Javi Gallego 2023-09-04 11:13:29 +02:00
parent 734b948aac
commit ed25bd93d6
1 changed files with 3 additions and 5 deletions

View File

@ -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));