From f3cca1c9307d0a11f1b8fff984ba09857d24463f Mon Sep 17 00:00:00 2001 From: vicent Date: Wed, 15 Jun 2022 14:24:35 +0200 Subject: [PATCH] fix: warehouse changed from 'silla' to 'algemesi' --- modules/entry/back/methods/entry/latestBuysFilter.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/entry/back/methods/entry/latestBuysFilter.js b/modules/entry/back/methods/entry/latestBuysFilter.js index 35252e107..8cb0b32db 100644 --- a/modules/entry/back/methods/entry/latestBuysFilter.js +++ b/modules/entry/back/methods/entry/latestBuysFilter.js @@ -96,6 +96,7 @@ module.exports = Self => { }); Self.latestBuysFilter = async(ctx, filter, options) => { + const models = Self.app.models; const myOptions = {}; if (typeof options == 'object') @@ -143,7 +144,10 @@ module.exports = Self => { const stmts = []; let stmt; - stmts.push('CALL cache.visible_refresh(@calc_id, FALSE, 1)'); + const warehouse = await models.Warehouse.findOne({where: {code: 'ALG'}}, myOptions); + stmt = new ParameterizedSQL(`CALL cache.visible_refresh(@calc_id, FALSE, ?)`, [warehouse.id]); + console.log(stmt); + stmts.push(stmt); const date = new Date(); date.setHours(0, 0, 0, 0);